Commit 07340e58 by jscat

nyx dev: 功能更新

1. 新增园区和夜市功能
parent 3bb66646
//app.js
//app.js
const base64 = require('./utils/base64.js');//Base64,hmac,sha1,crypto相关算法
var config=require('./config.js');
var util = require('./utils/util.js')
App({
globalData: {
// userInfo setting
nyxCode: "", //userId, 唯一识别码
authStatus: "", //授权状态, 00表示未授权, 01表示已授权
userInfo : {}, //用户信息
members : [], // 商家列表
member: { //商家信息
member_id: "",
address_id: "",
default_member: "",
member_name: "",
member_city: "",
member_address: "",
member_slogan: "",
member_logo: "",
},
memberInfo: { // 商家的地址信息
member_id: "",
address_id: "",
address_status: "",
member_name: "",
member_city: "",
member_address: "",
member_slogan: "",
member_logo: "",
},
emotionHost : "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/",
onOpenOp : {},
// socket setting jscat 2020/03/12
// webSocket的readyState属性用来定义连接状态,该属性的值有下面几种:
// 0 :对应常量CONNECTING(numeric value 0) ,
// 正在建立连接连接,还没有完成。The connection has not yet been established.
// 1 :对应常量OPEN(numeric value 1) ,
// 连接成功建立,可以进行通信。The WebSocket connection is established and communication is possible.
// 2 :对应常量CLOSING(numeric value 2)
// 连接正在进行关闭握手,即将关闭。The connection is going through the closing handshake.
// 3: 对应常量CLOSED(numeric value 3)
// 连接已经关闭或者根本没有建立。The connection has been closed or could not be opened.
socketTask : {},
callback: function () { },
// socket发送的消息队列
socketMsgQueue : [],
heart : '',
// 心跳失败次数
heartBeatFailCount : 0,
// 终止心跳
heartBeatTimeOut : null,
// 终止重新连接
connectSocketTimeOut : null,
socketClose: false,
socketOpen: false,
//文件上传数据格式
postData : {
photoArray: [],
photoTag: "",
photoTitle: "",
photoContent: "",
photoProduct: [],
startDatetime: "",
endDatetime: "",
},
//activity-submit跳转后需要带上category的index
switchId : "",
defaultCity: '上海',
defaultCounty: '静安区',
},
onLaunch: function () {
//将config存储到本地存储
wx.setStorageSync("config", config);
//调用API从本地缓存中获取数据
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
},
// 用户自定义函数
//初始化socket
initSocket(sid, uid, msg) {
let _this = this
var strUrl = ""
var strMsg = encodeURI(encodeURI(msg));
if(config.env == 0)
{
strUrl = config.socket_url + "?sid=" + sid + "&uid=" + uid + "&msg=" + strMsg
}
else
{
strUrl = config.socket_url + "/wss?sid=" + sid + "&uid=" + uid + "&msg=" + strMsg
}
config.debug == 1 ? console.log("===initSocket_strUrl_" + strUrl) : ""
_this.globalData.socketTask = wx.connectSocket({
//此处 url 可以用来测试
url: strUrl,
success: function (res) {
console.log('===initSocket 创建成功', res)
},
fail: function (err) {
console.log('===initSocket 创建失败', err)
},
})
//版本库需要在 1.7.0 以上
// _this.globalData.socketTask.onOpen(function (res) {
// console.log('app-onOpen webSocket连接已打开! readyState=' + _this.globalData.socketTask.readyState)
// })
// _this.globalData.socketTask.onError(function (res) {
// console.log('app-WebSocket连接错误! 错误信息', res)
// })
// _this.globalData.socketTask.onClose(function (res) {
// console.log('app-WebSocket连接已关闭! readyState=' + _this.globalData.socketTask.readyState)
// _this.initSocket(_this.globalData.sid, _this.globalData.uid)
// })
_this.globalData.socketTask.onMessage(function (res) {
// 用于在其他页面监听 websocket 返回的消息
_this.globalData.callback(res)
})
},
//统一发送消息,可以在其他页面调用此方法发送消息
sendSocketMessage: function (options) {
let _this = this
var msg = typeof options == "string" ? options : options.msg
return new Promise((resolve, reject) => {
if (_this.globalData.socketTask.readyState === 1) {
console.log('===通过 webSocket onMessage() 连接发送数据', msg)
_this.globalData.socketTask.send({
data: msg,
success: function (res) {
console.log('===sendSocketMessage 已发送', res);
resolve(res)
if (typeof options =='object') {
options.success && options.success(res);
}
},
fail: function (res) {
reject(res)
if (typeof msg == 'object') {
options.fail && options.fail(res);
}
}
})
} else {
console.log('已断开, msg_', msg)
_this.globalData.socketMsgQueue.push(msg)
}
})
},
/**
* 关闭 webSocket 连接
*/
closeSocket: function (options) {
console.log("===app closeSocket")
let _this = this
if (_this.globalData.connectSocketTimeOut) {
clearTimeout(_this.globalData.connectSocketTimeOut);
_this.globalData.connectSocketTimeOut = null;
}
_this.globalData.socketClose = true;
_this.stopHeartBeat();
wx.closeSocket({
success: function (res) {
console.log('===webSocket 已关闭!');
},
fail: function (res) {
}
})
},
// 开始心跳
startHeartBeat: function () {
console.log('===app socket开始心跳')
var _this = this;
_this.globalData.heart = 'heart';
_this.heartBeat();
},
// 结束心跳
stopHeartBeat: function () {
console.log('socket结束心跳')
var _this = this;
_this.globalData.heart = '';
if (_this.globalData.heartBeatTimeOut) {
clearTimeout(_this.globalData.heartBeatTimeOut);
_this.globalData.heartBeatTimeOut = null;
}
if (_this.globalData.connectSocketTimeOut) {
clearTimeout(_this.globalData.connectSocketTimeOut);
_this.globalData.connectSocketTimeOut = null;
}
},
// 心跳
heartBeat: function () {
var _this = this;
if (!_this.globalData.heart) {
return;
}
_this.sendSocketMessage({
msg: JSON.stringify({
'cmd': 'onHeart',
'uid': _this.globalData.nyxCode,
'msg': 'heart'
}),
success: function (res) {
console.log('===app socket心跳成功');
if (_this.globalData.heart) {
_this.globalData.heartBeatTimeOut = setTimeout(() => {
_this.heartBeat();
}, 7000);
}
},
fail: function (res) {
console.log('===app socket心跳失败');
if (_this.globalData.heartBeatFailCount > 2) {
// 重连
_this.connectSocket();
}
if (_this.globalData.heart) {
_this.globalData.heartBeatTimeOut = setTimeout(() => {
_this.heartBeat();
}, 7000);
}
_this.globalData.heartBeatFailCount++;
},
});
},
regUser: function (uuid) {
var _this = this;
_this.globalData.nyxCode = uuid;
_this.globalData.authStatus = "00";
wx.setStorageSync('nyxCode', uuid)
wx.setStorageSync('authStatus', "00")
var userInfo = {}
userInfo['userId'] = uuid
userInfo['nickName'] = "匿名用户"
userInfo['avatarUrl'] = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png"
//设置全局参数
wx.setStorageSync('userInfo', userInfo)
_this.globalData.userInfo = userInfo
var strUrl = config.user_reg_url + "?userid=" + uuid
config.debug == 1 ? console.log("===regUser_strUrl_" + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
success: function (res) {
config.debug == 1 ? console.info("===regUser_success_data_", res) : ""
},
fail: function () {
console.log('系统错误')
}
})
},
//计算赛季
getSeason: function () {
var date = new Date();
var year = date.getFullYear(); //获取完整的年份(4位)
var month = date.getMonth(); //获取当前月份(0-11,0代表1月)
var str = parseInt(year) % 2020 * 4 + parseInt(month / 3) + 1
str = str[1] ? str : '0' + str
return "s" + str
},
saveFile(pic) {
var _this = this;
//保存文件到本地缓存文件
wx.saveFile({
tempFilePath: pic,
success(res) {
//下载的文件路径
const savedFilePath = res.savedFilePath;
console.log("下载图片的参数", res)
}
})
},
//小程序图片检测主函数
checkPic(strUrl, pic, index, resolve, reject) {
var _this = this;
console.log("===checkPic_picName: "+pic)
wx.uploadFile({
url: strUrl,
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
name: 'file',
success: function (checkres) {
var i = index + 1
console.log("\n===第" + i + " 张图片检验过程")
console.info(checkres);
var checkResult = JSON.parse(checkres.data);
if (checkResult.data.errcode == '0') {
//校验没有违法违规进行自己业务代码处理
resolve("第" + i + "张图片状态码_" + checkResult.data.errcode)
console.log("===第" + i + " 张图片检验通过")
} else {
reject("第" + i + "张图片状态码_" + checkResult.data.errcode)
if (checkResult.data.errcode == '87014') {
wx.hideLoading();
wx.showModal({
content: '第' + i + '张图存在敏感内容,请更换图片',
showCancel: false,
confirmText: '明白了'
})
} else {
wx.hideLoading();
wx.showModal({
content: '系统错误,请稍后再试',
showCancel: false,
confirmText: '明白了'
})
}
}
},
fail: function(e) {
var i = index + 1
console.log("===第" + i + " 张图片检验失败", e)
reject("===第" + i + " 张图片检验失败")
}
})
},
//小程序图像检测入口函数
onCheckPic(file) {
var _this = this;
var strUrl = config.check_pic_url
let promise = Promise.all(file.map((pic, index) => {
return new Promise(function (resolve, reject) {
_this.checkPic(strUrl, pic, index, resolve, reject)
});
}))
return promise
},
//小程序文本检测主函数
checkText(strUrl, strText, resolve, reject) {
wx.request({
url: strUrl,
method: 'GET',
success: function (checkres) {
var checkResult = checkres.data;
console.info(checkResult);
if (checkResult.data.errcode == '0') {
//校验没有违法违规进行自己业务代码处理
resolve("文本状态码_" + checkResult.data.errcode)
console.log("===文本检验通过")
} else {
reject("文本状态码_" + checkResult.data.errcode)
if (checkResult.data.errcode == '87014') {
wx.hideLoading();
wx.showModal({
content: '文本存在敏感内容,请更换文字',
showCancel: false,
confirmText: '明白了'
})
} else {
wx.hideLoading();
wx.showModal({
content: '系统错误,请稍后再试',
showCancel: false,
confirmText: '明白了'
})
}
}
},
fail(e) {
reject("failed on checkText")
console.log("failed");
}
})
},
//小程序文本检测入口函数
onCheckText(strText) {
var _this = this;
var strUrl = config.check_text_url + "?text="+strText
let promise = new Promise(function (resolve, reject) {
_this.checkText(strUrl, strText, resolve, reject)
})
return promise
},
//具体的登陆及授权功能 - 在用户信息加密后(encryptedData)传到java后台, 后台进一步处理
login: function (resolve, reject) {
config.debug==1?console.log("===login_登陆及授权"):""
var _this = this;
wx.login({
success: function (res) {
var code = res.code;
config.debug==1? console.log("===login_code_", code):""
wx.getUserInfo({
success: function (res) {
config.debug == 1 ? console.log("===wx.getUserInfo_res_获取用户信息成功", res) : ""
//userInfo直接获取
/* userInfo
- nickName
- avatarUrl
- gender
- province
- city
- country
*/
wx.setStorageSync('userInfo', res.userInfo)
_this.globalData.userInfo = res.userInfo
//通过openid换取唯一的nyxCode
//同时更新userInfo
var nyxCode = _this.globalData.nyxCode
wx.request({
url: config.user_login_url,
method: 'post',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: { encryptedData: res.encryptedData, iv: res.iv, code: code, userId : nyxCode },
success: function (res) {
config.debug==1?console.info("===wx.login_data_", res):""
wx.setStorageSync('nyxCode', res.data.data.id)
wx.setStorageSync('authStatus', res.data.data.authStatus)
_this.globalData.nyxCode = res.data.data.id
_this.globalData.authStatus = res.data.data.authStatus
resolve("===app.js_login success")
},
fail: function () {
reject("===app.js_login failed")
console.log('系统错误')
}
})
//平台登录
},
fail: function (res) {
config.debug == 1 ? console.log("===app.js_login_获取用户信息失败", res) : ""
}
})
}
})
},
regMember: function (uuid) {
var _this = this;
_this.globalData.nyxCode = uuid;
wx.setStorageSync('nyxCode', uuid)
wx.setStorageSync('authStatus', "00")
var userInfo = {}
userInfo['userId'] = uuid
userInfo['nickName'] = "匿名用户"
userInfo['avatarUrl'] = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png"
//设置全局参数
wx.setStorageSync('userInfo', userInfo)
_this.globalData.userInfo = userInfo
var strUrl = config.user_reg_url + "?userid=" + uuid
config.debug == 1 ? console.log("===regUser_strUrl_" + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
success: function (res) {
config.debug == 1 ? console.info("===regUser_success_data_", res) : ""
},
fail: function () {
console.log('系统错误')
}
})
},
// 获取collects数据
// scrollType: 是否是翻页
// tips; 该函数是my-collects函数的简略版, 而且是单次运行的
getCollectsStorage: function (scrollType, pageNum, pageCount, resolve, reject) {
var _this = this;
var userId = _this.globalData.nyxCode
var query_url = '&userId=' + userId
var strUrl = config.collect_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);
// 设置全局的点赞标记 step1
var likeDictStorage = wx.getStorageSync('likeDictStorage') || {}
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
result["activity_id"] = res.data.data[i].activityId
// 设置全局的点赞标记 step2
likeDictStorage[result["activity_id"]] = 1
}
// 设置全局的点赞标记 step3
wx.setStorageSync('likeDictStorage', likeDictStorage)
console.log("===app getCollectsStorage passed")
resolve("===app getCollectsStorage passed")
}
},
fail: function (err) {
console.log("===app getCollectsStorage failed", err.errMsg)
reject(new Error("===app getCollectsStorage failed"));
}
})
},
// 通过user_id获取member_user 中所有的members数据
// scrollType: 是否是翻页
// tips; 该函数是my-collects函数的简略版, 而且是单次运行的
getMembers: function (scrollType, pageNum, pageCount, resolve, reject) {
var _this = this;
var userId = _this.globalData.nyxCode
//当商家存在多个地址信息时, 查找默认为01的那个
var addressStatus = '01'
var query_url = '&userId=' + userId + '&addressStatus=' + addressStatus
var strUrl = config.user_member_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 members = []
var member = {}
if(res.data.data.length > 0)
{
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
result["member_id"] = res.data.data[i].memberId
result["address_id"] = res.data.data[i].addressId
result["default_member"] = res.data.data[i].defaultMember
result["member_name"] = res.data.data[i].memberName
result["member_address"] = res.data.data[i].addressName
result["member_slogan"] = res.data.data[i].memberSlogan == undefined ? "" : res.data.data[i].memberSlogan
result["member_logo"] = res.data.data[i].memberLogo
members.push(result)
}
}
// 设置
wx.setStorageSync('members', members)
wx.setStorageSync('member', members[0])
_this.globalData.member = members[0]
_this.globalData.members = members
resolve("===app getMembers passed")
}
},
fail: function (err) {
console.log("===app getMembers failed", err.errMsg)
reject(new Error("===app getMembers failed"));
}
})
},
// 统计字符数
// 英文占1个字符,中文汉字占2个字符
gblen: function(str) { // eslint-disable-line
let len = 0;
for (let i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
len += 2;
} else {
len++;
}
}
return len;
},
assignDict: function(srcDict){
let destDict = {}
for(var key in srcDict) {
destDict[key] = srcDict[key]
}
return destDict
},
// 注册member by Oss
onRegMemberOss(memberInfo, default_member, address_status, resolve, reject)
{
var _this = this;
var member_id = "mid_" + util.wxuuid()
var address_id = "addid_" + util.wxuuid()
//todo success
//app.globalData.member.member_id = member_id
var member_name = memberInfo.member_name
var member_address = memberInfo.member_city + memberInfo.member_address
//即时更新member_address的值
//todo success
//app.globalData.member.member_address = member_address
var member_slogan = memberInfo.member_slogan
console.log("===this is onRegMemberOss");
//获取照片数组
var logoArray = [memberInfo.member_logo]
//时间戳
var oss = wx.getStorageSync('oss') || {}
var expire = oss.hasOwnProperty['logoToken'] ? oss['logoToken'].expire : undefined;
//获取当前时间戳
var expireNow = Date.parse(new Date()) / 1000;
//如果当前时间大于获取的时间 则重新获取oss;
if (expire == undefined || expireNow > expire) {
//重新获取oss, 成功之后执行uploadMember()
let promise_oss = new Promise(function (resolve) {
_this.oss_promise('logoToken', resolve)
})
promise_oss.then(
function (value) {
console.log("===enter promise_oss then_pass")
_this.uploadMember(member_id, address_id, member_name, member_address, member_slogan, logoArray, default_member, address_status, resolve, reject)
});
}
else
{
_this.uploadMember(member_id, address_id, member_name, member_address, member_slogan, logoArray, default_member, address_status, resolve, reject)
}
},
//上传商家信息到(阿里云)
uploadMember: function (member_id, address_id, member_name, member_address, member_slogan, logoArray, default_member, address_status, resolve, reject) {
var _this = this;
var pic = logoArray[0]
console.log(pic)
//传给阿里云的参数
var dir = 'logoToken'
var oss = wx.getStorageSync('oss')
var policy = oss[dir].policy;
var accessid = oss[dir].accessid;
var securityToken = oss[dir].securityToken;
var signature = oss[dir].signature;
var path = oss[dir].host + "/" + oss[dir].dir;
var host = oss[dir].host
console.log("policy: " + policy);
console.log("signature: " + signature);
console.log("accessid: " + accessid);
console.log("path: " + path)
var babyData = {
'Filename': '${filename}',
'name': pic.replace('http://tmp/', "").replace('wxfile://', ""),
'key': oss[dir].dir + '${filename}',
'policy': policy,
'OSSAccessKeyId': accessid,
'success_action_status': '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'x-oss-security-token': securityToken
}
//生成最终的文件字符串 file1.jpg
var image = pic.replace('http://tmp/', "").replace('wxfile://', "");
var member_logo = path + image
var user_id = _this.globalData.nyxCode
var strUrl = config.oss_member_callback_url
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&memberName=' + encodeURI(encodeURI(member_name)) + '&memberAddress=' + encodeURI(encodeURI(member_address)) + '&memberSlogan=' + encodeURI(encodeURI(member_slogan)) + '&image=' + member_logo + '&memberId=' + member_id + '&userId=' + user_id + '&addressId=' + address_id + '&defaultMember=' + default_member + '&addressStatus=' + address_status,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
babyData['callback'] = base64_callback_body
wx.uploadFile({
url: host,
formData: babyData,
name: 'file',
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
success: function (res) {
if (res.statusCode == 200) {
var result = JSON.parse(res.data);
//表示HTTP请求成功
console.log(result.data);
var member = {
member_id: result.data.memberId,
address_id: result.data.addressId,
default_member: result.data.defaultMember,
member_name: result.data.memberName,
member_address: result.data.memberAddress,
member_slogan: result.data.memberSlogan,
member_logo: result.data.memberLogo,
}
var memberInfo = {
member_id: result.data.memberId,
address_id: result.data.addressId,
address_status: result.data.addressStatus,
member_name: result.data.memberName,
member_address: result.data.memberAddress,
member_slogan: result.data.memberSlogan,
member_logo: result.data.memberLogo,
}
// 保存members和member, memberInfo
_this.globalData.member = member
wx.setStorageSync("member", member)
_this.globalData.memberInfo = memberInfo
wx.setStorageSync("memberInfo", memberInfo)
var members = _this.globalData.members || {} //初始注册member, 只有一个member
//将最新生成的member放在members第一位
members.unshift(member)
_this.globalData.members = members
wx.setStorageSync("members", members)
console.log(res)
resolve(res.data);
}
},
fail: function (err) {
console.log("fail to upload file", err.errMsg)
reject(new Error('failed to upload file'));
},
complete: function () {
console.log("complete to upload file");
}
});
},
// 获得oss配置信息
// jscat0901 dir是指上传的目录 'user-dir/' 或者是 'logo-dir/'
// 每一个上传目录对应的oss 参数是不一致的
oss: function (dir) {
var _this = this;
console.log("===this is oss");
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234&dirType=" + dir
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
var dict = {
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
}
//通过storage来进行数据的全局共享
var oss = wx.getStorageSync('oss') || {}
oss[dir] = dict
wx.setStorageSync('oss', oss)
}
}
})
},
//用于oss_promise
oss_promise: function (dir, resolve) {
var _this = this;
console.log("===this is oss_"+dir);
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234&dirType=" + dir
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
var dict = {
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
}
//通过storage来进行数据的全局共享
var oss = wx.getStorageSync('oss') || {}
oss[dir] = dict
wx.setStorageSync('oss', oss)
resolve("oss load success")
}
}
})
},
})
{
{
"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;
}
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=8)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=class{constructor(e){this.Component=e}getData(e){const t=this.Component.data;if(!e)return t;if(e.includes(".")){return e.split(".").reduce((e,t)=>e[t],t)}return this.Component.data[e]}setData(e,t=(()=>{})){e&&"object"==typeof e&&this.Component.setData(e,t)}};t.default=n},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSystemInfo=o,t.isComponent=function(e){return e&&void 0!==e.__wxExparserNodeId__&&"function"==typeof e.setData},t.isIos=i,t.shallowEqual=function e(t,a){if(t===a)return!0;if("object"==typeof t&&null!=t&&"object"==typeof a&&null!=a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(var n in t){if(!a.hasOwnProperty(n))return!1;if(!e(t[n],a[n]))return!1}return!0}return!1},t.getCurrentPage=d,t.getComponent=function(e){const t=new c;let a=d()||{};if(a.selectComponent&&"function"==typeof a.selectComponent){if(e)return a.selectComponent(e);t.warn("请传入组件ID")}else t.warn("该基础库暂不支持多个小程序日历组件")},t.uniqueArrayByDate=function(e=[]){let t={},a=[];e.forEach(e=>{t[`${e.year}-${e.month}-${e.day}`]=e});for(let e in t)a.push(t[e]);return a},t.delRepeatedEnableDay=function(e=[],t=[]){let a,n;if(2===t.length){const{startTimestamp:e,endTimestamp:r}=f(t);a=e,n=r}const r=h(e);return r.filter(e=>e<a||e>n)},t.convertEnableAreaToTimestamp=f,t.getDateTimeStamp=b,t.converEnableDaysToTimestamp=h,t.initialTasks=t.GetDate=t.Slide=t.Logger=void 0;var n,r=(n=a(2))&&n.__esModule?n:{default:n};let s;function o(){return s||(s=wx.getSystemInfoSync(),s)}class c{info(e){console.log("%cInfo: %c"+e,"color:#FF0080;font-weight:bold","color: #FF509B")}warn(e){console.log("%cWarn: %c"+e,"color:#FF6600;font-weight:bold","color: #FF9933")}tips(e){console.log("%cTips: %c"+e,"color:#00B200;font-weight:bold","color: #00CC33")}}t.Logger=c;t.Slide=class{isUp(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a;return t.clientY-n<-60&&r<20&&r>-20&&(this.slideLock=!1,!0)}isDown(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a;return t.clientY-n>60&&r<20&&r>-20}isLeft(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a,s=t.clientY-n;return r<-60&&s<20&&s>-20}isRight(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a,s=t.clientY-n;return r>60&&s<20&&s>-20}};class l{newDate(e,t,a){let n=`${+e}-${+t}-${+a}`;return i()&&(n=`${+e}/${+t}/${+a}`),new Date(n)}thisMonthDays(e,t){return new Date(Date.UTC(e,t,0)).getUTCDate()}firstDayOfWeek(e,t){return new Date(Date.UTC(e,t-1,1)).getUTCDay()}dayOfWeek(e,t,a){return new Date(Date.UTC(e,t-1,a)).getUTCDay()}todayDate(){const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()}}todayTimestamp(){const{year:e,month:t,date:a}=this.todayDate();return this.newDate(e,t,a).getTime()}toTimeStr(e){return e.day&&(e.date=e.day),`${+e.year}-${+e.month}-${+e.date}`}sortDates(e,t){return e.sort((function(e,a){return b(e)<b(a)&&"desc"!==t?-1:1}))}prevMonth(e){return+e.month>1?{year:e.year,month:e.month-1}:{year:e.year-1,month:12}}nextMonth(e){return+e.month<12?{year:e.year,month:e.month+1}:{year:e.year+1,month:1}}convertLunar(e=[]){return e.map(e=>(e&&(e.lunar=r.default.solar2lunar(+e.year,+e.month,+e.day)),e))}}function i(){const e=o();return/iphone|ios/i.test(e.platform)}function d(){const e=getCurrentPages();return e[e.length-1]}function f(e=[]){const t=new l,a=e[0].split("-"),n=e[1].split("-"),r=new c;if(3!==a.length||3!==n.length)return r.warn('enableArea() 参数格式为: ["2018-2-1", "2018-3-1"]'),{};return{start:a,end:n,startTimestamp:t.newDate(a[0],a[1],a[2]).getTime(),endTimestamp:t.newDate(n[0],n[1],n[2]).getTime()}}function b(e){if("[object Object]"!==Object.prototype.toString.call(e))return;return(new l).newDate(e.year,e.month,e.day).getTime()}function h(e=[]){const t=new c,a=new l,n=[];return e.forEach(e=>{if("string"!=typeof e)return t.warn("enableDays()入参日期格式错误");const r=e.split("-");if(3!==r.length)return t.warn("enableDays()入参日期格式错误");const s=a.newDate(r[0],r[1],r[2]).getTime();n.push(s)}),n}t.GetDate=l;t.initialTasks={flag:"finished",tasks:[]}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n={lunarInfo:[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42416,83315,21168,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46752,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19195,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448,84835,37744,18936,18800,25776,92326,59984,27424,108228,43744,41696,53987,51552,54615,54432,55888,23893,22176,42704,21972,21200,43448,43344,46240,46758,44368,21920,43940,42416,21168,45683,26928,29495,27296,44368,84821,19296,42352,21732,53600,59752,54560,55968,92838,22224,19168,43476,41680,53584,62034,54560],solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],Gan:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Zhi:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],Animals:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],solarTerm:["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"],sTermInfo:["9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","9778397bd19801ec9210c965cc920e","97b6b97bd19801ec95f8c965cc920f","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd197c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bcf97c3598082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd19801ec9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bd07f1487f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b97bd197c36c9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b70c9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","977837f0e37f149b0723b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0723b06bd","7f07e7f0e37f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f595b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e37f14998083b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14898082b0723b02d5","7f07e7f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66aa89801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e26665b66a449801e9808297c35","665f67f0e37f1489801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722"],nStr1:["日","一","二","三","四","五","六","七","八","九","十"],nStr2:["初","十","廿","卅"],nStr3:["正","二","三","四","五","六","七","八","九","十","冬","腊"],lYearDays:function(e){let t,a=348;for(t=32768;t>8;t>>=1)a+=n.lunarInfo[e-1900]&t?1:0;return a+n.leapDays(e)},leapMonth:function(e){return 15&n.lunarInfo[e-1900]},leapDays:function(e){return n.leapMonth(e)?65536&n.lunarInfo[e-1900]?30:29:0},monthDays:function(e,t){return t>12||t<1?-1:n.lunarInfo[e-1900]&65536>>t?30:29},solarDays:function(e,t){if(t>12||t<1)return-1;const a=t-1;return 1==+a?e%4==0&&e%100!=0||e%400==0?29:28:n.solarMonth[a]},toGanZhiYear:function(e){let t=(e-3)%10,a=(e-3)%12;return 0==+t&&(t=10),0==+a&&(a=12),n.Gan[t-1]+n.Zhi[a-1]},toAstro:function(e,t){return"魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(2*e-(t<[20,19,21,21,21,22,23,23,23,23,22,22][e-1]?2:0),2)+"座"},toGanZhi:function(e){return n.Gan[e%10]+n.Zhi[e%12]},getTerm:function(e,t){if(e<1900||e>2100)return-1;if(t<1||t>24)return-1;const a=n.sTermInfo[e-1900],r=[parseInt("0x"+a.substr(0,5)).toString(),parseInt("0x"+a.substr(5,5)).toString(),parseInt("0x"+a.substr(10,5)).toString(),parseInt("0x"+a.substr(15,5)).toString(),parseInt("0x"+a.substr(20,5)).toString(),parseInt("0x"+a.substr(25,5)).toString()],s=[r[0].substr(0,1),r[0].substr(1,2),r[0].substr(3,1),r[0].substr(4,2),r[1].substr(0,1),r[1].substr(1,2),r[1].substr(3,1),r[1].substr(4,2),r[2].substr(0,1),r[2].substr(1,2),r[2].substr(3,1),r[2].substr(4,2),r[3].substr(0,1),r[3].substr(1,2),r[3].substr(3,1),r[3].substr(4,2),r[4].substr(0,1),r[4].substr(1,2),r[4].substr(3,1),r[4].substr(4,2),r[5].substr(0,1),r[5].substr(1,2),r[5].substr(3,1),r[5].substr(4,2)];return parseInt(s[t-1])},toChinaMonth:function(e){if(e>12||e<1)return-1;let t=n.nStr3[e-1];return t+="月",t},toChinaDay:function(e){let t;switch(e){case 10:t="初十";break;case 20:t="二十";break;case 30:t="三十";break;default:t=n.nStr2[Math.floor(e/10)],t+=n.nStr1[e%10]}return t},getAnimal:function(e){return n.Animals[(e-4)%12]},solar2lunar:function(e,t,a){if(e<1900||e>2100)return-1;if(1900==+e&&1==+t&&+a<31)return-1;let r,s;r=e?new Date(e,parseInt(t)-1,a):new Date;let o=0,c=0;e=r.getFullYear(),t=r.getMonth()+1,a=r.getDate();let l=(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Date.UTC(1900,0,31))/864e5;for(s=1900;s<2101&&l>0;s++)c=n.lYearDays(s),l-=c;l<0&&(l+=c,s--);const i=new Date;let d=!1;i.getFullYear()===+e&&i.getMonth()+1===+t&&i.getDate()===+a&&(d=!0);let f=r.getDay();const b=n.nStr1[f];0==+f&&(f=7);const h=s;o=n.leapMonth(s);let u=!1;for(s=1;s<13&&l>0;s++)o>0&&s===o+1&&!1===u?(--s,u=!0,c=n.leapDays(h)):c=n.monthDays(h,s),!0===u&&s===o+1&&(u=!1),l-=c;0===l&&o>0&&s===o+1&&(u?u=!1:(u=!0,--s)),l<0&&(l+=c,--s);const y=s,m=l+1,D=t-1,p=n.toGanZhiYear(h),g=n.getTerm(e,2*t-1),T=n.getTerm(e,2*t);let w=n.toGanZhi(12*(e-1900)+t+11);a>=g&&(w=n.toGanZhi(12*(e-1900)+t+12));let C=!1,M=null;+g===a&&(C=!0,M=n.solarTerm[2*t-2]),+T===a&&(C=!0,M=n.solarTerm[2*t-1]);const _=Date.UTC(e,D,1,0,0,0,0)/864e5+25567+10,S=n.toGanZhi(_+a-1),k=n.toAstro(t,a);return{lYear:h,lMonth:y,lDay:m,Animal:n.getAnimal(h),IMonthCn:(u?"闰":"")+n.toChinaMonth(y),IDayCn:n.toChinaDay(m),cYear:e,cMonth:t,cDay:a,gzYear:p,gzMonth:w,gzDay:S,isToday:d,isLeap:u,nWeek:f,ncWeek:"星期"+b,isTerm:C,Term:M,astro:k}},lunar2solar:function(e,t,a,r){r=!!r;const s=n.leapMonth(e);if(r&&s!==t)return-1;if(2100==+e&&12==+t&&+a>1||1900==+e&&1==+t&&+a<31)return-1;const o=n.monthDays(e,t);let c=o;if(r&&(c=n.leapDays(e,t)),e<1900||e>2100||a>c)return-1;let l=0;for(let t=1900;t<e;t++)l+=n.lYearDays(t);let i=0,d=!1;for(let a=1;a<t;a++)i=n.leapMonth(e),d||i<=a&&i>0&&(l+=n.leapDays(e),d=!0),l+=n.monthDays(e,a);r&&(l+=o);const f=Date.UTC(1900,1,30,0,0,0),b=new Date(864e5*(l+a-31)+f),h=b.getUTCFullYear(),u=b.getUTCMonth()+1,y=b.getUTCDate();return n.solar2lunar(h,u,y)}},{Gan:r,Zhi:s,nStr1:o,nStr2:c,nStr3:l,Animals:i,solarTerm:d,lunarInfo:f,sTermInfo:b,solarMonth:h,...u}=n;var y=u;t.default=y},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=c(a(0)),r=c(a(4)),s=c(a(2)),o=a(1);function c(e){return e&&e.__esModule?e:{default:e}}const l=new o.Logger,i=new o.GetDate,d=Object.prototype.toString;class f extends n.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component.config}buildDate(e,t){const a=i.todayDate(),n=i.thisMonthDays(e,t),r=[];for(let o=1;o<=n;o++){const n=+a.year==+e&&+a.month==+t&&o===+a.date,c=this.getCalendarConfig(),l={year:e,month:t,day:o,choosed:!1,week:i.dayOfWeek(e,t,o),isToday:n,lunar:s.default.solar2lunar(+e,+t,+o)};r.push(l)}return r}enableArea(e=[]){if(2===e.length){if(this.__judgeParam(e)){let{days:t=[],selectedDay:a=[]}=this.getData("calendar");const{startTimestamp:n,endTimestamp:r}=(0,o.convertEnableAreaToTimestamp)(e),s=this.__handleEnableArea({dateArea:e,days:t,startTimestamp:n,endTimestamp:r},a);this.setData({"calendar.enableArea":e,"calendar.days":s.dates,"calendar.selectedDay":s.selectedDay,"calendar.enableAreaTimestamp":[n,r]})}}else l.warn('enableArea()参数需为时间范围数组,形如:["2018-8-4" , "2018-8-24"]')}enableDays(e=[]){const{enableArea:t=[]}=this.getData("calendar");let a=[];a=t.length?(0,o.delRepeatedEnableDay)(e,t):(0,o.converEnableDaysToTimestamp)(e);let{days:n=[],selectedDay:r=[]}=this.getData("calendar");const s=this.__handleEnableDays({days:n,expectEnableDaysTimestamp:a},r);this.setData({"calendar.days":s.dates,"calendar.selectedDay":s.selectedDay,"calendar.enableDays":e,"calendar.enableDaysTimestamp":a})}setSelectedDays(e){if(!(0,r.default)(this.Component).getCalendarConfig().multi)return l.warn("单选模式下不能设置多日期选中,请配置 multi");let{days:t}=this.getData("calendar"),a=[];if(e){if(e&&e.length){const{dates:n,selectedDates:r}=this.__handleSelectedDays(t,a,e);t=n,a=r}}else t.map(e=>{e.choosed=!0,e.showTodoLabel=!0}),a=t;(0,r.default)(this.Component).setCalendarConfig("multi",!0),this.setData({"calendar.days":t,"calendar.selectedDay":a})}disableDays(e){const{disableDays:t=[],days:a}=this.getData("calendar");if("[object Array]"!==Object.prototype.toString.call(e))return l.warn("disableDays 参数为数组");let n=[];if(e.length){n=(0,o.uniqueArrayByDate)(e.concat(t));const r=n.map(e=>i.toTimeStr(e));a.forEach(e=>{const t=i.toTimeStr(e);r.includes(t)&&(e.disable=!0)})}else a.forEach(e=>{e.disable=!1});this.setData({"calendar.days":a,"calendar.disableDays":n})}chooseArea(e=[]){return new Promise((t,a)=>{if(1===e.length&&(e=e.concat(e)),2===e.length){if(this.__judgeParam(e)){const n=(0,r.default)(this.Component).getCalendarConfig(),{startTimestamp:s,endTimestamp:c}=(0,o.convertEnableAreaToTimestamp)(e);this.setData({calendarConfig:{...n,chooseAreaMode:!0,mulit:!0},"calendar.chooseAreaTimestamp":[s,c]},()=>{this.__chooseContinuousDates(s,c).then(t).catch(a)})}}})}__pusheNextMonthDateArea(e,t,a,n){const r=this.buildDate(e.year,e.month);let s=r.length;for(let e=0;e<s;e++){const c=r[e],l=(0,o.getDateTimeStamp)(c);l<=a&&l>=t&&n.push({...c,choosed:!0}),e===s-1&&l<a&&this.__pusheNextMonthDateArea(i.nextMonth(c),t,a,n)}}__pushPrevMonthDateArea(e,t,a,n){const r=i.sortDates(this.buildDate(e.year,e.month),"desc");let s=r.length,c=(0,o.getDateTimeStamp)(r[0]);for(let e=0;e<s;e++){const l=r[e],d=(0,o.getDateTimeStamp)(l);d>=t&&d<=a&&n.push({...l,choosed:!0}),e===s-1&&c>t&&this.__pushPrevMonthDateArea(i.prevMonth(l),t,a,n)}}__calcDateWhenNotInOneMonth(e){const{firstDate:t,lastDate:a,startTimestamp:n,endTimestamp:r,filterSelectedDate:s}=e;(0,o.getDateTimeStamp)(t)>n&&this.__pushPrevMonthDateArea(i.prevMonth(t),n,r,s),(0,o.getDateTimeStamp)(a)<r&&this.__pusheNextMonthDateArea(i.nextMonth(a),n,r,s);return[...i.sortDates(s)]}__chooseContinuousDates(e,t){return new Promise((a,n)=>{const{days:r,selectedDay:s=[]}=this.getData("calendar"),c=[];let l=[];s.forEach(a=>{const n=(0,o.getDateTimeStamp)(a);n>=e&&n<=t&&(l.push(a),c.push(i.toTimeStr(a)))}),r.forEach(a=>{const n=(0,o.getDateTimeStamp)(a),r=c.includes(i.toTimeStr(a));if(n>=e&&n<=t){if(r)return;a.choosed=!0,l.push(a)}else if(a.choosed=!1,r){const e=l.findIndex(e=>i.toTimeStr(e)===i.toTimeStr(a));e>-1&&l.splice(e,1)}});const d=r[0],f=r[r.length-1],b=this.__calcDateWhenNotInOneMonth({firstDate:d,lastDate:f,startTimestamp:e,endTimestamp:t,filterSelectedDate:l});try{this.setData({"calendar.days":[...r],"calendar.selectedDay":b},()=>{a(b)})}catch(e){n(e)}})}setDateStyle(e){if("[object Array]"!==d.call(e))return;const{days:t,specialStyleDates:a}=this.getData("calendar");"[object Array]"===d.call(a)&&(e=(0,o.uniqueArrayByDate)([...a,...e]));const n=e.map(e=>`${e.year}_${e.month}_${e.day}`),r=t.map(t=>{const a=n.indexOf(`${t.year}_${t.month}_${t.day}`);return a>-1?{...t,class:e[a].class}:{...t}});this.setData({"calendar.days":r,"calendar.specialStyleDates":e})}__judgeParam(e){const{start:t,end:a,startTimestamp:n,endTimestamp:r}=(0,o.convertEnableAreaToTimestamp)(e);if(!t||!a)return;const s=i.thisMonthDays(t[0],t[1]),c=i.thisMonthDays(a[0],a[1]);return t[2]>s||t[2]<1?(l.warn("enableArea() 开始日期错误,指定日期不在当前月份天数范围内"),!1):t[1]>12||t[1]<1?(l.warn("enableArea() 开始日期错误,月份超出1-12月份"),!1):a[2]>c||a[2]<1?(l.warn("enableArea() 截止日期错误,指定日期不在当前月份天数范围内"),!1):a[1]>12||a[1]<1?(l.warn("enableArea() 截止日期错误,月份超出1-12月份"),!1):!(n>r)||(l.warn("enableArea()参数最小日期大于了最大日期"),!1)}__getDisableDateTimestamp(){let e;const{date:t,type:a}=this.getCalendarConfig().disableMode||{};if(t){const a=t.split("-");if(a.length<3)return l.warn("配置 disableMode.date 格式错误"),{};e=(0,o.getDateTimeStamp)({year:+a[0],month:+a[1],day:+a[2]})}return{disableDateTimestamp:e,disableType:a}}__handleEnableArea(e={},t=[]){const{area:a,days:n,startTimestamp:r,endTimestamp:s}=e,c=this.getData("calendar.enableDays")||[];let l=[];c.length&&(l=(0,o.delRepeatedEnableDay)(c,a));const{disableDateTimestamp:d,disableType:f}=this.__getDisableDateTimestamp(),b=[...n];return b.forEach(e=>{const a=+i.newDate(e.year,e.month,e.day).getTime();(+r>a||a>+s)&&!l.includes(a)||"before"===f&&d&&a<d||"after"===f&&d&&a>d?(e.disable=!0,e.choosed&&(e.choosed=!1,t=t.filter(t=>i.toTimeStr(e)!==i.toTimeStr(t)))):e.disable&&(e.disable=!1)}),{dates:b,selectedDay:t}}__handleEnableDays(e={},t=[]){const{days:a,expectEnableDaysTimestamp:n}=e,{enableAreaTimestamp:r=[]}=this.getData("calendar"),s=[...a];return s.forEach(e=>{const a=i.newDate(e.year,e.month,e.day).getTime();let s=!1;r.length?(+r[0]>+a||+a>+r[1])&&!n.includes(+a)&&(s=!0):n.includes(+a)||(s=!0),s?(e.disable=!0,e.choosed&&(e.choosed=!1,t=t.filter(t=>i.toTimeStr(e)!==i.toTimeStr(t)))):e.disable=!1}),{dates:s,selectedDay:t}}__handleSelectedDays(e=[],t=[],a){const{selectedDay:n,showLabelAlways:r}=this.getData("calendar");t=n&&n.length?(0,o.uniqueArrayByDate)(n.concat(a)):a;const{year:s,month:c}=e[0],l=[];return t.forEach(e=>{+e.year==+s&&+e.month==+c&&l.push(i.toTimeStr(e))}),[...e].map(e=>{l.includes(i.toTimeStr(e))&&(e.choosed=!0,r&&e.showTodoLabel?e.showTodoLabel=1:e.showTodoLabel=1)}),{dates:e,selectedDates:t}}}t.default=e=>new f(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=a(0))&&n.__esModule?n:{default:n};class s extends r.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component&&this.Component.config?this.Component.config:{}}setCalendarConfig(e){return new Promise((t,a)=>{if(!this.Component||!this.Component.config)return void a("异常:未找到组件配置信息");let n={...this.Component.config,...e};this.Component.config=n,this.setData({calendarConfig:n},()=>{t(n)})})}}t.default=e=>new s(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3)),r=i(a(0)),s=i(a(6)),o=i(a(4)),c=i(a(2)),l=a(1);function i(e){return e&&e.__esModule?e:{default:e}}const d=new l.GetDate,f=new l.Logger;class b extends r.default{constructor(e){super(e),this.Component=e,this.getCalendarConfig=(0,o.default)(this.Component).getCalendarConfig}switchWeek(e,t){return new Promise((a,n)=>{if((0,o.default)(this.Component).getCalendarConfig().multi)return f.warn("多选模式不能切换周月视图");const{selectedDay:r=[],curYear:c,curMonth:l}=this.getData("calendar");let i=[],b=!1;r.length?i=r[0]:(i=d.todayDate(),i.day=i.date,b=!0);let h=t||i;const{year:u,month:y}=h,m=c!==u||l!==y;if("week"===e){if(this.Component.weekMode)return;(r.length&&m||!r.length)&&(b=!0,h={year:c,month:l,day:h.day}),this.Component.weekMode=!0,this.setData({"calendarConfig.weekMode":!0}),this.jump(h,b).then(a).catch(n)}else{this.Component.weekMode=!1,this.setData({"calendarConfig.weekMode":!1});const e=r.length&&m||!r.length;(0,s.default)(this.Component).renderCalendar(c,l,h.day,e).then(a).catch(n)}})}updateCurrYearAndMonth(e){let{days:t,curYear:a,curMonth:n}=this.getData("calendar");const{month:r}=t[0],{month:s}=t[t.length-1],o=d.thisMonthDays(a,n),c=t[t.length-1],l=t[0];return(c.day+7>o||n===r&&r!==s)&&"next"===e?(n+=1,n>12&&(a+=1,n=1)):(+l.day<=7||n===s&&r!==s)&&"prev"===e&&(n-=1,n<=0&&(a-=1,n=12)),{Uyear:a,Umonth:n}}calculateLastDay(){const{days:e=[],curYear:t,curMonth:a}=this.getData("calendar");return{lastDayInThisWeek:e[e.length-1].day,lastDayInThisMonth:d.thisMonthDays(t,a)}}calculateFirstDay(){const{days:e}=this.getData("calendar");return{firstDayInThisWeek:e[0].day}}firstWeekInMonth(e,t,a){let r=d.dayOfWeek(e,t,1);a&&0===r&&(r=7);const[,s]=[0,7-r];let o=this.getData("calendar.days")||[];this.Component.weekMode&&(o=(0,n.default)(this.Component).buildDate(e,t));return o.slice(0,a?s+1:s)}lastWeekInMonth(e,t,a){const r=d.thisMonthDays(e,t),s=d.dayOfWeek(e,t,r),[o,c]=[r-s,r];let l=this.getData("calendar.days")||[];this.Component.weekMode&&(l=(0,n.default)(this.Component).buildDate(e,t));return l.slice(a?o:o-1,c)}__getDisableDateTimestamp(e){const{date:t,type:a}=e.disableMode||{};let n;if(t){const e=t.split("-");if(e.length<3)return f.warn("配置 disableMode.date 格式错误"),{};n=(0,l.getDateTimeStamp)({year:+e[0],month:+e[1],day:+e[2]})}return{disableDateTimestamp:n,disableType:a}}initSelectedDay(e){let t=[...e];const{selectedDay:a=[]}=this.getData("calendar"),n=a.map(e=>`${+e.year}-${+e.month}-${+e.day}`),r=this.getCalendarConfig(),{disableDateTimestamp:s,disableType:o}=this.__getDisableDateTimestamp(r);return t=t.map(e=>{if(!e)return{};const t=(0,l.getDateTimeStamp)(e);let a={...e};return n.includes(`${+a.year}-${+a.month}-${+a.day}`)?a.choosed=!0:a.choosed=!1,("after"===o&&t>s||"before"===o&&t<s)&&(a.disable=!0),a=this.__setTodoWhenJump(a,r),r.showLunar&&(a=this.__setSolarLunar(a)),r.highlightToday&&(a=this.__highlightToday(a)),a}),t}setEnableAreaOnWeekMode(e=[]){let{enableAreaTimestamp:t=[],enableDaysTimestamp:a=[]}=this.getData("calendar");e.forEach(e=>{const n=d.newDate(e.year,e.month,e.day).getTime();let r=!1;t.length?(+t[0]>+n||+n>+t[1])&&!a.includes(+n)&&(r=!0):a.length&&!a.includes(+n)&&(r=!0),r&&(e.disable=!0,e.choosed=!1);const s=(0,o.default)(this.Component).getCalendarConfig(),{disableDateTimestamp:c,disableType:l}=this.__getDisableDateTimestamp(s);("before"===l&&n<c||"after"===l&&n>c)&&(e.disable=!0)})}updateYMWhenSwipeCalendarHasSelected(e){const t=e.filter(e=>e.choosed);if(t&&t.length){const{year:e,month:a}=t[0];return{year:e,month:a}}return{}}calculateNextWeekDays(){let{lastDayInThisWeek:e,lastDayInThisMonth:t}=this.calculateLastDay(),{curYear:a,curMonth:r}=this.getData("calendar"),s=[];if(t-e>=7){const{Uyear:t,Umonth:n}=this.updateCurrYearAndMonth("next");a=t,r=n;for(let t=e+1;t<=e+7;t++)s.push({year:a,month:r,day:t,week:d.dayOfWeek(a,r,t)})}else{for(let n=e+1;n<=t;n++)s.push({year:a,month:r,day:n,week:d.dayOfWeek(a,r,n)});const{Uyear:n,Umonth:o}=this.updateCurrYearAndMonth("next");a=n,r=o;for(let n=1;n<=7-(t-e);n++)s.push({year:a,month:r,day:n,week:d.dayOfWeek(a,r,n)})}s=this.initSelectedDay(s);const{year:o,month:c}=this.updateYMWhenSwipeCalendarHasSelected(s);o&&c&&(a=o,r=c),this.setEnableAreaOnWeekMode(s),this.setData({"calendar.curYear":a,"calendar.curMonth":r,"calendar.days":s},()=>{(0,n.default)(this.Component).setDateStyle()})}calculatePrevWeekDays(){let{firstDayInThisWeek:e}=this.calculateFirstDay(),{curYear:t,curMonth:a}=this.getData("calendar"),r=[];if(e-7>0){const{Uyear:n,Umonth:s}=this.updateCurrYearAndMonth("prev");t=n,a=s;for(let n=e-7;n<e;n++)r.push({year:t,month:a,day:n,week:d.dayOfWeek(t,a,n)})}else{let n=[];for(let r=1;r<e;r++)n.push({year:t,month:a,day:r,week:d.dayOfWeek(t,a,r)});const{Uyear:s,Umonth:o}=this.updateCurrYearAndMonth("prev");t=s,a=o;const c=d.thisMonthDays(t,a);for(let n=c-Math.abs(e-7);n<=c;n++)r.push({year:t,month:a,day:n,week:d.dayOfWeek(t,a,n)});r=r.concat(n)}r=this.initSelectedDay(r);const{year:s,month:o}=this.updateYMWhenSwipeCalendarHasSelected(r);s&&o&&(t=s,a=o),this.setEnableAreaOnWeekMode(r),this.setData({"calendar.curYear":t,"calendar.curMonth":a,"calendar.days":r},()=>{(0,n.default)(this.Component).setDateStyle()})}calculateDatesWhenJump({year:e,month:t,day:a},{firstWeekDays:n,lastWeekDays:r},s){const o=this.__dateIsInWeek({year:e,month:t,day:a},n),c=this.__dateIsInWeek({year:e,month:t,day:a},r);let l=[];return l=o?this.__calculateDatesWhenInFirstWeek(n,s):c?this.__calculateDatesWhenInLastWeek(r,s):this.__calculateDates({year:e,month:t,day:a},s),l}jump({year:e,month:t,day:a},r){return new Promise(s=>{if(!a)return;const o=this.getCalendarConfig(),c="Mon"===o.firstDayOfWeek,l=this.firstWeekInMonth(e,t,c);let i=this.lastWeekInMonth(e,t,c),d=this.calculateDatesWhenJump({year:e,month:t,day:a},{firstWeekDays:l,lastWeekDays:i},c);d=d.map(n=>{let s={...n};return+s.year!=+e||+s.month!=+t||+s.day!=+a||r||(s.choosed=!0),s=this.__setTodoWhenJump(s,o),o.showLunar&&(s=this.__setSolarLunar(s)),o.highlightToday&&(s=this.__highlightToday(s)),s}),this.setEnableAreaOnWeekMode(d);const f={"calendar.days":d,"calendar.curYear":e,"calendar.curMonth":t,"calendar.empytGrids":[],"calendar.lastEmptyGrids":[]};r||(f["calendar.selectedDay"]=d.filter(e=>e.choosed)),this.setData(f,()=>{(0,n.default)(this.Component).setDateStyle(),s({year:e,month:t,date:a})})})}__setTodoWhenJump(e){const t={...e},{todoLabels:a=[],showLabelAlways:n}=this.getData("calendar"),r=a.map(e=>`${+e.year}-${+e.month}-${+e.day}`).indexOf(`${+t.year}-${+t.month}-${+t.day}`);if(-1!==r){t.showTodoLabel=1||!t.choosed;const e=a[r]||{};t.showTodoLabel&&e.todoText&&(t.todoText=e.todoText)}return t}__setSolarLunar(e){const t={...e};return t.lunar=c.default.solar2lunar(+t.year,+t.month,+t.day),t}__highlightToday(e){const t={...e},a=d.todayDate(),n=+a.year==+t.year&&+a.month==+t.month&&+t.day==+a.date;return t.isToday=n,t}__calculateDatesWhenInFirstWeek(e){const t=[...e];if(t.length<7){let e,{year:a,month:n}=t[0],r=7-t.length;for(n>1?(n-=1,e=d.thisMonthDays(a,n)):(n=12,a-=1,e=d.thisMonthDays(a,n));r;)t.unshift({year:a,month:n,day:e,week:d.dayOfWeek(a,n,e)}),e-=1,r-=1}return t}__calculateDatesWhenInLastWeek(e){const t=[...e];if(t.length<7){let{year:e,month:a}=t[0],n=7-t.length,r=1;for(a>11?(a=1,e+=1):a+=1;n;)t.push({year:e,month:a,day:r,week:d.dayOfWeek(e,a,r)}),r+=1,n-=1}return t}__calculateDates({year:e,month:t,day:a},r){const s=d.dayOfWeek(e,t,a);let o=[a-s,a+(6-s)];r&&(o=[a+1-s,a+(7-s)]);return(0,n.default)(this.Component).buildDate(e,t).slice(o[0]-1,o[1])}__dateIsInWeek(e,t){return t.find(t=>+t.year==+e.year&&+t.month==+e.month&&+t.day==+e.day)}__tipsWhenCanNotSwtich(){f.info("当前月份未选中日期下切换为周视图,不能明确该展示哪一周的日期,故此情况不允许切换")}}t.default=e=>new b(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(a(3)),r=l(a(7)),s=l(a(0)),o=l(a(2)),c=a(1);function l(e){return e&&e.__esModule?e:{default:e}}const i=new c.GetDate,d=new c.Logger;class f extends s.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component.config}renderCalendar(e,t,a,s){return new Promise(o=>{const c=this.getCalendarConfig();this.calculateEmptyGrids(e,t),this.calculateDays(e,t,a,s).then(()=>{const{todoLabels:a,specialStyleDates:s,enableDays:l,selectedDay:i}=this.getData("calendar")||{};a&&a.find(a=>+a.month==+t&&+a.year==+e)&&(0,r.default)(this.Component).setTodoLabels(),s&&s.length&&s.find(a=>+a.month==+t&&+a.year==+e)&&(0,n.default)(this.Component).setDateStyle(s),l&&l.length&&l.find(a=>{let n=a.split("-");return+n[1]==+t&&+n[0]==+e})&&(0,n.default)(this.Component).enableDays(l),i&&i.length&&i.find(a=>+a.month==+t&&+a.year==+e)&&c.mulit&&(0,n.default)(this.Component).setSelectedDays(i),this.Component.firstRender?o({firstRender:!1}):o({firstRender:!0})})})}calculateEmptyGrids(e,t){this.calculatePrevMonthGrids(e,t),this.calculateNextMonthGrids(e,t)}calculatePrevMonthGrids(e,t){let a=[];const n=i.thisMonthDays(e,t-1);let r=i.firstDayOfWeek(e,t);const s=this.getCalendarConfig()||{};if("Mon"===s.firstDayOfWeek&&(0===r?r=6:r-=1),r>0){const c=n-r,{onlyShowCurrentMonth:l}=s,{showLunar:i}=this.getCalendarConfig();for(let r=n;r>c;r--)l?a.push(""):a.push({day:r,lunar:i?o.default.solar2lunar(e,t-1,r):null});this.setData({"calendar.empytGrids":a.reverse()})}else this.setData({"calendar.empytGrids":null})}calculateExtraEmptyDate(e,t,a){let n=0;if(2==+t){n+=7;let r=i.dayOfWeek(e,t,1);"Mon"===a.firstDayOfWeek?1==+r&&(n+=7):0==+r&&(n+=7)}else{let r=i.dayOfWeek(e,t,1);"Mon"===a.firstDayOfWeek?0!==r&&r<6&&(n+=7):r<=5&&(n+=7)}return n}calculateNextMonthGrids(e,t){let a=[];const n=i.thisMonthDays(e,t);let r=i.dayOfWeek(e,t,n);const s=this.getCalendarConfig()||{};"Mon"===s.firstDayOfWeek&&(0===r?r=6:r-=1);let c=7-(r+1);const{onlyShowCurrentMonth:l,showLunar:d}=s;l||(c+=this.calculateExtraEmptyDate(e,t,s));for(let n=1;n<=c;n++)l?a.push(""):a.push({day:n,lunar:d?o.default.solar2lunar(e,t+1,n):null});this.setData({"calendar.lastEmptyGrids":a})}setSelectedDay(e,t,a){let n=[];const r=this.getCalendarConfig();if(r.noDefault)n=[],r.noDefault=!1;else{const r=this.getData("calendar")||{},{showLunar:s}=this.getCalendarConfig();n=a?[{year:e,month:t,day:a,choosed:!0,week:i.dayOfWeek(e,t,a),lunar:s?o.default.solar2lunar(e,t,a):null}]:r.selectedDay}return n}__getDisableDateTimestamp(){let e;const{date:t,type:a}=this.getCalendarConfig().disableMode||{};if(t){const a=t.split("-");if(a.length<3)return d.warn("配置 disableMode.date 格式错误"),{};e=(0,c.getDateTimeStamp)({year:+a[0],month:+a[1],day:+a[2]})}return{disableDateTimestamp:e,disableType:a}}resetDates(){this.setData({"calendar.days":[]})}calculateDays(e,t,a,r){return new Promise(s=>{this.resetDates();let o=[];const{disableDays:l=[],chooseAreaTimestamp:d=[],selectedDay:f=[]}=this.getData("calendar");o=(0,n.default)(this.Component).buildDate(e,t);let b=f;r||(b=this.setSelectedDay(e,t,a));const h=b.map(e=>i.toTimeStr(e)),u=l.map(e=>i.toTimeStr(e)),[y,m]=d;o.forEach(e=>{const t=i.toTimeStr(e),a=(0,c.getDateTimeStamp)(e);if(h.includes(t)&&!r){if(e.choosed=!0,a>m||a<y){const t=b.findIndex(t=>i.toTimeStr(t)===i.toTimeStr(e));b.splice(t,1)}}else y&&m&&a>=y&&a<=m&&!r&&(e.choosed=!0,b.push(e));u.includes(t)&&(e.disable=!0);const{disableDateTimestamp:n,disableType:s}=this.__getDisableDateTimestamp();let o=!1;n&&("before"===s&&a<n||"after"===s&&a>n)&&(o=!0);(o||this.__isDisable(a))&&(e.disable=!0,e.choosed=!1)}),this.setData({"calendar.days":o,"calendar.selectedDay":[...b]||!1},()=>{s()})})}__isDisable(e){const{enableArea:t=[],enableDays:a=[],enableAreaTimestamp:n=[]}=this.getData("calendar");let r=!1,s=(0,c.converEnableDaysToTimestamp)(a);return t.length&&(s=(0,c.delRepeatedEnableDay)(a,t)),n.length?(+n[0]>+e||+e>+n[1])&&!s.includes(+e)&&(r=!0):s.length&&!s.includes(+e)&&(r=!0),r}}t.default=e=>new f(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=a(0))&&n.__esModule?n:{default:n},s=a(1);const o=new s.Logger,c=new s.GetDate;class l extends r.default{constructor(e){super(e),this.Component=e}setTodoLabels(e){e&&(this.Component.todoConfig=e);const t=this.getData("calendar");if(!t||!t.days)return o.warn("请等待日历初始化完成后再调用该方法");const a=[...t.days],{curYear:n,curMonth:r}=t,{circle:c,dotColor:l="",pos:i="bottom",showLabelAlways:d,days:f=[]}=e||this.Component.todoConfig||{},{todoLabels:b=[],todoLabelPos:h,todoLabelColor:u}=t,y=this.getTodoLabels({year:n,month:r});let m=f.filter(e=>+e.year==+n&&+e.month==+r);this.Component.weekMode&&(m=f);const D=y.concat(m);for(let e of D){let t;t=this.Component.weekMode?a.find(t=>+e.year==+t.year&&+e.month==+t.month&&+e.day==+t.day):a[e.day-1],t&&(t.showTodoLabel=1||!t.choosed,t.showTodoLabel&&e.todoText&&(t.todoText=e.todoText),e.color&&(t.color=e.color))}const p={"calendar.days":a,"calendar.todoLabels":(0,s.uniqueArrayByDate)(b.concat(f))};c||(i&&i!==h&&(p["calendar.todoLabelPos"]=i),l&&l!==u&&(p["calendar.todoLabelColor"]=l)),p["calendar.todoLabelCircle"]=!1,p["calendar.showLabelAlways"]=d||!1,this.setData(p)}deleteTodoLabels(e){if(!(e instanceof Array&&e.length))return;const t=this.filterTodos(e),{days:a,curYear:n,curMonth:r}=this.getData("calendar"),s=t.filter(e=>n===+e.year&&r===+e.month);a.forEach(e=>{e.showTodoLabel=1}),s.forEach(e=>{a[e.day-1].showTodoLabel=1}),this.setData({"calendar.days":a,"calendar.todoLabels":t})}clearTodoLabels(){const{days:e=[]}=this.getData("calendar"),t=[].concat(e);t.forEach(e=>{e.showTodoLabel=1}),this.setData({"calendar.days":t,"calendar.todoLabels":[]})}getTodoLabels(e){const{todoLabels:t=[]}=this.getData("calendar");if(e){const{year:a,month:n}=e;return t.filter(e=>+e.year==+a&&+e.month==+n)}return t}filterTodos(e){const t=this.getData("calendar.todoLabels")||[],a=e.map(e=>c.toTimeStr(e));return t.filter(e=>!a.includes(c.toTimeStr(e)))}showTodoLabels(e,t,a){e.forEach(e=>{if(this.Component.weekMode)t.forEach((n,r)=>{if(+n.day==+e.day){const n=t[r];n.hasTodo=!0,n.todoText=e.todoText,a&&a.length&&+a[0].day==+e.day&&(n.showTodoLabel=!0)}});else{const n=t[e.day-1];if(!n)return;n.hasTodo=!0,n.todoText=e.todoText,a&&a.length&&+a[0].day==+e.day&&(t[a[0].day-1].showTodoLabel=!0)}})}}t.default=e=>new l(e)},function(e,t,a){"use strict";var n,r=(n=a(5))&&n.__esModule?n:{default:n},s=a(1),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=n?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(a,r,s):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a(9));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}const l=new s.Slide,i=new s.Logger,d=new s.GetDate;Component({options:{styleIsolation:"apply-shared",multipleSlots:!0},properties:{calendarConfig:{type:Object,value:{}}},data:{handleMap:{prev_year:"chooseYear",prev_month:"chooseMonth",next_month:"chooseMonth",next_year:"chooseYear"}},lifetimes:{attached:function(){this.initComp()},detached:function(){s.initialTasks.flag="finished",s.initialTasks.tasks.length=0}},methods:{initComp(){const e=this.setDefaultDisableDate();this.setConfig(e)},setDefaultDisableDate(){const e=this.properties.calendarConfig||{};return e.disableMode&&!e.disableMode.date&&(e.disableMode.date=d.toTimeStr(d.todayDate())),e},setConfig(e){e.markToday&&"string"==typeof e.markToday&&(e.highlightToday=!0),e.theme=e.theme||"default",this.weekMode=e.weekMode,this.setData({calendarConfig:e},()=>{(0,o.default)(this,e)})},chooseDate(e){const{type:t}=e.currentTarget.dataset;if(!t)return;this[this.data.handleMap[t]](t)},chooseYear(e){const{curYear:t,curMonth:a}=this.data.calendar;if(!t||!a)return i.warn("异常:未获取到当前年月");if(this.weekMode)return console.warn("周视图下不支持点击切换年月");let n=+t,r=+a;"prev_year"===e?n-=1:"next_year"===e&&(n+=1),this.render(t,a,n,r)},chooseMonth(e){const{curYear:t,curMonth:a}=this.data.calendar;if(!t||!a)return i.warn("异常:未获取到当前年月");if(this.weekMode)return console.warn("周视图下不支持点击切换年月");let n=+t,r=+a;"prev_month"===e?(r-=1,r<1&&(n-=1,r=12)):"next_month"===e&&(r+=1,r>12&&(n+=1,r=1)),this.render(t,a,n,r)},render(e,t,a,n){o.whenChangeDate.call(this,{curYear:e,curMonth:t,newYear:a,newMonth:n}),this.setData({"calendar.curYear":a,"calendar.curMonth":n}),o.renderCalendar.call(this,a,n)},tapDayItem(e){const{idx:t,date:a={}}=e.currentTarget.dataset,{day:n,disable:r}=a;if(r||!n)return;const s=this.data.calendarConfig||this.config||{},{multi:c,chooseAreaMode:l}=s;c?o.whenMulitSelect.call(this,t):l?o.whenChooseArea.call(this,t):o.whenSingleSelect.call(this,t),this.setData({"calendar.noDefault":!1})},doubleClickToToday(){if(!this.config.multi&&!this.weekMode)if(void 0===this.count?this.count=1:this.count+=1,this.lastClick){(new Date).getTime()-this.lastClick<500&&this.count>=2&&o.jump.call(this),this.count=void 0,this.lastClick=void 0}else this.lastClick=(new Date).getTime()},calendarTouchstart(e){const t=e.touches[0],a=t.clientX,n=t.clientY;this.slideLock=!0,this.setData({"gesture.startX":a,"gesture.startY":n})},handleSwipe(e){let t="calendar.leftSwipe",a="next_month",n="next_week";if("right"===e&&(t="calendar.rightSwipe",a="prev_month",n="prev_week"),this.setData({[t]:1}),this.currentYM=(0,o.getCurrentYM)(),this.weekMode)return this.slideLock=!1,this.currentDates=(0,o.getCalendarDates)(),"prev_week"===n?(0,r.default)(this).calculatePrevWeekDays():"next_week"===n&&(0,r.default)(this).calculateNextWeekDays(),this.onSwipeCalendar(n),void this.onWeekChange(n);this.chooseMonth(a),this.onSwipeCalendar(a)},calendarTouchmove(e){const{gesture:t}=this.data,{preventSwipe:a}=this.properties.calendarConfig;this.slideLock&&!a&&(l.isLeft(t,e.touches[0])&&(this.handleSwipe("left"),this.slideLock=!1),l.isRight(t,e.touches[0])&&(this.handleSwipe("right"),this.slideLock=!1))},calendarTouchend(e){this.setData({"calendar.leftSwipe":0,"calendar.rightSwipe":0})},onSwipeCalendar(e){this.triggerEvent("onSwipe",{directionType:e,currentYM:this.currentYM})},onWeekChange(e){this.triggerEvent("whenChangeWeek",{current:{currentYM:this.currentYM,dates:[...this.currentDates]},next:{currentYM:(0,o.getCurrentYM)(),dates:(0,o.getCalendarDates)()},directionType:e}),this.currentDates=null,this.currentYM=null}}})},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentYM=v,t.getSelectedDay=L,t.cancelSelectedDates=W,t.jump=A,t.setTodoLabels=O,t.deleteTodoLabels=x,t.clearTodoLabels=Y,t.getTodoLabels=E,t.disableDay=P,t.enableArea=j,t.enableDays=I,t.setSelectedDays=$,t.getCalendarConfig=G,t.setCalendarConfig=U,t.getCalendarDates=F,t.chooseDateArea=R,t.setDateStyle=N,t.switchView=X,t.default=t.calculateNextWeekDays=t.calculatePrevWeekDays=t.whenMulitSelect=t.whenChooseArea=t.whenSingleSelect=t.renderCalendar=t.whenChangeDate=void 0;var n=f(a(3)),r=f(a(5)),s=f(a(7)),o=f(a(0)),c=f(a(6)),l=f(a(4)),i=f(a(2)),d=a(1);function f(e){return e&&e.__esModule?e:{default:e}}let b={},h=new d.Logger,u=new d.GetDate,y=null;function m(e){return e&&(b=(0,d.getComponent)(e)),b}function D(e,t){return m(t),y=new o.default(b),y.getData(e)}function p(e,t=(()=>{})){return new o.default(b).setData(e,t)}const g={renderCalendar(e,t,a){return(0,d.isComponent)(this)&&(b=this),new Promise((n,r)=>{(0,c.default)(b).renderCalendar(e,t,a).then((r={})=>{if(!r.firstRender)return n({year:e,month:t,date:a});Z((0,d.getCurrentPage)()),b.triggerEvent("afterCalendarRender",b),b.firstRender=!0,d.initialTasks.flag="finished",d.initialTasks.tasks.length&&d.initialTasks.tasks.shift()(),n({year:e,month:t,date:a})}).catch(e=>{r(e)})})},whenChangeDate({curYear:e,curMonth:t,newYear:a,newMonth:n}){b.triggerEvent("whenChangeMonth",{current:{year:e,month:t},next:{year:a,month:n}})},whenMulitSelect(e){(0,d.isComponent)(this)&&(b=this);const{calendar:t={}}=D(),{days:a,todoLabels:n}=t,r=(0,l.default)(b).getCalendarConfig();let{selectedDay:s=[]}=t;const o=a[e];if(o){if(o.choosed=!o.choosed,o.choosed){o.cancel=!1;const{showLabelAlways:e}=D("calendar");e&&o.showTodoLabel?o.showTodoLabel=!0:o.showTodoLabel=1,r.takeoverTap||s.push(o)}else{o.cancel=!0;const e=u.toTimeStr(o);s=s.filter(t=>e!==u.toTimeStr(t)),n&&n.forEach(t=>{e===u.toTimeStr(t)&&(o.showTodoLabel=!0)})}if(r.takeoverTap)return b.triggerEvent("onTapDay",o);p({"calendar.days":a,"calendar.selectedDay":s}),g.afterTapDay(o,s)}},whenSingleSelect(e){(0,d.isComponent)(this)&&(b=this);const{calendar:t={}}=D(),{days:a,selectedDay:n=[],todoLabels:r}=t;let o=[];const c=a[e];if(!c)return;const i=[...n].pop()||{},{month:f,year:h}=a[0]||{},u=(0,l.default)(b).getCalendarConfig();if(u.takeoverTap)return b.triggerEvent("onTapDay",c);if(g.afterTapDay(c),!u.inverse&&i.day===c.day)return;a.forEach((e,t)=>{+e.day==+i.day&&(a[t].choosed=!1)}),r&&(o=r.filter(e=>+e.year===h&&+e.month===f)),(0,s.default)(b).showTodoLabels(o,a,n);const y={"calendar.days":a};i.day!==c.day?(i.choosed=!1,c.choosed=!0,t.showLabelAlways&&c.showTodoLabel||(c.showTodoLabel=1),y["calendar.selectedDay"]=[c]):u.inverse&&(c.choosed&&(c.showTodoLabel&&t.showLabelAlways?c.showTodoLabel=!0:c.showTodoLabel=1),y["calendar.selectedDay"]=[]),u.weekMode&&(y["calendar.curYear"]=c.year,y["calendar.curMonth"]=c.month),p(y)},gotoSetContinuousDates:(e,t)=>R([""+u.toTimeStr(e),""+u.toTimeStr(t)]),timeRangeHelper(e,t){const a=(0,d.getDateTimeStamp)(e),n=t[0];let r,s,o=t.length;o>1&&(r=t[o-1],s=(0,d.getDateTimeStamp)(r));return{endDate:r,startDate:n,currentDateTimestamp:a,endDateTimestamp:s,startTimestamp:(0,d.getDateTimeStamp)(n)}},calculateDateRange(e,t){const{endDate:a,startDate:n,currentDateTimestamp:r,endDateTimestamp:s,startTimestamp:o}=this.timeRangeHelper(e,t);let c=[],l=t.length;const i=t.filter(t=>u.toTimeStr(t)===u.toTimeStr(e));if(2===l&&i.length)return c=[e,e],c;if(r>=o&&s&&r<=s){c=l/2>t.findIndex(t=>u.toTimeStr(t)===u.toTimeStr(e))?[e,a]:[n,e]}else r<o?c=[e,a]:r>o&&(c=[n,e]);return c},chooseAreaWhenExistArea:(e,t)=>new Promise((a,n)=>{const r=g.calculateDateRange(e,u.sortDates(t));g.gotoSetContinuousDates(...r).then(t=>{a(t),g.afterTapDay(e)}).catch(t=>{n(t),g.afterTapDay(e)})}),chooseAreaWhenHasOneDate:(e,t,a)=>new Promise((n,r)=>{const s=a||t[0];let o=[s,e];const c=(0,d.getDateTimeStamp)(e);(0,d.getDateTimeStamp)(s)>c&&(o=[e,s]),g.gotoSetContinuousDates(...o).then(t=>{n(t),g.afterTapDay(e)}).catch(t=>{r(t),g.afterTapDay(e)})}),whenChooseArea(e){return new Promise((t,a)=>{if((0,d.isComponent)(this)&&(b=this),b.weekMode)return;const{days:n=[],selectedDay:r,lastChoosedDate:s}=D("calendar"),c=n[e];if(c.disable)return;if((0,l.default)(b).getCalendarConfig().takeoverTap)return b.triggerEvent("onTapDay",c);if(r&&r.length>1)g.chooseAreaWhenExistArea(c,r).then(e=>{t(e)}).catch(e=>{a(e)});else if(s||r&&1===r.length)g.chooseAreaWhenHasOneDate(c,r,s).then(e=>{t(e)}).catch(e=>{a(e)});else{n.forEach(e=>{+e.day==+c.day?e.choosed=!0:e.choosed=!1});new o.default(b).setData({"calendar.days":[...n],"calendar.lastChoosedDate":c})}})},afterTapDay(e,t){const a=(0,l.default)(b).getCalendarConfig(),{multi:n}=a;n?b.triggerEvent("afterTapDay",{currentSelected:e,selectedDates:t}):b.triggerEvent("afterTapDay",e)},jumpToToday:()=>new Promise((e,t)=>{const{year:a,month:n,date:r}=u.todayDate(),s=u.todayTimestamp(),o=(0,l.default)(b).getCalendarConfig();p({"calendar.curYear":a,"calendar.curMonth":n,"calendar.selectedDay":[{year:a,day:r,month:n,choosed:!0,lunar:o.showLunar?i.default.solar2lunar(a,n,r):null}],"calendar.todayTimestamp":s}),g.renderCalendar(a,n,r).then(()=>{e({year:a,month:n,date:r})}).catch(()=>{t("jump failed")})})},T=g.whenChangeDate;t.whenChangeDate=T;const w=g.renderCalendar;t.renderCalendar=w;const C=g.whenSingleSelect;t.whenSingleSelect=C;const M=g.whenChooseArea;t.whenChooseArea=M;const _=g.whenMulitSelect;t.whenMulitSelect=_;const S=g.calculatePrevWeekDays;t.calculatePrevWeekDays=S;const k=g.calculateNextWeekDays;function v(e){return m(e),{year:D("calendar.curYear"),month:D("calendar.curMonth")}}function L(e={},t){m(t);const a=G(),n=D("calendar.selectedDay")||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function W(e,t){m(t);const{days:a=[],selectedDay:n=[]}=D("calendar")||{};if(e&&e.length){const t=e.map(e=>`${+e.year}-${+e.month}-${+e.day}`),r=n.filter(e=>!t.includes(`${+e.year}-${+e.month}-${+e.day}`));a.forEach(e=>{t.includes(`${+e.year}-${+e.month}-${+e.day}`)&&(e.choosed=!1)}),p({"calendar.days":a,"calendar.selectedDay":r})}else a.forEach(e=>{e.choosed=!1}),p({"calendar.days":a,"calendar.selectedDay":[]})}function A(e,t,a,n){return new Promise((s,o)=>{m(n);const{selectedDay:c=[]}=D("calendar")||{},{weekMode:l}=D("calendarConfig")||{},{year:i,month:f,day:y}=c[0]||{};if(+i!=+e||+f!=+t||+y!=+a){if(l){let n=!1;if(!e||!t||!a){const r=u.todayDate();e=r.year,t=r.month,a=r.date,n=!0}return function({year:e,month:t,day:a},n){return new Promise((s,o)=>{(0,r.default)(b).jump({year:+e,month:+t,day:+a},n).then(e=>{s(e)}).catch(e=>{o(e)})})}({year:e,month:t,day:a},n).then(e=>{s(e)}).catch(e=>{o(e)}),void Z((0,d.getCurrentPage)())}e&&t?function({year:e,month:t,day:a}){return new Promise((n,r)=>{if("number"!=typeof+e||"number"!=typeof+t)return h.warn("jump 函数年月日参数必须为数字");const s=u.todayTimestamp();p({"calendar.curYear":+e,"calendar.curMonth":+t,"calendar.todayTimestamp":s},()=>{g.renderCalendar(+e,+t,+a).then(e=>{n(e)}).catch(e=>{r(e)})})})}({year:e,month:t,day:a}).then(e=>{s(e)}).catch(e=>{o(e)}):g.jumpToToday().then(e=>{s(e)}).catch(e=>{o(e)})}})}function O(e,t){m(t),(0,s.default)(b).setTodoLabels(e)}function x(e,t){m(t),(0,s.default)(b).deleteTodoLabels(e)}function Y(e){m(e),(0,s.default)(b).clearTodoLabels()}function E(e={},t){m(t);const a=G(),n=(0,s.default)(b).getTodoLabels()||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function P(e=[],t){m(t),(0,n.default)(b).disableDays(e)}function j(e=[],t){m(t),(0,n.default)(b).enableArea(e)}function I(e=[],t){m(t),(0,n.default)(b).enableDays(e)}function $(e,t){m(t),(0,n.default)(b).setSelectedDays(e)}function G(e){return m(e),(0,l.default)(b).getCalendarConfig()}function U(e,t){if(m(t),!e||0===Object.keys(e).length)return h.warn("setCalendarConfig 参数必须为非空对象");const a=G();return new Promise((t,n)=>{(0,l.default)(b).setCalendarConfig(e).then(n=>{t(n);const{date:r,type:s}=a.disableMode||{},{_date:o,_type:c}=e.disableMode||{};if(s!==c||r!==o){const{year:e,month:t}=v();A(e,t)}}).catch(e=>{n(e)})})}function F(e={},t){m(t);const a=G(),n=D("calendar.days",t)||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function R(e,t){return m(t),(0,n.default)(b).chooseArea(e)}function N(e,t){e&&(m(t),(0,n.default)(b).setDateStyle(e))}function X(...e){return new Promise((t,a)=>{const n=e[0];if(!e[1])return(0,r.default)(b).switchWeek(n).then(t).catch(a);"string"==typeof e[1]?(m(e[1]),(0,r.default)(b).switchWeek(n,e[2]).then(t).catch(a)):"object"==typeof e[1]&&("string"==typeof e[2]&&m(e[1]),(0,r.default)(b).switchWeek(n,e[1]).then(t).catch(a))})}function Z(e){e.calendar={jump:A,switchView:X,disableDay:P,enableArea:j,enableDays:I,chooseDateArea:R,getCurrentYM:v,getSelectedDay:L,cancelSelectedDates:W,setDateStyle:N,setTodoLabels:O,getTodoLabels:E,deleteTodoLabels:x,clearTodoLabels:Y,setSelectedDays:$,getCalendarConfig:G,setCalendarConfig:U,getCalendarDates:F}}function B(e,t){d.initialTasks.flag="process",b=e,b.config=t,function(e){let t=["日","一","二","三","四","五","六"];"Mon"===e&&(t=["一","二","三","四","五","六","日"]),p({"calendar.weeksCh":t})}(t.firstDayOfWeek),function(e){if(b.firstRenderWeekMode=!0,e&&"string"==typeof e){const t=e.split("-");if(t.length<3)return h.warn("配置 jumpTo 格式应为: 2018-4-2 或 2018-04-02");A(+t[0],+t[1],+t[2])}else e||p({"config.noDefault":!0}),A()}(t.defaultDay),h.tips("使用中若遇问题请反馈至 https://github.com/treadpit/wx_calendar/issues ✍️")}t.calculateNextWeekDays=k;t.default=(e,t={})=>{if("process"===d.initialTasks.flag)return d.initialTasks.tasks.push((function(){B(e,t)}));B(e,t)}}]);
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=8)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=class{constructor(e){this.Component=e}getData(e){const t=this.Component.data;if(!e)return t;if(e.includes(".")){return e.split(".").reduce((e,t)=>e[t],t)}return this.Component.data[e]}setData(e,t=(()=>{})){e&&"object"==typeof e&&this.Component.setData(e,t)}};t.default=n},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSystemInfo=o,t.isComponent=function(e){return e&&void 0!==e.__wxExparserNodeId__&&"function"==typeof e.setData},t.isIos=i,t.shallowEqual=function e(t,a){if(t===a)return!0;if("object"==typeof t&&null!=t&&"object"==typeof a&&null!=a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(var n in t){if(!a.hasOwnProperty(n))return!1;if(!e(t[n],a[n]))return!1}return!0}return!1},t.getCurrentPage=d,t.getComponent=function(e){const t=new c;let a=d()||{};if(a.selectComponent&&"function"==typeof a.selectComponent){if(e)return a.selectComponent(e);t.warn("请传入组件ID")}else t.warn("该基础库暂不支持多个小程序日历组件")},t.uniqueArrayByDate=function(e=[]){let t={},a=[];e.forEach(e=>{t[`${e.year}-${e.month}-${e.day}`]=e});for(let e in t)a.push(t[e]);return a},t.delRepeatedEnableDay=function(e=[],t=[]){let a,n;if(2===t.length){const{startTimestamp:e,endTimestamp:r}=f(t);a=e,n=r}const r=h(e);return r.filter(e=>e<a||e>n)},t.convertEnableAreaToTimestamp=f,t.getDateTimeStamp=b,t.converEnableDaysToTimestamp=h,t.initialTasks=t.GetDate=t.Slide=t.Logger=void 0;var n,r=(n=a(2))&&n.__esModule?n:{default:n};let s;function o(){return s||(s=wx.getSystemInfoSync(),s)}class c{info(e){console.log("%cInfo: %c"+e,"color:#FF0080;font-weight:bold","color: #FF509B")}warn(e){console.log("%cWarn: %c"+e,"color:#FF6600;font-weight:bold","color: #FF9933")}tips(e){console.log("%cTips: %c"+e,"color:#00B200;font-weight:bold","color: #00CC33")}}t.Logger=c;t.Slide=class{isUp(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a;return t.clientY-n<-60&&r<20&&r>-20&&(this.slideLock=!1,!0)}isDown(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a;return t.clientY-n>60&&r<20&&r>-20}isLeft(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a,s=t.clientY-n;return r<-60&&s<20&&s>-20}isRight(e={},t={}){const{startX:a,startY:n}=e,r=t.clientX-a,s=t.clientY-n;return r>60&&s<20&&s>-20}};class l{newDate(e,t,a){let n=`${+e}-${+t}-${+a}`;return i()&&(n=`${+e}/${+t}/${+a}`),new Date(n)}thisMonthDays(e,t){return new Date(Date.UTC(e,t,0)).getUTCDate()}firstDayOfWeek(e,t){return new Date(Date.UTC(e,t-1,1)).getUTCDay()}dayOfWeek(e,t,a){return new Date(Date.UTC(e,t-1,a)).getUTCDay()}todayDate(){const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()}}todayTimestamp(){const{year:e,month:t,date:a}=this.todayDate();return this.newDate(e,t,a).getTime()}toTimeStr(e){return e.day&&(e.date=e.day),`${+e.year}-${+e.month}-${+e.date}`}sortDates(e,t){return e.sort((function(e,a){return b(e)<b(a)&&"desc"!==t?-1:1}))}prevMonth(e){return+e.month>1?{year:e.year,month:e.month-1}:{year:e.year-1,month:12}}nextMonth(e){return+e.month<12?{year:e.year,month:e.month+1}:{year:e.year+1,month:1}}convertLunar(e=[]){return e.map(e=>(e&&(e.lunar=r.default.solar2lunar(+e.year,+e.month,+e.day)),e))}}function i(){const e=o();return/iphone|ios/i.test(e.platform)}function d(){const e=getCurrentPages();return e[e.length-1]}function f(e=[]){const t=new l,a=e[0].split("-"),n=e[1].split("-"),r=new c;if(3!==a.length||3!==n.length)return r.warn('enableArea() 参数格式为: ["2018-2-1", "2018-3-1"]'),{};return{start:a,end:n,startTimestamp:t.newDate(a[0],a[1],a[2]).getTime(),endTimestamp:t.newDate(n[0],n[1],n[2]).getTime()}}function b(e){if("[object Object]"!==Object.prototype.toString.call(e))return;return(new l).newDate(e.year,e.month,e.day).getTime()}function h(e=[]){const t=new c,a=new l,n=[];return e.forEach(e=>{if("string"!=typeof e)return t.warn("enableDays()入参日期格式错误");const r=e.split("-");if(3!==r.length)return t.warn("enableDays()入参日期格式错误");const s=a.newDate(r[0],r[1],r[2]).getTime();n.push(s)}),n}t.GetDate=l;t.initialTasks={flag:"finished",tasks:[]}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n={lunarInfo:[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42416,83315,21168,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46752,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19195,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448,84835,37744,18936,18800,25776,92326,59984,27424,108228,43744,41696,53987,51552,54615,54432,55888,23893,22176,42704,21972,21200,43448,43344,46240,46758,44368,21920,43940,42416,21168,45683,26928,29495,27296,44368,84821,19296,42352,21732,53600,59752,54560,55968,92838,22224,19168,43476,41680,53584,62034,54560],solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],Gan:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Zhi:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],Animals:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],solarTerm:["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"],sTermInfo:["9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","9778397bd19801ec9210c965cc920e","97b6b97bd19801ec95f8c965cc920f","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd197c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bcf97c3598082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd19801ec9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bd07f1487f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b97bd197c36c9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b70c9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","977837f0e37f149b0723b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0723b06bd","7f07e7f0e37f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f595b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e37f14998083b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14898082b0723b02d5","7f07e7f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66aa89801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e26665b66a449801e9808297c35","665f67f0e37f1489801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722"],nStr1:["日","一","二","三","四","五","六","七","八","九","十"],nStr2:["初","十","廿","卅"],nStr3:["正","二","三","四","五","六","七","八","九","十","冬","腊"],lYearDays:function(e){let t,a=348;for(t=32768;t>8;t>>=1)a+=n.lunarInfo[e-1900]&t?1:0;return a+n.leapDays(e)},leapMonth:function(e){return 15&n.lunarInfo[e-1900]},leapDays:function(e){return n.leapMonth(e)?65536&n.lunarInfo[e-1900]?30:29:0},monthDays:function(e,t){return t>12||t<1?-1:n.lunarInfo[e-1900]&65536>>t?30:29},solarDays:function(e,t){if(t>12||t<1)return-1;const a=t-1;return 1==+a?e%4==0&&e%100!=0||e%400==0?29:28:n.solarMonth[a]},toGanZhiYear:function(e){let t=(e-3)%10,a=(e-3)%12;return 0==+t&&(t=10),0==+a&&(a=12),n.Gan[t-1]+n.Zhi[a-1]},toAstro:function(e,t){return"魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(2*e-(t<[20,19,21,21,21,22,23,23,23,23,22,22][e-1]?2:0),2)+"座"},toGanZhi:function(e){return n.Gan[e%10]+n.Zhi[e%12]},getTerm:function(e,t){if(e<1900||e>2100)return-1;if(t<1||t>24)return-1;const a=n.sTermInfo[e-1900],r=[parseInt("0x"+a.substr(0,5)).toString(),parseInt("0x"+a.substr(5,5)).toString(),parseInt("0x"+a.substr(10,5)).toString(),parseInt("0x"+a.substr(15,5)).toString(),parseInt("0x"+a.substr(20,5)).toString(),parseInt("0x"+a.substr(25,5)).toString()],s=[r[0].substr(0,1),r[0].substr(1,2),r[0].substr(3,1),r[0].substr(4,2),r[1].substr(0,1),r[1].substr(1,2),r[1].substr(3,1),r[1].substr(4,2),r[2].substr(0,1),r[2].substr(1,2),r[2].substr(3,1),r[2].substr(4,2),r[3].substr(0,1),r[3].substr(1,2),r[3].substr(3,1),r[3].substr(4,2),r[4].substr(0,1),r[4].substr(1,2),r[4].substr(3,1),r[4].substr(4,2),r[5].substr(0,1),r[5].substr(1,2),r[5].substr(3,1),r[5].substr(4,2)];return parseInt(s[t-1])},toChinaMonth:function(e){if(e>12||e<1)return-1;let t=n.nStr3[e-1];return t+="月",t},toChinaDay:function(e){let t;switch(e){case 10:t="初十";break;case 20:t="二十";break;case 30:t="三十";break;default:t=n.nStr2[Math.floor(e/10)],t+=n.nStr1[e%10]}return t},getAnimal:function(e){return n.Animals[(e-4)%12]},solar2lunar:function(e,t,a){if(e<1900||e>2100)return-1;if(1900==+e&&1==+t&&+a<31)return-1;let r,s;r=e?new Date(e,parseInt(t)-1,a):new Date;let o=0,c=0;e=r.getFullYear(),t=r.getMonth()+1,a=r.getDate();let l=(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Date.UTC(1900,0,31))/864e5;for(s=1900;s<2101&&l>0;s++)c=n.lYearDays(s),l-=c;l<0&&(l+=c,s--);const i=new Date;let d=!1;i.getFullYear()===+e&&i.getMonth()+1===+t&&i.getDate()===+a&&(d=!0);let f=r.getDay();const b=n.nStr1[f];0==+f&&(f=7);const h=s;o=n.leapMonth(s);let u=!1;for(s=1;s<13&&l>0;s++)o>0&&s===o+1&&!1===u?(--s,u=!0,c=n.leapDays(h)):c=n.monthDays(h,s),!0===u&&s===o+1&&(u=!1),l-=c;0===l&&o>0&&s===o+1&&(u?u=!1:(u=!0,--s)),l<0&&(l+=c,--s);const y=s,m=l+1,D=t-1,p=n.toGanZhiYear(h),g=n.getTerm(e,2*t-1),T=n.getTerm(e,2*t);let w=n.toGanZhi(12*(e-1900)+t+11);a>=g&&(w=n.toGanZhi(12*(e-1900)+t+12));let C=!1,M=null;+g===a&&(C=!0,M=n.solarTerm[2*t-2]),+T===a&&(C=!0,M=n.solarTerm[2*t-1]);const _=Date.UTC(e,D,1,0,0,0,0)/864e5+25567+10,S=n.toGanZhi(_+a-1),k=n.toAstro(t,a);return{lYear:h,lMonth:y,lDay:m,Animal:n.getAnimal(h),IMonthCn:(u?"闰":"")+n.toChinaMonth(y),IDayCn:n.toChinaDay(m),cYear:e,cMonth:t,cDay:a,gzYear:p,gzMonth:w,gzDay:S,isToday:d,isLeap:u,nWeek:f,ncWeek:"星期"+b,isTerm:C,Term:M,astro:k}},lunar2solar:function(e,t,a,r){r=!!r;const s=n.leapMonth(e);if(r&&s!==t)return-1;if(2100==+e&&12==+t&&+a>1||1900==+e&&1==+t&&+a<31)return-1;const o=n.monthDays(e,t);let c=o;if(r&&(c=n.leapDays(e,t)),e<1900||e>2100||a>c)return-1;let l=0;for(let t=1900;t<e;t++)l+=n.lYearDays(t);let i=0,d=!1;for(let a=1;a<t;a++)i=n.leapMonth(e),d||i<=a&&i>0&&(l+=n.leapDays(e),d=!0),l+=n.monthDays(e,a);r&&(l+=o);const f=Date.UTC(1900,1,30,0,0,0),b=new Date(864e5*(l+a-31)+f),h=b.getUTCFullYear(),u=b.getUTCMonth()+1,y=b.getUTCDate();return n.solar2lunar(h,u,y)}},{Gan:r,Zhi:s,nStr1:o,nStr2:c,nStr3:l,Animals:i,solarTerm:d,lunarInfo:f,sTermInfo:b,solarMonth:h,...u}=n;var y=u;t.default=y},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=c(a(0)),r=c(a(4)),s=c(a(2)),o=a(1);function c(e){return e&&e.__esModule?e:{default:e}}const l=new o.Logger,i=new o.GetDate,d=Object.prototype.toString;class f extends n.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component.config}buildDate(e,t){const a=i.todayDate(),n=i.thisMonthDays(e,t),r=[];for(let o=1;o<=n;o++){const n=+a.year==+e&&+a.month==+t&&o===+a.date,c=this.getCalendarConfig(),l={year:e,month:t,day:o,choosed:!1,week:i.dayOfWeek(e,t,o),isToday:n,lunar:s.default.solar2lunar(+e,+t,+o)};r.push(l)}return r}enableArea(e=[]){if(2===e.length){if(this.__judgeParam(e)){let{days:t=[],selectedDay:a=[]}=this.getData("calendar");const{startTimestamp:n,endTimestamp:r}=(0,o.convertEnableAreaToTimestamp)(e),s=this.__handleEnableArea({dateArea:e,days:t,startTimestamp:n,endTimestamp:r},a);this.setData({"calendar.enableArea":e,"calendar.days":s.dates,"calendar.selectedDay":s.selectedDay,"calendar.enableAreaTimestamp":[n,r]})}}else l.warn('enableArea()参数需为时间范围数组,形如:["2018-8-4" , "2018-8-24"]')}enableDays(e=[]){const{enableArea:t=[]}=this.getData("calendar");let a=[];a=t.length?(0,o.delRepeatedEnableDay)(e,t):(0,o.converEnableDaysToTimestamp)(e);let{days:n=[],selectedDay:r=[]}=this.getData("calendar");const s=this.__handleEnableDays({days:n,expectEnableDaysTimestamp:a},r);this.setData({"calendar.days":s.dates,"calendar.selectedDay":s.selectedDay,"calendar.enableDays":e,"calendar.enableDaysTimestamp":a})}setSelectedDays(e){if(!(0,r.default)(this.Component).getCalendarConfig().multi)return l.warn("单选模式下不能设置多日期选中,请配置 multi");let{days:t}=this.getData("calendar"),a=[];if(e){if(e&&e.length){const{dates:n,selectedDates:r}=this.__handleSelectedDays(t,a,e);t=n,a=r}}else t.map(e=>{e.choosed=!0,e.showTodoLabel=!0}),a=t;(0,r.default)(this.Component).setCalendarConfig("multi",!0),this.setData({"calendar.days":t,"calendar.selectedDay":a})}disableDays(e){const{disableDays:t=[],days:a}=this.getData("calendar");if("[object Array]"!==Object.prototype.toString.call(e))return l.warn("disableDays 参数为数组");let n=[];if(e.length){n=(0,o.uniqueArrayByDate)(e.concat(t));const r=n.map(e=>i.toTimeStr(e));a.forEach(e=>{const t=i.toTimeStr(e);r.includes(t)&&(e.disable=!0)})}else a.forEach(e=>{e.disable=!1});this.setData({"calendar.days":a,"calendar.disableDays":n})}chooseArea(e=[]){return new Promise((t,a)=>{if(1===e.length&&(e=e.concat(e)),2===e.length){if(this.__judgeParam(e)){const n=(0,r.default)(this.Component).getCalendarConfig(),{startTimestamp:s,endTimestamp:c}=(0,o.convertEnableAreaToTimestamp)(e);this.setData({calendarConfig:{...n,chooseAreaMode:!0,mulit:!0},"calendar.chooseAreaTimestamp":[s,c]},()=>{this.__chooseContinuousDates(s,c).then(t).catch(a)})}}})}__pusheNextMonthDateArea(e,t,a,n){const r=this.buildDate(e.year,e.month);let s=r.length;for(let e=0;e<s;e++){const c=r[e],l=(0,o.getDateTimeStamp)(c);l<=a&&l>=t&&n.push({...c,choosed:!0}),e===s-1&&l<a&&this.__pusheNextMonthDateArea(i.nextMonth(c),t,a,n)}}__pushPrevMonthDateArea(e,t,a,n){const r=i.sortDates(this.buildDate(e.year,e.month),"desc");let s=r.length,c=(0,o.getDateTimeStamp)(r[0]);for(let e=0;e<s;e++){const l=r[e],d=(0,o.getDateTimeStamp)(l);d>=t&&d<=a&&n.push({...l,choosed:!0}),e===s-1&&c>t&&this.__pushPrevMonthDateArea(i.prevMonth(l),t,a,n)}}__calcDateWhenNotInOneMonth(e){const{firstDate:t,lastDate:a,startTimestamp:n,endTimestamp:r,filterSelectedDate:s}=e;(0,o.getDateTimeStamp)(t)>n&&this.__pushPrevMonthDateArea(i.prevMonth(t),n,r,s),(0,o.getDateTimeStamp)(a)<r&&this.__pusheNextMonthDateArea(i.nextMonth(a),n,r,s);return[...i.sortDates(s)]}__chooseContinuousDates(e,t){return new Promise((a,n)=>{const{days:r,selectedDay:s=[]}=this.getData("calendar"),c=[];let l=[];s.forEach(a=>{const n=(0,o.getDateTimeStamp)(a);n>=e&&n<=t&&(l.push(a),c.push(i.toTimeStr(a)))}),r.forEach(a=>{const n=(0,o.getDateTimeStamp)(a),r=c.includes(i.toTimeStr(a));if(n>=e&&n<=t){if(r)return;a.choosed=!0,l.push(a)}else if(a.choosed=!1,r){const e=l.findIndex(e=>i.toTimeStr(e)===i.toTimeStr(a));e>-1&&l.splice(e,1)}});const d=r[0],f=r[r.length-1],b=this.__calcDateWhenNotInOneMonth({firstDate:d,lastDate:f,startTimestamp:e,endTimestamp:t,filterSelectedDate:l});try{this.setData({"calendar.days":[...r],"calendar.selectedDay":b},()=>{a(b)})}catch(e){n(e)}})}setDateStyle(e){if("[object Array]"!==d.call(e))return;const{days:t,specialStyleDates:a}=this.getData("calendar");"[object Array]"===d.call(a)&&(e=(0,o.uniqueArrayByDate)([...a,...e]));const n=e.map(e=>`${e.year}_${e.month}_${e.day}`),r=t.map(t=>{const a=n.indexOf(`${t.year}_${t.month}_${t.day}`);return a>-1?{...t,class:e[a].class}:{...t}});this.setData({"calendar.days":r,"calendar.specialStyleDates":e})}__judgeParam(e){const{start:t,end:a,startTimestamp:n,endTimestamp:r}=(0,o.convertEnableAreaToTimestamp)(e);if(!t||!a)return;const s=i.thisMonthDays(t[0],t[1]),c=i.thisMonthDays(a[0],a[1]);return t[2]>s||t[2]<1?(l.warn("enableArea() 开始日期错误,指定日期不在当前月份天数范围内"),!1):t[1]>12||t[1]<1?(l.warn("enableArea() 开始日期错误,月份超出1-12月份"),!1):a[2]>c||a[2]<1?(l.warn("enableArea() 截止日期错误,指定日期不在当前月份天数范围内"),!1):a[1]>12||a[1]<1?(l.warn("enableArea() 截止日期错误,月份超出1-12月份"),!1):!(n>r)||(l.warn("enableArea()参数最小日期大于了最大日期"),!1)}__getDisableDateTimestamp(){let e;const{date:t,type:a}=this.getCalendarConfig().disableMode||{};if(t){const a=t.split("-");if(a.length<3)return l.warn("配置 disableMode.date 格式错误"),{};e=(0,o.getDateTimeStamp)({year:+a[0],month:+a[1],day:+a[2]})}return{disableDateTimestamp:e,disableType:a}}__handleEnableArea(e={},t=[]){const{area:a,days:n,startTimestamp:r,endTimestamp:s}=e,c=this.getData("calendar.enableDays")||[];let l=[];c.length&&(l=(0,o.delRepeatedEnableDay)(c,a));const{disableDateTimestamp:d,disableType:f}=this.__getDisableDateTimestamp(),b=[...n];return b.forEach(e=>{const a=+i.newDate(e.year,e.month,e.day).getTime();(+r>a||a>+s)&&!l.includes(a)||"before"===f&&d&&a<d||"after"===f&&d&&a>d?(e.disable=!0,e.choosed&&(e.choosed=!1,t=t.filter(t=>i.toTimeStr(e)!==i.toTimeStr(t)))):e.disable&&(e.disable=!1)}),{dates:b,selectedDay:t}}__handleEnableDays(e={},t=[]){const{days:a,expectEnableDaysTimestamp:n}=e,{enableAreaTimestamp:r=[]}=this.getData("calendar"),s=[...a];return s.forEach(e=>{const a=i.newDate(e.year,e.month,e.day).getTime();let s=!1;r.length?(+r[0]>+a||+a>+r[1])&&!n.includes(+a)&&(s=!0):n.includes(+a)||(s=!0),s?(e.disable=!0,e.choosed&&(e.choosed=!1,t=t.filter(t=>i.toTimeStr(e)!==i.toTimeStr(t)))):e.disable=!1}),{dates:s,selectedDay:t}}__handleSelectedDays(e=[],t=[],a){const{selectedDay:n,showLabelAlways:r}=this.getData("calendar");t=n&&n.length?(0,o.uniqueArrayByDate)(n.concat(a)):a;const{year:s,month:c}=e[0],l=[];return t.forEach(e=>{+e.year==+s&&+e.month==+c&&l.push(i.toTimeStr(e))}),[...e].map(e=>{l.includes(i.toTimeStr(e))&&(e.choosed=!0,r&&e.showTodoLabel?e.showTodoLabel=1:e.showTodoLabel=1)}),{dates:e,selectedDates:t}}}t.default=e=>new f(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=a(0))&&n.__esModule?n:{default:n};class s extends r.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component&&this.Component.config?this.Component.config:{}}setCalendarConfig(e){return new Promise((t,a)=>{if(!this.Component||!this.Component.config)return void a("异常:未找到组件配置信息");let n={...this.Component.config,...e};this.Component.config=n,this.setData({calendarConfig:n},()=>{t(n)})})}}t.default=e=>new s(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3)),r=i(a(0)),s=i(a(6)),o=i(a(4)),c=i(a(2)),l=a(1);function i(e){return e&&e.__esModule?e:{default:e}}const d=new l.GetDate,f=new l.Logger;class b extends r.default{constructor(e){super(e),this.Component=e,this.getCalendarConfig=(0,o.default)(this.Component).getCalendarConfig}switchWeek(e,t){return new Promise((a,n)=>{if((0,o.default)(this.Component).getCalendarConfig().multi)return f.warn("多选模式不能切换周月视图");const{selectedDay:r=[],curYear:c,curMonth:l}=this.getData("calendar");let i=[],b=!1;r.length?i=r[0]:(i=d.todayDate(),i.day=i.date,b=!0);let h=t||i;const{year:u,month:y}=h,m=c!==u||l!==y;if("week"===e){if(this.Component.weekMode)return;(r.length&&m||!r.length)&&(b=!0,h={year:c,month:l,day:h.day}),this.Component.weekMode=!0,this.setData({"calendarConfig.weekMode":!0}),this.jump(h,b).then(a).catch(n)}else{this.Component.weekMode=!1,this.setData({"calendarConfig.weekMode":!1});const e=r.length&&m||!r.length;(0,s.default)(this.Component).renderCalendar(c,l,h.day,e).then(a).catch(n)}})}updateCurrYearAndMonth(e){let{days:t,curYear:a,curMonth:n}=this.getData("calendar");const{month:r}=t[0],{month:s}=t[t.length-1],o=d.thisMonthDays(a,n),c=t[t.length-1],l=t[0];return(c.day+7>o||n===r&&r!==s)&&"next"===e?(n+=1,n>12&&(a+=1,n=1)):(+l.day<=7||n===s&&r!==s)&&"prev"===e&&(n-=1,n<=0&&(a-=1,n=12)),{Uyear:a,Umonth:n}}calculateLastDay(){const{days:e=[],curYear:t,curMonth:a}=this.getData("calendar");return{lastDayInThisWeek:e[e.length-1].day,lastDayInThisMonth:d.thisMonthDays(t,a)}}calculateFirstDay(){const{days:e}=this.getData("calendar");return{firstDayInThisWeek:e[0].day}}firstWeekInMonth(e,t,a){let r=d.dayOfWeek(e,t,1);a&&0===r&&(r=7);const[,s]=[0,7-r];let o=this.getData("calendar.days")||[];this.Component.weekMode&&(o=(0,n.default)(this.Component).buildDate(e,t));return o.slice(0,a?s+1:s)}lastWeekInMonth(e,t,a){const r=d.thisMonthDays(e,t),s=d.dayOfWeek(e,t,r),[o,c]=[r-s,r];let l=this.getData("calendar.days")||[];this.Component.weekMode&&(l=(0,n.default)(this.Component).buildDate(e,t));return l.slice(a?o:o-1,c)}__getDisableDateTimestamp(e){const{date:t,type:a}=e.disableMode||{};let n;if(t){const e=t.split("-");if(e.length<3)return f.warn("配置 disableMode.date 格式错误"),{};n=(0,l.getDateTimeStamp)({year:+e[0],month:+e[1],day:+e[2]})}return{disableDateTimestamp:n,disableType:a}}initSelectedDay(e){let t=[...e];const{selectedDay:a=[]}=this.getData("calendar"),n=a.map(e=>`${+e.year}-${+e.month}-${+e.day}`),r=this.getCalendarConfig(),{disableDateTimestamp:s,disableType:o}=this.__getDisableDateTimestamp(r);return t=t.map(e=>{if(!e)return{};const t=(0,l.getDateTimeStamp)(e);let a={...e};return n.includes(`${+a.year}-${+a.month}-${+a.day}`)?a.choosed=!0:a.choosed=!1,("after"===o&&t>s||"before"===o&&t<s)&&(a.disable=!0),a=this.__setTodoWhenJump(a,r),r.showLunar&&(a=this.__setSolarLunar(a)),r.highlightToday&&(a=this.__highlightToday(a)),a}),t}setEnableAreaOnWeekMode(e=[]){let{enableAreaTimestamp:t=[],enableDaysTimestamp:a=[]}=this.getData("calendar");e.forEach(e=>{const n=d.newDate(e.year,e.month,e.day).getTime();let r=!1;t.length?(+t[0]>+n||+n>+t[1])&&!a.includes(+n)&&(r=!0):a.length&&!a.includes(+n)&&(r=!0),r&&(e.disable=!0,e.choosed=!1);const s=(0,o.default)(this.Component).getCalendarConfig(),{disableDateTimestamp:c,disableType:l}=this.__getDisableDateTimestamp(s);("before"===l&&n<c||"after"===l&&n>c)&&(e.disable=!0)})}updateYMWhenSwipeCalendarHasSelected(e){const t=e.filter(e=>e.choosed);if(t&&t.length){const{year:e,month:a}=t[0];return{year:e,month:a}}return{}}calculateNextWeekDays(){let{lastDayInThisWeek:e,lastDayInThisMonth:t}=this.calculateLastDay(),{curYear:a,curMonth:r}=this.getData("calendar"),s=[];if(t-e>=7){const{Uyear:t,Umonth:n}=this.updateCurrYearAndMonth("next");a=t,r=n;for(let t=e+1;t<=e+7;t++)s.push({year:a,month:r,day:t,week:d.dayOfWeek(a,r,t)})}else{for(let n=e+1;n<=t;n++)s.push({year:a,month:r,day:n,week:d.dayOfWeek(a,r,n)});const{Uyear:n,Umonth:o}=this.updateCurrYearAndMonth("next");a=n,r=o;for(let n=1;n<=7-(t-e);n++)s.push({year:a,month:r,day:n,week:d.dayOfWeek(a,r,n)})}s=this.initSelectedDay(s);const{year:o,month:c}=this.updateYMWhenSwipeCalendarHasSelected(s);o&&c&&(a=o,r=c),this.setEnableAreaOnWeekMode(s),this.setData({"calendar.curYear":a,"calendar.curMonth":r,"calendar.days":s},()=>{(0,n.default)(this.Component).setDateStyle()})}calculatePrevWeekDays(){let{firstDayInThisWeek:e}=this.calculateFirstDay(),{curYear:t,curMonth:a}=this.getData("calendar"),r=[];if(e-7>0){const{Uyear:n,Umonth:s}=this.updateCurrYearAndMonth("prev");t=n,a=s;for(let n=e-7;n<e;n++)r.push({year:t,month:a,day:n,week:d.dayOfWeek(t,a,n)})}else{let n=[];for(let r=1;r<e;r++)n.push({year:t,month:a,day:r,week:d.dayOfWeek(t,a,r)});const{Uyear:s,Umonth:o}=this.updateCurrYearAndMonth("prev");t=s,a=o;const c=d.thisMonthDays(t,a);for(let n=c-Math.abs(e-7);n<=c;n++)r.push({year:t,month:a,day:n,week:d.dayOfWeek(t,a,n)});r=r.concat(n)}r=this.initSelectedDay(r);const{year:s,month:o}=this.updateYMWhenSwipeCalendarHasSelected(r);s&&o&&(t=s,a=o),this.setEnableAreaOnWeekMode(r),this.setData({"calendar.curYear":t,"calendar.curMonth":a,"calendar.days":r},()=>{(0,n.default)(this.Component).setDateStyle()})}calculateDatesWhenJump({year:e,month:t,day:a},{firstWeekDays:n,lastWeekDays:r},s){const o=this.__dateIsInWeek({year:e,month:t,day:a},n),c=this.__dateIsInWeek({year:e,month:t,day:a},r);let l=[];return l=o?this.__calculateDatesWhenInFirstWeek(n,s):c?this.__calculateDatesWhenInLastWeek(r,s):this.__calculateDates({year:e,month:t,day:a},s),l}jump({year:e,month:t,day:a},r){return new Promise(s=>{if(!a)return;const o=this.getCalendarConfig(),c="Mon"===o.firstDayOfWeek,l=this.firstWeekInMonth(e,t,c);let i=this.lastWeekInMonth(e,t,c),d=this.calculateDatesWhenJump({year:e,month:t,day:a},{firstWeekDays:l,lastWeekDays:i},c);d=d.map(n=>{let s={...n};return+s.year!=+e||+s.month!=+t||+s.day!=+a||r||(s.choosed=!0),s=this.__setTodoWhenJump(s,o),o.showLunar&&(s=this.__setSolarLunar(s)),o.highlightToday&&(s=this.__highlightToday(s)),s}),this.setEnableAreaOnWeekMode(d);const f={"calendar.days":d,"calendar.curYear":e,"calendar.curMonth":t,"calendar.empytGrids":[],"calendar.lastEmptyGrids":[]};r||(f["calendar.selectedDay"]=d.filter(e=>e.choosed)),this.setData(f,()=>{(0,n.default)(this.Component).setDateStyle(),s({year:e,month:t,date:a})})})}__setTodoWhenJump(e){const t={...e},{todoLabels:a=[],showLabelAlways:n}=this.getData("calendar"),r=a.map(e=>`${+e.year}-${+e.month}-${+e.day}`).indexOf(`${+t.year}-${+t.month}-${+t.day}`);if(-1!==r){t.showTodoLabel=1||!t.choosed;const e=a[r]||{};t.showTodoLabel&&e.todoText&&(t.todoText=e.todoText)}return t}__setSolarLunar(e){const t={...e};return t.lunar=c.default.solar2lunar(+t.year,+t.month,+t.day),t}__highlightToday(e){const t={...e},a=d.todayDate(),n=+a.year==+t.year&&+a.month==+t.month&&+t.day==+a.date;return t.isToday=n,t}__calculateDatesWhenInFirstWeek(e){const t=[...e];if(t.length<7){let e,{year:a,month:n}=t[0],r=7-t.length;for(n>1?(n-=1,e=d.thisMonthDays(a,n)):(n=12,a-=1,e=d.thisMonthDays(a,n));r;)t.unshift({year:a,month:n,day:e,week:d.dayOfWeek(a,n,e)}),e-=1,r-=1}return t}__calculateDatesWhenInLastWeek(e){const t=[...e];if(t.length<7){let{year:e,month:a}=t[0],n=7-t.length,r=1;for(a>11?(a=1,e+=1):a+=1;n;)t.push({year:e,month:a,day:r,week:d.dayOfWeek(e,a,r)}),r+=1,n-=1}return t}__calculateDates({year:e,month:t,day:a},r){const s=d.dayOfWeek(e,t,a);let o=[a-s,a+(6-s)];r&&(o=[a+1-s,a+(7-s)]);return(0,n.default)(this.Component).buildDate(e,t).slice(o[0]-1,o[1])}__dateIsInWeek(e,t){return t.find(t=>+t.year==+e.year&&+t.month==+e.month&&+t.day==+e.day)}__tipsWhenCanNotSwtich(){f.info("当前月份未选中日期下切换为周视图,不能明确该展示哪一周的日期,故此情况不允许切换")}}t.default=e=>new b(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(a(3)),r=l(a(7)),s=l(a(0)),o=l(a(2)),c=a(1);function l(e){return e&&e.__esModule?e:{default:e}}const i=new c.GetDate,d=new c.Logger;class f extends s.default{constructor(e){super(e),this.Component=e}getCalendarConfig(){return this.Component.config}renderCalendar(e,t,a,s){return new Promise(o=>{const c=this.getCalendarConfig();this.calculateEmptyGrids(e,t),this.calculateDays(e,t,a,s).then(()=>{const{todoLabels:a,specialStyleDates:s,enableDays:l,selectedDay:i}=this.getData("calendar")||{};a&&a.find(a=>+a.month==+t&&+a.year==+e)&&(0,r.default)(this.Component).setTodoLabels(),s&&s.length&&s.find(a=>+a.month==+t&&+a.year==+e)&&(0,n.default)(this.Component).setDateStyle(s),l&&l.length&&l.find(a=>{let n=a.split("-");return+n[1]==+t&&+n[0]==+e})&&(0,n.default)(this.Component).enableDays(l),i&&i.length&&i.find(a=>+a.month==+t&&+a.year==+e)&&c.mulit&&(0,n.default)(this.Component).setSelectedDays(i),this.Component.firstRender?o({firstRender:!1}):o({firstRender:!0})})})}calculateEmptyGrids(e,t){this.calculatePrevMonthGrids(e,t),this.calculateNextMonthGrids(e,t)}calculatePrevMonthGrids(e,t){let a=[];const n=i.thisMonthDays(e,t-1);let r=i.firstDayOfWeek(e,t);const s=this.getCalendarConfig()||{};if("Mon"===s.firstDayOfWeek&&(0===r?r=6:r-=1),r>0){const c=n-r,{onlyShowCurrentMonth:l}=s,{showLunar:i}=this.getCalendarConfig();for(let r=n;r>c;r--)l?a.push(""):a.push({day:r,lunar:i?o.default.solar2lunar(e,t-1,r):null});this.setData({"calendar.empytGrids":a.reverse()})}else this.setData({"calendar.empytGrids":null})}calculateExtraEmptyDate(e,t,a){let n=0;if(2==+t){n+=7;let r=i.dayOfWeek(e,t,1);"Mon"===a.firstDayOfWeek?1==+r&&(n+=7):0==+r&&(n+=7)}else{let r=i.dayOfWeek(e,t,1);"Mon"===a.firstDayOfWeek?0!==r&&r<6&&(n+=7):r<=5&&(n+=7)}return n}calculateNextMonthGrids(e,t){let a=[];const n=i.thisMonthDays(e,t);let r=i.dayOfWeek(e,t,n);const s=this.getCalendarConfig()||{};"Mon"===s.firstDayOfWeek&&(0===r?r=6:r-=1);let c=7-(r+1);const{onlyShowCurrentMonth:l,showLunar:d}=s;l||(c+=this.calculateExtraEmptyDate(e,t,s));for(let n=1;n<=c;n++)l?a.push(""):a.push({day:n,lunar:d?o.default.solar2lunar(e,t+1,n):null});this.setData({"calendar.lastEmptyGrids":a})}setSelectedDay(e,t,a){let n=[];const r=this.getCalendarConfig();if(r.noDefault)n=[],r.noDefault=!1;else{const r=this.getData("calendar")||{},{showLunar:s}=this.getCalendarConfig();n=a?[{year:e,month:t,day:a,choosed:!0,week:i.dayOfWeek(e,t,a),lunar:s?o.default.solar2lunar(e,t,a):null}]:r.selectedDay}return n}__getDisableDateTimestamp(){let e;const{date:t,type:a}=this.getCalendarConfig().disableMode||{};if(t){const a=t.split("-");if(a.length<3)return d.warn("配置 disableMode.date 格式错误"),{};e=(0,c.getDateTimeStamp)({year:+a[0],month:+a[1],day:+a[2]})}return{disableDateTimestamp:e,disableType:a}}resetDates(){this.setData({"calendar.days":[]})}calculateDays(e,t,a,r){return new Promise(s=>{this.resetDates();let o=[];const{disableDays:l=[],chooseAreaTimestamp:d=[],selectedDay:f=[]}=this.getData("calendar");o=(0,n.default)(this.Component).buildDate(e,t);let b=f;r||(b=this.setSelectedDay(e,t,a));const h=b.map(e=>i.toTimeStr(e)),u=l.map(e=>i.toTimeStr(e)),[y,m]=d;o.forEach(e=>{const t=i.toTimeStr(e),a=(0,c.getDateTimeStamp)(e);if(h.includes(t)&&!r){if(e.choosed=!0,a>m||a<y){const t=b.findIndex(t=>i.toTimeStr(t)===i.toTimeStr(e));b.splice(t,1)}}else y&&m&&a>=y&&a<=m&&!r&&(e.choosed=!0,b.push(e));u.includes(t)&&(e.disable=!0);const{disableDateTimestamp:n,disableType:s}=this.__getDisableDateTimestamp();let o=!1;n&&("before"===s&&a<n||"after"===s&&a>n)&&(o=!0);(o||this.__isDisable(a))&&(e.disable=!0,e.choosed=!1)}),this.setData({"calendar.days":o,"calendar.selectedDay":[...b]||!1},()=>{s()})})}__isDisable(e){const{enableArea:t=[],enableDays:a=[],enableAreaTimestamp:n=[]}=this.getData("calendar");let r=!1,s=(0,c.converEnableDaysToTimestamp)(a);return t.length&&(s=(0,c.delRepeatedEnableDay)(a,t)),n.length?(+n[0]>+e||+e>+n[1])&&!s.includes(+e)&&(r=!0):s.length&&!s.includes(+e)&&(r=!0),r}}t.default=e=>new f(e)},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=a(0))&&n.__esModule?n:{default:n},s=a(1);const o=new s.Logger,c=new s.GetDate;class l extends r.default{constructor(e){super(e),this.Component=e}setTodoLabels(e){e&&(this.Component.todoConfig=e);const t=this.getData("calendar");if(!t||!t.days)return o.warn("请等待日历初始化完成后再调用该方法");const a=[...t.days],{curYear:n,curMonth:r}=t,{circle:c,dotColor:l="",pos:i="bottom",showLabelAlways:d,days:f=[]}=e||this.Component.todoConfig||{},{todoLabels:b=[],todoLabelPos:h,todoLabelColor:u}=t,y=this.getTodoLabels({year:n,month:r});let m=f.filter(e=>+e.year==+n&&+e.month==+r);this.Component.weekMode&&(m=f);const D=y.concat(m);for(let e of D){let t;t=this.Component.weekMode?a.find(t=>+e.year==+t.year&&+e.month==+t.month&&+e.day==+t.day):a[e.day-1],t&&(t.showTodoLabel=1||!t.choosed,t.showTodoLabel&&e.todoText&&(t.todoText=e.todoText),e.color&&(t.color=e.color))}const p={"calendar.days":a,"calendar.todoLabels":(0,s.uniqueArrayByDate)(b.concat(f))};c||(i&&i!==h&&(p["calendar.todoLabelPos"]=i),l&&l!==u&&(p["calendar.todoLabelColor"]=l)),p["calendar.todoLabelCircle"]=!1,p["calendar.showLabelAlways"]=d||!1,this.setData(p)}deleteTodoLabels(e){if(!(e instanceof Array&&e.length))return;const t=this.filterTodos(e),{days:a,curYear:n,curMonth:r}=this.getData("calendar"),s=t.filter(e=>n===+e.year&&r===+e.month);a.forEach(e=>{e.showTodoLabel=1}),s.forEach(e=>{a[e.day-1].showTodoLabel=1}),this.setData({"calendar.days":a,"calendar.todoLabels":t})}clearTodoLabels(){const{days:e=[]}=this.getData("calendar"),t=[].concat(e);t.forEach(e=>{e.showTodoLabel=1}),this.setData({"calendar.days":t,"calendar.todoLabels":[]})}getTodoLabels(e){const{todoLabels:t=[]}=this.getData("calendar");if(e){const{year:a,month:n}=e;return t.filter(e=>+e.year==+a&&+e.month==+n)}return t}filterTodos(e){const t=this.getData("calendar.todoLabels")||[],a=e.map(e=>c.toTimeStr(e));return t.filter(e=>!a.includes(c.toTimeStr(e)))}showTodoLabels(e,t,a){e.forEach(e=>{if(this.Component.weekMode)t.forEach((n,r)=>{if(+n.day==+e.day){const n=t[r];n.hasTodo=!0,n.todoText=e.todoText,a&&a.length&&+a[0].day==+e.day&&(n.showTodoLabel=!0)}});else{const n=t[e.day-1];if(!n)return;n.hasTodo=!0,n.todoText=e.todoText,a&&a.length&&+a[0].day==+e.day&&(t[a[0].day-1].showTodoLabel=!0)}})}}t.default=e=>new l(e)},function(e,t,a){"use strict";var n,r=(n=a(5))&&n.__esModule?n:{default:n},s=a(1),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=n?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(a,r,s):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a(9));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}const l=new s.Slide,i=new s.Logger,d=new s.GetDate;Component({options:{styleIsolation:"apply-shared",multipleSlots:!0},properties:{calendarConfig:{type:Object,value:{}}},data:{handleMap:{prev_year:"chooseYear",prev_month:"chooseMonth",next_month:"chooseMonth",next_year:"chooseYear"}},lifetimes:{attached:function(){this.initComp()},detached:function(){s.initialTasks.flag="finished",s.initialTasks.tasks.length=0}},methods:{initComp(){const e=this.setDefaultDisableDate();this.setConfig(e)},setDefaultDisableDate(){const e=this.properties.calendarConfig||{};return e.disableMode&&!e.disableMode.date&&(e.disableMode.date=d.toTimeStr(d.todayDate())),e},setConfig(e){e.markToday&&"string"==typeof e.markToday&&(e.highlightToday=!0),e.theme=e.theme||"default",this.weekMode=e.weekMode,this.setData({calendarConfig:e},()=>{(0,o.default)(this,e)})},chooseDate(e){const{type:t}=e.currentTarget.dataset;if(!t)return;this[this.data.handleMap[t]](t)},chooseYear(e){const{curYear:t,curMonth:a}=this.data.calendar;if(!t||!a)return i.warn("异常:未获取到当前年月");if(this.weekMode)return console.warn("周视图下不支持点击切换年月");let n=+t,r=+a;"prev_year"===e?n-=1:"next_year"===e&&(n+=1),this.render(t,a,n,r)},chooseMonth(e){const{curYear:t,curMonth:a}=this.data.calendar;if(!t||!a)return i.warn("异常:未获取到当前年月");if(this.weekMode)return console.warn("周视图下不支持点击切换年月");let n=+t,r=+a;"prev_month"===e?(r-=1,r<1&&(n-=1,r=12)):"next_month"===e&&(r+=1,r>12&&(n+=1,r=1)),this.render(t,a,n,r)},render(e,t,a,n){o.whenChangeDate.call(this,{curYear:e,curMonth:t,newYear:a,newMonth:n}),this.setData({"calendar.curYear":a,"calendar.curMonth":n}),o.renderCalendar.call(this,a,n)},tapDayItem(e){const{idx:t,date:a={}}=e.currentTarget.dataset,{day:n,disable:r}=a;if(r||!n)return;const s=this.data.calendarConfig||this.config||{},{multi:c,chooseAreaMode:l}=s;c?o.whenMulitSelect.call(this,t):l?o.whenChooseArea.call(this,t):o.whenSingleSelect.call(this,t),this.setData({"calendar.noDefault":!1})},doubleClickToToday(){if(!this.config.multi&&!this.weekMode)if(void 0===this.count?this.count=1:this.count+=1,this.lastClick){(new Date).getTime()-this.lastClick<500&&this.count>=2&&o.jump.call(this),this.count=void 0,this.lastClick=void 0}else this.lastClick=(new Date).getTime()},calendarTouchstart(e){const t=e.touches[0],a=t.clientX,n=t.clientY;this.slideLock=!0,this.setData({"gesture.startX":a,"gesture.startY":n})},handleSwipe(e){let t="calendar.leftSwipe",a="next_month",n="next_week";if("right"===e&&(t="calendar.rightSwipe",a="prev_month",n="prev_week"),this.setData({[t]:1}),this.currentYM=(0,o.getCurrentYM)(),this.weekMode)return this.slideLock=!1,this.currentDates=(0,o.getCalendarDates)(),"prev_week"===n?(0,r.default)(this).calculatePrevWeekDays():"next_week"===n&&(0,r.default)(this).calculateNextWeekDays(),this.onSwipeCalendar(n),void this.onWeekChange(n);this.chooseMonth(a),this.onSwipeCalendar(a)},calendarTouchmove(e){const{gesture:t}=this.data,{preventSwipe:a}=this.properties.calendarConfig;this.slideLock&&!a&&(l.isLeft(t,e.touches[0])&&(this.handleSwipe("left"),this.slideLock=!1),l.isRight(t,e.touches[0])&&(this.handleSwipe("right"),this.slideLock=!1))},calendarTouchend(e){this.setData({"calendar.leftSwipe":0,"calendar.rightSwipe":0})},onSwipeCalendar(e){this.triggerEvent("onSwipe",{directionType:e,currentYM:this.currentYM})},onWeekChange(e){this.triggerEvent("whenChangeWeek",{current:{currentYM:this.currentYM,dates:[...this.currentDates]},next:{currentYM:(0,o.getCurrentYM)(),dates:(0,o.getCalendarDates)()},directionType:e}),this.currentDates=null,this.currentYM=null}}})},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCurrentYM=v,t.getSelectedDay=L,t.cancelSelectedDates=W,t.jump=A,t.setTodoLabels=O,t.deleteTodoLabels=x,t.clearTodoLabels=Y,t.getTodoLabels=E,t.disableDay=P,t.enableArea=j,t.enableDays=I,t.setSelectedDays=$,t.getCalendarConfig=G,t.setCalendarConfig=U,t.getCalendarDates=F,t.chooseDateArea=R,t.setDateStyle=N,t.switchView=X,t.default=t.calculateNextWeekDays=t.calculatePrevWeekDays=t.whenMulitSelect=t.whenChooseArea=t.whenSingleSelect=t.renderCalendar=t.whenChangeDate=void 0;var n=f(a(3)),r=f(a(5)),s=f(a(7)),o=f(a(0)),c=f(a(6)),l=f(a(4)),i=f(a(2)),d=a(1);function f(e){return e&&e.__esModule?e:{default:e}}let b={},h=new d.Logger,u=new d.GetDate,y=null;function m(e){return e&&(b=(0,d.getComponent)(e)),b}function D(e,t){return m(t),y=new o.default(b),y.getData(e)}function p(e,t=(()=>{})){return new o.default(b).setData(e,t)}const g={renderCalendar(e,t,a){return(0,d.isComponent)(this)&&(b=this),new Promise((n,r)=>{(0,c.default)(b).renderCalendar(e,t,a).then((r={})=>{if(!r.firstRender)return n({year:e,month:t,date:a});Z((0,d.getCurrentPage)()),b.triggerEvent("afterCalendarRender",b),b.firstRender=!0,d.initialTasks.flag="finished",d.initialTasks.tasks.length&&d.initialTasks.tasks.shift()(),n({year:e,month:t,date:a})}).catch(e=>{r(e)})})},whenChangeDate({curYear:e,curMonth:t,newYear:a,newMonth:n}){b.triggerEvent("whenChangeMonth",{current:{year:e,month:t},next:{year:a,month:n}})},whenMulitSelect(e){(0,d.isComponent)(this)&&(b=this);const{calendar:t={}}=D(),{days:a,todoLabels:n}=t,r=(0,l.default)(b).getCalendarConfig();let{selectedDay:s=[]}=t;const o=a[e];if(o){if(o.choosed=!o.choosed,o.choosed){o.cancel=!1;const{showLabelAlways:e}=D("calendar");e&&o.showTodoLabel?o.showTodoLabel=!0:o.showTodoLabel=1,r.takeoverTap||s.push(o)}else{o.cancel=!0;const e=u.toTimeStr(o);s=s.filter(t=>e!==u.toTimeStr(t)),n&&n.forEach(t=>{e===u.toTimeStr(t)&&(o.showTodoLabel=!0)})}if(r.takeoverTap)return b.triggerEvent("onTapDay",o);p({"calendar.days":a,"calendar.selectedDay":s}),g.afterTapDay(o,s)}},whenSingleSelect(e){(0,d.isComponent)(this)&&(b=this);const{calendar:t={}}=D(),{days:a,selectedDay:n=[],todoLabels:r}=t;let o=[];const c=a[e];if(!c)return;const i=[...n].pop()||{},{month:f,year:h}=a[0]||{},u=(0,l.default)(b).getCalendarConfig();if(u.takeoverTap)return b.triggerEvent("onTapDay",c);if(g.afterTapDay(c),!u.inverse&&i.day===c.day)return;a.forEach((e,t)=>{+e.day==+i.day&&(a[t].choosed=!1)}),r&&(o=r.filter(e=>+e.year===h&&+e.month===f)),(0,s.default)(b).showTodoLabels(o,a,n);const y={"calendar.days":a};i.day!==c.day?(i.choosed=!1,c.choosed=!0,t.showLabelAlways&&c.showTodoLabel||(c.showTodoLabel=1),y["calendar.selectedDay"]=[c]):u.inverse&&(c.choosed&&(c.showTodoLabel&&t.showLabelAlways?c.showTodoLabel=!0:c.showTodoLabel=1),y["calendar.selectedDay"]=[]),u.weekMode&&(y["calendar.curYear"]=c.year,y["calendar.curMonth"]=c.month),p(y)},gotoSetContinuousDates:(e,t)=>R([""+u.toTimeStr(e),""+u.toTimeStr(t)]),timeRangeHelper(e,t){const a=(0,d.getDateTimeStamp)(e),n=t[0];let r,s,o=t.length;o>1&&(r=t[o-1],s=(0,d.getDateTimeStamp)(r));return{endDate:r,startDate:n,currentDateTimestamp:a,endDateTimestamp:s,startTimestamp:(0,d.getDateTimeStamp)(n)}},calculateDateRange(e,t){const{endDate:a,startDate:n,currentDateTimestamp:r,endDateTimestamp:s,startTimestamp:o}=this.timeRangeHelper(e,t);let c=[],l=t.length;const i=t.filter(t=>u.toTimeStr(t)===u.toTimeStr(e));if(2===l&&i.length)return c=[e,e],c;if(r>=o&&s&&r<=s){c=l/2>t.findIndex(t=>u.toTimeStr(t)===u.toTimeStr(e))?[e,a]:[n,e]}else r<o?c=[e,a]:r>o&&(c=[n,e]);return c},chooseAreaWhenExistArea:(e,t)=>new Promise((a,n)=>{const r=g.calculateDateRange(e,u.sortDates(t));g.gotoSetContinuousDates(...r).then(t=>{a(t),g.afterTapDay(e)}).catch(t=>{n(t),g.afterTapDay(e)})}),chooseAreaWhenHasOneDate:(e,t,a)=>new Promise((n,r)=>{const s=a||t[0];let o=[s,e];const c=(0,d.getDateTimeStamp)(e);(0,d.getDateTimeStamp)(s)>c&&(o=[e,s]),g.gotoSetContinuousDates(...o).then(t=>{n(t),g.afterTapDay(e)}).catch(t=>{r(t),g.afterTapDay(e)})}),whenChooseArea(e){return new Promise((t,a)=>{if((0,d.isComponent)(this)&&(b=this),b.weekMode)return;const{days:n=[],selectedDay:r,lastChoosedDate:s}=D("calendar"),c=n[e];if(c.disable)return;if((0,l.default)(b).getCalendarConfig().takeoverTap)return b.triggerEvent("onTapDay",c);if(r&&r.length>1)g.chooseAreaWhenExistArea(c,r).then(e=>{t(e)}).catch(e=>{a(e)});else if(s||r&&1===r.length)g.chooseAreaWhenHasOneDate(c,r,s).then(e=>{t(e)}).catch(e=>{a(e)});else{n.forEach(e=>{+e.day==+c.day?e.choosed=!0:e.choosed=!1});new o.default(b).setData({"calendar.days":[...n],"calendar.lastChoosedDate":c})}})},afterTapDay(e,t){const a=(0,l.default)(b).getCalendarConfig(),{multi:n}=a;n?b.triggerEvent("afterTapDay",{currentSelected:e,selectedDates:t}):b.triggerEvent("afterTapDay",e)},jumpToToday:()=>new Promise((e,t)=>{const{year:a,month:n,date:r}=u.todayDate(),s=u.todayTimestamp(),o=(0,l.default)(b).getCalendarConfig();p({"calendar.curYear":a,"calendar.curMonth":n,"calendar.selectedDay":[{year:a,day:r,month:n,choosed:!0,lunar:o.showLunar?i.default.solar2lunar(a,n,r):null}],"calendar.todayTimestamp":s}),g.renderCalendar(a,n,r).then(()=>{e({year:a,month:n,date:r})}).catch(()=>{t("jump failed")})})},T=g.whenChangeDate;t.whenChangeDate=T;const w=g.renderCalendar;t.renderCalendar=w;const C=g.whenSingleSelect;t.whenSingleSelect=C;const M=g.whenChooseArea;t.whenChooseArea=M;const _=g.whenMulitSelect;t.whenMulitSelect=_;const S=g.calculatePrevWeekDays;t.calculatePrevWeekDays=S;const k=g.calculateNextWeekDays;function v(e){return m(e),{year:D("calendar.curYear"),month:D("calendar.curMonth")}}function L(e={},t){m(t);const a=G(),n=D("calendar.selectedDay")||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function W(e,t){m(t);const{days:a=[],selectedDay:n=[]}=D("calendar")||{};if(e&&e.length){const t=e.map(e=>`${+e.year}-${+e.month}-${+e.day}`),r=n.filter(e=>!t.includes(`${+e.year}-${+e.month}-${+e.day}`));a.forEach(e=>{t.includes(`${+e.year}-${+e.month}-${+e.day}`)&&(e.choosed=!1)}),p({"calendar.days":a,"calendar.selectedDay":r})}else a.forEach(e=>{e.choosed=!1}),p({"calendar.days":a,"calendar.selectedDay":[]})}function A(e,t,a,n){return new Promise((s,o)=>{m(n);const{selectedDay:c=[]}=D("calendar")||{},{weekMode:l}=D("calendarConfig")||{},{year:i,month:f,day:y}=c[0]||{};if(+i!=+e||+f!=+t||+y!=+a){if(l){let n=!1;if(!e||!t||!a){const r=u.todayDate();e=r.year,t=r.month,a=r.date,n=!0}return function({year:e,month:t,day:a},n){return new Promise((s,o)=>{(0,r.default)(b).jump({year:+e,month:+t,day:+a},n).then(e=>{s(e)}).catch(e=>{o(e)})})}({year:e,month:t,day:a},n).then(e=>{s(e)}).catch(e=>{o(e)}),void Z((0,d.getCurrentPage)())}e&&t?function({year:e,month:t,day:a}){return new Promise((n,r)=>{if("number"!=typeof+e||"number"!=typeof+t)return h.warn("jump 函数年月日参数必须为数字");const s=u.todayTimestamp();p({"calendar.curYear":+e,"calendar.curMonth":+t,"calendar.todayTimestamp":s},()=>{g.renderCalendar(+e,+t,+a).then(e=>{n(e)}).catch(e=>{r(e)})})})}({year:e,month:t,day:a}).then(e=>{s(e)}).catch(e=>{o(e)}):g.jumpToToday().then(e=>{s(e)}).catch(e=>{o(e)})}})}function O(e,t){m(t),(0,s.default)(b).setTodoLabels(e)}function x(e,t){m(t),(0,s.default)(b).deleteTodoLabels(e)}function Y(e){m(e),(0,s.default)(b).clearTodoLabels()}function E(e={},t){m(t);const a=G(),n=(0,s.default)(b).getTodoLabels()||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function P(e=[],t){m(t),(0,n.default)(b).disableDays(e)}function j(e=[],t){m(t),(0,n.default)(b).enableArea(e)}function I(e=[],t){m(t),(0,n.default)(b).enableDays(e)}function $(e,t){m(t),(0,n.default)(b).setSelectedDays(e)}function G(e){return m(e),(0,l.default)(b).getCalendarConfig()}function U(e,t){if(m(t),!e||0===Object.keys(e).length)return h.warn("setCalendarConfig 参数必须为非空对象");const a=G();return new Promise((t,n)=>{(0,l.default)(b).setCalendarConfig(e).then(n=>{t(n);const{date:r,type:s}=a.disableMode||{},{_date:o,_type:c}=e.disableMode||{};if(s!==c||r!==o){const{year:e,month:t}=v();A(e,t)}}).catch(e=>{n(e)})})}function F(e={},t){m(t);const a=G(),n=D("calendar.days",t)||[];if(e.lunar&&!a.showLunar){return u.convertLunar(n)}return n}function R(e,t){return m(t),(0,n.default)(b).chooseArea(e)}function N(e,t){e&&(m(t),(0,n.default)(b).setDateStyle(e))}function X(...e){return new Promise((t,a)=>{const n=e[0];if(!e[1])return(0,r.default)(b).switchWeek(n).then(t).catch(a);"string"==typeof e[1]?(m(e[1]),(0,r.default)(b).switchWeek(n,e[2]).then(t).catch(a)):"object"==typeof e[1]&&("string"==typeof e[2]&&m(e[1]),(0,r.default)(b).switchWeek(n,e[1]).then(t).catch(a))})}function Z(e){e.calendar={jump:A,switchView:X,disableDay:P,enableArea:j,enableDays:I,chooseDateArea:R,getCurrentYM:v,getSelectedDay:L,cancelSelectedDates:W,setDateStyle:N,setTodoLabels:O,getTodoLabels:E,deleteTodoLabels:x,clearTodoLabels:Y,setSelectedDays:$,getCalendarConfig:G,setCalendarConfig:U,getCalendarDates:F}}function B(e,t){d.initialTasks.flag="process",b=e,b.config=t,function(e){let t=["日","一","二","三","四","五","六"];"Mon"===e&&(t=["一","二","三","四","五","六","日"]),p({"calendar.weeksCh":t})}(t.firstDayOfWeek),function(e){if(b.firstRenderWeekMode=!0,e&&"string"==typeof e){const t=e.split("-");if(t.length<3)return h.warn("配置 jumpTo 格式应为: 2018-4-2 或 2018-04-02");A(+t[0],+t[1],+t[2])}else e||p({"config.noDefault":!0}),A()}(t.defaultDay),h.tips("使用中若遇问题请反馈至 https://github.com/treadpit/wx_calendar/issues ✍️")}t.calculateNextWeekDays=k;t.default=(e,t={})=>{if("process"===d.initialTasks.flag)return d.initialTasks.tasks.push((function(){B(e,t)}));B(e,t)}}]);
\ No newline at end of file
{
{
"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,AAEAAAANAIAAAwBQRkZUTYda3jUAAAfEAAAAHEdERUYAKQANAAAHpAAAAB5PUy8yPllJ4AAAAVgAAABWY21hcAAP65kAAAHIAAABQmdhc3D//wADAAAHnAAAAAhnbHlmLotR3AAAAxwAAAGkaGVhZBTU+ykAAADcAAAANmhoZWEHKwOFAAABFAAAACRobXR4DasB4gAAAbAAAAAWbG9jYQC0AR4AAAMMAAAAEG1heHABEwAyAAABOAAAACBuYW1lKeYRVQAABMAAAAKIcG9zdEoLnOYAAAdIAAAAUgABAAAAAQAAiPM8al8PPPUACwQAAAAAANjbW5YAAAAA2NtblgCzAAQDTQL8AAAACAACAAAAAAAAAAEAAAOA/4AAXAQAAAAAAANNAAEAAAAAAAAAAAAAAAAAAAAEAAEAAAAHACYAAgAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5+vn7gOA/4AAXAOAAIAAAAABAAAAAAAABAAAAAAAAAAEAAAABAABLgD4ALQAswAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAA5+7//wAA5+v//xgYAAEAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJgBMAI4A0gABAS4ABAMKAvwAEgAACQEmBh0BFBcJAQYdARQWNwE2NAL+/j0ECQYBaP6YBgkEAcMMAZkBYAMEBU0IBf7n/ucFCE0FBAMBYAoeAAAAAQD4AAQC1AL8ABIAAAE1NCYHAQYUFwEWNj0BNCcJATYC1AkE/j0MDAHDBAkG/pgBaAYCpk0FBAP+oAoeCv6gAwQFTQgFARkBGQUAAAIAtAAgA00C4AASACUAAAkBNiYrASIHAwYUFwEWOwEyNicTATYmKwEiBwMGFBcBFjsBMjYnAREBCQMEBU0IBf8HBwD/BQhNBQQDJwEJAwQFTQgF/wcHAP8FCE0FBAMBgAFTBAkG/roJFgn+ugYJBAFTAVMECQb+ugkWCf66BgkEAAAAAAIAswAgA0wC4AASACUAAAEDJisBIgYXCQEGFjsBMjcBNjQlAyYrASIGFwkBBhY7ATI3ATY0AhX/BQhNBQQDAQn+9wMEBU0IBQD/BwEp/wUITQUEAwEJ/vcDBAVNCAUA/wcBlAFGBgkE/q3+rQQJBgFGCRYJAUYGCQT+rf6tBAkGAUYJFgAAAAAAABIA3gABAAAAAAAAABUALAABAAAAAAABAAgAVAABAAAAAAACAAcAbQABAAAAAAADAAgAhwABAAAAAAAEAAgAogABAAAAAAAFAAsAwwABAAAAAAAGAAgA4QABAAAAAAAKACsBQgABAAAAAAALABMBlgADAAEECQAAACoAAAADAAEECQABABAAQgADAAEECQACAA4AXQADAAEECQADABAAdQADAAEECQAEABAAkAADAAEECQAFABYAqwADAAEECQAGABAAzwADAAEECQAKAFYA6gADAAEECQALACYBbgAKAEMAcgBlAGEAdABlAGQAIABiAHkAIABpAGMAbwBuAGYAbwBuAHQACgAACkNyZWF0ZWQgYnkgaWNvbmZvbnQKAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABpAGMAbwBuAGYAbwBuAHQAAGljb25mb250AABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAABHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuAABoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAABodHRwOi8vZm9udGVsbG8uY29tAAACAAAAAAAAAAoAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAcAAAABAAIBAgEDAQQBBQVyaWdodARsZWZ0CmRvdWJsZWxlZnQLZG91YmxlcmlnaHQAAAAAAAH//wACAAEAAAAMAAAAFgAAAAIAAQADAAYAAQAEAAAAAgAAAAAAAAABAAAAANWkJwgAAAAA2NtblgAAAADY21uW) 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
//城市检索的首字母
//城市检索的首字母
const LETTERS = ["A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z"]
// 城市信息
const CITY_LIST = [{ "id": "35", "provincecode": "150000", "city": "阿拉善盟", "code": "152900", "initial": "A", "short": "Alashanmeng" }, { "id": "38", "provincecode": "210000", "city": "鞍山", "code": "210300", "initial": "A", "short": "Anshan" }, { "id": "105", "provincecode": "340000", "city": "安庆", "code": "340800", "initial": "A", "short": "Anqing" }, { "id": "156", "provincecode": "410000", "city": "安阳", "code": "410500", "initial": "A", "short": "Anyang" }, { "id": "256", "provincecode": "510000", "city": "阿坝藏族羌族自治州", "code": "513200", "initial": "A", "short": "Aba" }, { "id": "262", "provincecode": "520000", "city": "安顺", "code": "520400", "initial": "A", "short": "Anshun" }, { "id": "289", "provincecode": "540000", "city": "阿里地区", "code": "542500", "initial": "A", "short": "Ali" }, { "id": "299", "provincecode": "610000", "city": "安康", "code": "610900", "initial": "A", "short": "Ankang" }, { "id": "335", "provincecode": "650000", "city": "阿克苏地区", "code": "652900", "initial": "A", "short": "Akesu" }, { "id": "341", "provincecode": "650000", "city": "阿勒泰地区", "code": "654300", "initial": "A", "short": "Aletai" }, { "id": "1", "provincecode": "110000", "city": "北京", "code": "110000", "initial": "B", "short": "Beijing" }, { "id": "7", "provincecode": "130000", "city": "保定", "code": "130600", "initial": "B", "short": "Baoding" }, { "id": "25", "provincecode": "150000", "city": "包头", "code": "150200", "initial": "B", "short": "Baotou" }, { "id": "31", "provincecode": "150000", "city": "巴彦淖尔", "code": "150800", "initial": "B", "short": "Bayannaoer" }, { "id": "40", "provincecode": "210000", "city": "本溪", "code": "210500", "initial": "B", "short": "Benxi" }, { "id": "55", "provincecode": "220000", "city": "白山", "code": "220600", "initial": "B", "short": "Baishan" }, { "id": "57", "provincecode": "220000", "city": "白城", "code": "220800", "initial": "B", "short": "Baicheng" }, { "id": "100", "provincecode": "340000", "city": "蚌埠", "code": "340300", "initial": "B", "short": "Bangbu" }, { "id": "150", "provincecode": "370000", "city": "滨州", "code": "371600", "initial": "B", "short": "Binzhou" }, { "id": "222", "provincecode": "450000", "city": "北海", "code": "450500", "initial": "B", "short": "Beihai" }, { "id": "227", "provincecode": "450000", "city": "百色", "code": "451000", "initial": "B", "short": "Baise" }, { "id": "254", "provincecode": "510000", "city": "巴中", "code": "511900", "initial": "B", "short": "Bazhong" }, { "id": "265", "provincecode": "520000", "city": "毕节地区", "code": "522400", "initial": "B", "short": "Bijie" }, { "id": "271", "provincecode": "530000", "city": "保山", "code": "530500", "initial": "B", "short": "Baoshan" }, { "id": "293", "provincecode": "610000", "city": "宝鸡", "code": "610300", "initial": "B", "short": "Baoji" }, { "id": "304", "provincecode": "620000", "city": "白银", "code": "620400", "initial": "B", "short": "Baiyin" }, { "id": "333", "provincecode": "650000", "city": "博尔塔拉蒙古自治州", "code": "652700", "initial": "B", "short": "Boertala" }, { "id": "334", "provincecode": "650000", "city": "巴音郭楞蒙古自治州", "code": "652800", "initial": "B", "short": "Bayinguoleng" }, { "id": "", "provincecode": "500000", "city": "重庆", "code": "500000", "initial": "C", "short": "Chongqing" }, { "id": "9", "provincecode": "130000", "city": "承德", "code": "130800", "initial": "C", "short": "Chengde" }, { "id": "10", "provincecode": "130000", "city": "沧州", "code": "130900", "initial": "C", "short": "Cangzhou" }, { "id": "16", "provincecode": "140000", "city": "长治", "code": "140400", "initial": "C", "short": "Changzhi" }, { "id": "27", "provincecode": "150000", "city": "赤峰", "code": "150400", "initial": "C", "short": "Chifeng" }, { "id": "48", "provincecode": "210000", "city": "朝阳", "code": "211300", "initial": "C", "short": "Chaoyang" }, { "id": "50", "provincecode": "220000", "city": "长春", "code": "220100", "initial": "C", "short": "Changchun" }, { "id": "77", "provincecode": "320000", "city": "常州", "code": "320400", "initial": "C", "short": "Changzhou" }, { "id": "107", "provincecode": "340000", "city": "滁州", "code": "341100", "initial": "C", "short": "Chuzhou" }, { "id": "110", "provincecode": "340000", "city": "巢湖", "code": "341400", "initial": "C", "short": "Chaohu" }, { "id": "113", "provincecode": "340000", "city": "池州", "code": "341700", "initial": "C", "short": "Chizhou" }, { "id": "183", "provincecode": "430000", "city": "长沙", "code": "430100", "initial": "C", "short": "Changsha" }, { "id": "189", "provincecode": "430000", "city": "常德", "code": "430700", "initial": "C", "short": "Changde" }, { "id": "192", "provincecode": "430000", "city": "郴州", "code": "431000", "initial": "C", "short": "Chenzhou" }, { "id": "215", "provincecode": "440000", "city": "潮州", "code": "445100", "initial": "C", "short": "Chaozhou" }, { "id": "231", "provincecode": "450000", "city": "崇左", "code": "451400", "initial": "C", "short": "Chongzuo" }, { "id": "238", "provincecode": "510000", "city": "成都", "code": "510100", "initial": "C", "short": "Chengdu" }, { "id": "276", "provincecode": "530000", "city": "楚雄彝族自治州", "code": "532300", "initial": "C", "short": "Chuxiong" }, { "id": "285", "provincecode": "540000", "city": "昌都地区", "code": "542100", "initial": "C", "short": "Changdu" }, { "id": "332", "provincecode": "650000", "city": "昌吉回族自治州", "code": "652300", "initial": "C", "short": "Changji" }, { "id": "14", "provincecode": "140000", "city": "大同", "code": "140200", "initial": "D", "short": "Datong" }, { "id": "37", "provincecode": "210000", "city": "大连", "code": "210200", "initial": "D", "short": "Dalian" }, { "id": "41", "provincecode": "210000", "city": "丹东", "code": "210600", "initial": "D", "short": "Dandong" }, { "id": "64", "provincecode": "230000", "city": "大庆", "code": "230600", "initial": "D", "short": "Daqing" }, { "id": "71", "provincecode": "230000", "city": "大兴安岭地区", "code": "232700", "initial": "D", "short": "Daxinganling" }, { "id": "139", "provincecode": "370000", "city": "东营", "code": "370500", "initial": "D", "short": "Dongying" }, { "id": "148", "provincecode": "370000", "city": "德州", "code": "371400", "initial": "D", "short": "Dezhou" }, { "id": "213", "provincecode": "440000", "city": "东莞", "code": "441900", "initial": "D", "short": "Dongguan" }, { "id": "242", "provincecode": "510000", "city": "德阳", "code": "510600", "initial": "D", "short": "Deyang" }, { "id": "252", "provincecode": "510000", "city": "达州", "code": "511700", "initial": "D", "short": "Dazhou" }, { "id": "280", "provincecode": "530000", "city": "大理白族自治州", "code": "532900", "initial": "D", "short": "Dali" }, { "id": "281", "provincecode": "530000", "city": "德宏傣族景颇族自治州", "code": "533100", "initial": "D", "short": "Dehong" }, { "id": "283", "provincecode": "530000", "city": "迪庆藏族自治州", "code": "533400", "initial": "D", "short": "Diqing" }, { "id": "311", "provincecode": "620000", "city": "定西", "code": "621100", "initial": "D", "short": "Dingxi" }, { "id": "29", "provincecode": "150000", "city": "鄂尔多斯", "code": "150600", "initial": "E", "short": "Eerduosi" }, { "id": "174", "provincecode": "420000", "city": "鄂州", "code": "420700", "initial": "E", "short": "Ezhou" }, { "id": "181", "provincecode": "420000", "city": "恩施土家族苗族自治州", "code": "422800", "initial": "E", "short": "Enshi" }, { "id": "39", "provincecode": "210000", "city": "抚顺", "code": "210400", "initial": "F", "short": "Fushun" }, { "id": "44", "provincecode": "210000", "city": "阜新", "code": "210900", "initial": "F", "short": "Fuxin" }, { "id": "108", "provincecode": "340000", "city": "阜阳", "code": "341200", "initial": "F", "short": "Fuyang" }, { "id": "115", "provincecode": "350000", "city": "福州", "code": "350100", "initial": "F", "short": "Fuzhou" }, { "id": "133", "provincecode": "360000", "city": "抚州", "code": "361000", "initial": "F", "short": "Fuzhou" }, { "id": "202", "provincecode": "440000", "city": "佛山", "code": "440600", "initial": "F", "short": "Foshan" }, { "id": "223", "provincecode": "450000", "city": "防城港", "code": "450600", "initial": "F", "short": "Fangchenggang" }, { "id": "130", "provincecode": "360000", "city": "赣州", "code": "360700", "initial": "G", "short": "Ganzhou" }, { "id": "197", "provincecode": "440000", "city": "广州", "code": "440100", "initial": "G", "short": "Guangzhou" }, { "id": "220", "provincecode": "450000", "city": "桂林", "code": "450300", "initial": "G", "short": "Guilin" }, { "id": "225", "provincecode": "450000", "city": "贵港", "code": "450800", "initial": "G", "short": "Guigang" }, { "id": "244", "provincecode": "510000", "city": "广元", "code": "510800", "initial": "G", "short": "Guangyuan" }, { "id": "251", "provincecode": "510000", "city": "广安", "code": "511600", "initial": "G", "short": "Guangan" }, { "id": "257", "provincecode": "510000", "city": "甘孜藏族自治州", "code": "513300", "initial": "G", "short": "Ganzi" }, { "id": "259", "provincecode": "520000", "city": "贵阳", "code": "520100", "initial": "G", "short": "Guiyang" }, { "id": "314", "provincecode": "620000", "city": "甘南藏族自治州", "code": "623000", "initial": "G", "short": "Gannan" }, { "id": "320", "provincecode": "630000", "city": "果洛藏族自治州", "code": "632600", "initial": "G", "short": "Guoluo" }, { "id": "326", "provincecode": "640000", "city": "固原", "code": "640400", "initial": "G", "short": "Guyuan" }, { "id": "5", "provincecode": "130000", "city": "邯郸", "code": "130400", "initial": "H", "short": "Handan" }, { "id": "12", "provincecode": "130000", "city": "衡水", "code": "131100", "initial": "H", "short": "Hengshui" }, { "id": "", "provincecode": "370000", "city": "菏泽", "code": "371700", "initial": "H", "short": "Heze" }, { "id": "24", "provincecode": "150000", "city": "呼和浩特", "code": "150100", "initial": "H", "short": "Huhehaote" }, { "id": "30", "provincecode": "150000", "city": "呼伦贝尔", "code": "150700", "initial": "H", "short": "Hulunbeier" }, { "id": "49", "provincecode": "210000", "city": "葫芦岛", "code": "211400", "initial": "H", "short": "Huludao" }, { "id": "59", "provincecode": "230000", "city": "哈尔滨", "code": "230100", "initial": "H", "short": "Haerbin" }, { "id": "62", "provincecode": "230000", "city": "鹤岗", "code": "230400", "initial": "H", "short": "Hegang" }, { "id": "69", "provincecode": "230000", "city": "黑河", "code": "231100", "initial": "H", "short": "Heihe" }, { "id": "81", "provincecode": "320000", "city": "淮安", "code": "320800", "initial": "H", "short": "Huaian" }, { "id": "87", "provincecode": "330000", "city": "杭州", "code": "330100", "initial": "H", "short": "Hangzhou" }, { "id": "91", "provincecode": "330000", "city": "湖州", "code": "330500", "initial": "H", "short": "Huzhou" }, { "id": "98", "provincecode": "340000", "city": "合肥", "code": "340100", "initial": "H", "short": "Hefei" }, { "id": "101", "provincecode": "340000", "city": "淮南", "code": "340400", "initial": "H", "short": "Huainan" }, { "id": "103", "provincecode": "340000", "city": "淮北", "code": "340600", "initial": "H", "short": "Huaibei" }, { "id": "106", "provincecode": "340000", "city": "黄山", "code": "341000", "initial": "H", "short": "Huangshan" }, { "id": "112", "provincecode": "340000", "city": "亳州", "code": "341600", "initial": "H", "short": "Bozhou" }, { "id": "157", "provincecode": "410000", "city": "鹤壁", "code": "410600", "initial": "H", "short": "Hebi" }, { "id": "170", "provincecode": "420000", "city": "黄石", "code": "420200", "initial": "H", "short": "Huangshi" }, { "id": "178", "provincecode": "420000", "city": "黄冈", "code": "421100", "initial": "H", "short": "Huanggang" }, { "id": "186", "provincecode": "430000", "city": "衡阳", "code": "430400", "initial": "H", "short": "Hengyang" }, { "id": "194", "provincecode": "430000", "city": "怀化", "code": "431200", "initial": "H", "short": "Huaihua" }, { "id": "207", "provincecode": "440000", "city": "惠州", "code": "441300", "initial": "H", "short": "Huizhou" }, { "id": "210", "provincecode": "440000", "city": "河源", "code": "441600", "initial": "H", "short": "Heyuan" }, { "id": "228", "provincecode": "450000", "city": "贺州", "code": "451100", "initial": "H", "short": "Hezhou" }, { "id": "229", "provincecode": "450000", "city": "河池", "code": "451200", "initial": "H", "short": "Hechi" }, { "id": "232", "provincecode": "460000", "city": "海口", "code": "460100", "initial": "H", "short": "Haikou" }, { "id": "277", "provincecode": "530000", "city": "红河哈尼族彝族自治州", "code": "532500", "initial": "H", "short": "Honghe" }, { "id": "297", "provincecode": "610000", "city": "汉中", "code": "610700", "initial": "H", "short": "Hanzhong" }, { "id": "316", "provincecode": "630000", "city": "海东地区", "code": "632100", "initial": "H", "short": "Haidong" }, { "id": "317", "provincecode": "630000", "city": "海北藏族自治州", "code": "632200", "initial": "H", "short": "Haibei" }, { "id": "318", "provincecode": "630000", "city": "黄南藏族自治州", "code": "632300", "initial": "H", "short": "Huangnan" }, { "id": "319", "provincecode": "630000", "city": "海南藏族自治州", "code": "632500", "initial": "H", "short": "Hainan" }, { "id": "322", "provincecode": "630000", "city": "海西蒙古族藏族自治州", "code": "632800", "initial": "H", "short": "Haixi" }, { "id": "331", "provincecode": "650000", "city": "哈密地区", "code": "652200", "initial": "H", "short": "Hami" }, { "id": "338", "provincecode": "650000", "city": "和田地区", "code": "653200", "initial": "H", "short": "Hetiandi" }, { "id": "17", "provincecode": "140000", "city": "晋城", "code": "140500", "initial": "J", "short": "Jincheng" }, { "id": "19", "provincecode": "140000", "city": "晋中", "code": "140700", "initial": "J", "short": "Jinzhong" }, { "id": "42", "provincecode": "210000", "city": "锦州", "code": "210700", "initial": "J", "short": "Jinzhou" }, { "id": "51", "provincecode": "220000", "city": "吉林", "code": "220200", "initial": "J", "short": "Jilin" }, { "id": "61", "provincecode": "230000", "city": "鸡西", "code": "230300", "initial": "J", "short": "Jixi" }, { "id": "66", "provincecode": "230000", "city": "佳木斯", "code": "230800", "initial": "J", "short": "Jiamusi" }, { "id": "90", "provincecode": "330000", "city": "嘉兴", "code": "330400", "initial": "J", "short": "Jiaxing" }, { "id": "93", "provincecode": "330000", "city": "金华", "code": "330700", "initial": "J", "short": "Jinhua" }, { "id": "125", "provincecode": "360000", "city": "景德镇", "code": "360200", "initial": "J", "short": "Jingdezhen" }, { "id": "127", "provincecode": "360000", "city": "九江", "code": "360400", "initial": "J", "short": "Jiujiang" }, { "id": "131", "provincecode": "360000", "city": "吉安", "code": "360800", "initial": "J", "short": "Jian" }, { "id": "135", "provincecode": "370000", "city": "济南", "code": "370100", "initial": "J", "short": "Jinan" }, { "id": "142", "provincecode": "370000", "city": "济宁", "code": "370800", "initial": "J", "short": "Jining" }, { "id": "159", "provincecode": "410000", "city": "焦作", "code": "410800", "initial": "J", "short": "Jiaozuo" }, { "id": "175", "provincecode": "420000", "city": "荆门", "code": "420800", "initial": "J", "short": "Jingmen" }, { "id": "177", "provincecode": "420000", "city": "荆州", "code": "421000", "initial": "J", "short": "Jingzhou" }, { "id": "203", "provincecode": "440000", "city": "江门", "code": "440700", "initial": "J", "short": "Jiangmen" }, { "id": "216", "provincecode": "440000", "city": "揭阳", "code": "445200", "initial": "J", "short": "Jieyang" }, { "id": "302", "provincecode": "620000", "city": "嘉峪关", "code": "620200", "initial": "J", "short": "Jiayuguan" }, { "id": "303", "provincecode": "620000", "city": "金昌", "code": "620300", "initial": "J", "short": "Jinchang" }, { "id": "309", "provincecode": "620000", "city": "酒泉", "code": "620900", "initial": "J", "short": "Jiuquan" }, { "id": "153", "provincecode": "410000", "city": "开封", "code": "410200", "initial": "K", "short": "Kaifeng" }, { "id": "268", "provincecode": "530000", "city": "昆明", "code": "530100", "initial": "K", "short": "Kunming" }, { "id": "329", "provincecode": "650000", "city": "克拉玛依", "code": "650200", "initial": "K", "short": "Kelamayi" }, { "id": "336", "provincecode": "650000", "city": "克孜勒苏柯尔克孜自治州", "code": "653000", "initial": "K", "short": "Kezile" }, { "id": "337", "provincecode": "650000", "city": "喀什地区", "code": "653100", "initial": "K", "short": "Kashidi" }, { "id": "11", "provincecode": "130000", "city": "廊坊", "code": "131000", "initial": "L", "short": "Langfang" }, { "id": "22", "provincecode": "140000", "city": "临汾", "code": "141000", "initial": "L", "short": "Linfen" }, { "id": "23", "provincecode": "140000", "city": "吕梁", "code": "141100", "initial": "L", "short": "Lvliang" }, { "id": "45", "provincecode": "210000", "city": "辽阳", "code": "211000", "initial": "L", "short": "Liaoyang" }, { "id": "53", "provincecode": "220000", "city": "辽源", "code": "220400", "initial": "L", "short": "Liaoyuan" }, { "id": "80", "provincecode": "320000", "city": "连云港", "code": "320700", "initial": "L", "short": "Lianyungang" }, { "id": "97", "provincecode": "330000", "city": "丽水", "code": "331100", "initial": "L", "short": "Lishui" }, { "id": "111", "provincecode": "340000", "city": "六安", "code": "341500", "initial": "L", "short": "Liuan" }, { "id": "122", "provincecode": "350000", "city": "龙岩", "code": "350800", "initial": "L", "short": "Longyan" }, { "id": "146", "provincecode": "370000", "city": "莱芜", "code": "371200", "initial": "L", "short": "Laiwu" }, { "id": "147", "provincecode": "370000", "city": "临沂", "code": "371300", "initial": "L", "short": "Linyi" }, { "id": "149", "provincecode": "370000", "city": "聊城", "code": "371500", "initial": "L", "short": "Liaocheng" }, { "id": "154", "provincecode": "410000", "city": "洛阳", "code": "410300", "initial": "L", "short": "Luoyang" }, { "id": "162", "provincecode": "410000", "city": "漯河", "code": "411100", "initial": "L", "short": "Luohe" }, { "id": "195", "provincecode": "430000", "city": "娄底", "code": "431300", "initial": "L", "short": "Loudi" }, { "id": "219", "provincecode": "450000", "city": "柳州", "code": "450200", "initial": "L", "short": "Liuzhou" }, { "id": "230", "provincecode": "450000", "city": "来宾", "code": "451300", "initial": "L", "short": "Laibin" }, { "id": "241", "provincecode": "510000", "city": "泸州", "code": "510500", "initial": "L", "short": "Luzhou" }, { "id": "247", "provincecode": "510000", "city": "乐山", "code": "511100", "initial": "L", "short": "Leshan" }, { "id": "258", "provincecode": "510000", "city": "凉山彝族自治州", "code": "513400", "initial": "L", "short": "Liangshan" }, { "id": "260", "provincecode": "520000", "city": "六盘水", "code": "520200", "initial": "L", "short": "Liupanshui" }, { "id": "273", "provincecode": "530000", "city": "丽江", "code": "530700", "initial": "L", "short": "Lijiang" }, { "id": "275", "provincecode": "530000", "city": "临沧", "code": "530900", "initial": "L", "short": "Lincang" }, { "id": "284", "provincecode": "540000", "city": "拉萨", "code": "540100", "initial": "L", "short": "Lasa" }, { "id": "290", "provincecode": "540000", "city": "林芝地区", "code": "542600", "initial": "L", "short": "Linzhi" }, { "id": "301", "provincecode": "620000", "city": "兰州", "code": "620100", "initial": "L", "short": "Lanzhou" }, { "id": "312", "provincecode": "620000", "city": "陇南", "code": "621200", "initial": "L", "short": "Longnan" }, { "id": "313", "provincecode": "620000", "city": "临夏回族自治州", "code": "622900", "initial": "L", "short": "Linxia" }, { "id": "68", "provincecode": "230000", "city": "牡丹江", "code": "231000", "initial": "M", "short": "Mudanjiang" }, { "id": "102", "provincecode": "340000", "city": "马鞍山", "code": "340500", "initial": "M", "short": "Maanshan" }, { "id": "205", "provincecode": "440000", "city": "茂名", "code": "440900", "initial": "M", "short": "Maoming" }, { "id": "208", "provincecode": "440000", "city": "梅州", "code": "441400", "initial": "M", "short": "Meizhou" }, { "id": "243", "provincecode": "510000", "city": "绵阳", "code": "510700", "initial": "M", "short": "Mianyang" }, { "id": "249", "provincecode": "510000", "city": "眉山", "code": "511400", "initial": "M", "short": "Meishan" }, { "id": "74", "provincecode": "320000", "city": "南京", "code": "320100", "initial": "N", "short": "Nanjing" }, { "id": "79", "provincecode": "320000", "city": "南通", "code": "320600", "initial": "N", "short": "Nantong" }, { "id": "88", "provincecode": "330000", "city": "宁波", "code": "330200", "initial": "N", "short": "Ningbo" }, { "id": "121", "provincecode": "350000", "city": "南平", "code": "350700", "initial": "N", "short": "Nanping" }, { "id": "123", "provincecode": "350000", "city": "宁德", "code": "350900", "initial": "N", "short": "Ningde" }, { "id": "124", "provincecode": "360000", "city": "南昌", "code": "360100", "initial": "N", "short": "Nanchang" }, { "id": "164", "provincecode": "410000", "city": "南阳", "code": "411300", "initial": "N", "short": "Nanyang" }, { "id": "218", "provincecode": "450000", "city": "南宁", "code": "450100", "initial": "N", "short": "Nanning" }, { "id": "246", "provincecode": "510000", "city": "内江", "code": "511000", "initial": "N", "short": "Neijiang" }, { "id": "248", "provincecode": "510000", "city": "南充", "code": "511300", "initial": "N", "short": "Nanchong" }, { "id": "282", "provincecode": "530000", "city": "怒江傈僳族自治州", "code": "533300", "initial": "N", "short": "Nujiang" }, { "id": "288", "provincecode": "540000", "city": "那曲地区", "code": "542400", "initial": "N", "short": "Naqu" }, { "id": "46", "provincecode": "210000", "city": "盘锦", "code": "211100", "initial": "P", "short": "Panjin" }, { "id": "117", "provincecode": "350000", "city": "莆田", "code": "350300", "initial": "P", "short": "Putian" }, { "id": "126", "provincecode": "360000", "city": "萍乡", "code": "360300", "initial": "P", "short": "Pingxiang" }, { "id": "155", "provincecode": "410000", "city": "平顶山", "code": "410400", "initial": "P", "short": "Pingdingshan" }, { "id": "160", "provincecode": "410000", "city": "濮阳", "code": "410900", "initial": "P", "short": "Puyang" }, { "id": "240", "provincecode": "510000", "city": "攀枝花", "code": "510400", "initial": "P", "short": "Panzhihua" }, { "id": "308", "provincecode": "620000", "city": "平凉", "code": "620800", "initial": "P", "short": "Pingliang" }, { "id": "4", "provincecode": "130000", "city": "秦皇岛", "code": "130300", "initial": "Q", "short": "Qinhuangdao" }, { "id": "60", "provincecode": "230000", "city": "齐齐哈尔", "code": "230200", "initial": "Q", "short": "Qiqihaer" }, { "id": "67", "provincecode": "230000", "city": "七台河", "code": "230900", "initial": "Q", "short": "Qitaihe" }, { "id": "94", "provincecode": "330000", "city": "衢州", "code": "330800", "initial": "Q", "short": "Quzhou" }, { "id": "119", "provincecode": "350000", "city": "泉州", "code": "350500", "initial": "Q", "short": "Quanzhou" }, { "id": "136", "provincecode": "370000", "city": "青岛", "code": "370200", "initial": "Q", "short": "Qingdao" }, { "id": "212", "provincecode": "440000", "city": "清远", "code": "441800", "initial": "Q", "short": "Qingyuan" }, { "id": "224", "provincecode": "450000", "city": "钦州", "code": "450700", "initial": "Q", "short": "Qinzhou" }, { "id": "264", "provincecode": "520000", "city": "黔西南布依族苗族自治州", "code": "522300", "initial": "Q", "short": "Qianxinan" }, { "id": "266", "provincecode": "520000", "city": "黔东南苗族侗族自治州", "code": "522600", "initial": "Q", "short": "Qiandong" }, { "id": "267", "provincecode": "520000", "city": "黔南布依族苗族自治州", "code": "522700", "initial": "Q", "short": "Qiannan" }, { "id": "269", "provincecode": "530000", "city": "曲靖", "code": "530300", "initial": "Q", "short": "Qujing" }, { "id": "310", "provincecode": "620000", "city": "庆阳", "code": "621000", "initial": "Q", "short": "Qingyang" }, { "id": "145", "provincecode": "370000", "city": "日照", "code": "371100", "initial": "R", "short": "Rizhao" }, { "id": "287", "provincecode": "540000", "city": "日喀则地区", "code": "542300", "initial": "R", "short": "Rikaze" }, { "id": "2", "provincecode": "130000", "city": "石家庄", "code": "130100", "initial": "S", "short": "Shijiazhuang" }, { "id": "", "provincecode": "310000", "city": "上海", "code": "310000", "initial": "S", "short": "Shanghai" }, { "id": "18", "provincecode": "140000", "city": "朔州", "code": "140600", "initial": "S", "short": "Shuozhou" }, { "id": "36", "provincecode": "210000", "city": "沈阳", "code": "210100", "initial": "S", "short": "Shenyang" }, { "id": "", "provincecode": "530000", "city": "普洱", "code": "530800", "initial": "P", "short": "Puer" }, { "id": "52", "provincecode": "220000", "city": "四平", "code": "220300", "initial": "S", "short": "Siping" }, { "id": "56", "provincecode": "220000", "city": "松原", "code": "220700", "initial": "S", "short": "Songyuan" }, { "id": "63", "provincecode": "230000", "city": "双鸭山", "code": "230500", "initial": "S", "short": "Shuangyashan" }, { "id": "70", "provincecode": "230000", "city": "绥化", "code": "231200", "initial": "S", "short": "Suihua" }, { "id": "78", "provincecode": "320000", "city": "苏州", "code": "320500", "initial": "S", "short": "Suzhou" }, { "id": "86", "provincecode": "320000", "city": "宿迁", "code": "321300", "initial": "S", "short": "Suqian" }, { "id": "92", "provincecode": "330000", "city": "绍兴", "code": "330600", "initial": "S", "short": "Shaoxing" }, { "id": "109", "provincecode": "340000", "city": "宿州", "code": "341300", "initial": "S", "short": "Suzhou" }, { "id": "118", "provincecode": "350000", "city": "三明", "code": "350400", "initial": "S", "short": "Sanming" }, { "id": "134", "provincecode": "360000", "city": "上饶", "code": "361100", "initial": "S", "short": "Shangrao" }, { "id": "163", "provincecode": "410000", "city": "三门峡", "code": "411200", "initial": "S", "short": "Sanmenxia" }, { "id": "165", "provincecode": "410000", "city": "商丘", "code": "411400", "initial": "S", "short": "Shangqiu" }, { "id": "171", "provincecode": "420000", "city": "十堰", "code": "420300", "initial": "S", "short": "Shiyan" }, { "id": "180", "provincecode": "420000", "city": "随州", "code": "421300", "initial": "S", "short": "Suizhou" }, { "id": "187", "provincecode": "430000", "city": "邵阳", "code": "430500", "initial": "S", "short": "Shaoyang" }, { "id": "198", "provincecode": "440000", "city": "韶关", "code": "440200", "initial": "S", "short": "Shaoguan" }, { "id": "199", "provincecode": "440000", "city": "深圳", "code": "440300", "initial": "S", "short": "Shenzhen" }, { "id": "201", "provincecode": "440000", "city": "汕头", "code": "440500", "initial": "S", "short": "Shantou" }, { "id": "209", "provincecode": "440000", "city": "汕尾", "code": "441500", "initial": "S", "short": "Shanwei" }, { "id": "233", "provincecode": "460000", "city": "三亚", "code": "460200", "initial": "S", "short": "Sanya" }, { "id": "245", "provincecode": "510000", "city": "遂宁", "code": "510900", "initial": "S", "short": "Suining" }, { "id": "286", "provincecode": "540000", "city": "山南地区", "code": "542200", "initial": "S", "short": "Shannan" }, { "id": "300", "provincecode": "610000", "city": "商洛", "code": "611000", "initial": "S", "short": "Shangluo" }, { "id": "324", "provincecode": "640000", "city": "石嘴山", "code": "640200", "initial": "S", "short": "Shizuishan" }, { "id": "3", "provincecode": "130000", "city": "唐山", "code": "130200", "initial": "T", "short": "Tangshan" }, { "id": "13", "provincecode": "140000", "city": "太原", "code": "140100", "initial": "T", "short": "Taiyuan" }, { "id": "28", "provincecode": "150000", "city": "通辽", "code": "150500", "initial": "T", "short": "Tongliao" }, { "id": "47", "provincecode": "210000", "city": "铁岭", "code": "211200", "initial": "T", "short": "Tieling" }, { "id": "54", "provincecode": "220000", "city": "通化", "code": "220500", "initial": "T", "short": "Tonghua" }, { "id": "85", "provincecode": "320000", "city": "泰州", "code": "321200", "initial": "T", "short": "Taizhou" }, { "id": "96", "provincecode": "330000", "city": "台州", "code": "331000", "initial": "T", "short": "Taizhou" }, { "id": "104", "provincecode": "340000", "city": "铜陵", "code": "340700", "initial": "T", "short": "Tongling" }, { "id": "143", "provincecode": "370000", "city": "泰安", "code": "370900", "initial": "T", "short": "Taian" }, { "id": "263", "provincecode": "520000", "city": "铜仁地区", "code": "522200", "initial": "T", "short": "Tongren" }, { "id": "292", "provincecode": "610000", "city": "铜川", "code": "610200", "initial": "T", "short": "Tongchuan" }, { "id": "305", "provincecode": "620000", "city": "天水", "code": "620500", "initial": "T", "short": "Tianshui" }, { "id": "330", "provincecode": "650000", "city": "吐鲁番地区", "code": "652100", "initial": "T", "short": "Tulufan" }, { "id": "340", "provincecode": "650000", "city": "塔城地区", "code": "654200", "initial": "T", "short": "Tachengdi" }, { "id": "343", "provincecode": "120000", "city": "天津", "code": "120000", "initial": "T", "short": "Tianjin" }, { "id": "26", "provincecode": "150000", "city": "乌海", "code": "150300", "initial": "W", "short": "Wuhai" }, { "id": "32", "provincecode": "150000", "city": "乌兰察布", "code": "150900", "initial": "W", "short": "Wulanchabu" }, { "id": "75", "provincecode": "320000", "city": "无锡", "code": "320200", "initial": "W", "short": "Wuxi" }, { "id": "89", "provincecode": "330000", "city": "温州", "code": "330300", "initial": "W", "short": "Wenzhou" }, { "id": "99", "provincecode": "340000", "city": "芜湖", "code": "340200", "initial": "W", "short": "Wuhu" }, { "id": "141", "provincecode": "370000", "city": "潍坊", "code": "370700", "initial": "W", "short": "Weifang" }, { "id": "144", "provincecode": "370000", "city": "威海", "code": "371000", "initial": "W", "short": "Weihai" }, { "id": "169", "provincecode": "420000", "city": "武汉", "code": "420100", "initial": "W", "short": "Wuhan" }, { "id": "221", "provincecode": "450000", "city": "梧州", "code": "450400", "initial": "W", "short": "Wuzhou" }, { "id": "278", "provincecode": "530000", "city": "文山壮族苗族自治州", "code": "532600", "initial": "W", "short": "Wenshan" }, { "id": "295", "provincecode": "610000", "city": "渭南", "code": "610500", "initial": "W", "short": "Weinan" }, { "id": "306", "provincecode": "620000", "city": "武威", "code": "620600", "initial": "W", "short": "Wuwei" }, { "id": "325", "provincecode": "640000", "city": "吴忠", "code": "640300", "initial": "W", "short": "Wuzhong" }, { "id": "328", "provincecode": "650000", "city": "乌鲁木齐", "code": "650100", "initial": "W", "short": "Wulumuqi" }, { "id": "6", "provincecode": "130000", "city": "邢台", "code": "130500", "initial": "X", "short": "Xingtai" }, { "id": "21", "provincecode": "140000", "city": "忻州", "code": "140900", "initial": "X", "short": "Xinzhou" }, { "id": "33", "provincecode": "150000", "city": "兴安盟", "code": "152200", "initial": "X", "short": "Xinganmeng" }, { "id": "34", "provincecode": "150000", "city": "锡林郭勒盟", "code": "152500", "initial": "X", "short": "Xilinguolemeng" }, { "id": "76", "provincecode": "320000", "city": "徐州", "code": "320300", "initial": "X", "short": "Xuzhou" }, { "id": "114", "provincecode": "340000", "city": "宣城", "code": "341800", "initial": "X", "short": "Xuancheng" }, { "id": "116", "provincecode": "350000", "city": "厦门", "code": "350200", "initial": "X", "short": "Xiamen" }, { "id": "128", "provincecode": "360000", "city": "新余", "code": "360500", "initial": "X", "short": "Xinyu" }, { "id": "158", "provincecode": "410000", "city": "新乡", "code": "410700", "initial": "X", "short": "Xinxiang" }, { "id": "161", "provincecode": "410000", "city": "许昌", "code": "411000", "initial": "X", "short": "Xuchang" }, { "id": "166", "provincecode": "410000", "city": "信阳", "code": "411500", "initial": "X", "short": "Xinyang" }, { "id": "173", "provincecode": "420000", "city": "襄樊", "code": "420600", "initial": "X", "short": "Xiangfan" }, { "id": "176", "provincecode": "420000", "city": "孝感", "code": "420900", "initial": "X", "short": "Xiaogan" }, { "id": "179", "provincecode": "420000", "city": "咸宁", "code": "421200", "initial": "X", "short": "Xianning" }, { "id": "185", "provincecode": "430000", "city": "湘潭", "code": "430300", "initial": "X", "short": "Xiangtan" }, { "id": "196", "provincecode": "430000", "city": "湘西土家族苗族自治州", "code": "433100", "initial": "X", "short": "Xiangxi" }, { "id": "279", "provincecode": "530000", "city": "西双版纳傣族自治州", "code": "532800", "initial": "X", "short": "Xishuangbanna" }, { "id": "291", "provincecode": "610000", "city": "西安", "code": "610100", "initial": "X", "short": "Xian" }, { "id": "294", "provincecode": "610000", "city": "咸阳", "code": "610400", "initial": "X", "short": "Xianyang" }, { "id": "315", "provincecode": "630000", "city": "西宁", "code": "630100", "initial": "X", "short": "Xining" }, { "id": "15", "provincecode": "140000", "city": "阳泉", "code": "140300", "initial": "Y", "short": "Yangquan" }, { "id": "20", "provincecode": "140000", "city": "运城", "code": "140800", "initial": "Y", "short": "Yuncheng" }, { "id": "43", "provincecode": "210000", "city": "营口", "code": "210800", "initial": "Y", "short": "Yingkou" }, { "id": "58", "provincecode": "220000", "city": "延边朝鲜族自治州", "code": "222400", "initial": "Y", "short": "Yanbian" }, { "id": "65", "provincecode": "230000", "city": "伊春", "code": "230700", "initial": "Y", "short": "Yichun" }, { "id": "82", "provincecode": "320000", "city": "盐城", "code": "320900", "initial": "Y", "short": "Yancheng" }, { "id": "83", "provincecode": "320000", "city": "扬州", "code": "321000", "initial": "Y", "short": "Yangzhou" }, { "id": "129", "provincecode": "360000", "city": "鹰潭", "code": "360600", "initial": "Y", "short": "Yingtan" }, { "id": "132", "provincecode": "360000", "city": "宜春", "code": "360900", "initial": "Y", "short": "Yichun" }, { "id": "140", "provincecode": "370000", "city": "烟台", "code": "370600", "initial": "Y", "short": "Yantai" }, { "id": "172", "provincecode": "420000", "city": "宜昌", "code": "420500", "initial": "Y", "short": "Yichang" }, { "id": "188", "provincecode": "430000", "city": "岳阳", "code": "430600", "initial": "Y", "short": "Yueyang" }, { "id": "191", "provincecode": "430000", "city": "益阳", "code": "430900", "initial": "Y", "short": "Yiyang" }, { "id": "193", "provincecode": "430000", "city": "永州", "code": "431100", "initial": "Y", "short": "Yongzhou" }, { "id": "211", "provincecode": "440000", "city": "阳江", "code": "441700", "initial": "Y", "short": "Yangjiang" }, { "id": "217", "provincecode": "440000", "city": "云浮", "code": "445300", "initial": "Y", "short": "Yunfu" }, { "id": "226", "provincecode": "450000", "city": "玉林", "code": "450900", "initial": "Y", "short": "Yulin" }, { "id": "250", "provincecode": "510000", "city": "宜宾", "code": "511500", "initial": "Y", "short": "Yibin" }, { "id": "253", "provincecode": "510000", "city": "雅安", "code": "511800", "initial": "Y", "short": "Yaan" }, { "id": "270", "provincecode": "530000", "city": "玉溪", "code": "530400", "initial": "Y", "short": "Yuxi" }, { "id": "296", "provincecode": "610000", "city": "延安", "code": "610600", "initial": "Y", "short": "Yanan" }, { "id": "298", "provincecode": "610000", "city": "榆林", "code": "610800", "initial": "Y", "short": "Yulin" }, { "id": "321", "provincecode": "630000", "city": "玉树藏族自治州", "code": "632700", "initial": "Y", "short": "Yushu" }, { "id": "323", "provincecode": "640000", "city": "银川", "code": "640100", "initial": "Y", "short": "Yinchuan" }, { "id": "339", "provincecode": "650000", "city": "伊犁哈萨克自治州", "code": "654000", "initial": "Y", "short": "Yilihasake" }, { "id": "8", "provincecode": "130000", "city": "张家口", "code": "130700", "initial": "Z", "short": "Zhangjiakou" }, { "id": "84", "provincecode": "320000", "city": "镇江", "code": "321100", "initial": "Z", "short": "Zhenjiang" }, { "id": "95", "provincecode": "330000", "city": "舟山", "code": "330900", "initial": "Z", "short": "Zhoushan" }, { "id": "120", "provincecode": "350000", "city": "漳州", "code": "350600", "initial": "Z", "short": "Zhangzhou" }, { "id": "137", "provincecode": "370000", "city": "淄博", "code": "370300", "initial": "Z", "short": "Zibo" }, { "id": "138", "provincecode": "370000", "city": "枣庄", "code": "370400", "initial": "Z", "short": "Zaozhuang" }, { "id": "152", "provincecode": "410000", "city": "郑州", "code": "410100", "initial": "Z", "short": "Zhengzhou" }, { "id": "167", "provincecode": "410000", "city": "周口", "code": "411600", "initial": "Z", "short": "Zhoukou" }, { "id": "168", "provincecode": "410000", "city": "驻马店", "code": "411700", "initial": "Z", "short": "Zhumadian" }, { "id": "184", "provincecode": "430000", "city": "株洲", "code": "430200", "initial": "Z", "short": "Zhuzhou" }, { "id": "190", "provincecode": "430000", "city": "张家界", "code": "430800", "initial": "Z", "short": "Zhangjiajie" }, { "id": "200", "provincecode": "440000", "city": "珠海", "code": "440400", "initial": "Z", "short": "Zhuhai" }, { "id": "204", "provincecode": "440000", "city": "湛江", "code": "440800", "initial": "Z", "short": "Zhanjiang" }, { "id": "206", "provincecode": "440000", "city": "肇庆", "code": "441200", "initial": "Z", "short": "Zhaoqing" }, { "id": "214", "provincecode": "440000", "city": "中山", "code": "442000", "initial": "Z", "short": "Zhongshan" }, { "id": "239", "provincecode": "510000", "city": "自贡", "code": "510300", "initial": "Z", "short": "Zigong" }, { "id": "255", "provincecode": "510000", "city": "资阳", "code": "512000", "initial": "Z", "short": "Ziyang" }, { "id": "261", "provincecode": "520000", "city": "遵义", "code": "520300", "initial": "Z", "short": "Zunyi" }, { "id": "272", "provincecode": "530000", "city": "昭通", "code": "530600", "initial": "Z", "short": "Zhaotong" }, { "id": "307", "provincecode": "620000", "city": "张掖", "code": "620700", "initial": "Z", "short": "Zhangye" }, { "id": "327", "provincecode": "640000", "city": "中卫", "code": "640500", "initial": "Z", "short": "Zhongwei" }]
const HOT_CITY_LIST = [{ cityCode: 110000, city: '北京' }, { cityCode: 310000, city: '上海' }, { cityCode: 440100, city: '广州' }, { cityCode: 440300, city: '深圳' }, { cityCode: 330100, city: '杭州' }, { cityCode: 320100, city: '南京' }, { cityCode: 420100, city: '武汉' }, { cityCode: 120000, city: '天津' }, { cityCode: 610100, city: '西安' },]
const CITY_NOT_FOUND = [{ city: '无匹配城', code: "000" }]
export { LETTERS, CITY_LIST, HOT_CITY_LIST, CITY_NOT_FOUND };
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
// pages/activity/activity-info/activity-info.js
// pages/activity/activity-info/activity-info.js
var config = wx.getStorageSync("config");
var app = getApp();
var event = require('./../../../utils/event.js')
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : [], // 商家信息
member: {}, // 默认商家信息
windowHeight: "",
windowWidth: "",
contentHeight: "",
scrollLeft: 0, //切换栏的滚动条位置
// 基础数据
curImage: 0, // 用于image switch, //图片轮循的时候, 不同步更新价格 jscat 20200921
curIndex: 0, // 给选中的tab加粗
activityInfo: {}, // 活动基础信息
products: [], // 活动类别详情
products_string : {}, //活动类别详情对应的string, 主要用于navigator传值
//点赞模块
likeDictUpdate: {}, // 判断当前页面是否存在点赞操作
likeStatus: 0, // 判断like图标的状态
likeUrl: "../../../icon/activity/like.png", // like图标的url
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
var windowWidth = wx.getSystemInfoSync().windowWidth;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
windowWidth: windowWidth,
contentHeight : windowHeight * 0.675,
})
wx.setNavigationBarTitle({
title: '活动详情',
})
//step1: 初始化商家及用户数据
var nyxCode = wx.getStorageSync('nyxCode');
//不存在
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'),
})
}
//step2: 获取上一页面传入的数据
var activityInfo = _this.__data__.activityInfo
if (Object.keys(activityInfo).length==0 && options.title != "")
{
activityInfo['activity_id'] = options.activity_id;
activityInfo['note_image'] = options.note_image.split("::");
activityInfo['title'] = options.title;
activityInfo['content'] = options.content;
activityInfo['num_like'] = options.num_like;
activityInfo['address_name'] = options.address_name;
activityInfo['product_desc'] = options.product_desc;
activityInfo['unit_price'] = parseFloat(options.unit_price).toFixed(2);
activityInfo['member_id'] = options.member_id;
activityInfo['member_name'] = options.member_name;
activityInfo['member_slogan'] = options.member_slogan;
activityInfo['start_datetime'] = options.start_datetime;
activityInfo['end_datetime'] = options.end_datetime;
activityInfo['member_logo'] = options.member_logo==""?'/icon/icon_avatar1.png':options.member_logo;
}
_this.setData({ activityInfo })
//step3: 获取products, 活动的具体类别
_this.getProducts(activityInfo['activity_id'])
// step4 确定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)
},
);
// step5 数据载入页面, 初始化
// 初始载入'我已收藏'的清单, 存入storage
let promise_like = new Promise(function (resolve, reject) {
app.getCollectsStorage(0, 1, 100, resolve, reject);
})
promise_like.then(
function (value){
var likeDictStorage = wx.getStorageSync('likeDictStorage')
if(likeDictStorage.hasOwnProperty([activityInfo['activity_id']])
&& likeDictStorage[activityInfo['activity_id']] == 1 )
{
//同步更新likeStatus和likeUrl
var likeStatus = 1
var likeUrl = "../../../icon/activity/like_selected.png"
_this.setData({
likeStatus: likeStatus,
likeUrl: likeUrl,
})
}
console.log("===enter promise_like then_passed_" + value)
},
function (value){
console.log("===enter promise_like then_failed_" + value)
}
)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
// 获取likeDictUpdate
var likeDictUpdate = _this.__data__.likeDictUpdate
var userId = _this.__data__.nyxCode
var activityId = _this.__data__.activityInfo['activity_id']
var numLike = _this.__data__.activityInfo['num_like']
// 如果存在update操作, 则更新
if (likeDictUpdate.hasOwnProperty(activityId) && likeDictUpdate[activityId] != 0 ) {
// step1: 更新数据库
_this.submitLike(userId, activityId, likeDictUpdate[activityId])
// step2: 通过eventBus影响订阅页(首页或者收藏页)的数据
var data = {
'activity_id': activityId,
'num_like' : numLike
}
event.emit('LikeChanged', data);
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户分享
* 1. 点击右上角分享
* 2. 点击tab栏分享
*/
onShareAppMessage: function (options) {
var _this = this;
var url_activity = "/pages/activity/activity-info/activity-info?"
+"activity_id="+_this.data.activityInfo["activity_id"]
+"&note_image="+_this.data.activityInfo['noteImage'].join("::")
+"&title="+_this.data.activityInfo["title"]
+"&content="+_this.data.activityInfo["content"]
+"&num_like="+_this.data.activityInfo['num_like']
+"&address_name="+_this.data.activityInfo["address_name"]
+"&member_id="+_this.data.activityInfo["member_id"]
+"&member_name="+_this.data.activityInfo["member_name"]
+"&member_slogan="+_this.data.activityInfo["member_slogan"]
+"&member_logo="+_this.data.activityInfo["member_logo"]
+"&start_datetime="+_this.data.activityInfo["start_datetime"]
+"&end_datetime="+_this.data.activityInfo["end_datetime"]
var shareObj = {
    title: "好友推荐: "+ _this.data.activityInfo['title'],
    path: url_activity, // 默认是当前页面,必须是以'/'开头的完整路径
    imageUrl: ''
}
// 来自页面内的按钮的转发
  if( options.from == 'button' ){
    // 此处可以修改 shareObj 中的内容
    shareObj.path = url_activity;
  }
return shareObj;
},
/**
*
* 用户自定义函数 jscat 20200903
*/
//获取活动的具体子项; products
getProducts(activity_id){
var _this = this;
var pageCount = 10
var pageNum = 1
var query_url = '&activityId=' + activity_id
var strUrl = config.product_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 products = []
var products_string = {}
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
result["productId"] = res.data.data[i].productId
result["productDesc"] = res.data.data[i].productDesc
result["unitPrice"] = res.data.data[i].unitPrice.toFixed(2)
result["quantity"] = res.data.data[i].quantity
result["defaultStatus"] = res.data.data[i].defaultStatus
products.push(result)
}
_this.setData({ products })
}
}
})
},
//切换所选的类别
switchCategory(e) {
var _this = this;
var curIndex = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
this.setData({ curIndex })
},
//滑动获取选中商品
getSelectItem: function (e) {
var that = this;
var preCurImage = that.data.curImage;
var itemWidth = e.detail.scrollWidth / that.data.activityInfo.note_image.length;//每个商品的宽度
var scrollLeft = e.detail.scrollLeft;//滚动宽度
var curImage = Math.round(scrollLeft / itemWidth);//通过Math.round方法对滚动大于一半的位置进行进位
var newScrollLeft = 0
// 目标: 始终让图片居中显示
if (curImage != preCurImage
|| (curImage == that.data.activityInfo.note_image.length - 1 && scrollLeft > that.data.windowWidth * (that.data.activityInfo.note_image.length - 1))
)
{
newScrollLeft = that.data.windowWidth * curImage
that.setData({
scrollLeft : newScrollLeft,
curImage : curImage, //图片轮循的时候, 不同步更新价格 jscat 20200921
});
}
},
//跳转到结算页 order.wxml
toBuy: function (e) {
var _this = this;
var products_string = JSON.stringify(_this.data.products);
var url = "/pages/mall/order/order?"
+ "&activity_id=" + _this.__data__.activityInfo["activity_id"]
+ "&productsstring=" + products_string
+ "&curIndex=" + _this.data.curIndex
wx.navigateTo({
url: url
});
},
//跳转到结算页 order.wxml
toOrder: function (e) {
var _this = this;
var products_string = JSON.stringify(_this.data.products);
var url = "/pages/mall/order/order?"
+ "&activity_id=" + _this.__data__.activityInfo["activity_id"]
+ "&products_string=" + products_string
+ "&product_image=" + _this.__data__.activityInfo['note_image']
+ "&member_name=" + _this.__data__.activityInfo['member_name']
+ "&title=" + _this.__data__.activityInfo['title']
+ "&curIndex=" + _this.data.curIndex
wx.navigateTo({
url: url
});
},
//跳转到首页
toHome: function (e) {
wx.switchTab({
url: "/pages/activity/activity"
});
},
//点击clone后跳转至活动创建页面
// 数据通过app.globalData
// app.globalData.postData
// photoTag: "",
// photoTitle: "",
// photoContent: "",
// photoProduct: [],
// startDatetime: "",
// endDatetime: "",
onClickClone: function (e) {
var _this = this;
var url = "/pages/member/activity-post/activity-post"
// 构造数据
app.globalData.postData.startDatetime = _this.data.activityInfo["start_datetime"]
app.globalData.postData.endDatetime = _this.data.activityInfo["end_datetime"]
app.globalData.postData.photoTitle = _this.data.activityInfo["title"]
app.globalData.postData.photoContent = _this.data.activityInfo["content"]
app.globalData.postData.photoProduct = _this.data.products
wx.switchTab({
url: url
});
},
submitLike: function (userId, activityId, op) {
var _this = this;
var query_url = '?activityId=' + activityId + '&userId=' + userId
var strUrl = op == 1 ? config.collect_like_url + query_url : config.collect_like_del_url + query_url
config.debug == 1 ? console.log("===submitLike strUrl is: " + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
}
}
})
},
// 接收前端请求
onSubmitLike: function (e) {
var _this = this;
let activityId = e.currentTarget.dataset.id; // 获取活动id
var activityInfo = _this.__data__.activityInfo
// storage.likeDictStorage 只负责前端显示
// data.likeDictUpdate 负责数据库操作
var likeStatus = 0
var likeDictUpdate = _this.__data__.likeDictUpdate
var likeDictStorage = wx.getStorageSync('likeDictStorage') || {}
// 添加操作, 一定是storage的值为0或者undefined
if (!likeDictStorage.hasOwnProperty(activityId) || likeDictStorage[activityId] == 0 ) {
// 同步更新likeDictStorage, likeDictUpdate和activityInfo, like+1
// 同步更新前端
activityInfo['num_like'] = parseInt(activityInfo['num_like']) + 1
likeDictStorage[activityId] = 1
likeStatus = 1
// 表示本页面有数据操作
likeDictUpdate[activityId] = likeDictUpdate.hasOwnProperty(activityId) ? likeDictUpdate[activityId] + 1 : 1
wx.setStorageSync('likeDictStorage', likeDictStorage)
}
// 删除操作, 一定是storage的值为1
else if(likeDictStorage.hasOwnProperty(activityId) && likeDictStorage[activityId] == 1 )
{
//同步更新likeDict和activityInfo, like-1
activityInfo['num_like'] = parseInt(activityInfo['num_like']) - 1
likeDictStorage[activityId] = 0
likeStatus = 0
likeDictUpdate[activityId] = likeDictUpdate.hasOwnProperty(activityId) ? likeDictUpdate[activityId] - 1 : -1
wx.setStorageSync('likeDictStorage', likeDictStorage)
}
_this.setData({
likeDictUpdate: likeDictUpdate,
likeStatus: likeStatus,
likeUrl:likeStatus==1?"../../../icon/activity/like_selected.png":"../../../icon/activity/like.png",
activityInfo: activityInfo,
})
},
})
\ 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
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
/* 表格 */
.table{
display: inline-flex;
flex-direction: column;
border: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 0;
width: 100%;
}
.scrollClass {
display: flex;
width: 100%;
white-space: nowrap;
margin-top: 23px;
height: 100%;
background-color: white;
}
.table_header {
display: inline-flex;
}
.th {
display: flex;
flex-direction: column;
width: 200rpx;
height: 90rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.cell_label{
font-size: 30rpx;
color: rgba(74, 74, 74, 1);
margin-left: 10rpx;
}
.cell_date_label{
font-size: 20rpx;
color: rgba(74, 74, 74, 1);
}
.table_main {
display: inline-flex;
flex-direction: row;
}
.right-item{
display: flex;
flex-direction: row;
}
.td {
display: flex;
flex-direction: column;
/* height: 60rpx; */
background: white;
justify-content: center;
/* align-items: center; */
border: 1rpx solid rgba(218, 217, 217, 1);
border-top: 0;
border-left:0;
}
.table_Text_class {
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
}
.table_Text_last_class{
display: flex;
/* 左右 */
/* justify-content: center; */
/* 上下 */
align-items: center;
height: 100rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
margin-left: 10rpx;
/* word-break: normal; */
}
.list-activity-number{
position: relative;
display: flex;
flex-direction: row;
flex: 1;
justify-content: center;
font-size: 32rpx;
}
.table_Text_last_class text{
/* overflow : hidden;
white-space: nowrap;
text-overflow: ellipsis; */
/* 多行溢出省略 */
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp:2;
overflow: hidden;
text-overflow:ellipsis;
}
.bottom_placeholder {
position: relative;
width: 100%;
height: 160rpx;
line-height: 10rpx;
}
\ No newline at end of file
// 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*/
// pages/index/note-info/note-info.js
// pages/index/note-info/note-info.js
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "",
userInfo : {},
windowHeight: "",
windowWidth: "",
contentHeight: "",
scrollLeft: 0, //切换栏的滚动条位置
curIndex : 0,
quiz: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
var windowWidth = wx.getSystemInfoSync().windowWidth;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
windowWidth: windowWidth,
contentHeight : windowHeight * 0.675,
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
})
}
var quiz = _this.__data__.quiz
if (Object.keys(quiz).length==0 && options.title != "")
{
quiz['activity_id'] = options.activity_id;
quiz['note_image'] = options.note_image.split("::");
quiz['title'] = options.title;
quiz['content'] = options.content.split("::");
quiz['like'] = options.like;
quiz['quiz'] = options.quiz;
quiz['point'] = options.point;
quiz['member_id'] = options.member_id;
quiz['member_name'] = options.member_name;
quiz['member_slogan'] = options.member_slogan;
quiz['member_logo'] = options.member_logo==""?'/icon/icon_avatar1.png':options.member_logo;
}
wx.setNavigationBarTitle({
title: '活动详情',
})
_this.setData(
{
quiz: quiz,
}
)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (options) {
var shareObj = {
    title: "好友推荐: "+"Renaissance Bar知识竞答", // 默认是小程序的名称(可以写slogan等)
    path: '/pages/share/share', // 默认是当前页面,必须是以'/'开头的完整路径
    imageUrl: ''
}
  // 来自页面内的按钮的转发
  if( options.from == 'button' ){
    // var eData = options.target.dataset;
    // console.log( eData.id); // shareBtn
    // 此处可以修改 shareObj 中的内容
    shareObj.path = '/pages/goods/goods?goodId=123';
  }
return shareObj;
},
/**
*
* 用户自定义函数
*/
//滑动获取选中商品
getSelectItem: function (e) {
var that = this;
var preCurIndex = that.data.curIndex;
var itemWidth = e.detail.scrollWidth / that.data.quiz.note_image.length;//每个商品的宽度
var scrollLeft = e.detail.scrollLeft;//滚动宽度
var curIndex = Math.round(scrollLeft / itemWidth);//通过Math.round方法对滚动大于一半的位置进行进位
var newScrollLeft = 0
// 目标: 始终让图片居中显示
if (curIndex != preCurIndex
|| (curIndex == that.data.quiz.note_image.length - 1 && scrollLeft > that.data.windowWidth * (that.data.quiz.note_image.length - 1))
)
{
newScrollLeft = that.data.windowWidth * curIndex
that.setData({
scrollLeft : newScrollLeft,
curIndex : curIndex,
});
}
// console.log("itemWidth: ",itemWidth)
// console.log("scrollLeft: ", scrollLeft)
// console.log("curIndex: ", curIndex)
// console.log("newScrollLeft: ", newScrollLeft)
},
//跳转到知识竞答页面
toGame: function (e) {
var _this = this;
var url = "/pages/key/matchTest/matchTest?"
+ "&activity_id=" + _this.__data__.quiz["activity_id"]
+ "&quiz=" + _this.__data__.quiz["quiz"]
+ "&point=" + _this.__data__.quiz["point"]
+ "&member_id=" + _this.__data__.quiz["member_id"]
+ "&member_name=" + _this.__data__.quiz["member_name"]
+ "&title=" + _this.__data__.quiz["title"]
wx.navigateTo({
url: url
});
},
//跳转到首页
toHome: function (e) {
wx.switchTab({
url: "/pages/activity/activity"
});
},
//点击clone后跳转至竞答创建页面
onClickClone: function (e) {
var _this = this;
var url = "/pages/member/quiz-post/quiz-post?"
+ "&activity_id=" + "aid_123"
wx.navigateTo({
url: url
});
},
})
\ No newline at end of file
<view class="page">
<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="{{quiz.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-title" style="font-weight: bold">
<view class="clone">
<view class="clone-left">{{quiz.member_name}} {{quiz.title}}</view>
<view class="clone-right" bindtap="onClickClone" data-id='{{index}}'>
<view class="note-column" style="font-size: 24rpx;font-weight:normal;">
<image src="../../../icon/activity/clone.png"></image>
克隆
</view>
</view>
</view>
</view>
<view class="note-content">
{{quiz.content[0]}}
</view>
<view class="note-content">
{{quiz.content[1]}}
</view>
</view>
<!-- 企业信息 -->
<view class="note-row">
<image class="writer-image" src="{{quiz.member_logo}}"/>
<view class="note-column">
<span class="name">{{quiz.member_name}}</span>
<span class="name">{{quiz.member_slogan}}</span>
</view>
</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">
<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>
<view class="weui-tabbar__item">
<view style="position: relative;display:inline-block;">
<button class="button-red" bindtap="toGame">立即参与</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: 32rpx;
/* 后期用于 '展开' 功能 */
/* overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical; */
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;
margin-bottom: 30rpx;
margin-top: 30rpx;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
}
.writer-image{
width: 100rpx;
height: 100rpx;
margin-left: 5%;
}
/* 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_total {
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
width: 100%;
height: 160rpx;
line-height: 10rpx;
background: white;
}
.button-red {
background-color: #f44336; /* 红色 */
}
.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{
display: flex;
flex-direction: row;
}
.list .items{
display: flex;
flex-direction: column;
}
.items image{
width: 64rpx;
height: 64rpx;
font-size: 0;
}
.items text{
/* display: block; */
text-align: center;
margin-top: 0rpx;
margin-bottom: 20rpx;
padding: 0rpx;
font-size: 28rpx;
}
/* 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;
}
\ No newline at end of file
// pages/index/quiz-result/quiz-result.js
// pages/index/quiz-result/quiz-result.js
var config=wx.getStorageSync("config");
var app = getApp();
var util = require('./../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
/* 用于判断是否已经登陆 */
nyxCode : "",
authStatus : "",
userInfo : {}, // nickName, avartarUrl, gender, province, city, country
windowHeight: "",
windowWidth: "",
contentHeight: "",
//竞答结果: match_id, member_name, title, num_valid, num_total, points
matchInfo : {},
//当前时间
nowDate : "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
})
}
var matchInfo = _this.__data__.matchInfo
if (Object.keys(matchInfo).length==0 && options.match_id != "")
{
matchInfo['match_id'] = options.match_id;
matchInfo['member_name'] = options.member_name;
matchInfo['title'] = options.title;
matchInfo['num_valid'] = options.num_valid;
matchInfo['num_total'] = options.num_total;
matchInfo['points'] = options.points;
}
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
var windowWidth = wx.getSystemInfoSync().windowWidth;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
windowWidth: windowWidth,
contentHeight : windowHeight * 0.675,
matchInfo : matchInfo,
nowDate: util.formatTime(new Date())
})
wx.setNavigationBarTitle({
title: '活动结果',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (options) {
var shareObj = {
    title: "好友推荐: "+"Renaissance Bar知识竞答", // 默认是小程序的名称(可以写slogan等)
    path: '/pages/share/share', // 默认是当前页面,必须是以'/'开头的完整路径
    imageUrl: ''
}
  // 来自页面内的按钮的转发
  if( options.from == 'button' ){
    // var eData = options.target.dataset;
    // console.log( eData.id); // shareBtn
    // 此处可以修改 shareObj 中的内容
    shareObj.path = '/pages/goods/goods?goodId=123';
  }
return shareObj;
},
/**
*
* 用户自定义函数
*/
//跳转到知识竞答页面
toGame: function (e) {
wx.navigateTo({
url: "/pages/key/matchTest/matchTest"
});
},
//跳转到"我的积分"页面 jscat 0728
onCheckPoints: function (e) {
wx.navigateTo({
url: "/pages/my/my-points/my-points"
});
},
//跳转到首页
toHome: function (e) {
wx.switchTab({
url: "/pages/activity/activity"
});
},
})
\ 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">
<!-- Tab: 酒肆风云 + 头像 -->
<view class="result-list">
<view class="item bg bg01 ">
<!-- 左侧 -->
<view class="float-li t1">
<view class="result-left">
<view class="t1 justify align">
<view class="t1-left">酒肆风云</view>
<view class="t1-right">
<image class="avatar" src="../../../icon/icon_avatar3.png"></image>
</view>
</view>
<view class="t3 justify align">
<view class="t3-left">{{tutil.formatDate_ymdw_today(nowDate)}}</view>
<view class="t3-right" bindtap="onClickPoints">
<view style="line-height:1;">{{userInfo.nickName}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 文字内容 -->
<view class="note">
<view class="note-title" style="font-weight: bold">
{{matchInfo.member_name}} {{matchInfo.title}}
</view>
<view class="note-content">
{{userInfo.nickName}} {{matchInfo.num_total}}题答对{{matchInfo.num_valid}}题 喜提{{matchInfo.points}}积分
</view>
<view class="note-content">
战胜99%玩家
</view>
</view>
<!-- start bottom simple button-->
<!-- refer to https://www.jb51.net/article/129438.htm -->
<view class="bottom_total">
<view class="bottom_line"></view>
<view class="weui-flex" style="height: 180rpx;">
<view class="weui-flex__item weui-flex justify align"><view class="placeholder">
<view class="list">
<view class="items" bindtap="onCheckPoints">
<image src="../../../icon/activity/points.png"></image>
<text>查看积分</text>
</view>
<view class="items">
<button class="share" open-type="share">
</button>
<image src="../../../icon/activity/share.png"></image>
<text>分享战绩</text>
</view>
<!-- </view>
</view></view>
<view class="weui-flex__item weui-flex justify align"><view class="placeholder">
<view class="list"> -->
<view class="items" bindtap="toHome">
<image src="../../../icon/index.png"></image>
<text>返回首页</text>
</view>
</view>
</view></view>
</view>
</view>
<!-- end bottom-->
</view>
.page{
.page{
height:100vh; /* 相对于视口(Layout Viewport)的高度; 视口被均分为100单位的vh */
background-color:#f4f8fb;
}
.note{
width: 100%;
/* position: fixed; */
border-radius: 5rpx;
float: left;
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.note-title{
font-size: 16px;
/* 后期用于 '展开' 功能 */
/* overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical; */
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;
margin-bottom: 30rpx;
margin-top: 30rpx;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
}
.writer-image{
width: 120rpx;
height: 120rpx;
margin-left: 10%;
}
/* 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_total {
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
width: 100%;
height: 180rpx;
line-height: 10rpx;
background: white;
}
.button-red {
background-color: #f44336; /* 红色 */
}
.button-brown {
background-color: #D1A96E; /* 红色 */
}
button {
text-align: center;
font-size: 40rpx;
height: 2.6em;
line-height: 2.6em;
color: #fff;
}
.frame{
height: 480rpx;
}
.placeholder{
width: 100%;
margin: 5px;
padding: 0 10px;
text-align: center;
line-height: 2.3em;
}
/* justify-content: center;(水平居中) align-items: center;(垂直居中) */
.justify{
justify-content: center;
}
.align{
align-items: center;
}
.border{
border: 3rpx solid #ccc;
border-radius: 0rpx;
padding: 10rpx;
}
/* 好友助力积分列表 */
.list-title{
display: flex;
flex-direction: column;
/* align-items: center; */
}
.list-title .title{
font-size: 80rpx;
font-weight: bold;
margin-top: 40rpx;
margin-bottom: 40rpx;
}
.list .items{
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
}
.items image{
width: 80rpx;
height: 80rpx;
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;
}
.avatar{
width: 100rpx;
height: 100rpx;
overflow:visible;
border-radius: 50%;
}
/* result css */
.result-list{width: 100%; margin: 0 auto}
.result-list .item{width: 100%; height: 280rpx; margin-bottom: 20rpx;}
.result-list .item .float-li{width: 100%; height: 100%; border-right: 2rpx dashed rgba(255,255,255,.3)}
.result-list .item .float-li-right{width: 220rpx; padding-right: 20rpx; height:100%; color: #fff}
.result-left{position: relative}
.result-left .t{position: absolute; color: #fff}
.result-left .t1{width: 100%; display: flex; margin-left: 20rpx; margin-top: 20rpx; height: 160rpx; color: #fff}
.result-left .t1-left{display:flex; align-items: center;width: 60%; font-size: 70rpx; font-weight: bold;}
.result-left .t1-right{width: 40%; font-size: 50rpx; display:flex; align-items: center;}
.result-left .t2{left: 20rpx; top:160rpx}
.result-left .t3{width: 100%; display: flex; margin-left: 20rpx; margin-top: 10rpx; height: 50rpx; color: #fff}
.result-left .t3-left{width: 60%; display:flex; align-items: center;}
.result-left .t3-right{width: 40%; display:flex; align-items: center;}
.result-left .t3-right image{
width: 40rpx;
height: 40rpx;
font-size: 0;
}
.bg{width:700rpx; height: 250rpx;margin-bottom:50rpx;position:relative;overflow:hidden}
.bg i{position: absolute;left: 20%;top: 90rpx;height: 500rpx;width: 700rpx;background-color: rgba(255,255,255,.15);transform: rotate(-30deg);
}
.bg01{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: #F39B00}
\ No newline at end of file
// pages/key/key.js
// pages/key/key.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../utils/log.js')
var util = require('./../../utils/util.js')
Page({
/**
* 系统配置:主要用于置底页面设置 step1
*/
keyHeight: '',
chatHeight: "",
/**
* 页面的初始数据
*/
data: {
// 主要是公屏内容
autoplay: false,
interval: 3000,
duration: 1200,
indicatorDots: true,
emotionArr: [],
messageInputVal: '',
emotionHost: null,
nodes: [{
name: 'img'
}],
// {
// nickName : "张三"",
// type: 'L',
// messageType: 'txt',
// con: '微软开发者大会',
// avater: '../../imgs/avater.jpg'
// },
messageList: [],
isMedia: false,
isEmotion: false,
isShowAdd: false,
// socket
user_input_text: '',//用户输入文字
inputValue: '',
returnValue: '',
addImg: false,
//格式示例数据,可为空
allContentList: [],
num: 0,
sid: "key",
chatUserInfo: {},
scrollTop: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
console.log('===onLoad, options_', JSON.stringify(options));
/*step1 先确定用户信息 */
var nyxCode = wx.getStorageSync('nyxCode');
//不存在
if (!nyxCode)
{
//注册新用户
console.log("===onLoad_regUser")
wx.clearStorageSync('nyxCode');
nyxCode = "uid_" + util.wxuuid()
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
app.regUser(nyxCode);
}
else //存在
{
//更新用户信息
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")
}
})
}
//初始化socket
if (app.globalData.socketTask.readyState != 1 && app.globalData.socketTask.readyState != 0) {
var sid = _this.data.sid
if (sid != undefined && nyxCode != undefined && sid != "" && nyxCode != "") {
console.log("===onLoad_initSocket")
app.initSocket(sid, nyxCode, "进入竞答环节")
app.globalData.socketClose = false
}
}
wx.setNavigationBarTitle({
title: "发现有趣的你"
})
/**
* 系统配置:主要用于置底页面设置 step2
let h = 750 * res.windowHeight/res.windowWidth
*/
//获取设备高度,小程序自带的方法
var windowHeight = wx.getSystemInfoSync().windowHeight;
var keyHeight = windowHeight*0.4
var chatHeight = windowHeight - keyHeight
_this.setData({
keyHeight: keyHeight,
chatHeight: chatHeight,
})
//模拟表情数据
let emotion = emotionFun();
this.setData({
emotionArr: emotion,
emotionHost: app.globalData.emotionHost
})
},
// 初始化socket, 监听socket
onShow: function () {
var _this = this;
console.log("===onShow_readyState_", app.globalData.socketTask.readyState)
var uid = wx.getStorageSync('nyxCode')
if (app.globalData.socketTask.readyState != 1 && app.globalData.socketTask.readyState != 0 && uid != "") {
var sid = _this.data.sid
if (sid != undefined && uid != undefined && sid != "" && uid != "") {
console.log("===onShow_initSocket")
app.initSocket(sid, uid, "进入竞答环节")
app.globalData.socketClose = false
}
}
// 最好放在onShow
app.globalData.socketTask.onOpen(function (res) {
console.log('chat-onOpen webSocket连接已打开! readyState=' + app.globalData.socketTask.readyState)
//console.log("chat-open res_", res)
if (app.globalData.socketClose) {
app.closeSocket();
}
else {
app.globalData.socketOpen = true;
// 发送答题积分消息
var sendMsg = wx.getStorageSync('sendMsg')
if (sendMsg) {
_this.sendSocketMessage(sendMsg)
}
for (var i = 0; i < app.globalData.socketMsgQueue.length; i++) {
_this.sendSocketMessage(app.globalData.socketMsgQueue[i])
}
app.globalData.socketMsgQueue = []
app.startHeartBeat();
}
})
app.globalData.socketTask.onError(function (res) {
console.log('chat-WebSocket连接错误! 错误信息', res)
})
/*
两种情形,注意区分
case1. 用户跳转到其他页面, 触发onHide, 则正式退出
case2. socket掉线,则需要重连
*/
app.globalData.socketTask.onClose(function (res) {
console.log('chat-WebSocket连接已关闭! readyState=' + app.globalData.socketTask.readyState)
//对应case1
if (!app.globalData.socketClose) {
clearTimeout(app.globalData.connectSocketTimeOut)
app.globalData.connectSocketTimeOut = setTimeout(() => {
console.log("===onClose_initSocket")
app.initSocket(_this.data.sid, app.globalData.nyxCode, "进入竞答环节")
}, 3000);
}
})
app.globalData.socketTask.onMessage(onMessage => {
//console.log('监听WebSocket接受到服务器的消息事件。服务器返回的消息', onMessage.data)
var json = JSON.parse(onMessage.data);
// uid
var uid = json["uid"];
if (json["cmd"] != "onHeart") {
console.log("===onMessage_json: ", json)
var strUrl = config.userinfo_query_url + "?userid=" + uid
//tofix 这个地方特别容易出错
config.debug == 1 ? console.log("===onMessage getData strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log("===onMessage_res_",res)
var list = {}
//成功返回,服务器没问题
if (res.resultCode == "200")
{
if (res.data.length == 0) {
list['userId'] = uid
list['nickName'] = "匿名用户"
list['avatarUrl'] = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/u_image/icon_avatar1.png"
}
else {
list = res.data[0]
}
console.log("===onMessage_chatUserInfo, ", list)
_this.setData({
chatUserInfo: list
})
_this.processData(json)
}
else
{
console.log("===onMessage, 系统错误")
}
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function (){
var _this = this;
},
onType: function (e) {
console.log(e)
switch (e.detail.idx) {
case '1':
wx.navigateTo({
url: '/pages/key/matchTest/matchTest'
})
break;
case '2':
wx.navigateTo({
url: '/pages/key/matchTest/matchTest'
})
break;
case '3':
wx.navigateTo({
url: '/pages/key/matchOne/matchOne'
})
break;
case '4':
wx.navigateTo({
url: '/pages/key/matchTwo/matchTwo'
})
break;
default:
break;
}
},
/*
*/
//点击空白页,隐藏表情和图片选择
cancelShow() {
this.setData({
isEmotion: false,
isMedia: false
})
},
//打开表情选择
openEmotion() {
this.scrollBottom();
this.setData({
isEmotion: !this.data.isEmotion,
isMedia: false
})
},
//选择表情
selectEmotion(e) {
let inputEmotion = this.data.messageInputVal.concat(e.currentTarget.dataset.txt);
this.setData({
messageInputVal: inputEmotion
})
//this.isShowAddFun();
},
//删除输入的值
deleteVal() {
// console.log(this.data.messageInputVal.length)
let newVal = this.data.messageInputVal.substring(0, this.data.messageInputVal.length - 1);
this.setData({
messageInputVal: newVal
})
//this.isShowAddFun();
},
//分享(带参数),在onLoad接收参数
onShareAppMessage: function () {
return {
title: '让有趣被发现',
path: 'pages/key/key', // 路径,传递参数到指定页面。
imageUrl: '../../icon/images/nyx.png' //自定义分享封面
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
//app.closeSocket();
console.log('===onUnload webSocket 连接关闭事件。')
},
//发送消息
messageSend: function () {
let self = this;
let messageVal = self.data.messageInputVal;
if (!messageVal) {
wx.showToast({
title: '请输入内容',
icon: 'none',
duration: 2000
})
return false;
}
//表情处理
var reg = /\[.+?\]/g;
let newVal = messageVal.replace(reg, function (a, b) {
return face(a) ? face(a) : a;
});
//发送的消息
let objR = {
nickName: app.globalData.userInfo.nickName,
type: 'R',
messageType: 'txt',
con: newVal,
avater: app.globalData.userInfo.avatarUrl,
};
let messageArr = [];
messageArr.push(objR);
let newMessageArr = self.data.messageList.concat(messageArr);
//判断公屏的文字是否合规
let promise = app.onCheckText(messageVal)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
self.submitTo(messageVal)
//更新数据(模拟请求历史数据)
self.setData({
messageInputVal: "",
messageList: newMessageArr,
isEmotion: false,
isMedia: false
})
self.scrollBottom();
},
function (value) {
console.log("===enter promise then_failed_" + value)
});
},
//使页面滚动到底部
//tofix 应该需要一些优化 jscat 2020/03/13
scrollBottom: function () {
// wx.createSelectorQuery().select('#wrapperCon').boundingClientRect(function (rect) {
// wx.pageScrollTo({
// scrollTop: rect.bottom * 1000 //加整数的目的是消息数量多的时候,解决滚动会出现不到底部,并且抖动的问题
// })
// }).exec();
this.setData({
scrollTop: 1000 * 10 // 这里我们的单对话区域最高1000,取了最大值,应该有方法取到精确的
});
},
//获取输入内容
messageInput: function (e) {
let inputVal = e.detail.value;
this.setData({
messageInputVal: inputVal
})
},
//是否显示添加按钮
isShowAddFun() {
//如果有输入显示发送按钮,隐藏加号添加图片功能
if (this.data.messageInputVal) {
this.setData({
isShowAdd: false
})
} else {
this.setData({
isShowAdd: true
})
}
},
// 提交文字
submitTo: function (inputValue) {
let _this = this;
if (app.globalData.socketTask.readyState == 1) {
// 如果打开了socket就发送数据给服务器
var msg = JSON.stringify({
'cmd': 'onData',
'uid': app.globalData.nyxCode,
'msg': inputValue
})
_this.sendSocketMessage(msg)
}
},
bindKeyInput: function (e) {
this.setData({
inputValue: e.detail.value
})
},
/*
mark: tabbar 切换之后触发onHide()
*/
onHide: function () {
app.closeSocket();
console.log('===onHide WebSocket 连接关闭')
},
// 发送和接收 socket 消息
sendSocketMessage: function (msg) {
let _this = this
return new Promise((resolve, reject) => {
app.sendSocketMessage(msg)
app.globalData.callback = function (res) {
console.log('===webSocket 收到服务器内容: ', res)
resolve(res)
}
})
},
//获取到了socket广播的消息 => 通过userid获取userInfo => 小程序端处理获取到的msg
processData(json) {
var _this = this;
/*
cmd==onOpen, text = "欢迎" + map.uid + "进入竞答游戏"
cmd==onData, text = map.msg
if(chatUserinfo.nickName == app.globalData.userInfo.nickName) 不添加
*/
var text = ""
var nickName = ""
var avater = ""
console.log("====chatUserInfo, ", _this.data.chatUserInfo)
if (json["cmd"] == "onOpen" || json["cmd"] == "onScore") {
text = " " + _this.data.chatUserInfo.nickName + " " +json["msg"]
nickName = "系统"
avater = "../../icon/mall.png"
}
else if (json["cmd"] == "onData") {
text = json["msg"]
nickName = _this.data.chatUserInfo.nickName
avater = _this.data.chatUserInfo.avatarUrl
}
//表情处理
var reg = /\[.+?\]/g;
let newVal = text.replace(reg, function (a, b) {
return face(a) ? face(a) : a;
});
//回复
let objL = {
nickName: nickName,
type: 'L',
messageType: 'txt',
con: newVal,
avater: avater,
};
let messageArr = [];
//jscat 20200314 most important!
// 判断内容是否显示
// 1. 发送data,同时非自己
// 2. (自己登陆,不需要重复发送),
// 3. (竞答完成后,需要发送内容)
// 4. (别人登陆, 需要发送)
if (
(json["cmd"] == "onData" && _this.data.chatUserInfo.userid != app.globalData.nyxCode)
|| (json["cmd"] == "onOpen" && app.globalData.onOpenOp.key!=true)
|| (json["cmd"] == "onOpen" && _this.data.chatUserInfo.userid != app.globalData.nyxCode)
|| (json["cmd"] == "onScore")
)
{
messageArr.push(objL);
}
if ((json["cmd"] == "onScore" && wx.getStorageSync("sendMsg") != ""))
{
wx.setStorageSync('sendMsg', '');
}
if (json["cmd"] == "onOpen")
{
app.globalData.onOpenOp.key = true;
}
let newMessageArr = _this.data.messageList.concat(messageArr);
//更新数据(模拟请求历史数据)
_this.setData({
messageInputVal: "",
messageList: newMessageArr,
isEmotion: false,
isMedia: false,
})
_this.scrollBottom();
},
})
//通过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)
}
})
})
}
//表情文件
function emotionFun() {
let emoArr = [
{ "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": "[右太极]" }
];
return emoArr;
}
//表情转换
function face(obj) {
let emotion = emotionFun();
let emotionHost = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/";
let face = {};
for (let i = 0; i < emotion.length; i++) {
face[emotion[i].text] = '<img src="' + emotionHost + emotion[i].name + '.png" style="widht:20px;height:20px;vertical-align: middle;"/>'
}
return face[obj];
}
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "让有趣被发现 - 酒肆"
}
\ No newline at end of file
<!--pages/key/key.wxml-->
<!--pages/key/key.wxml-->
<view class="page">
<!-- start key view -->
<view class="weui-cells">
<scroll-view scroll-y="true" style="height:{{keyHeight}}px;position:fixed; top:0;">
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/key/matchTest/matchTest">
<view class="weui-cell__hd">
<image src="/icon/daily.png" />
</view>
<view class="weui-cell__bd">随便看看</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/key/matchStudy/matchStudy">
<view class="weui-cell__hd">
<image src="/icon/study.png"/>
</view>
<view class="weui-cell__bd">知识学习</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</scroll-view>
</view>
<!--end key view -->
<!--公屏view-->
<view style="height:{{chatHeight+40}}px;position:fixed; bottom:0;">
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">公屏发言</view>
</view>
<scroll-view scroll-y="true" scroll-top="{{scrollTop}}" style="height:{{chatHeight}}px;position:fixed; bottom:0;">
<view class="wrapper {{isShowAdd?'media-padd':''}} {{isEmotion?'emotion-padd':''}}" id="wrapperCon" bindtap="cancelShow" >
<!-- 消息列表 -->
<view class="chat {{item.type=='L'?'chat-l':'chat-r'}}" wx:for="{{messageList}}" wx:for-item="item">
<!-- <view class="c-date">2019年3月23日 15:33</view> -->
<view class="message-list">
<view class="avater {{item.type=='R'?'avater-r':''}}">
<image src='{{item.avater}}'></image>
<view class="{{item.type=='R'?'nick-name-r':'nick-name-l'}}" wx:if="{{item.type=='L'}}">{{item.nickName}}</view>
<view class="{{item.type=='R'?'nick-name-r':'nick-name-l'}}" wx:if="{{item.type=='R'}}">{{item.nickName}}</view>
</view>
<view class="chat-con {{item.type=='L'?'chat-con-l':'chat-con-r'}} ">
<rich-text wx:if="{{item.messageType=='txt'}}" nodes="{{item.con}}"></rich-text>
<image class="message-img" mode="widthFix" bindtap="imagePreview" data-src="{{item.con}}" wx:if="{{item.messageType=='img'}}" src="{{item.con}}"></image>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<!-- 消息输入 -->
<view class="message-input">
<input class="{{isShowAdd?'':'showSend'}}" placeholder="请输入内容" type="text" value="{{messageInputVal}}" cursor-spacing="10" bindinput='messageInput' confirm-type="send" bindconfirm="messageSend" />
<button bindtap="messageSend">发送</button>
<image mode="widthFix" class="input-img {{isShowAdd?'':'showAdd'}}" src='../../icon/chat/face1.png' id="face" bindtap="openEmotion"></image>
<!-- 表情文件 -->
<view class="emotion-box" wx:if="{{isEmotion}}">
<swiper class="home-swiper" indicator-dots="true" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-dots="{{indicatorDots}}">
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index<23}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=23&&index<46}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=46&&index<69}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
<swiper-item class="emotion-list">
<block wx:for-items="{{emotionArr}}" wx:key='index' wx:if="{{index>=69&&index<92}}">
<image bindtap="selectEmotion" data-txt="{{item.text}}" src="{{emotionHost+item.name}}.png" class="slide-image" />
</block>
<image src="../../icon/chat/delete.png" bindtap="deleteVal" class="slide-image" />
</swiper-item>
</swiper>
</view>
</view>
</view>
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 100rpx;
height: 100rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
/* 公屏 */
/*轮播控件 - start*/
.home-swiper {
width: 100%;
height: 400rpx;
}
.slide-image {
width: 100%;
height: 100%;
}
/*轮播控件 - end*/
.wrapper {
padding-top: 20rpx;
padding-bottom: 100rpx;
}
.message-list {
margin: 10rpx 30rpx 30rpx;
}
.chat {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
box-sizing: border-box;
}
.chat-con {
padding: 20rpx;
border-radius: 8rpx;
font-size: 30rpx;
color: #333;
position: relative;
}
/* left-message */
.chat-l {
align-items: flex-start;
}
.avater {
width: 90rpx;
height: 90rpx;
position: relative;
}
.avater>image {
width: 100%;
height: 100%;
display: block;
border-radius: 10%;
}
.chat-con-l {
background-color: #fff;
margin-left: 120rpx;
margin-top: -50rpx;
}
.chat-con-l::after {
content: '';
border-width: 20rpx;
border-style: solid;
border-color: transparent #fff transparent transparent;
position: absolute;
top: 18rpx;
left: -28rpx;
}
/* right-message */
.chat-r {
align-items: flex-end;
}
.chat-con-r {
background-color: #7dca4a;
margin-right: 120rpx;
margin-top: 35rpx;
}
.chat-con-r::after {
content: '';
border-width: 20rpx;
border-style: solid;
border-color: transparent transparent transparent #7dca4a;
position: absolute;
top: 18rpx;
right: -28rpx;
}
.avater-r {
float: right;
}
/* input-message */
.message-input {
position: fixed;
bottom: 0;
width: 100%;
background-color: #efefef;
padding: 20rpx 0 0;
z-index: 99;
}
.message-input>input {
font-size: 30rpx;
border: solid #ddd 1rpx;
width: 71%;
min-height: 60rpx;
height: 100%;
margin-left: 20rpx;
padding: 5rpx 10rpx;
border-radius: 8rpx;
margin-bottom: 15rpx;
color: #333;
background-color: #fff;
}
.showSend{
width:65% !important;
}
.showAdd {
left:73% !important;
}
.message-input>button {
width: 100rpx;
height: 60rpx;
background-color: #7dca4a;
font-size: 28rpx;
color: #fff;
margin-top: -82rpx;
float: right;
margin-right: 20rpx;
padding: 0;
line-height: 60rpx;
}
.input-m {
width: 500rpx;
max-width: 500rpx;
height: 70rpx;
max-height: 70rpx;
border: solid red 1px;
margin-left: 80rpx;
position: relative;
display: inline-block;
top: -80rpx;
overflow-y: scroll;
background-color: #fff;
}
.c-date {
font-size: 26rpx;
color: #999;
padding: 10rpx 0 30rpx;
text-align: center;
width: 100%;
}
.message-input .input-img {
width: 60rpx;
height: 60rpx;
}
#rec {
position: absolute;
top: 26rpx;
left: 10rpx;
}
#face {
position: absolute;
top: 20rpx;
left: 80%;
}
#add {
position: absolute;
top: 20rpx;
left: 90%;
}
.nick-name-l {
position: absolute;
top: -2%;
left: 138%;
z-index: 2;
font-size: 24rpx;
color: #666;
width: 200rpx;
}
.nick-name-r {
position: absolute;
top: -10%;
right: -25%;
z-index: 2;
font-size: 24rpx;
color: #666;
width: 200rpx;
}
.media-img {
width: 120rpx;
height: 120rpx;
display: inline-block;
}
.media-box {
background-color: #f0f0f0;
border-top: solid #e1e1e1 1rpx;
}
.media-list {
width: 150rpx;
height: 150rpx;
padding: 10px;
text-align: center;
display: inline-block;
}
.media-list>view {
font-size: 26rpx;
color: #666;
}
.emotion-box {
background-color: #f0f0f0;
padding-bottom: 40rpx;
border-top: solid #e1e1e1 1rpx;
}
.emotion-list {
margin: 20rpx auto 0;
text-align: center;
}
.emotion-list>image {
width: 55rpx;
height: 55rpx;
margin: 15rpx 30rpx;
}
.emotion-padd {
padding-bottom: 77% !important;
}
.media-padd{
padding-bottom: 42% !important;
}
.message-img {
width: 300rpx;
height: 200rpx;
display: inline-block;
vertical-align: middle;
}
// pages/key/matchTest/matchTest.js
// pages/key/matchTest/matchTest.js
var item_list = [];
var choiceString = [];
var config=wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 系统配置:主要用于置底页面设置 step1
*/
windowHeight: '',
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
matchType: "", // 学习类别
isStudyDone: false, //是否已经完成该项学习
/*
jscat 20200303
注意upload和显示的差异
显示永远是当前题的questionId
而upload永远是下一题的item_index, 正好跟数量对应
也就是show question和comment需要从questionId来获取
*/
/* 问题列表 */
item_list : [],
item_index : 0 , //注意和questionId的差异,指向下一个item的index, 在onTypeNext里增加
score : 0, // 表示回答正确的分数
questionId : 0, //注意和item_index的差异,指向当前题的questionId,在点击onTypeNext之前都出于未保存状态
item_index_done : 0, //表示已经完成的(经过onClick)的题数
/* 某一个问题的当前选项 */
current_item: 10, /* 指向当前button的item */
hidden_type: 1, /* 表明icon的可见程度,0表示可见 1=hidden默认 */
button_disabled : 0, /* 表明button的可用程度, 0表示可用,1表示不可用*/
operateResult: "", // default "/icon/icon_success.png"
/* 数据初始化 */
// answer: 5,
// questionId: "",
// questionName: "",
// choiceString: []
// 接受从quiz-info来的参数
quizParam : {}, // activity_id, member_id, quiz, point, member_name, title
// 从tbl_quiz来的参数
quizInfo : {}, // questionId, questionName, answer
// 最后生成的结果
quizResult : {}, // num_valid, num_total, points
/* 评论 */
bGetCommentOp : false,
comment_hidden_type : 1,
commentList : [],
likeDict : {},
inputContentValue: null,
isHideLoadMore: false,
pageIndex: 1, //分页搜索的page index
inputHolderValue : "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
autoFocus: true, //对话框默认为focus
/* 模态框 */
showModal: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
matchType: "daily", // 学习类型
})
}
var quizParam = _this.__data__.quizParam
var quiz_string = ""
if (Object.keys(quizParam).length==0 && options.activity_id != "")
{
quizParam['activity_id'] = options.activity_id;
quizParam['quiz'] = options.quiz;
quizParam['point'] = options.point;
quizParam['member_id'] = options.member_id;
quizParam['member_name'] = options.member_name;
quizParam['title'] = options.title;
quiz_string = options.quiz;
}
//随机获取10条数据的id
/**
* 系统配置:主要用于置底页面设置 step2
*/
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight,
quizParam : quizParam
})
/* end */
if (_this.__data__.item_list.length == 0)
{
if(quiz_string != "")
{
_this.getQuiz(quiz_string);
}
else
{
_this.getRand();
}
_this.setData({
isStudyDone: false, //每次进来从新操作
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var isHideLoadMore = _this.__data__.isHideLoadMore;
var objectId = _this.__data__.questionId;;//获取index值
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//避免下拉更新发生在之前
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == true) {
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getComment(1, pageIndex, 4, objectId);
}, 1000)
}
else {
console.log('没有更多')
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/*
* 动态的高亮选中的button
* disable未选中的button
*/
onClick: function (e) {
var _this = this;
let cuu = e.target.id;//获取index值
console.log(cuu);
var operateResult = "";
var answer = _this.__data__.quizInfo.answer;
var score = _this.__data__.score;
//拿到已经回答的题目数
var item_index_done = _this.__data__.item_index_done;
if(cuu == answer-1)
{
operateResult = "/icon/icon_success.png"
score = score + 1
}
else{
operateResult = "/icon/icon_fail.png"
}
var selected = parseInt(cuu) + 1
console.log("current choice is: \"" + selected + "\"");
console.log("correct answer is: \"" + answer + "\"");
console.log("current button_disabled is: \"" + 1 + "\"");
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
//优先获取comment
//避免使用onGetComment, 因为此处没有onGetComment的点击事件
var bGetCommentOp = _this.__data__.bGetCommentOp
if (bGetCommentOp == false || bGetCommentOp == undefined) {
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, _this.data.questionId)
}
//ps: jscat 20200303 最后重置状态
_this.setData({
item_index_done: parseInt(item_index_done)+1,
current_item: cuu,
operateResult : operateResult,
hidden_type : 0,
button_disabled : 1,
score : score,
comment_hidden_type : 0, /* 点击按钮之后,评论自动弹出 */
})
},
/* 点击 进入下一题 */
// item_index要增加,需要在进入下一题时候进行
onTypeNext: function (e) {
var _this = this;
//拿到下一个item_index
var current_index = _this.__data__.item_index;
//指向下一题, 获取数据
current_index = current_index + 1
/*
未按下button,在"查看评论"和"隐藏评论"中切换
已按下button,则直接显示评论,同时显示"下一题"
*/
//重置数据状态
_this.setData({
item_index: current_index,
hidden_type: 1,
button_disabled: 0,
current_item: 10, /* 指向当前button的item */
comment_hidden_type: 1, /* 默认隐藏comment */
commentList: [], /* 重置comment列表 */
bGetCommentOp: false,
inputContentValue: "", //清除提交内容
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
})
//功能实现
//逻辑判断
//超过了10题(或者指定数量的题目),溢出了,直接进入doneTest
if(current_index >= _this.__data__.item_list.length)
{
_this.doneTest()
}
else
{
config.debug==1?console.log("===onTypeNext item_index \"" + current_index + "\""):""
var questionId = _this.__data__.item_list[current_index]
_this.getData(questionId)
}
//载入页面
getCurrentPages()[getCurrentPages().length - 1].onLoad()
},
// 获取随机数据
getRand : function (e) {
var _this = this;
wx.request({
url: config.rand_url,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
console.log(res.data);
var itemList = [];
for (var k = 0; k < res.data.totalCount; k++) {
itemList.push(res.data.data[k].id)
}
item_list = itemList
_this.setData({
item_list: item_list,
item_index: 0 //初始化item_index
})
var wid = itemList[0]
_this.getData(wid)
}
})
},
// 获取指定quiz_string数据
getQuiz : function (quiz_string) {
var _this = this;
var itemList = quiz_string.split("::")
_this.setData({
item_list: itemList,
item_index: 0 //初始化item_index
})
var wid = itemList[0]
_this.getData(wid)
},
// 获取真实数据
getData: function (questionId) {
var _this = this;
config.debug==1?console.log("===getData questionId is: \""+questionId+"\""):""
wx.request({
url: config.data_url + '?questionId=' + questionId,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示上传成功(可以在阿里云服务器查看上传的图片)
console.log(res.data);
var result = {}
result["questionId"] = res.data.data["0"].id
result["questionName"] = res.data.data["0"].questionName
result["answer"] = res.data.data["0"].answer
var list = res.data.data["0"].choiceString.split("::")
for (var j = 0; j < list.length; j++) {
var str = "A";
list[j] = (String.fromCharCode(str.charCodeAt()+j)) +". "+ list[j];
}
result["choiceString"] = list
_this.setData({
quizInfo : result,
questionId: questionId,
})
}
}
})
},
/*
如果完成了指定的题目
1. 结算成绩
2. 存入数据库 tbl_match
3. 跳转到 /quiz-result.wxml 页面
*/
doneTest: function (res) {
var _this = this
// 1. 结算成绩
var quizResult = {}
var num_valid = _this.__data__.score
var num_total = _this.__data__.item_list.length
var points = num_valid / num_total
var scores = parseFloat(_this.__data__.quizParam["point"])
var match_point = parseFloat(points * scores).toFixed(1)
// var match_result = num_valid + "/" + num_total
// 2. 存入数据库 tbl_match, 并且拿到 match_id
_this.uploadMatch(match_point, num_valid, num_total);
// 3. 跳转到 /quiz-result.wxml 页面
// matchId
// 成绩 quizResult
// 信息 quizParam, member_name, title
// _this.toResult()
},
// 这题有问题; report bug
onReportBug: function (e) {
var _this = this
/* 调用接口新增bug记录 2019-12-13
通过x-www-form-urlencoded 格式调用,可以兼容swagger的前端请求
*/
config.debug==1?console.log("===onReportBug questionId is: " + _this.__data__.questionId):""
wx.request({
url: config.bug_url,
method: 'POST',
data: {
questionId: _this.__data__.questionId,
userId: _this.__data__.nyxCode, //获取userid
userComment : "格式错误"
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType : "json",
success: function (res) {
console.log(res.data);
var score = _this.__data__.score + 1;
//拿到已经回答的题目数
var item_index_done = parseInt(_this.__data__.item_index_done) + 1 //用于更新已完成题数
_this.setData({
score: score,
button_disabled : 1,
item_index_done : item_index_done,
})
config.debug == 1 ? console.log("===onBug score_" + score + "_quizDone_" + item_index_done) : ""
//设置为已更新状态
wx.setStorageSync('updateStatus', true)
/*通过弹窗方式确认 */
// begin showModal
wx.showModal({
title: '谢谢你反馈问题',
content: '此题已判定为正确',
showCancel: false, // 将cancel按钮disable掉
confirmText: '下一题',
success(res) {
if (res.confirm) {
// 用户点击了确定属性的按钮,于是跳转到tabbar /pages/key/key
// wx.navigator 和 wx.redirectto都无法跳转到tabbar
console.log("showModal success");
console.log(res)
}
},
fail: function (res) {
console.log("showModal failed");
console.log(res)
},//接口调用失败的回调函数
complete: function (res) {
console.log("showModal complete");
console.log(res)
},//接口调用结束的回调函数(调用成功、失败都会执行)
}) // end showModal
//载入页面
_this.onTypeNext();
} // end success
}) // end wx.request
console.log("show modal");
},
/*
* 用户自定义函数
* 查看评论
* 输入值为quiz id
* 默认返回5条
*/
// 获取评论 per quiz id
getComment(scrollType, pageNum, pageCount, objectId)
{
var _this = this;
var strUrl = "";
if (pageNum != 0 && pageCount != 0) {
strUrl = config.msg_query_url + "?pageCount=" + pageCount
+ "&pageNum=" + pageNum
+ "&objectId=" + objectId
}
config.debug==1?console.log("===getComment strUrl " + strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.data.resultCode == 200) {
//表示查询成功
console.log(res.data);
var list = res.data.data
var bisHideLoadMoreType = false;
if (list.length < pageCount) {
bisHideLoadMoreType = true;
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var commentList = _this.__data__.commentList;
list = commentList.concat(list)
}
_this.setData({
commentList: list,
isHideLoadMore: bisHideLoadMoreType,
pageIndex: pageNum + 1,
bGetCommentOp: true,
})
}
}
})
},
/*
*/
onGetComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId;//获取index值
var commentList = _this.__data__.commentList
var bGetCommentOp = _this.__data__.bGetCommentOp
config.debug==1?console.log("===onGetComment objectId is: \"" + objectId + "\""):""
if (bGetCommentOp == false || bGetCommentOp == undefined)
{
//获取第一页数据,每页四条
_this.getComment(0, 1, 4, objectId)
}
_this.setData({
comment_hidden_type: _this.data.comment_hidden_type==1?0:1,
})
},
/*
* 提交评论
*/
submitComment: function (objectId, objectName, useridFrom, useridTo, content, contentTo)
{
var _this = this
var strUrl = config.msg_add_url
config.debug==1?console.log("===submitComment strUrl_" + strUrl + "_objectId_"+objectId
+ "_useridFrom_"+useridFrom
+ "_useridTo_" + useridTo
+ "_content_" + content
+ "_contentTo_" + contentTo
):""
wx.request({
url: strUrl,
method: 'POST',
data: {
commentType: '每日一学',
objectId: objectId,
objectName: objectName,
useridFrom: useridFrom,
useridTo : useridTo,
content :content,
contentTo: contentTo,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if (res.data.resultCode == 200) {
//表示提交成功
console.log(res.data);
var list = res.data.data['0']
var commentList = _this.data.commentList
commentList.push(list)
_this.setData({
commentList: commentList,
inputContentValue : "", //清除提交内容
inputHolderValue: "评论才叫真诚" ,
inputUseridToValue: "",
inputContentToValue: "",
})
}
}
})
},
onSubmitComment: function (e) {
var _this = this;
var objectId = _this.__data__.questionId //获取index值
var objectName = _this.__data__.quizInfo.questionName //获取index值
let content = e.detail.value.content;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var useridTo = e.detail.value.useridTo;//获取reply id
var contentTo = e.detail.value.contentTo;//获取reply content
if(content != undefined && content != "")
{
_this.submitComment(objectId, objectName, useridFrom, useridTo, content, contentTo)
}
},
/*
* 提交点赞
*/
submitLike:function(commentId)
{
var _this = this;
var strUrl = config.msg_like_url + '?commentId=' + commentId
config.debug==1?console.log("===submitLike strUrl is: " +strUrl):""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
var commentList = _this.data.commentList
var likeDict = _this.data.likeDict
for (var j = 0; j < commentList.length; j++) {
if(commentList[j].commentId == commentId)
commentList[j].numLike = parseInt(commentList[j].numLike) + 1
likeDict[commentId] = 1
}
_this.setData({
likeDict: likeDict,
commentList : commentList,
})
}
}
})
},
onSubmitLike: function (e) {
var _this = this;
let commentId = e.currentTarget.dataset.commentId;//获取评论内容
var useridFrom = _this.__data__.nyxCode;//获取userid
var likeDict = _this.__data__.likeDict;//获取userid
if(likeDict[commentId] == 0 || likeDict[commentId] == undefined)
{
_this.submitLike(commentId)
}
},
/*
* 回复里@某人
* 先通过dataset的方式将数据存入setData
* 然后通过前端的hidden input存入具体的值
* 最后在onSubmitComment里同过e.detail.value获取
*/
onReplyUser : function (e)
{
var _this = this;
let nickname = e.currentTarget.dataset.nickname; //获取nickname的值
let useridTo = e.currentTarget.dataset.userid; //获取useridTo的值
let contentTo = e.currentTarget.dataset.contentTo; //获取contentTo的值
_this.setData({
inputHolderValue: "@" + nickname,
inputUseridToValue: useridTo,
inputContentToValue: contentTo,
autoFocus: true,
})
},
onCancelReply: function (e) {
var _this = this;
var content = e.detail.value
if (content == "" && _this.__data__.inputUseridToValue != "")
{
this.setData({
inputHolderValue: "评论才叫真诚",
inputUseridToValue: "",
inputContentToValue: "",
});
}
},
/*
更新test的记录到tbl_match表
*/
uploadMatch(match_point, num_valid, num_total){
var _this = this;
var strUrl = config.match_add_item_url
config.debug == 1?console.log("===uploadMatch strUrl "+strUrl+"_point_"+match_point):""
wx.request({
url: strUrl,
method: 'POST',
data: {
activityId: _this.__data__.quizParam["activity_id"],
memberId: _this.__data__.quizParam["member_id"],
userId: _this.data.nyxCode,
matchPoint: match_point,
matchResult: num_valid + "/" + num_total,
},
header: {
"Content-Type": "application/x-www-form-urlencoded",
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if ( res.data.resultCode == 200 ) {
//表示提交成功
console.log("成绩记录成功");
//得到matchId
var matchList = res.data.data;
var match_id = matchList.length >= 1 ? matchList[0].matchId : ""
_this.toResultPage(match_id, num_valid, num_total, match_point)
}
}
})
},
  // 外面的弹窗
  btn: function () {
    this.setData({
      showModal: true
    })
  },
 
  // 禁止屏幕滚动
  preventTouchMove: function () {
  },
 
  // 弹出层里面的弹窗
  ok: function () {
    this.setData({
      showModal: false
    })
  },
onCheckPoints: function (e) {
wx.navigateTo({
url: "/pages/my/my-points/my-points"
})
},
//跳转到竞答结果页 quiz-result.wxml
toResultPage(match_id, num_valid, num_total, match_point) {
// matchId
// 成绩 quizResult
// 信息 quizParam, member_name, title
// toResult
var _this = this;
var url = "/pages/activity/quiz-result/quiz-result?"
+ "&match_id=" + match_id
+ "&member_name=" + _this.__data__.quizParam["member_name"]
+ "&title=" + _this.__data__.quizParam["title"]
+ "&num_total=" + num_total
+ "&num_valid=" + num_valid
+ "&points=" + match_point
wx.navigateTo({
url: url
})
},
})
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "活动竞答"
}
\ No newline at end of file
<!--pages/key/matchTest/matchTest.wxml-->
<!--pages/key/matchTest/matchTest.wxml-->
<wxs module="tutil" src="./../../../utils/date.wxs"></wxs>
<view class="page bottom_fixed_page" style="min-height:{{ windowHeight }}px">
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModal}}">
<!-- 二维码或其他图片 -->
<view class="text">
<text style="color:#666666">恭喜你获得 </text>
<text style="font-weight:bold;">10</text>
<text style="color:#666666"> 积分</text>
</view>
<view class="weui-flex weui-width">
<view class="weui-flex__item"><view class="placeholder-modal">
<view class="items" bindtap="onCheckPoints">
<image src="../../../icon/activity/points.png"></image>
<text>查看积分</text>
</view>
</view></view>
<view class="weui-flex__item"><view class="placeholder-modal">
<view class="items">
<button class="share" open-type="share">
</button>
<image src="../../../icon/activity/share.png"></image>
<text>分享给好友</text>
</view>
</view></view>
</view>
    <view bindtap="ok" class="ok">取消</view>
</view>
<!-- end 遮罩层 -->
<view class="weui-flex">
<view class="weui-flex__item"><view class="placeholder">题目:{{item_index+1}}/10题</view></view>
<view class="weui-flex__item"><view class="placeholder">分数:{{score}}</view></view>
</view>
<view class="weui-loadmore" hidden="{{!isStudyDone}}">
<view class="weui-loadmore__tips">好牛哦, 恭喜你已完成本次学习 {{'>'}}_{{'<'}} </view>
</view>
<view hidden="{{isStudyDone}}"> <!-- start of isStudyDone flag -->
<view class="page__hd">
<!-- 标题 -->
<view class="page__desc question-name">{{quizInfo.questionName}}</view>
</view>
<view class="page__bd " wx:for-items="{{quizInfo.choiceString}}" >
<button class="weui-btn button-sp-area {{current_item == index?'btn-selected':'btn-not-selected'}}" bind:tap="onClick" disabled="{{button_disabled==1?true:false}}" id="{{index}}">
<image src="{{operateResult}}" style="vertical-align:middle;width:60rpx;height:60rpx" hidden="{{hidden_type==1?true:(current_item == index?false:true)}}" />
{{item}}
</button>
</view>
<view class="page__hd" hidden="{{button_disabled==0}}">
<!-- 优化: 直接显示正确答案 -->
<view class="page__desc">推荐答案: {{tutil.formatAnswer(quizInfo.answer)}}</view>
</view>
<!-- <text>\n</text> -->
<view class="weui-flex">
<view class="weui-flex__item" bindtap="{{button_disabled==0?'onGetComment':'onTypeNext'}}">
<view class="placeholder-button">
<image src="{{button_disabled==0?(comment_hidden_type==1?'/icon/matchTest/checkComment.png':'/icon/matchTest/checkComment.png'):'/icon/matchTest/next.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />
{{button_disabled==0?(comment_hidden_type==1?"查看评论":"隐藏评论"):"下一题"}}</view>
</view>
<view class="weui-flex__item"><view class="{{button_disabled==0?'placeholder-button':'placeholder-button-disabled'}}" bind:tap="onReportBug">
<image src="{{button_disabled==0?'/icon/matchTest/question.png':'/icon/matchTest/question_0.png'}}" style="vertical-align:middle;width:60rpx;height:60rpx" />这题有问题</view>
</view>
</view>
<!-- 评论区 -->
<view class="page__bd" hidden="{{comment_hidden_type==1?true:false}}">
<view class="weui-panel weui-panel_access" wx:for="{{commentList}}" wx:key="commentList">
<view class="weui-panel__bd weui-media-box weui-media-box_appmsg" bind:tap="onReplyUser" data-nickname="{{item.nicknameFrom}}" data-userid="{{item.useridFrom}}" data-content-to="{{item.content}}">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
<image class="weui-media-box__thumb" src="{{item.avatarUrlFrom}}" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell" style="height:20rpx;text-align:left;padding-left:0rpx;margin:0rpx">
<view class="weui-cell__bd" style="text-align:left;padding:rpx;margin:0rpx">
<!-- start id+日期 -->
<view class="workbench">
<view class="items weui-media-box__desc">
<text>{{item.nicknameFrom}}</text>
<text class="bottom">{{tutil.formatDate_ymd(item.createDatetime)}}</text>
</view>
</view>
<!-- end id+date -->
</view>
<!-- start 点赞数 + 图标 -->
<view class="weui-media-box__desc" style="font-size:30rpx">
{{item.numLike}}
<view bindtap="onSubmitLike" data-comment-id="{{item.commentId}}">
<image src="/icon/matchTest/like.png" style="width:30rpx;height:30rpx" />
</view>
</view>
<!-- end 点赞数 + 图标 -->
</view>
</view>
<view class="weui-media-box__desc">{{item.nicknameTo==null?"":"@"+item.nicknameTo+" "}}{{item.content}}</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 class="page__bd page__bd_spacing text-align: center;" style="text-align: center;">
-- the end --
</view> -->
<!-- 评论栏置底 -->
<view class="page__hd bottom_fixed_view" style="position:fixed; bottom:0;width: 750rpx;">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__ft">
<form catchsubmit="onSubmitComment" >
<view class="weui-cell weui-cell_access">
<view class="weui-cell__bd">
<input class="weui-input" type="text" name="content" focus="{{autoFocus}}" value='{{inputContentValue}}' pattern="" placeholder="{{inputHolderValue}}" bindblur="onCancelReply" />
<input type="text" style="display:none" name="useridTo" value='{{inputUseridToValue}}'/>
<input type="text" style="display:none" name="contentTo" value='{{inputContentToValue}}'/>
</view>
<view class="weui-cell__ft">
<button type="default" formType="submit">发送</button>
</view>
</view>
</form>
</view>
</view>
</view>
</view>
</view> <!-- end of isStudyDone flag -->
</view>
page{background-color:#EDEDED;}
page{background-color:#EDEDED;}
.button-sp-area{
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
padding-top: 0px;
margin-left: 0rpx;
padding-left: 100rpx;
text-align:left;
line-height: 60rpx; /*缩小行间距 */
font-size: 36rpx;
}
.mini-btn{
margin: 0 4px;
}
.btn-selected{
/* background-color: #ffffff; */
color: rgb(105, 72, 16);
border-color: #00ff00;
border-style:solid;
border-width:2px;
}
.btn-not-selected{
/* background-color: #111111; */
color: rgb(105, 72, 16);
}
.icon-success{
color: greenyellow;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.icon-cancel{
color: red;
size: 21px;
margin-top: 20rpx; /* 用于表示button与button之间的间隔 */
}
.text{
font-size: 6px;
line-height: 0.5em;
}
.container {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
line-height: 80rpx;
height: 100rpx;
}
.left {
color: #888;
}
.right {
color: #ff0000;
}
/* 题目分数行 */
.placeholder{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
font-size: 36rpx;
/* color: rgba(0,0,0,.3); */
}
/* 题目行 */
.question-name{
font-size: 36rpx;
}
.placeholder-button{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(198, 133, 36);
font-size: 34rpx;
font-weight: bold;
}
.placeholder-button-disabled{
margin: 5px;
padding: 0 10px;
text-align: center;
background-color: #F7F7F7;
height: 2.3em;
line-height: 2.3em;
color: rgba(0,0,0,.3);
font-size: 35rpx;
font-weight: bold;
pointer-events: none;
}
/**
* 系统配置:主要用于置底页面设置 step3
*/
.bottom_fixed_page{
position: relative;
padding-bottom: 56px; /* 需要定位的盒子的高度 */
box-sizing: border-box;
}
.bottom_fixed_view {
position: fixed;
bottom:0;
}
/*
id+date css
*/
.workbench{
font-size: 25rpx;
padding-bottom: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items{
width: 200rpx;
flex:1;
text-align: left;
}
.workbench .items text{
display: block;
text-align: left;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
font-size: 25rpx;
display: block;
text-align: left;
margin-top: 3rpx;
}
/* end */
/* 加载更多 */
.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;
}
/* start - 小程序自定义弹框css */
/* 遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
/* 弹出层 */
.modalDlg{
width: 70%;
height: 360rpx;
position: fixed;
top: 50px;
left: 0;
right: 0;
z-index: 9999;
margin: 0 auto;
background-color: #fff;
border-radius:5px;
display: flex;
flex-direction: column;
align-items: center;
}
/* 弹出层里面的图片 */
/* 弹出层里面的按钮 */
.ok{
width: 100%;
height: 2rpx;
background: #ccc;
text-align: center;
font-size: 38rpx;
color: #666666;
}
/* 弹出层里面的文字 */
.text{
text-align: center;
font-size: 38rpx;
color: rgb(255, 0, 0);
width: 80%;
/* margin: 20rpx; */
padding: 30rpx;
}
/* 图片+文字 */
.weui-width{
width: 80%;
}
.placeholder-modal{
margin: 0px;
text-align: center;
vertical-align: middle;
line-height: 2.3em;
background-color: #fff;
}
/* end - 小程序自定义弹框css */
.items{
width: 100%;
display: flex;
flex-direction: column;
text-align: center;
align-items: center;
}
.items image{
width: 80rpx;
height: 80rpx;
margin-top: 10rpx;
font-size: 0;
}
.items text{
/* display: block; */
text-align: center;
padding: 0rpx;
font-size: 30rpx;
color:#666666
}
/* 分享按钮 */
.share {
position: absolute;
background-size: 50rpx 50rpx;
opacity: 0;
border:none;
}
\ No newline at end of file
//logs.js
//logs.js
var util = require('../../utils/util.js')
Page({
data: {
logs: []
},onShareAppMessage: function () {
return {
title: '自定义分享标题',
path: '/page/user?id=123',
success: function(res) {
// 分享成功
},
fail: function(res) {
// 分享失败
}
}
},
onLoad: function () {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(function (log) {
return util.formatTime(new Date(log))
})
})
},
fenxiang:function(){
wx.showShareMenu({
success:function(res){
console.log(res);
}
})
}
})
{
{
"navigationBarTitleText": "查看启动日志"
}
\ No newline at end of file
<!--logs.wxml-->
<!--logs.wxml-->
<view class="container log-list">
<button bindtap="fenxiang">
点我
</button>
</view>
.log-list {
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}
// pages/my/my-orders/my-orders.js
// pages/my/my-orders/my-orders.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
members : [],
//活动列表
orderInfo : {}, // 活动信息
orderItems: [], // 子活动列表
/* 数量加减 */
totalPrice: 0,
totalCount: 0,
curIndex: 0,
selected_all : 0,
// 消息提示框的遮罩层
showToast: false,
// 支付按钮可用状态
canClick: true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
wx.setNavigationBarTitle({
title: '订单结算',
})
//step1: 初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members: wx.getStorageSync('members'),
})
}
//step2: 获取上一页面传入的数据
var orderInfo = _this.__data__.orderInfo || {}
var orderItems = []
var curIndex = 0
var totalPrice = 0.0
var totalCount = 1
if (Object.keys(orderInfo).length==0 && options.title != "")
{
orderInfo['activity_id'] = options.activity_id;
orderInfo['product_image'] = options.product_image
orderInfo['member_name'] = options.member_name
orderInfo['title'] = options.title
curIndex = options.curIndex
orderItems = JSON.parse(options.products_string)
orderInfo['item_height'] = 100 + 120*(orderItems.length) + 30 * (orderItems.length+1)
for(var i=0; i<orderItems.length; i++)
{
if(curIndex == i)
{
orderItems[i]['quantity'] = 1
orderItems[i]['defaultStatus'] = 1
totalPrice = orderItems[i]['unitPrice']
totalPrice = totalPrice.toFixed(2)
}
else
{
orderItems[i]['quantity'] = 0
orderItems[i]['defaultStatus'] = 0
}
}
}
_this.setData({ orderInfo })
_this.setData({ orderItems })
_this.setData({ curIndex })
_this.setData({ totalPrice })
_this.setData({ totalCount })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
/* 加数
*/
addCount: function (e) {
var _this = this;
console.log("===刚刚您点击了加1");
var orderItems = _this.data.orderItems;
var totalPrice = 0;
var totalCount = 0;
var selected_all = _this.data.selected_all;
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var index = e.currentTarget.dataset.index
// 总数量+1
if (orderItems[index]['quantity'] < 1000) {
orderItems[index]['quantity'] = orderItems[index]['quantity']+1;
orderItems[index]['defaultStatus'] = 1;
}
// 如果所有 商品的defaultStatus==1, 则selected_all=1
// 因为是addCount, 所以假定selected_all为1
selected_all = orderItems[index]['defaultStatus']
for(var i=0; i< orderItems.length; i++)
{
selected_all = orderItems[i]['defaultStatus'] == 1?selected_all && 1 : 0
totalPrice = orderItems[i]['defaultStatus'] == 1 ? _this.add(totalPrice, _this.mul(orderItems[i]['quantity'], orderItems[i]['unitPrice'])) : totalPrice
totalCount = orderItems[i]['defaultStatus'] == 1?totalCount+orderItems[i]['quantity']:totalCount
}
totalPrice = totalPrice.toFixed(2)
// 将数值与状态写回
_this.setData({
orderItems,
totalPrice,
totalCount,
selected_all,
});
},
/* 减数 */
delCount: function (e) {
var _this = this;
console.log("刚刚您点击了减1");
var orderItems = _this.data.orderItems;
var totalPrice = 0;
var totalCount = 0;
var selected_all = _this.data.selected_all;
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var index = e.currentTarget.dataset.index
// 商品总数量-1
if (orderItems[index]['quantity'] > 1) {
orderItems[index]['quantity'] = orderItems[index]['quantity'] - 1;
orderItems[index]['defaultStatus'] = 1;
}
// 如果减到0
// 当前商品的defaultStatus = 0
// 所有商品的selected_all = 0
else if(orderItems[index]['quantity'] == 1)
{
orderItems[index]['quantity'] = 0;
orderItems[index]['defaultStatus'] = 0;
selected_all = 0;
}
//计算totalPrice和totalCount
for(var i=0; i< orderItems.length; i++)
{
totalPrice = orderItems[i]['defaultStatus'] == 1 ? _this.add(totalPrice, _this.mul(orderItems[i]['quantity'], orderItems[i]['unitPrice'])) : totalPrice
totalCount = orderItems[i]['defaultStatus'] == 1?totalCount+orderItems[i]['quantity']:totalCount
}
totalPrice = totalPrice.toFixed(2)
// 将数值与状态写回
_this.setData({
orderItems,
totalPrice,
selected_all,
totalCount,
});
},
//加法
add : function (arg1, arg2) {
var r1, r2, m;
try {
r1 = arg1.toString().split(".")[1].length
} catch (e) {
r1 = 0
}
try {
r2 = arg2.toString().split(".")[1].length
} catch (e) {
r2 = 0
}
m = Math.pow(10, Math.max(r1, r2))
return (arg1 * m + arg2 * m) / m
},
//减法
sub : function (arg1, arg2) {
var _this = this;
return _this.add(arg1, -arg2);
},
//乘法
mul : function (arg1, arg2) {
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
try {
m += s1.split(".")[1].length
} catch (e) { }
try {
m += s2.split(".")[1].length
} catch (e) { }
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
},
//除法
div : function (arg1, arg2) {
var t1 = 0, t2 = 0, r1, r2;
try {
t1 = arg1.toString().split(".")[1].length
} catch (e) { }
try {
t2 = arg2.toString().split(".")[1].length
} catch (e) { }
r1 = Number(arg1.toString().replace(".", ""))
r2 = Number(arg2.toString().replace(".", ""))
return (r1 / r2) * pow(10, t2 - t1);
},
// 单个商品 选择按钮
// rt1: 改变多选框状态 orderItems[i]['defaultStatus']: true || false
// rt2: 同步更新selected_all
// rt3: 同步改变totalPrice
// rt4: jscat 20200913, 如果quantity==0, 选中之后则增加为1,选中状态设置为1
radioTap: function(e){
var _this = this
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var dataId = e.currentTarget.dataset.id
var orderItems = _this.data.orderItems
var selected_all = _this.data.selected_all
var totalPrice = 0;
var totalCount = 0;
// 如果quantity==0, 则defaultStatus=0, selected_all=0
orderItems[dataId].defaultStatus = orderItems[dataId].defaultStatus==1 ? 0 :
(orderItems[dataId]['quantity']>0 ? 1 : 0)
//rt4: 如果quantity==0, 选中之后则增加为1
//点击即反馈 原则
if(orderItems[dataId]['quantity'] == 0)
{
orderItems[dataId]['quantity'] = 1
orderItems[dataId].defaultStatus = 1
}
//确定selected_all, totalPrice, totalCount的值
selected_all = orderItems[dataId].defaultStatus
for(var i=0; i<orderItems.length; i++)
{
selected_all = orderItems[i]['defaultStatus'] == 1 ? selected_all && 1 : 0
totalPrice = orderItems[i].defaultStatus == 0 ? totalPrice :
_this.add(totalPrice, _this.mul(orderItems[i]['quantity'], orderItems[i]['unitPrice']))
totalCount = orderItems[i].defaultStatus == 0 ? totalCount : totalCount + orderItems[i]['quantity']
}
totalPrice = totalPrice.toFixed(2)
_this.setData({
orderItems,
selected_all,
totalCount,
totalPrice,
})
},
// 全选按钮
// 改变多选框状态 orderItems[i]['defaultStatus']: true || false
// 同步改变totalPrice
radioChangeAll: function (e){
var _this = this
var orderItems = _this.data.orderItems
var selected_all = _this.data.selected_all
var totalPrice = 0;
var totalCount = 0;
// 改变状态
selected_all = selected_all == 1 ? 0 : 1
// 改变后计算
for(var i=0; i< orderItems.length; i++)
{
orderItems[i]['defaultStatus'] = selected_all == 1 ? (orderItems[i]['quantity']>0 ? 1 : 0) : 0
totalPrice = selected_all == 0 ? 0 :
_this.add(totalPrice, _this.mul(orderItems[i]['quantity'], orderItems[i]['unitPrice']))
totalCount = orderItems[i].defaultStatus == 0 ? totalCount : totalCount + orderItems[i]['quantity']
}
totalPrice = totalPrice.toFixed(2)
_this.setData({
orderItems,
selected_all,
totalCount,
totalPrice,
})
},
// 跳转到支付页面
// 目前暂时跳转到 /page/my/my.wxml
toPay: function (e) {
var _this = this;
var strUrl = config.order_add_url
config.debug == 1?console.log("===uploadOrder strUrl "+strUrl):""
//先设置支付按钮不可点击
var canClick = false;
_this.setData({ canClick })
// 订单处理, 添加到订单项的条件
// 1. 商品中某一类别的quantity>=1,
// 2. defaultStatus==1
var items = _this.data.orderItems
var orderItems = []
for(var i=0; i<items.length;i++)
{
if(items[i].quantity >= 1 && items[i].defaultStatus == 1)
{
orderItems.push(items[i])
}
}
wx.request({
url: strUrl,
method: 'POST',
data: {
activityId: _this.__data__.orderInfo["activity_id"],
userId: _this.data.nyxCode,
productImage: _this.__data__.orderInfo['product_image'],
totalPrice: _this.data.totalPrice,
totalCount: _this.data.totalCount,
orderItemString: JSON.stringify(orderItems),
},
header: {
'content-type': 'application/x-www-form-urlencoded',
'Cookie': wx.getStorageSync('cookieKey'),
},
dataType: "json",
success: function (res) {
if ( res.data.resultCode == 200 ) {
//表示提交成功
console.log("===订单上传成功");
//重置数据
//设置支付按钮可点击
var canClick = true;
_this.setData({ canClick })
//回到首页
_this.toHome();
}
else if(res.data.resultCode == '000601')
{
//表示重复提交
console.log("===订单重复提交触发");
//重置数据
//设置支付按钮可点击
var canClick = true;
var showToast = true;
_this.setData({ canClick, showToast })
wx.showToast({
icon: 'none',
title: '重复提交, 请3分钟后再试',
duration: 2000,
success: function(){
setTimeout(function(){
var showToast = false
_this.setData({ showToast })
}, 2000)
}
})
}
}
})
},
//跳转到首页
toHome: function (e) {
var _this = this;
// jscat 20200913 消息提示框
/*
需求:
1, 消息提示
2, 延迟3000ms
3, 遮罩层
*/
var showToast = true
_this.setData({ showToast })
wx.showToast({
icon: 'none',
title: '预订成功',
duration: 3000,
success: function(){
setTimeout(function(){
wx.switchTab({
url: '/pages/activity/activity',
success: function (e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
// 更新首页的数据
console.log("===switchTab page", page)
}
});
}, 3000)
}
})
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<!-- 定义遮罩层 -->
<view class="mask" wx:if="{{showToast}}"></view>
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list">
<view class="item stamp stamp01" style="height:{{orderInfo.item_height}}rpx;">
<!-- 商家信息 -->
<checkbox-group class="check-group" bindchange="radioChange">
<view class="note-row align">
<!-- <checkbox class="wx-checkbox-input wx-checkbox-input-checked">
</checkbox> -->
<view class="note-info">
<view class="note-member" style="font-weight: bold">
<view class="member-left">{{orderInfo.member_name}}</view>
</view>
</view>
</view>
<!-- 商品信息 -->
<block wx:for="{{orderItems}}" wx:for-item="sub_item" wx:key="{{index}}">
<view class="note-row align">
<checkbox class="wx-checkbox-input wx-checkbox-input-checked" value="{{index}}" id="{{index}}" data-id="{{index}}" checked="{{sub_item.defaultStatus>0?true:false}}" bindtap="radioTap" />
<image class="writer-image" src="{{orderInfo.product_image}}"/>
<view class="note-column">
<span>{{sub_item.productDesc}}</span>
<span>
<view class="price-row">
<view class="sub-price">¥{{sub_item.unitPrice}}</view>
<!-- start 数量加减 -->
<view class="stepper">
<!-- 减号 -->
<text class="sign {{sub_item.quantity <= 0 ? 'disabled' : 'normal'}}" bindtap="delCount" data-index="{{index}}">-</text>
<!-- 数值 -->
<input class="number" type="number" bindchange="bindManual" value="{{sub_item.quantity}}" disabled="disabled"/>
<!-- 加号 -->
<text class="sign {{sub_item.quantity >= 100 ? 'disabled' : 'normal'}}" bindtap="addCount" data-index="{{index}}">+</text>
</view>
<!-- end 数量加减 -->
</view>
</span>
</view>
</view>
</block>
</checkbox-group>
</view>
</view>
<!-- start bottom-->
<!-- refer to https://www.jb51.net/article/129438.htm -->
<view class="page__bd">
<view class="weui-tabbar">
<view style="display:flex; flex-direction: row; align-items:center; vertical-align:middle;">
<checkbox-group class="check-group" bindchange="radioChangeAll" style="margin-top:-8rpx">
<checkbox class="wx-checkbox-input wx-checkbox-input-checked"
checked="{{selected_all==1?true:false}}">
<text style="font-size:30rpx;margin-left:10rpx;">全选</text>
</checkbox>
</checkbox-group>
</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 class="note-row align" style="margin-bottom:0; justify-content: flex-end">
<view style="font-size:30rpx;margin-right:20rpx;color:#000">合计:
<text style="color:#FF6600">¥{{totalPrice}}</text>
</view>
<view style="width:200rpx">
<button class="button-red" disabled="{{!canClick}}" bindtap="toPay">确定({{totalCount}})</button>
</view>
</view>
</view>
</view>
</view>
<!-- end bottom-->
</view>
\ No newline at end of file
.page{
.page{
/* height: 100vh; */
background: #F2F2F2;
}
.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: 340rpx; margin-bottom: 20rpx;}
.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: 100%; display: flex; margin-left: 20rpx; margin-top: 20rpx; height: 160rpx; color: #fff}
.coupon-left .t1-left{width: 160rpx; font-size: 70rpx;}
.coupon-left .t1-right{width: 520rpx; font-size: 50rpx; }
/* .coupon-left .t2{left: 20rpx; top:160rpx} */
.coupon-left .t2{width: 100%; 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: 100%; 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: 100%; 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{width:100%; height: 250rpx;margin-bottom:50rpx;position:relative;overflow:hidden}
.stamp i{position: absolute;left: 20%;top: 90rpx;height: 500rpx;width: 100%;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: 20rpx;
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-left{
color: #000;
font-size: 16px;
margin-left: 5%;
width: 120rpx;
}
/* 右边: 具体价格 */
.note-price-right{
color: #000;
font-size: 16px;
margin-top: 0;
font-weight: bold;
}
.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;
margin-bottom: 30rpx;
/* margin-top: 30rpx; */
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 20rpx;
margin-right: 5%;
width: 500rpx;
}
.writer-image{
width: 120rpx;
height: 120rpx;
margin-left: 20rpx;
}
.price-row{
display: flex;
flex-direction: row;
align-items: center;
}
.sub-price{
color: #FF6600;
font-size: 16px;
margin-right: 5%;
margin-top: 0;
text-align:justify;
flex: 1;
}
.sub-quantity{
display: flex;
font-size: 16px;
justify-content: flex-end;
}
.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%;
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;
}
.weui-tabbar{
position:fixed;
bottom:0;
left:0;
right:0;
}
/* 分享按钮 */
.share {
position: absolute;
background-size: 50rpx 50rpx;
opacity: 0;
border:none;
}
/*checkbox 选项框大小 */
checkbox .wx-checkbox-input{
border-radius: 50%; /* 圆角 */
width: 30rpx; /* 背景的宽 */
height: 30rpx; /* 背景的高 */
}
/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
background: #f44336;
}
/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
border-radius: 50%; /* 圆角 */
width: 30rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
height: 30rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
line-height: 30rpx;
text-align: center;
font-size:20rpx; /* 对勾大小 30rpx */
color:#fff; /* 对勾颜色 白色 */
background: transparent;
transform:translate(-50%, -50%) scale(1);
-webkit-transform:translate(-50%, -50%) scale(1);
}
.check-group{
margin-left: 20rpx;
}
/* start of 数量加减 */
.stepper {
width:80px;
height: 22px;
/*给主容器设一个边框*/
border: 1rpx solid #818284;
border-radius: 3px;
/* margin:20px auto; */
background: white;
}
/*加号和减号*/
.stepper .sign {
width: 20px;
line-height: 20px;
text-align: center;
float: left;
}
/*数值*/
.stepper .number {
width: 36px;
height: 20px;
float: left;
margin: 0 auto;
text-align: center;
font-size: 14px;
color: #000;
/*给中间的input设置左右边框即可*/
border-left: 1rpx solid #818284;
border-right: 1rpx solid #818284;
}
/*普通样式*/
.stepper .normal{
color: black;
}
/*禁用样式*/
.stepper .disabled{
color: #ccc;
}
/* end of 数量加减 */
/* 消息提示框的遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
\ 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: {
startDate: '',
endDate: '',
startTime: "",
endTime: "",
title: "",
content: "",
products: "",
attributeArray: ['活动类别', '价格', '库存'],
},
onLoad: function () {
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
var date = ""
var startDate = ""
var endDate = ""
var startTime = "19:30"
var endTime = "23:30"
var title =""
var content = ""
var products = []
// 如果startDatetime有值
if(app.globalData.postData.startDatetime != "")
{
// 2020-09-07 19:41:00
// 保证了startDatetime始终是格式化值
startDate = app.globalData.postData.startDatetime.substr(0, 10)
startTime = app.globalData.postData.startDatetime.substr(11, 5)
endDate = app.globalData.postData.endDatetime.substr(0, 10)
endTime = app.globalData.postData.endDatetime.substr(11, 5)
title = app.globalData.postData.photoTitle
content = app.globalData.postData.photoContent
products = app.globalData.postData.photoProduct
}
else
{
var dateNow = new Date();
var year = dateNow.getFullYear();
var month = dateNow.getMonth() + 1;
month = month.toString().length==1 ? '0'+month : month
var day = dateNow.getDate()
day = day.toString().length==1 ? '0'+day : day
date = year + "-" + month + "-" + day
startDate = date
endDate = date
}
//如果未设置products, 初始值为""
if(products.length == 0)
{
products = [{ productDesc: "", unitPrice: 0, quantity: 100, }]
}
//设置本地变量
_this.setData({
startDate: startDate,
endDate: endDate,
startTime: startTime,
endTime: endTime,
title: title,
content: content,
products: products,
});
//设置全局变量
app.globalData.postData.startDatetime = startDate + " " + startTime + ":00"
app.globalData.postData.endDatetime = endDate + " " + endTime + ":00"
},
onReady: function (e) {
},
// Page Flow
navigateToSubmit() {
var _this = this;
var product = _this.__data__.products
app.globalData.postData.photoProduct = _this.__data__.products
if(checkField())
{
let promise = app.onCheckText(app.globalData.postData.photoTag)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
wx.navigateTo({ url: './../activity-submit/activity-submit' })
},
function (value) {
console.log("===enter promise then_failed_" + value)
},);
}
},
// Date Flow
// 输入该组图片的标题
bindKeyTitle(e) {
var _this = this;
_this.setData({
inputTitle: e.detail.value
})
//全局赋值
app.globalData.postData.photoTitle = e.detail.value
},
// 输入该组图片的标签
bindKeyTag(e) {
var _this = this;
_this.setData({
inputTag: e.detail.value
})
//全局赋值
app.globalData.postData.photoTag = e.detail.value
},
bindKeyText(e){
var _this = this;
//js的e.currentTarget.id 对应wxml的 id="0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="productDesc"
var index = e.currentTarget.id;
var key = e.currentTarget.dataset.id
var products = _this.__data__.products
var dict = products[index]
dict[key] = e.detail.value
products.splice(index, 1, dict);
_this.setData({ products })
},
addList: function(){
var _this = this;
var list = _this.data.products;
var newData = { productDesc: "", unitPrice: 0, quantity: 100, };
list.push(newData);//实质是添加lists数组内容,使for循环多一次
this.setData({
products: list,
})
},
delList: function (e) {
var _this = this;
var dataId = e.currentTarget.dataset.id
var products = _this.data.products;
products.splice( dataId,1);
this.setData({
products: products,
})
},
// 点击开始日期组件确定事件
bindDateStartChange: function (e) {
var _this = this;
var startTime = _this.data.startTime
var startDate = e.detail.value
_this.setData({
startDate: startDate
})
app.globalData.postData.startDatetime = startDate + " " + startTime + ":00"
},
// 点击结束日期组件确定事件
bindDateEndChange: function (e) {
var _this = this;
var endTime = _this.data.endTime
var endDate = e.detail.value
_this.setData({
endDate: e.detail.value
})
app.globalData.postData.endDatetime = endDate + " " + endTime + ":00"
},
// 点击时间组件确定事件
bindTimeStartChange: function (e) {
var _this = this;
var startDate = _this.data.startDate
var startTime = e.detail.value
_this.setData({
startTime: e.detail.value
})
app.globalData.postData.startDatetime = startDate + " " + startTime + ":00"
},
// 点击时间组件确定事件
bindTimeEndChange: function (e) {
var _this = this;
var endDate = _this.data.endDate
var endTime = e.detail.value
_this.setData({
endTime: e.detail.value
})
app.globalData.postData.endDatetime = endDate + " " + endTime + ":00"
},
})
function checkField(){
var info = ""
var products = app.globalData.postData.photoProduct
for(var i=0; i<products.length; i++)
{
if(products[i].productDesc==undefined || products[i].productDesc=="")
{
info = "请输入第"+ i +"项活动类别"
}
}
if(app.globalData.postData.photoTitle.length == 0)
{
info = "请输入活动标题"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
else if(info!="")
{
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
console.log("字段校验成功")
return true;
}
{
{
"navigationBarTitleText": "添加详情"
}
\ No newline at end of file
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<view class="page" style="height:100%;width:100%">
<block>
<button class="weui-btn" type="warn" bindtap="navigateToSubmit">下一步</button>
</block>
<view class="weui-cells__title">#添加活动标题</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyTitle" placeholder="请输入活动标题" value="{{title}}"/>
</view>
</view>
</view>
<!-- <view class="weui-cells__title">#添加亮点</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyTag" placeholder="请输入亮点" />
</view>
</view>
</view> -->
<view style="display:flex; flex-direction: row;">
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:55%">
<picker mode="date" value="{{startDate}}" bindchange="bindDateStartChange">
<view class="picker">
开始日期: {{startDate}}
</view>
</picker>
</view>
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:45%">
<picker mode="time" value="{{startTime}}" start="08:00" end="23:30" bindchange="bindTimeStartChange">
<view class="picker">
时间: {{startTime}}
</view>
</picker>
</view>
</view>
<view style="display:flex; flex-direction: row;">
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:55%">
<picker mode="date" value="{{endDate}}" bindchange="bindDateEndChange">
<view class="picker">
结束日期: {{endDate}}
</view>
</picker>
</view>
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:45%">
<picker mode="time" value="{{endTime}}" start="08:00" end="23:30" bindchange="bindTimeEndChange">
<view class="picker">
时间: {{endTime}}
</view>
</picker>
</view>
</view>
<view class="weui-cells__title">#添加活动类别</view>
<!-- 添加表格: 序号, 类别描述, 价格, 个数 -->
<view class='table'>
<view class='table_header'>
<view class="th" style='width:70rpx;background-color:white'>
<view class='centerclass cell_label'>序号</view>
</view>
<block wx:for="{{attributeArray}}">
<view class='th'>
<view class="cell_label centerclass">{{item}}</view>
</view>
</block>
<view class="th" style='width:70rpx;background-color:white'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
<block wx:for="{{products}}" wx:for-item="item" wx:key="{{index}}">
<view class='table_main'>
<!-- 序号 -->
<view class='td' style='width:70rpx;background-color:white;'>
<view class="cell_label centerclass">{{index}}</view>
</view>
<!-- 类别 -->
<view class='td'>
<view class='table_Text_last_class'>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入类别" id="{{index}}" data-id="productDesc" value="{{item.productDesc}}"></input>
</view>
</view>
<!-- 价格 -->
<view class='td'>
<view class='table_Text_last_class'>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入价格" id="{{index}}" data-id="unitPrice" value="{{item.unitPrice}}"></input>
</view>
</view>
<!-- 库存 -->
<view class='td'>
<view class='table_Text_last_class'>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入库存" id="{{index}}" data-id="quantity" value="{{item.quantity}}"></input>
</view>
</view>
<!-- start 删除新行按钮 -->
<view class="th" style='width:70rpx;background-color:white'>
<view class='centerclass cell_label' bindtap='delList' data-id="{{index}}">
<image src="../../../../icon/del.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
<!-- end 删除新行按钮 -->
</view>
</block>
<!-- start 添加新行按钮 -->
<view class='table_header'>
<view class="th" style='width:70rpx;background-color:white'>
<view class='centerclass cell_label' bindtap='addList'>
<image src="../../../../icon/add.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
</view>
<!-- end 添加新行按钮 -->
</view>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
/* 表格 */
.table{
display: inline-flex;
flex-direction: column;
border: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 0;
}
.scrollClass {
display: flex;
width: 100%;
white-space: nowrap;
margin-top: 23px;
height: 100%;
background-color: white;
}
.table_header {
display: inline-flex;
}
.th {
display: flex;
flex-direction: column;
width: 200rpx;
height: 90rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.cell_label{
font-size: 32rpx;
color: rgba(74, 74, 74, 1);
}
.cell_date_label{
font-size: 20rpx;
color: rgba(74, 74, 74, 1);
}
.table_main {
display: inline-flex;
flex-direction: row;
}
.right-item{
display: flex;
flex-direction: row;
}
.td {
display: flex;
flex-direction: column;
width: 200rpx;
/* height: 90rpx; */
background: white;
justify-content: center;
align-items: center;
border: 1rpx solid rgba(218, 217, 217, 1);
border-top: 0;
border-left:0;
}
.table_Text_class {
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
}
.table_Text_last_class{
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
}
\ No newline at end of file
// pages/member/activity-post/activity-post.js
// pages/member/activity-post/activity-post.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../../utils/log.js')
var util = require('./../../../utils/util.js')
/*
提交流程
数据通过app.globalData
app.globalData.postData
photoTag: "",
photoTitle: "",
photoContent: "",
photoProduct: [],
startDatetime: "",
endDatetime: "",
1. post.js 生成图片的临时路径
2. edit.js 编辑标签
3. submit.js 上传阿里云oss, 将内容上传到数据库
- 获取token
- 上传oss
- 上传数据库
*/
const base64 = require('./../../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
Page({
data: {
photoArray: [],
sourceTypeIndex: 2,
sourceType: ['拍照', '相册', '拍照或相册'],
sizeTypeIndex: 2,
sizeType: ['压缩', '原图', '压缩或原图'],
countIndex: 8,
count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
//定义图片尺寸
imageSize: '',
//下一次被选中的记号
nextSign: 0,
// 下一步按钮可用状态
canClick: true,
},
onLoad: function () {
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
// 通过全局变量来同步本地变量local variable
// 否则本地变量会有脏数据
var photoArray = app.globalData.postData.photoArray
_this.setData({ photoArray })
},
sourceTypeChange(e) {
this.setData({
sourceTypeIndex: e.detail.value
})
},
sizeTypeChange(e) {
this.setData({
sizeTypeIndex: e.detail.value
})
},
countChange(e) {
this.setData({
countIndex: e.detail.value
})
},
//在进入页面时就执行,用于初始化
onReady: function (e) {
var _this = this;
var canClick = true;
_this.setData({ canClick })
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this;
// 通过全局变量来同步本地变量local variable
// 否则本地变量会有脏数据
var photoArray = app.globalData.postData.photoArray
_this.setData({ photoArray })
},
// Page Flow
onNavigateToEdit() {
var _this = this;
var photoArray = _this.data.photoArray
var nextSign = 1
_this.setData({ nextSign })
//先设置支付按钮不可点击
var canClick = false;
_this.setData({ canClick })
if(photoArray.length == 0) // 添加照片
{
_this.addPhoto()
}
else
{
_this.navigateToEdit()
}
},
navigateToEdit() {
var _this = this;
var newFilePaths = _this.data.photoArray
// let promise = app.onCheckPic(newFilePaths)
// //在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
// //then后的括号里应该是参数param
// //https://www.cnblogs.com/qlongbg/p/11603328.html
// promise.then(function (value) {
// console.log("===checkPic_enter promise then_" + value)
// //同步更新全局变量
// app.globalData.postData.photoArray = newFilePaths
// wx.navigateTo({ url: './edit/edit' })
// });
//先设置支付按钮为可点击
var canClick = true;
_this.setData({ canClick })
//离开的时候再赋值全局变量
app.globalData.postData.photoArray = newFilePaths
wx.navigateTo({ url: './activity-edit/activity-edit' })
},
// Date Flow
/*
step1: 选定图片,可以预览
step2: 添加描述文字,选择tag
step3: 上传
1. chooseImage
2. 进行图片编辑
3. 点击下一步验证图片是否合法合规 navigateToEdit
通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
1) > 2M会出现 45002, content size out of limit 错误
2) 自动裁剪成4:3 或 1:1
*/
//添加图片
addPhoto: function () {
var _this = this;
//先设置支付按钮不可点击
var canClick = false;
_this.setData({
photoArray: [],
canClick: canClick
})
console.log("===this is addPhoto");
wx.chooseImage({
sizeType: ['original, compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var canvasId = "photoCanvasId";
console.log("===addPhoto_上传图片参数", res)
_this.onEditPic(res, canvasId)
},
fail: function(err)
{
console.log("===addPhoto failed", err.errMsg)
},
complete: function(e)
{
//无论成功与否,设置按钮可点击
var canClick = true;
_this.setData({ canClick })
}
})
},
previewImage(e) {
const current = e.target.dataset.src
wx.previewImage({
current,
urls: this.data.photoArray
})
},
//保存图形的tmp地址
saveData(newFilePaths){
var _this = this;
console.log("===saveData", newFilePaths)
_this.setData({
photoArray: newFilePaths
})
app.globalData.postData.photoArray = newFilePaths;
},
//小程序图片处理主函数
editPic(tempFilePaths, index, canvasId) {
var _this = this;
var photoArray = _this.data.photoArray
if (index < tempFilePaths.length){
var pic = tempFilePaths[index]
wx.getImageInfo({
src: pic, //图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径,
success: function (res) {
// util.imageUtil 用于计算长宽比
var i = index + 1
console.log("第"+i+"张上传图片参数", res)
var imageSize = util.imageUtil(res);
console.log("success on getImageInfo_"+index);
console.log(imageSize)
_this.setData({
imageSize: imageSize
})
const ctx = wx.createCanvasContext(canvasId);
//ctx.drawImage(pic, 0, 0, imageSize.swidth, imageSize.sheight);
ctx.drawImage(pic, imageSize.sx, imageSize.sy, imageSize.swidth, imageSize.sheight,
imageSize.x, imageSize.y, imageSize.width, imageSize.height);
// 需要注意的是 draw 方法是异步的,如果图片还没加载成功,有可能画出来的是空的
// 所以 draw 方法通常都会带有定时器这样的回调
ctx.draw(false, setTimeout(function () {
//ctx.draw(false, function () {
var i = index + 1
console.log("==enter draw_"+i);
wx.canvasToTempFilePath({
canvasId: canvasId,
fileType:"jpg",
success: function (res) {
console.log("===success_", res)
console.log("===第"+i+"图处理成功")
photoArray.push(res.tempFilePath)
_this.setData({
photoArray: photoArray
})
index = index + 1
_this.editPic(tempFilePaths, index, canvasId); // 用于多个图片压缩
},
fail: function (e) {
var i = index + 1
console.log("===第"+i+"图处理失败")
}
});
},1000));
//});
},
fail: function(e) {
console.log("failed", e);
},
complete: function(e) {
var i = index + 1
console.log("complete on getImageInfo_"+i, e);
}
})
}
else //图片处理完毕
{
var nextSign = _this.data.nextSign
var photoArray = _this.data.photoArray
//设置支付按钮可点击
var canClick = true;
_this.setData({ canClick })
if(nextSign == 1)
{
_this.navigateToEdit()
}
}
},
// 通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
// 1) > 2M会出现45002, content size out of limit错误
// 2) 自动裁剪成4:3(高/宽 1080) 或 1:1 有品默认1:1
// refer1 微信小程序图片压缩 https://www.jianshu.com/p/1b8a1e96a6d5
// refer2 小程序压缩图片(canvas) https://www.jianshu.com/p/ec1f95008dce
onEditPic(res, canvasId) {
var _this = this;
var tempFilePaths = res.tempFilePaths;
var index = 0;
_this.editPic(tempFilePaths, index, canvasId)
}
})
\ No newline at end of file
{
{
"navigationBarTitleText": "活动创建"
}
\ No newline at end of file
<!-- /pages/member/activity-post/activity-post.wxml -->
<!-- /pages/member/activity-post/activity-post.wxml -->
<view class="page" style="height:100%;width:100%">
<block>
<button class="weui-btn" type="warn" disabled="{{!canClick}}" bindtap="onNavigateToEdit">下一步</button>
</block>
<form>
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">活动图片上传</view>
<view class="weui-uploader__info">{{photoArray.length}}/{{count[countIndex]}}</view>
</view>
<view class="weui-uploader__bd">
<view class="weui-uploader__files">
<block wx:for="{{photoArray}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="addPhoto"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</form>
<canvas canvas-id='photoCanvasId' class='myCanvas' style='width:{{imageSize.width}}px;height:{{imageSize.height}}px'>
</canvas>
</view>
\ No newline at end of file
page{
page{
height: 100vh;
background-color:#f5f8fa;
}
.banner{
position: relative;
}
.banner image{
height: 200px;
width:100%;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
.banner .play{
width: 40px;
height: 40px;
position: absolute;
bottom: 10px;
right:10px;
z-index: 10;
}
.mdetail{
overflow: hidden;
height:55px;
padding:5px 10px;
border-bottom:1px solid #dbdbdb;
}
.mdetail image{
float:left;
width:55px;
height:55px;
}
.minfo{
float:left;
margin-left:10px;
padding:10px 0;
}
.detailLeft{
float:left;
}
.detailRight{
float:right;
}
.mname{
font-size: 14px;
margin-bottom:10px;
}
.mauthor{
font-size: 12px;
color:#dbdbdb;
}
/*
隐藏 canvas,避免显示错误
*/
.myCanvas {
position: absolute;
top: -9999px;
left: -9999px;
}
// pages/member/activity-post/activity-submit/activity-submit.js
// pages/member/activity-post/activity-submit/activity-submit.js
const base64 = require('../../../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
var config = wx.getStorageSync("config");
var util = require('./../../../../utils/util.js')
var app = getApp();
Page({
data : {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "",
userInfo : {},
logoArray: [], // logo 临时temp上传
members : [], // 一个用户所有管理的商户, 全局数据
member: {}, //某一个商户的信息, 全局数据
memberInfos: [], // 某一个商户member_id对应的所有address 可能是1:n, 局部数据
memberInfo: {}, // 某一个商户member_name对应的默认address 是1:1, 全局数据
addresses: [], // 地址列表, 局部数据
content: "",
contentLength: 0,
//当textarea获取焦点时自适应高度,失去焦点时不自适应高度
//自适应高度时,style中的height无效
auto_height:true,
/*
//members
member_id
address_id
default_member
member_name
member_city // new added jscat 20200915
member_address
member_slogan
member_logo
*/
//阿里云 OSS相关参数
// accessid: "",
// policy: "",
// signature: "",
// host: "",
// dir: "",
// expire: "",
// securityToken: "",
oss :{},
// 消息提示框的遮罩层
showToast: false,
defaultCity: '',
// 多商户被选中的index, 与members配合使用
// 给选中的tab加粗
curIndex: 0,
curAddress: 0,
// 支付按钮可用状态
canClick: true,
// 操作按钮
submitString: "",
},
onLoad: function (options) {
var _this = this;
//memberInfos/memberInfo更新需求
/*
member_edit页面修改后, 更新地址信息
更新memberInfo, memberInfos, 以及addresses
*/
if(options.mode != undefined)
{
console.log("enter into activity-submit.js onLoad options", options.mode)
var curAddress = _this.data.curAddress
//修改值
if(options.mode == "01")
{
var memberInfo = app.globalData.memberInfo
var memberInfos = _this.data.memberInfos
var addresses = _this.data.addresses
memberInfos[curAddress] = memberInfo
addresses[curAddress] = memberInfo.member_address
_this.setData({ memberInfo, memberInfos, addresses, curAddress})
}
//新增address值, memberInfos 新增
else if(options.mode == "02")
{
curAddress = _this.data.memberInfos.length
var memberInfo = app.globalData.memberInfo
var memberInfos = _this.data.memberInfos
var addresses = _this.data.addresses
memberInfos.push(memberInfo)
addresses.push(memberInfo.member_address)
_this.setData({ memberInfo, memberInfos, addresses, curAddress})
}
//新增member值, members, member改变, memberInfo改变, memberInfos改变
else if(options.mode == "03")
{
var curIndex = 0
curAddress = 0
var member = app.globalData.member
var members = app.globalData.members
var memberInfo = app.globalData.memberInfo
var memberInfos = [ memberInfo ]
var addresses = [ memberInfo.member_address ]
_this.setData({ member, members, memberInfo, memberInfos, addresses, curIndex, curAddress})
}
}
else
{
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members') || [],
member : wx.getStorageSync('member') || {},
})
}
//初始化发布字串
var submitString = ""
if(wx.getStorageSync('authStatus') == '01')
{
submitString = "活动发布"
}
else
{
submitString = "授权发布"
}
_this.setData({ submitString })
var members = wx.getStorageSync('members') || []
if(members.length != 0)
{
var logoArray = [ members[0].member_logo ]
_this.setData({ logoArray })
}
var content = ""
var contentLength = 0
if(app.globalData.postData.startDatetime != "")
{
content = app.globalData.postData.photoContent; //获取content
contentLength = app.gblen(content)
}
_this.setData({ content, contentLength })
// 获取当前的member
var defaultCity = app.globalData.defaultCity
_this.setData({ defaultCity })
var member = app.globalData.member || {}
if(!member.hasOwnProperty('member_city'))
{
member["member_city"] = defaultCity
}
if(!member.hasOwnProperty('member_slogan'))
{
member["member_slogan"] = "标语待完善"
}
if(!member.hasOwnProperty('member_logo'))
{
member["member_logo"] = ""
}
app.globalData.member = member
_this.setData({ member})
// 获取该member下的所有地址信息memberInfos
/*
1. memberInfos
2. memberInfo
3. addresses
*/
_this.getMemberInfos()
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
onReady: function (e) {
var _this = this;
var canClick = true;
_this.setData({ canClick })
//进入页面就自动获取oss参数
_this.oss('userToken');
if(_this.data.members.length == 0)
{
_this.oss('logoToken');
}
},
// Date Flow
// 提交 tbl_member, oss 和数据库
// 活动提交入口
onSubmit: function(e) {
var _this = this;
if(_this.checkField())
{
_this.submitPost()
}
},
submitPost: function () {
var _this = this;
var title = app.globalData.postData.photoTitle
var content = app.globalData.postData.photoContent; //获取content
var logoArray = _this.__data__.logoArray
//先设置按钮不可点击
var canClick = false;
_this.setData({ canClick })
var submitString = "活动发布中"
_this.setData({ submitString })
// user_id
// member_id
// activity_id
// 注册member并且提交 (此时member还不存在,同时说明memberInfo也不存在)
if( app.globalData.members.length == 0 // 说明还不是member, 需要注册
&& app.globalData.member != {} // 存在member的信息, 可没有member_id
)
{
// 注册 member
// setStorage
if(logoArray.length == 0) // 直接数据库上传
{
//todo
_this.onRegMember();
}
else // 通过oss上传
{
let promise_regMember = new Promise(function (resolve, reject) {
_this.onRegMemberOss(resolve, reject)
})
promise_regMember.then(
function (value) {
console.log("===enter promise_regMember then_pass_" + value)
// 提交活动
// 存入数据库
// 成功之后返回activity页面
_this.releaseOss(title, content);
},
function (value) {
console.log("===enter promise_regMember then_failed_" + value)
});
}
}
else //直接提交
{
console.log("===直接提交aliyun oss")
// todo jscat 20200815 测试版本不需要限定文本content是否为 ""
//if (content != undefined && content != "") {
if(1) {
//step1, 上传至oss-获取token,在onReady()提前准备
//_this.oss();
//step2, 判断文本是否合规
let promise = app.onCheckText(title+content)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
//step3, 上传至oss-上传图片
_this.releaseOss(title, content);
_this.switchTab()
},
function (value) {
console.log("===enter promise then_failed_" + value)
});
//step4, 上传信息到数据库
//上传数据库在oss sdk的callback函数里设置
//需要java后台支持
}
}
},
// 获得oss配置信息
// jscat0901 dir是指上传的目录 'user-dir/' 或者是 'logo-dir/'
// 每一个上传目录对应的oss 参数是不一致的
oss: function (dir) {
var _this = this;
console.log("===this is oss");
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234&dirType=" + dir
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
var dict = {
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
}
var oss = _this.data.oss
oss[dir] = dict
_this.setData({
oss : oss,
})
}
}
})
},
//用于oss_promise
oss_promise: function (dir, resolve) {
var _this = this;
console.log("===this is oss");
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234&dirType=" + dir
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
var dict = {
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
}
var oss = _this.data.oss
oss[dir] = dict
_this.setData({
oss : oss,
})
resolve("oss load success")
}
}
})
},
//上传照片(阿里云)
uploadAli: function (tag, title, content, photoArr, product, startDatetime, endDatetime) {
var _this = this;
console.log("===uploadAli_data_tag: ",tag)
console.log("===uploadAli_data_title: ",title)
console.log("===uploadAli_data_content: ",content)
console.log("===uploadAli_data_photoArr: ",photoArr)
var promise = Promise.all(photoArr.map((pic, index) => {
//pic是多图上传模式中的单张图片 index => 0 : length-1
console.log(pic)
//传给阿里云的参数
var dir = 'userToken'
var policy = this.data.oss[dir].policy;
var accessid = this.data.oss[dir].accessid;
var securityToken = this.data.oss[dir].securityToken;
var signature = this.data.oss[dir].signature;
var path = this.data.oss[dir].host + "/" + this.data.oss[dir].dir;
console.log("policy: " + policy);
console.log("signature: " + signature);
console.log("accessid: " + accessid);
console.log("path: " + path)
var babyData = {
'Filename': '${filename}',
'name': pic.replace('http://tmp/', "").replace('wxfile://', ""),
'key': this.data.oss[dir].dir + '${filename}',
'policy': policy,
'OSSAccessKeyId': accessid,
'success_action_status': '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'x-oss-security-token': securityToken
}
// 多图n上传流程,通过promise.all实现异步控制
// n-1图直接上传
// 第n图上传+设置callback,在java后台提交参数到数据库
if (index == photoArr.length - 1)
{
var photoArrsm = [];
//由于微信小程序生成的临时路径在上传阿里云的时候不需要上传.所以需要对路径进行处理,但是在手机端上传和PC端上传,图片临时路径的前缀不同,所以需要进行分别的处理
// pc: http://tmp/
// wx: wxfile://
for (let i = 0; i < photoArr.length; i++) {
photoArrsm.push(path + photoArr[i].replace('http://tmp/', "").replace('wxfile://', ""));
}
//生成最终的文件字符串 file1.jpg::file2.png (数据库解析格式)
var image = photoArrsm.join("::")
var user_id = wx.getStorageSync('nyxCode')
var address_id = app.globalData.member.address_id
var member_id = app.globalData.member.member_id
var strUrl = config.oss_activity_callback_url
var strParam = ""
for(var i=0; i<product.length; i++)
{
for(var key in product[i])
{
strParam += "&" + key + "=" + product[i][key]
}
}
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag=' + encodeURI(encodeURI(tag)) + '&title=' + encodeURI(encodeURI(title)) + '&content=' + encodeURI(encodeURI(content)) + '&image=' + image + '&userId=' + user_id + '&memberId=' + member_id + '&addressId=' + address_id + encodeURI (encodeURI(strParam)) + '&startDatetime=' + startDatetime + '&endDatetime=' + endDatetime,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
babyData['callback'] = base64_callback_body
}
return new Promise(function (resolve, reject) {
var host = _this.data.oss['userToken'].host;
wx.uploadFile({
url: host,
formData: babyData,
name: 'file',
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
success: function (res) {
console.log("=== index_"+index)
console.log(res)
console.log("success to upload file")
//_this.switchTab()
},
fail: function (err) {
console.log("fail to upload file")
},
complete: function () {
console.log("complete to upload file");
}
});
});
})).then(
_this.switchTab()
);
},
//发布活动按钮
releaseOss: function (title, content) {
var _this = this;
console.log("===this is releaseOss");
//获取照片数组
var photoArr = app.globalData.postData.photoArray;
var tag = app.globalData.postData.photoTag
var product = app.globalData.postData.photoProduct
var startDatetime = app.globalData.postData.startDatetime
var endDatetime = app.globalData.postData.endDatetime
//时间戳
var expire = this.data.oss['userToken'].expire;
//获取当前时间戳
var expireNow = Date.parse(new Date()) / 1000;
//如果当前时间大于获取的时间 则重新获取oss;
if (expire == undefined || expireNow > expire) {
//重新获取oss, 成功之后执行uploadAli()
let promise_oss = new Promise(function (resolve) {
_this.oss_promise('userToken', resolve)
})
promise_oss.then(
function (value) {
console.log("===enter promise_oss user_token then_pass")
_this.uploadAli(tag, title, content, photoArr, product, startDatetime, endDatetime)
});
}
else
{
_this.uploadAli(tag, title, content, photoArr, product, startDatetime, endDatetime)
}
},
switchTab() {
var _this = this;
//跳转到/activity.wxml页面
app.globalData.switchId = 1
// 重置数据
app.globalData.postData = {
photoArray: [],
photoTag: "",
photoTitle: "",
photoContent: "",
photoProduct: [],
startDatetime: "",
endDatetime: "",
}
// jscat 20200913 消息提示框
/*
需求:
1, 消息提示
2, 延迟3000ms
3, 遮罩层
*/
var showToast = true
_this.setData({ showToast })
wx.showToast({
icon: 'none',
title: '发布成功',
duration: 2000,
success: function(){
setTimeout(function(){
wx.switchTab({
url: '/pages/activity/activity',
success: function (e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
// 更新首页的数据
console.log("===switchTab page", page)
page.onUpdateData();
}
});
}, 2000)
}
})
},
// 授权入口: 获取用户授权信息
// authStatus=='00' && members.length == 0
onGetUserInfo: function(e)
{
var _this = this;
if(_this.checkField())
{
_this.getUserInfo()
}
},
getUserInfo() {
let _this = this;
//先设置点击按钮不可点击
var canClick = false;
_this.setData({ canClick })
config.debug==1?console.log("===getUserInfo"):""
// 获取用户信息
wx.getSetting({
success(res) {
config.debug == 1 ? console.log("===getUserInfo_res_" + res) : ""
if (res.authSetting['scope.userInfo']) { // 判断获取用户信息是否授权
config.debug == 1 ? console.log("已授权=====") : ""
var submitString = "活动发布"
_this.setData({ submitString })
// 已经授权, 可以直接调用 getUserInfo 获取用户信息
let promise_login = new Promise(function (resolve, reject) {
app.login(resolve, reject)
})
promise_login.then(
function (value) {
console.log("===enter promise_login then_pass_" + value)
_this.submitPost()
},
function (value) {
console.log("===enter promise_login then_failed_" + value)
});
} else {
config.debug == 1 ? console.log("未授权=====") : ""
// 无法重新进行授权; jscat 20200901
// 因为 openSetting:fail can only be invoked by user TAP gesture.
wx.showModal({
title: '授权提示',
content: '微活动发布需要您的授权哦'
})
}
}
})
},
// 添加内容
bindKeyInput(e) {
var _this = this;
//
app.globalData.postData.photoContent = e.detail.value
var content = e.detail.value
var contentLength = app.gblen(content)
_this.setData({ content, contentLength })
},
// 为member添加口号
bindSlogan(e) {
var _this = this;
var member = app.globalData.member || {}
member["member_slogan"] = e.detail.value
app.globalData.member = member
_this.setData({ member })
},
// 为member添加名称
bindName(e) {
var _this = this;
var member = app.globalData.member || {}
member["member_name"] = e.detail.value
app.globalData.member = member
_this.setData({ member })
},
// 为member添加城市 //local变量
// jscat 20200915,
bindCity(e) {
var _this = this;
var member = app.globalData.member || {}
member["member_city"] = e.detail.value
app.globalData.member = member
_this.setData({ member })
},
// 为member添加地址
bindAddress(e) {
var _this = this;
var member = app.globalData.member || {}
member["member_address"] = e.detail.value
app.globalData.member = member //实际上member赋值之后,app.globalData的值也同时改变
_this.setData({ member })
},
/*
logo处理功能
*/
addLogo: function (res) {
var _this = this;
_this.setData({
logoArray: []
})
console.log("===this is addLogo");
wx.chooseImage({
sizeType: ['original, compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log("===addLogo_上传图片参数", res)
_this.setData({
logoArray: res.tempFilePaths
})
}
})
},
previewImage(e) {
const current = e.target.dataset.src
wx.previewImage({
current,
urls: this.data.logoArray
})
},
//保存图形的tmp地址
saveData(newFilePaths){
var _this = this;
console.log("===saveData", newFilePaths)
_this.setData({
photoArray: newFilePaths
})
app.globalData.postData.photoArray = newFilePaths;
},
// 直接注册member
// todo not finished jscat 20200902
onRegMember(resolve)
{
var _this = this;
var member_id = "mid_" + util.wxuuid()
app.globalData.member.member_id = member_id
var member_name = app.globalData.member.member_name
var member_address = app.globalData.member.member_city + app.globalData.member.member_address
//即时更新member_address的值
app.globalData.member.member_address = member_address
var member_slogan = app.globalData.member.member_slogan
var user_id = _this.__data__.nyxCode
console.log("===this is onRegMember");
var query_url = '?userId=' + user_id + '&memberId=' + member_id + '&memberName=' + member_name
+ '&memberAddress=' + member_address
+ '&memberSlogan=' + member_slogan
var strUrl = config.member_reg_url + query_url
config.debug == 1 ? console.log("===onRegMember strUrl is: " + strUrl) : ""
wx.request({
url: strUrl,
method: 'GET',
header: {
'Cookie': wx.getStorageSync('cookieKey'),
},
success: function (res) {
if (res.statusCode == 200) {
//表示查询成功
console.log(res.data);
resolve("reg_member success")
}
}
})
},
// 注册member by Oss
onRegMemberOss(resolve, reject)
{
var _this = this;
var member_id = "mid_" + util.wxuuid()
var address_id = "addid_" + util.wxuuid()
app.globalData.member.member_id = member_id
var member_name = app.globalData.member.member_name
var member_address = app.globalData.member.member_city + app.globalData.member.member_address
//即时更新member_address的值
app.globalData.member.member_address = member_address
var member_slogan = app.globalData.member.member_slogan
var logoArray = _this.__data__.logoArray
console.log("===this is onRegMemberOss");
//获取照片数组
var logoArray = _this.__data__.logoArray
//时间戳
var expire = this.data.oss['logoToken'].expire;
//获取当前时间戳
var expireNow = Date.parse(new Date()) / 1000;
//如果当前时间大于获取的时间 则重新获取oss;
if (expire == undefined || expireNow > expire) {
//重新获取oss, 成功之后执行uploadMember()
let promise_oss = new Promise(function (resolve) {
_this.oss_promise('logoToken', resolve)
})
promise_oss.then(
function (value) {
console.log("===enter promise_oss then_pass")
_this.uploadMember(member_id, address_id, member_name, member_address, member_slogan, logoArray, resolve, reject)
});
}
else
{
_this.uploadMember(member_id, address_id, member_name, member_address, member_slogan, logoArray, resolve, reject)
}
},
//上传商家信息到(阿里云)
uploadMember: function (member_id, address_id, member_name, member_address, member_slogan, logoArray, resolve, reject) {
var _this = this;
var pic = logoArray[0]
console.log(pic)
//传给阿里云的参数
var dir = 'logoToken'
var policy = this.data.oss[dir].policy;
var accessid = this.data.oss[dir].accessid;
var securityToken = this.data.oss[dir].securityToken;
var signature = this.data.oss[dir].signature;
var path = this.data.oss[dir].host + "/" + this.data.oss[dir].dir;
var host = _this.data.oss[dir].host
console.log("policy: " + policy);
console.log("signature: " + signature);
console.log("accessid: " + accessid);
console.log("path: " + path)
var babyData = {
'Filename': '${filename}',
'name': pic.replace('http://tmp/', "").replace('wxfile://', ""),
'key': this.data.oss[dir].dir + '${filename}',
'policy': policy,
'OSSAccessKeyId': accessid,
'success_action_status': '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'x-oss-security-token': securityToken
}
//生成最终的文件字符串 file1.jpg
var image = pic.replace('http://tmp/', "").replace('wxfile://', "");
var member_logo = path + image
var user_id = _this.__data__.nyxCode
//设置member全局函数
app.globalData.member['member_logo'] = member_logo
app.globalData.member['member_status'] = "01"
app.globalData.member['default_member'] = "01"
app.globalData.member['address_id'] = address_id
app.globalData.member['member_id'] = member_id
app.globalData.member['member_name'] = member_name
app.globalData.member['member_address'] = member_address
app.globalData.member['member_slogan'] = member_slogan
var strUrl = config.oss_member_callback_url
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&memberName=' + encodeURI(encodeURI(member_name)) + '&memberAddress=' + encodeURI(encodeURI(member_address)) + '&memberSlogan=' + encodeURI(encodeURI(member_slogan)) + '&image=' + member_logo + '&memberId=' + member_id + '&userId=' + user_id + '&addressId=' + address_id,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
babyData['callback'] = base64_callback_body
wx.uploadFile({
url: host,
formData: babyData,
name: 'file',
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
success: function (res) {
// 保存members和member
var member = app.globalData.member
wx.setStorageSync("member", member)
var members = [app.globalData.member] //初始注册member, 只有一个member
wx.setStorageSync("members", members)
_this.setData({ members, members })
console.log(res)
resolve(res.data);
},
fail: function (err) {
console.log("fail to upload file", err.errMsg)
reject(new Error('failed to upload file'));
},
complete: function () {
console.log("complete to upload file");
}
});
},
areablur:function(){
this.setData({
auto_height:false
})
},
areafocus:function(){
this.setData({
auto_height: true
})
},
checkField(){
var _this = this;
var info = ""
if(app.globalData.postData.photoContent.length == 0)
{
info = "请输入活动内容"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
else if(_this.data.logoArray.length == 0)
{
info = "请上传店铺logo"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
else if(app.globalData.member.member_name == undefined || app.globalData.member.member_name.length == 0)
{
info = "请输入店铺名称"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
else if(app.globalData.member.member_address == undefined || app.globalData.member.member_address.length == 0)
{
info = "请输入店铺地址"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
return false;
}
console.log("字段校验成功")
return true;
},
// 更换商家
// 从members里选择一个, 设置为member(local, storage, app.globalData)
// 同时更新该member对应的所有memberInfos地址信息
switchCategory(e) {
var _this = this;
var curIndex = e.currentTarget.dataset.index ? e.currentTarget.dataset.index : 0
var member = _this.__data__.members[curIndex]
wx.setStorageSync('member', member)
app.globalData.member = member
var curAddress = 0
_this.setData({ member, curIndex, curAddress })
//同步更新该member对应的所有地址信息
_this.getMemberInfos()
},
/*
* 更换某一个memberInfo的地址信息
*/
onAddressPicker: function (e) {
var _this = this;
var curAddress = e.detail.value
var memberInfo = _this.data.memberInfos[curAddress]
app.globalData.memberInfo = memberInfo
_this.setData({ curAddress, memberInfo })
},
/*
修改商家信息: 重点更新 slgoan + 地址
新增地址信息: 重点新增 地址
*/
toMemberEdit: function (e) {
var _this = this;
// 操作的类别
var id = e.currentTarget.id;
// 操作的名称
var title = e.currentTarget.dataset.title
var url = "/pages/member/activity-post/member-edit/member-edit?"
+ "&mode=" + id
+ "&title=" + title
wx.navigateTo({
url: url
})
},
//子页面(member-edit.js)调用父页面(activity-submit.js)的数据更新操作
updateMemberData: function (options) {
var _this = this;
this.onLoad(options); //最好是只写需要刷新的区域的代码,onload也可,效率低,有点low
},
//重新获取member的所有address信息
//memberInfo默认为index=0
getMemberInfos: function(){
var _this = this;
var member = app.globalData.member
var query_url = '?memberId=' + member.member_id
var strUrl = config.member_info_query_url + 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 memberInfos = []
var addresses = []
var memberInfo = {}
var dict = res.data.data
if(dict.length >= 1)
{
for(var i=0; i<dict.length; i++)
{
var result = {}
result['member_id'] = dict[i].memberId
result['address_id'] = dict[i].addressId
result['address_status'] = dict[i].addressStatus
result['member_name'] = dict[i].memberName
result['member_address'] = dict[i].memberAddress
result['member_slogan'] = dict[i].memberSlogan
result['member_logo'] = dict[i].memberLogo
addresses.push(dict[i].memberAddress)
memberInfos.push(result)
}
memberInfo = memberInfos[0]
}
app.globalData.memberInfo = memberInfo
_this.setData({ memberInfos, memberInfo, addresses })
wx.setStorageSync('memberInfo', memberInfo)
}
}
})
},
})
{
{
"navigationBarTitleText": "活动发布"
}
\ No newline at end of file
<view class="page-body">
<view class="page-body">
<!-- 定义遮罩层 -->
<view class="mask" wx:if="{{showToast}}"></view>
<!-- <form > -->
<view class="btn-area">
<block wx:if="{{authStatus=='00'}}">
<button class="weui-btn" type="warn" open-type="getUserInfo" bindgetuserinfo="onGetUserInfo">{{submitString}}</button>
</block>
<block wx:else>
<button class="weui-btn" type="warn" disabled="{{!canClick}}" bindtap="onSubmit">{{submitString}}</button>
</block>
</view>
<view class="weui-cells__title">#添加活动内容</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea auto-height="{{auto_height}}" bindblur='areablur' bindfocus='areafocus' class="weui-textarea" bindinput='bindKeyInput' name="inputContent" placeholder="请输入活动内容" style="height: 3.3em" value="{{content}}"/>
<view class="weui-textarea-counter">{{contentLength}}/2000</view>
</view>
</view>
</view>
<!-- </form> -->
<!-- start 商家选择栏 多商家才出现 -->
<block wx:if="{{members.length!=0}}">
<view class="weui-cells__title">#选择发布商家</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="{{members}}"
wx:key="{{item.id}}" data-id="{{item.id}}" data-index="{{index}}"
bindtap="switchCategory">{{item.member_name}}</view>
</scroll-view>
</view>
</block>
<!-- end 商家选择栏 -->
<!-- start of 商家信息 -->
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">{{members.length==0?'完善5项商家信息, 直接发布活动':'商家信息'}}</view>
</view>
<!-- 地址 -->
<view class="weui-uploader__hd">
<block wx:if="{{members.length==0}}">
<input class="weui-input" bindinput="bindSlogan" placeholder="1、请输入店铺标语" />
</block>
<block wx:else>
{{memberInfos[curAddress].member_slogan}}
</block>
</view>
<!-- start of note-row -->
<view class="note-row">
<!-- start of column left -->
<view class="note-column-left align justify">
<view class="weui-uploader__bd">
<!-- start of 已上传 -->
<block wx:if="{{members.length > 0}}">
<view class="weui-uploader__files">
<block wx:for="{{[memberInfos[curAddress].member_logo]}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
</block>
<!-- end of 已上传 -->
<!-- start of 未上传 -->
<block wx:elif="{{logoArray.length == 0}}">
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="addLogo"></view>
<!-- <view class="weui-uploader__title">商家信息</view> -->
<view style="color: rgba(0,0,0,.5);font-size:30rpx;">2、添加Logo</view>
</view>
</block>
<block wx:else>
<view class="weui-uploader__files">
<block wx:for="{{logoArray}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
</block>
<!-- end of 未上传 -->
</view>
</view>
<!-- end of note-column-left -->
<!-- start of note-column-->
<view class="note-column" style="margin-left: 20rpx;">
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<block wx:if="{{members.length==0}}">
<input class="weui-input" bindinput="bindName" placeholder="3、请输入店铺名称" />
</block>
<block wx:else>
{{memberInfos[curAddress].member_name}}
</block>
</view>
</view>
</view>
<!-- end of note-column-->
<!-- start of note-column-->
<block wx:if="{{members.length==0}}">
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindCity" value="{{defaultCity}}" placeholder="4、请输入店铺城市">
</input>
</view>
</view>
</view>
</block>
<!-- end of note-column-->
<!-- start of note-column-->
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<block wx:if="{{members.length==0}}">
<input class="weui-input" bindinput="bindAddress" placeholder="5、请输入店铺地址" />
</block>
<block wx:else>
<picker mode="selector" range="{{addresses}}" value="{{curAddress}}" bindchange="onAddressPicker" class='address_member'>
<image src='../../../../icon/down.png' style='width: 40rpx;height: 40rpx;' class='selecrtImg'></image>
<text>{{memberInfos[curAddress].member_address}}</text>
</picker>
</block>
</view>
</view>
</view>
<!-- end of note-column-->
</view>
</view>
</view>
</view>
</view>
</view>
<!-- end of 商家信息 -->
<block wx:if="{{members.length>0}}">
<!-- start of 更新商家信息 -->
<view class="weui-cells__title">#更新商家信息</view>
<view class="navBar" >
<scroll-view class="navBar-box" style="display:flex">
<!-- <view class="cate-list" bindtap="updateMember" id="00" data-title="新增商家信息">
<image src="../../../../icon/add_3.png"/>新增商家信息</view> -->
<view class="cate-list" bindtap="toMemberEdit" id="01" data-title="修改商家信息">
<image src="../../../../icon/edit.png"/>修改商家信息</view>
<view class="cate-list" bindtap="toMemberEdit" id="02" data-title="新增地址信息">
<image src="../../../../icon/add_3.png"/>新增地址信息</view>
</scroll-view>
<scroll-view class="navBar-box" style="display:flex">
<view class="cate-list" bindtap="toMemberEdit" id="03" data-title="新增商家信息">
<image src="../../../../icon/add_3.png"/>新增商家信息</view>
</scroll-view>
</view>
<!-- end of 更新商家信息 -->
</block>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.note-row{
width: 100%;
display: flex;
flex-direction: row;
}
.note-column{
display: flex;
flex-direction: column;
}
.note-column-left{
width : 196rpx;
display: flex;
}
.writer-image{
width: 196rpx;
height: 196rpx;
}
/* 消息提示框的遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
/* start of navbar navBar -> navBar-box -> cate-list -> cate-list.on jscat 20200916*/
.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;
}
.navBar-box .cate-list.update {
color: #9d9d9d;
font-weight: bold;
}
.cate-list image {
width: 70rpx;
height: 70rpx;
vertical-align: middle;
}
.navBar-box{
width: 100%;
height: 60rpx;
}
/* end of navbar */
/* start of menuBox 下拉菜单 */
.address_member{
height: 80rpx;
background: #fff;
float:left;
}
.selecrtImg{
float:left;
margin-top: 10rpx;
}
/* end of menuBox */
/* start of button */
.button-sp-area{
margin: 0 auto;
text-align:center;
font-size: 32rpx;
}
.mini-btn{
margin: 0 4px;
font-size: 32rpx;
}
.weui-cells{
width: 100%;
margin-top: 0;
bottom:0px;
left:0px;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell_access{
border-top: 1px solid #ffffff;
}
.weui-cell__hd image {
width: 70rpx;
height: 70rpx;
margin-right: 15px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
/* end of button */
\ No newline at end of file
// pages/member/activity-post/activity-submit/activity-submit.js
// pages/member/activity-post/activity-submit/activity-submit.js
const base64 = require('../../../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
var config = wx.getStorageSync("config");
var util = require('./../../../../utils/util.js')
const app = getApp();
Page({
data : {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "",
userInfo : {},
members : [], // 一个商家所有管理的商户, global
member: {}, //该商家默认的商户, global
memberInfos: [], // 某一个商户member_name对应的address 可能是1:n, local
memberInfo: {}, // 某一个address的详细信息, global
addresses: [], // 地址列表
//当textarea获取焦点时自适应高度,失去焦点时不自适应高度
//自适应高度时,style中的height无效
auto_height:true,
/*
//members
member_id
address_id
default_member
member_name
member_city // new added jscat 20200915
member_address
member_slogan
member_logo
*/
//阿里云 OSS相关参数
// accessid: "",
// policy: "",
// signature: "",
// host: "",
// dir: "",
// expire: "",
// securityToken: "",
oss :{},
// 消息提示框的遮罩层
showToast: false,
defaultCity: '',
// 多商户被选中的index, 与members配合使用
// 给选中的tab加粗
curIndex: 0,
curAddress: 0,
// 确认/取消按钮可用状态
canClick: true,
// 页面标题
title: "",
mode: "", // 01-editMember, 02-addAddress
},
onLoad: function ( options ) {
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
//step1: 初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members') || [],
member : wx.getStorageSync('member') || {},
memberInfo : wx.getStorageSync('memberInfo') || {},
})
}
//step2: 获取上一页面传入的数据
var mode = ""
var title = ""
if (options.mode != "")
{
mode = options.mode;
title = options.title;
}
_this.setData({ mode, title })
var defaultCity = app.globalData.defaultCity
_this.setData({ defaultCity })
//step3: 设置当前memberInfo的信息
var memberInfo = app.assignDict(app.globalData.memberInfo)
//如果是新增商家, 则重置memberInfo数据
if(mode == "03")
{
//重置memberInfo数据
memberInfo.member_id = ""
memberInfo.address_id = ""
memberInfo.address_status = "00"
memberInfo.member_name = ""
memberInfo.member_address = ""
memberInfo.member_slogan = "标语待完善中"
memberInfo.member_logo = ""
memberInfo.member_city = defaultCity
}
_this.setData({ memberInfo })
//step4: 设置窗口标题
wx.setNavigationBarTitle({
title: title,
})
},
onReady: function (e) {
var _this = this;
//进入页面就自动获取oss参数
app.oss('logoToken');
var canClick = true;
_this.setData({ canClick })
},
// Date Flow
// 添加口号到local page的memberInfo
bindSlogan(e) {
var _this = this;
var memberInfo = _this.data.memberInfo || {}
memberInfo["member_slogan"] = e.detail.value
_this.setData({ memberInfo })
},
// 添加名称到local page的memberInfo
bindName(e) {
var _this = this;
var memberInfo = _this.data.memberInfo || {}
memberInfo["member_name"] = e.detail.value
_this.setData({ memberInfo })
},
// 添加城市到local page的memberInfo
// jscat 20200915,
bindCity(e) {
var _this = this;
var memberInfo = _this.data.memberInfo || {}
memberInfo["member_city"] = e.detail.value
_this.setData({ memberInfo })
},
//添加地址到local page的memberInfo
bindAddress(e) {
var _this = this;
var memberInfo = _this.data.memberInfo || {}
memberInfo.member_address = e.detail.value
_this.setData({ memberInfo })
},
/*
logo处理功能
*/
/*
logo处理功能
*/
addLogo: function (res) {
var _this = this;
console.log("===this is addLogo");
wx.chooseImage({
sizeType: ['original, compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log("===addLogo_上传图片参数", res)
var memberInfo = _this.data.memberInfo
memberInfo['member_logo'] = res.tempFilePaths[0]
_this.setData({
memberInfo
})
}
})
},
previewImage(e) {
var _this = this;
const current = e.target.dataset.src
wx.previewImage({
current,
urls: [ _this.data.memberInfo.member_logo ]
})
},
areablur:function(){
this.setData({
auto_height:false
})
},
areafocus:function(){
this.setData({
auto_height: true
})
},
checkField(){
var _this = this;
var info = ""
if(_this.data.memberInfo.member_slogan == "")
{
info = "请输入店铺标语"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
_this.setData({ canClick: true})
return false;
}
else if(_this.data.memberInfo.member_logo == "")
{
info = "请上传店铺logo"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
_this.setData({ canClick: true})
return false;
}
else if(_this.data.memberInfo.member_name == "")
{
info = "请输入店铺名称"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
_this.setData({ canClick: true})
return false;
}
else if(_this.data.memberInfo.member_city == "")
{
info = "请输入店铺城市"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
_this.setData({ canClick: true})
return false;
}
else if(_this.data.memberInfo.member_address == "")
{
info = "请输入店铺地址"
wx.showModal({
content: info,
showCancel: false,
confirmText: '确认'
})
_this.setData({ canClick: true})
return false;
}
console.log("字段校验成功")
return true;
},
onAddressPicker: function (e) {
var _this = this;
var curAddress = e.detail.value
_this.setData(
{
curAddress: curAddress,
}
)
},
// 确认修改/新增
/*
数据更新保存在local
更新数据库
如果成功
则同步更新storage数据和app.globalData数据
*/
toConfirm(e) {
var _this = this;
var mode = _this.data.mode
var canClick = _this.data.canClick
//可确认状态才执行数据操作
if(canClick == true)
{
//do nothing
//先设置按钮不可点击
var canClick = false;
_this.setData({ canClick })
if(mode == "01") //修改商家信息 editMember
{
//写入数据库,如果成功,则更新数据; 触发父页面的方法
_this.onEditMember()
}
else if (mode == "02") //新增地址信息 addAddress
{
//写入数据库,如果成功,则更新数据; 触发父页面的方法
_this.onAddAddress()
}
else if (mode == "03") //新增商家信息 addMember
{
//写入数据库,如果成功,则更新数据; 触发父页面的方法
//检查字段
if(_this.checkField())
{
_this.onAddMember()
}
}
}
},
// 取消
toCancel(e) {
var _this = this;
wx.navigateBack({
delta: 1
})
},
// 修改商家信息 member(tbl_member)/memberInfo(tbl_address)
onEditMember(e)
{
var _this = this;
var memberInfo = _this.data.memberInfo
if(memberInfo.member_slogan == app.globalData.memberInfo.member_slogan &&
memberInfo.member_address == app.globalData.memberInfo.member_address)
{
_this.showToast("商家信息未修改");
}
else
{
_this.editMember();
}
},
editMember(e) {
var _this = this;
var memberInfo = _this.data.memberInfo
var query_url = '?memberId=' + memberInfo.member_id +'&memberSlogan=' + memberInfo.member_slogan + '&memberAddress='+memberInfo.member_address + '&addressStatus='+memberInfo.address_status + '&addressId='+memberInfo.address_id
var strUrl = config.member_edit_url + 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 memberInfo = _this.__data__.memberInfo
//成功则更新storage和app.globalData
wx.setStorageSync('memberInfo', memberInfo)
app.globalData.memberInfo = memberInfo
//表示修改了一个字符串
var options = {'mode': '01'}
var pages = getCurrentPages();//当前页面栈
if (pages.length > 1) {
var prevPage = pages[pages.length - 2];//获取上一个页面实例对象
prevPage.updateMemberData(options);//触发父页面中的方法
}
_this.showToast("商家信息修改成功")
}
}
})
},
// 新增地址信息
onAddAddress(e) {
var _this = this;
var memberInfo = _this.data.memberInfo
if(memberInfo.member_address == app.globalData.memberInfo.member_address)
{
_this.showToast("商家信息未修改");
}
else
{
_this.addAddress();
}
},
addAddress(e) {
var _this = this;
var memberInfo = _this.data.memberInfo
var query_url = '?memberId=' + memberInfo.member_id + '&memberAddress='+memberInfo.member_address
var strUrl = config.member_add_address_url + 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请求成功, 更新memberInfo数据
console.log(res.data);
var memberInfo = _this.__data__.memberInfo
var dict = res.data.data
memberInfo['address_status'] = dict['addressStatus']
memberInfo['address_id'] = dict['addressId']
//成功则更新storage和app.globalData
//step1: 设置memberInfo
wx.setStorageSync('memberInfo', memberInfo)
app.globalData.memberInfo = memberInfo
_this.setData({memberInfo})
//step2: 设置memberInfos
//表示新增了一个字符串
var options = {'mode': '02'}
var pages = getCurrentPages();//当前页面栈
if (pages.length > 1) {
console.log("enter into addAddress prevPage.updateMemberData(options)")
var prevPage = pages[pages.length - 2];//获取上一个页面实例对象
prevPage.updateMemberData(options);//触发父页面中的方法
}
_this.showToast("商家地址新增成功")
}
}
})
},
// 新增商家信息
onAddMember(e) {
var _this = this;
var memberInfo = _this.data.memberInfo
_this.addMember(memberInfo);
},
addMember: function(memberInfo) {
var _this = this;
var default_member = "01"
var address_status = "01"
let promise_regMember = new Promise(function (resolve, reject) {
app.onRegMemberOss(memberInfo, default_member, address_status, resolve, reject)
})
promise_regMember.then(
function (value) {
console.log("===enter promise_regMember then_pass_" + value)
// 提交活动
// 存入数据库
// 成功之后返回activity页面
var memberInfo = app.globalData.memberInfo
//step1: 设置memberInfo
_this.setData({memberInfo})
//step2: 设置memberInfos
//表示新增了一个字符串
var options = {'mode': '03'}
var pages = getCurrentPages();//当前页面栈
if (pages.length > 1) {
var prevPage = pages[pages.length - 2];//获取上一个页面实例对象
prevPage.updateMemberData(options);//触发父页面中的方法
}
_this.showToast("商家信息新增成功")
},
function (value) {
console.log("===enter promise_regMember then_failed_" + value)
});
},
showToast(title){
var _this = this;
var showToast = true;
_this.setData({ showToast })
wx.showToast({
icon: 'none',
title: title,
duration: 2000,
success: function(){
setTimeout(function(){
var showToast = false
var canClick = true
_this.setData({ showToast, canClick })
wx.navigateBack({
delta: 1
})
}, 2000)
}
})
}
})
{
{
"navigationBarTitleText": "活动发布"
}
\ No newline at end of file
<view class="page-body">
<view class="page-body">
<!-- 定义遮罩层 -->
<view class="mask" wx:if="{{showToast}}"></view>
<!-- 新增商家 -->
<block wx:if="{{mode=='03'}}">
<!-- start of 商家信息 -->
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">商家信息</view>
</view>
<!-- 地址 -->
<view class="weui-uploader__hd">
<input class="weui-input" bindinput="bindSlogan" placeholder="1、请输入店铺标语" value="{{memberInfo.member_slogan}}" />
</view>
<!-- start of note-row -->
<view class="note-row">
<!-- start of column left -->
<view class="note-column-left align justify">
<view class="weui-uploader__bd">
<!-- start of 未上传 -->
<block wx:if="{{memberInfo.member_logo == ''}}">
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="addLogo"></view>
<view style="color: rgba(0,0,0,.5);font-size:30rpx;">2、添加Logo</view>
</view>
</block>
<block wx:else>
<view class="weui-uploader__files">
<block wx:for="{{[memberInfo.member_logo]}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
</block>
<!-- end of 未上传 -->
</view>
</view>
<!-- end of note-column-left -->
<!-- start of note-column-->
<view class="note-column" style="margin-left: 20rpx;">
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindName" placeholder="3、请输入店铺名称" />
</view>
</view>
</view>
<!-- end of note-column-->
<!-- start of note-column-->
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindCity" value="{{defaultCity}}" placeholder="4、请输入店铺城市">
</input>
</view>
</view>
</view>
<!-- end of note-column-->
<!-- start of note-column-->
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindAddress" placeholder="5、请输入店铺地址" />
</view>
</view>
</view>
<!-- end of note-column-->
</view>
</view>
</view>
</view>
</view>
</view>
<!-- end of 商家信息 -->
</block>
<block wx:else>
<!-- start of 商家信息 -->
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">商家信息</view>
</view>
<!-- 地址 -->
<view class="weui-uploader__hd">
<input class="weui-input" bindinput="bindSlogan" placeholder="1、请输入店铺标语" value="{{memberInfo.member_slogan}}" />
</view>
<!-- start of note-row -->
<view class="note-row">
<!-- start of column left -->
<view class="note-column-left align justify">
<view class="weui-uploader__bd">
<!-- start of 已上传 -->
<view class="weui-uploader__files">
<block wx:for="{{[memberInfo.member_logo]}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
<!-- end of 已上传 -->
</view>
</view>
<!-- end of note-column-left -->
<!-- start of note-column-->
<view class="note-column" style="margin-left: 20rpx;">
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
{{memberInfo.member_name}}
</view>
</view>
</view>
<!-- end of note-column-->
<!-- start of note-column-->
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
<!-- <textarea auto-height="{{auto_height}}" class="weui-textarea" bindinput="bindAddressEdit" placeholder="5、请输入店铺地址" value="{{memberInfo.member_address}}"/> -->
<input class="weui-input" bindinput="bindAddress" placeholder="5、请输入店铺地址" value="{{memberInfo.member_address}}"/>
</view>
</view>
</view>
<!-- end of note-column-->
<!-- start of note-column-->
<view class="weui-cells weui-cells_after-title" style="height: 96rpx">
<view>
<view class="weui-cell__bd">
</view>
</view>
</view>
<!-- end of note-column-->
</view>
</view>
</view>
</view>
</view>
</view>
<!-- end of 商家信息 -->
</block>
<view class="navBar" >
<view class="navBar-box" style="display:flex; justify-content: center;align-items: center;">
<view class="cate-list {{canClick==true?'on':''}}" bindtap="toConfirm" disabled="{{!canClick}}" >确认</view>
<view class="cate-list" bindtap="toCancel" disabled="{{!canClick}}" >取消</view>
</view>
</view>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.note-row{
width: 100%;
display: flex;
flex-direction: row;
}
.note-column{
display: flex;
flex-direction: column;
}
.note-column-left{
width : 196rpx;
display: flex;
}
.writer-image{
width: 196rpx;
height: 196rpx;
}
/* 消息提示框的遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
/* start of navbar navBar -> navBar-box -> cate-list -> cate-list.on jscat 20200916*/
.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;
}
.navBar-box .cate-list.update {
color: #e64340;
font-weight: bold;
}
.cate-list image {
width: 70rpx;
height: 70rpx;
margin-right: 15px;
vertical-align: middle;
}
.navBar-box{
width: 100%;
height: 60rpx;
}
/* end of navbar */
/* start of menuBox 下拉菜单 */
.address_member{
height: 80rpx;
background: #fff;
float:left;
}
.selecrtImg{
float:left;
margin-top: 10rpx;
}
/* end of menuBox */
/* start of button */
.button-sp-area{
margin: 0 auto;
text-align:center;
font-size: 32rpx;
}
.mini-btn{
margin: 0 4px;
font-size: 32rpx;
}
.weui-cells{
width: 100%;
margin-top: 0;
bottom:0px;
left:0px;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell_access{
border-top: 1px solid #ffffff;
}
.weui-cell__hd image {
width: 70rpx;
height: 70rpx;
margin-right: 15px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
/* end of button */
/* 遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
\ No newline at end of file
// pages/member/quiz-post/quiz-edit/quiz-edit.js
// pages/member/quiz-post/quiz-edit/quiz-edit.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../../../utils/log.js')
var util = require('./../../../../utils/util.js')
Page({
data: {
quizList : [],
//阿里云 OSS相关参数
accessid: "",
policy: "",
signature: "",
host: "",
dir: "",
expire: "",
securityToken: "",
},
onLoad: function () {
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
_this.setData({
scrollTop: a-200
})
}
})
var quizInfo_1 = {
questionId : "qid_001",
questionName : "叁年间2020年最受欢迎的活动是?",
answer : "B",
choiceString : [
"Tunight盲品活动",
"'奥地利'「月选酒」套装, 一天不到700支",
"周年庆,烧烤海鲜自助",
"Royi·叁年间的酒市集",
]
}
var quizInfo_2 = {
questionId : "qid_001",
questionName : "与勃艮第( Burgundy)的黑比诺( Pinot Noir )相比,新西兰的黑比诺葡萄酒具有什么特点? ",
answer : "D",
choiceString : [
"酸度更高,酒体更饱满",
"酸度较低,酒体更饱满",
"果香更加浓郁",
"B 和 C ",
]
}
var quizList = []
quizList.push(quizInfo_1)
quizList.push(quizInfo_2)
_this.setData({
quizList: quizList
})
},
onReady: function (e) {
var _this = this;
//进入页面就自动获取oss参数
_this.oss();
},
// Page Flow
navigateToSubmit() {
let promise = app.onCheckText(app.globalData.postData.photoTag)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
wx.navigateTo({ url: './../quiz-submit/quiz-submit' })
},
function (value) {
console.log("===enter promise then_failed_" + value)
},);
},
// Date Flow
// 输入该组图片的标签
bindKeyInput(e) {
var _this = this;
_this.setData({
inputValue: e.detail.value
})
//全局赋值
app.globalData.postData.photoTag = e.detail.value
},
addList: function(e){
var _this = this;
var dataId = e.currentTarget.dataset.id
var quizList = _this.data.quizList;
var newData = "索诺玛( Sonoma)";
quizList[dataId].choiceString.push(newData);//实质是添加lists数组内容,使for循环多一次
this.setData({
quizList: quizList,
})
},
delList: function (e) {
var _this = this;
var idxId = e.currentTarget.id;
var subId = e.currentTarget.dataset.id
var quizList = _this.data.quizList;
quizList[idxId].choiceString.splice( subId,1);;//实质是添加lists数组内容,使for循环多一次
this.setData({
quizList: quizList,
})
},
switchTab() {
//跳转到/activity.wxml页面
app.globalData.switchId = 0
wx.switchTab({
url: '/pages/activity/activity'
});
},
addMore: function(){
var _this = this;
var quizList = _this.data.quizList;
var quizInfo = {
questionName : "新西兰的优质黑比诺( Pinot Noir )产区有?",
answer : "",
choiceString : [
"中奥塔哥( Central Otago )",
]
}
quizList.push(quizInfo);//实质是添加lists数组内容,使for循环多一次
this.setData({
quizList: quizList,
})
},
// start of aliyun oss
// Date Flow
// 提交oss和数据库
onSubmitPost: function (e) {
var _this = this;
var title = e.detail.value.inputTitle;//获取title
var content = e.detail.value.inputContent;//获取content
app.globalData.postData.title = title
app.globalData.postData.content = content
if (content != undefined && content != "") {
//step1, 上传至oss-获取token,在onReady()提前准备
//_this.oss();
//step2, 判断文本是否合规
let promise = app.onCheckText(title+content)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
//step3, 上传至oss-上传图片
//_this.releaseOss(title, content);
_this.switchTab()
},
function (value) {
console.log("===enter promise then_failed_" + value)
});
//step4, 上传信息到数据库
//上传数据库在oss sdk的callback函数里设置
//需要java后台支持
}
},
oss: function () {
var _this = this;
console.log("===this is oss");
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234"
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
_this.setData({
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
})
}
}
})
},
//上传照片(阿里云)
uploadAli: function (tag, title, content, photoArr) {
var _this = this;
console.log("===uploadAli_data_tag: ",tag)
console.log("===uploadAli_data_title: ",title)
console.log("===uploadAli_data_content: ",content)
console.log("===uploadAli_data_photoArr: ",photoArr)
var promise = Promise.all(photoArr.map((pic, index) => {
//pic是多图上传模式中的单张图片 index => 0 : length-1
console.log(pic)
//传给阿里云的参数
var policy = this.data.policy;
var accessid = this.data.accessid;
var securityToken = this.data.securityToken;
var signature = this.data.signature;
var path = this.data.host + "/" + this.data.dir;
console.log("policy: " + policy);
console.log("signature: " + signature);
console.log("accessid: " + accessid);
console.log("path: " + path)
var babyData = {
'Filename': '${filename}',
'name': pic.replace('http://tmp/', "").replace('wxfile://', ""),
'key': this.data.dir + '${filename}',
'policy': policy,
'OSSAccessKeyId': accessid,
'success_action_status': '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'x-oss-security-token': securityToken
}
// 多图n上传流程,通过promise.all实现异步控制
// n-1图直接上传
// 第n图上传+设置callback,在java后台提交参数到数据库
if (index == photoArr.length - 1)
{
var photoArrsm = [];
//由于微信小程序生成的临时路径在上传阿里云的时候不需要上传.所以需要对路径进行处理,但是在手机端上传和PC端上传,图片临时路径的前缀不同,所以需要进行分别的处理
// pc: http://tmp/
// wx: wxfile://
for (let i = 0; i < photoArr.length; i++) {
photoArrsm.push(path + photoArr[i].replace('http://tmp/', "").replace('wxfile://', ""));
}
//生成最终的文件字符串 file1.jpg::file2.png (数据库解析格式)
var image = photoArrsm.join("::")
var userId = wx.getStorageSync('nyxCode')
var strUrl = config.oss_callback_url
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag=' + encodeURI(encodeURI(tag)) + '&title=' + encodeURI(encodeURI(title)) + '&content=' + encodeURI(encodeURI(content)) + '&image=' + image + '&userId=' + userId,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
babyData['callback'] = base64_callback_body
}
return new Promise(function (resolve, reject) {
var host = _this.data.host;
wx.uploadFile({
url: host,
formData: babyData,
name: 'file',
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
success: function (res) {
console.log("=== index_"+index)
console.log(res)
resolve(res.data);
},
fail: function (err) {
reject(new Error('failed to upload file'));
console.log("fail to upload file")
},
complete: function () {
console.log("complete to upload file");
}
});
});
})).then(_this.switchTab());
},
//发布按钮
releaseOss: function (title, content) {
var _this = this;
console.log("===this is releaseOss");
//获取照片数组
var photoArr = app.globalData.postData.photoArray;
//时间搓
var expire = this.data.expire;
//获取当前时间搓
var expireNow = Date.parse(new Date()) / 1000;
//如果当前时间大于获取的时间 则重新获取oss;
if (expire == undefined || expireNow > expire) {
//重新获取oss
_this.oss();
expire = this.data.expire;
}
var tag = app.globalData.postData.photoTag
this.uploadAli(tag, title, content, photoArr)
},
// end of aliyun oss
})
{
{
"navigationBarTitleText": "添加详情"
}
\ No newline at end of file
<!-- /page/member/quiz-post/quiz-edit/quiz-edit 添加分类的特点,以及自定义特点 -->
<!-- /page/member/quiz-post/quiz-edit/quiz-edit 添加分类的特点,以及自定义特点 -->
<wxs module="tutil" src="./../../../../utils/date.wxs"></wxs>
<view class="page" style="height:100%;width:100%">
<block>
<button type="default" bindtap="switchTab">竞答发布</button>
</block>
<view class="weui-cells__title">#添加标题</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入标题" />
</view>
</view>
</view>
<view class="weui-cells__title">#添加积分</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入积分" />
</view>
</view>
</view>
<view class="weui-cells__title">#添加问题</view>
<block wx:for="{{quizList}}" wx:for-item="quizInfo" wx:for-index="idx" wx:key="{{idx}}">
<view class='table'>
<!-- 题目所在行 -->
<view class='table_header'>
<view class="th-question" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>问题{{idx+1}}</view>
</view>
<view class='th-question' style='width:70%;'>
<view class="table_Text_class">{{quizInfo.questionName}}</view>
</view>
<view class="th-question" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
<!-- 答案所在行 -->
<view class='table_header'>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>答案</view>
</view>
<view class='th' style='width:70%;'>
<view class="cell_label centerclass">{{quizInfo.answer}}</view>
</view>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label'>
</view>
</view>
</view>
<!-- 选项列表 -->
<block wx:for="{{quizInfo.choiceString}}" wx:for-item="item" wx:key="{{index}}">
<view class='table_main'>
<!--类别 -->
<view class='td' style='width:15%;background-color:white;'>
<view class="cell_label centerclass">{{tutil.formatAnswer(index+1)}}</view>
</view>
<!-- 描述 -->
<view class='td'>
<view class='table_Text_last_class'>
{{item}}
</view>
</view>
<!-- start 删除新行按钮 -->
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label' bindtap='delList' id="{{idx}}" data-id="{{index}}">
<image src="../../../../icon/del.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
<!-- end 删除新行按钮 -->
</view>
</block>
<!-- start 添加新行按钮 -->
<view class='table_header'>
<view class="th" style='width:15%;background-color:white'>
<view class='centerclass cell_label' bindtap='addList' data-id="{{idx}}">
<image src="../../../../icon/add.png" style="width: 50rpx;height: 50rpx;"></image>
</view>
</view>
</view>
<!-- end 添加新行按钮 -->
</view>
<view class="weui-cells__title"></view>
</block>
<block>
<button type="default" bindtap="addMore">新增一题</button>
</block>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
/* 表格 */
.table{
display: inline-flex;
flex-direction: column;
border: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 0;
width: 100%;
}
.scrollClass {
display: flex;
width: 100%;
white-space: nowrap;
margin-top: 23px;
height: 100%;
background-color: white;
}
.table_header {
display: inline-flex;
}
.th-question {
display: flex;
flex-direction: column;
width: 70%;
height: 140rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.th {
display: flex;
flex-direction: column;
width: 70%;
height: 90rpx;
background: rgba(241, 252, 255, 1);
border-right: 1rpx solid rgba(218, 217, 217, 1);
border-bottom: 1rpx solid rgba(218, 217, 217, 1);
justify-content: center;
align-items: center;
overflow-x: auto;
}
.cell_label{
font-size: 26rpx;
color: rgba(74, 74, 74, 1);
}
.cell_date_label{
font-size: 20rpx;
color: rgba(74, 74, 74, 1);
}
.table_main {
display: inline-flex;
flex-direction: row;
}
.right-item{
display: flex;
flex-direction: row;
}
.td {
display: flex;
flex-direction: column;
width: 70%;
/* height: 90rpx; */
background: white;
justify-content: center;
align-items: center;
border: 1rpx solid rgba(218, 217, 217, 1);
border-top: 0;
border-left:0;
}
.table_Text_class {
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgb(152, 18, 8);
width: 100%;
word-break: normal;
}
.table_Text_last_class{
display: flex;
justify-content: center;
align-items: center;
height: 60rpx;
font-size: 30rpx;
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
}
\ No newline at end of file
// pages/member/quiz-post/quiz-post.js
// pages/member/quiz-post/quiz-post.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../../utils/log.js')
var util = require('./../../../utils/util.js')
/*
提交流程
1. post.js 生成图片的临时路径
2. edit.js 编辑标签
3. submit.js 上传阿里云oss, 将内容上传到数据库
- 获取token
- 上传oss
- 上传数据库
*/
const base64 = require('./../../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
Page({
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
that.setData({
scrollTop: a-200
})
}
})
wx.setNavigationBarTitle({
title: '竞答创建',
})
},
data: {
photoArray: [],
sourceTypeIndex: 2,
sourceType: ['拍照', '相册', '拍照或相册'],
sizeTypeIndex: 2,
sizeType: ['压缩', '原图', '压缩或原图'],
countIndex: 8,
count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
//定义图片尺寸
imageSize: '',
},
sourceTypeChange(e) {
this.setData({
sourceTypeIndex: e.detail.value
})
},
sizeTypeChange(e) {
this.setData({
sizeTypeIndex: e.detail.value
})
},
countChange(e) {
this.setData({
countIndex: e.detail.value
})
},
//在进入页面时就执行,用于初始化
onReady: function (e) {
},
// Page Flow
navigateToEdit() {
var _this = this;
var newFilePaths = _this.data.photoArray
// let promise = app.onCheckPic(newFilePaths)
// //在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
// //then后的括号里应该是参数param
// //https://www.cnblogs.com/qlongbg/p/11603328.html
// promise.then(function (value) {
// console.log("===checkPic_enter promise then_" + value)
// //同步更新全局变量
// app.globalData.postData.photoArray = newFilePaths
// wx.navigateTo({ url: './edit/edit' })
// });
app.globalData.postData.photoArray = newFilePaths
wx.navigateTo({ url: './quiz-edit/quiz-edit' })
},
// Date Flow
/*
step1: 选定图片,可以预览
step2: 添加描述文字,选择tag
step3: 上传
1. chooseImage
2. 进行图片编辑
3. 点击下一步验证图片是否合法合规 navigateToEdit
通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
1) > 2M会出现 45002, content size out of limit 错误
2) 自动裁剪成4:3 或 1:1
*/
addPhoto: function (res) {
var _this = this;
_this.setData({
photoArray: []
})
console.log("===this is addPhoto");
wx.chooseImage({
sizeType: ['original, compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var canvasId = "photoCanvasId";
console.log("===addPhoto_上传图片参数", res)
_this.onEditPic(res, canvasId)
}
})
},
previewImage(e) {
const current = e.target.dataset.src
wx.previewImage({
current,
urls: this.data.photoArray
})
},
//保存图形的tmp地址
saveData(newFilePaths){
var _this = this;
console.log("===saveData", newFilePaths)
_this.setData({
photoArray: newFilePaths
})
app.globalData.postData.photoArray = newFilePaths;
},
//小程序图片处理主函数
editPic(tempFilePaths, index, canvasId) {
var _this = this;
var photoArray = _this.data.photoArray
if (index < tempFilePaths.length){
var pic = tempFilePaths[index]
wx.getImageInfo({
src: pic, //图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径,
success: function (res) {
// util.imageUtil 用于计算长宽比
var i = index + 1
console.log("第"+i+"张上传图片参数", res)
var imageSize = util.imageUtil(res);
console.log("success on getImageInfo_"+index);
console.log(imageSize)
_this.setData({
imageSize: imageSize
})
const ctx = wx.createCanvasContext(canvasId);
//ctx.drawImage(pic, 0, 0, imageSize.swidth, imageSize.sheight);
ctx.drawImage(pic, imageSize.sx, imageSize.sy, imageSize.swidth, imageSize.sheight,
imageSize.x, imageSize.y, imageSize.width, imageSize.height);
// 需要注意的是 draw 方法是异步的,如果图片还没加载成功,有可能画出来的是空的
// 所以 draw 方法通常都会带有定时器这样的回调
ctx.draw(false, setTimeout(function () {
//ctx.draw(false, function () {
var i = index + 1
console.log("==enter draw_"+i);
wx.canvasToTempFilePath({
canvasId: canvasId,
fileType:"jpg",
success: function (res) {
console.log("===success_", res)
console.log("===第"+i+"图处理成功")
photoArray.push(res.tempFilePath)
_this.setData({
photoArray: photoArray
})
index = index + 1
_this.editPic(tempFilePaths, index, canvasId); // 用于多个图片压缩
},
fail: function (e) {
var i = index + 1
console.log("===第"+i+"图处理失败")
}
});
},1000));
//});
},
fail: function(e) {
console.log("failed", e);
},
complete: function(e) {
var i = index + 1
console.log("complete on getImageInfo_"+i, e);
}
})
}
},
// 通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
// 1) > 2M会出现45002, content size out of limit错误
// 2) 自动裁剪成4:3(高/宽 1080) 或 1:1 有品默认1:1
// refer1 微信小程序图片压缩 https://www.jianshu.com/p/1b8a1e96a6d5
// refer2 小程序压缩图片(canvas) https://www.jianshu.com/p/ec1f95008dce
onEditPic(res, canvasId) {
var _this = this;
var tempFilePaths = res.tempFilePaths;
var index = 0;
_this.editPic(tempFilePaths, index, canvasId)
}
})
{
{
"navigationBarTitleText": "竞答创建"
}
\ No newline at end of file
<!-- /pages/member/quiz-post/quiz-post.wxml -->
<!-- /pages/member/quiz-post/quiz-post.wxml -->
<view class="page" style="height:100%;width:100%">
<block>
<button type="default" bindtap="navigateToEdit">下一步</button>
</block>
<form>
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">图片上传</view>
<view class="weui-uploader__info">{{photoArray.length}}/{{count[countIndex]}}</view>
</view>
<view class="weui-uploader__bd">
<view class="weui-uploader__files">
<block wx:for="{{photoArray}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="addPhoto"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</form>
<canvas canvas-id='photoCanvasId' class='myCanvas' style='width:{{imageSize.width}}px;height:{{imageSize.height}}px'>
</canvas>
</view>
\ No newline at end of file
page{
page{
height: 100vh;
background-color:#f5f8fa;
}
.banner{
position: relative;
}
.banner image{
height: 200px;
width:100%;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
.banner .play{
width: 40px;
height: 40px;
position: absolute;
bottom: 10px;
right:10px;
z-index: 10;
}
.mdetail{
overflow: hidden;
height:55px;
padding:5px 10px;
border-bottom:1px solid #dbdbdb;
}
.mdetail image{
float:left;
width:55px;
height:55px;
}
.minfo{
float:left;
margin-left:10px;
padding:10px 0;
}
.detailLeft{
float:left;
}
.detailRight{
float:right;
}
.mname{
font-size: 14px;
margin-bottom:10px;
}
.mauthor{
font-size: 12px;
color:#dbdbdb;
}
/*
隐藏 canvas,避免显示错误
*/
.myCanvas {
position: absolute;
top: -9999px;
left: -9999px;
}
// pages/schedule/schedule.js
// pages/schedule/schedule.js
var config = wx.getStorageSync("config");
var app = getApp();
// https://treadpit.github.io/wx_calendar/
Page({
/**
* 页面的初始数据
*/
data: {
/* 用于判断是否已经登陆 */
nyxCode : "",
authStatus : "",
userInfo : {},
members: [],
curDate : "",
days : [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
}
wx.setNavigationBarTitle({
title: '活动日历',
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onToUser :function(e){
wx.navigateTo({
url: '/pages/my/user/user',
})
},
/**
* 日历初次渲染完成后触发事件,如设置事件标记
*/
afterCalendarRender(e) {
var _this = this;
console.log('===afterCalendarRender', e);
// => { year: 2019, month: 12}
const ym = this.calendar.getCurrentYM()
var month = ym['month'].toString().length==1?'0'+ym['month']:ym['month']
var strCurDate = ym['year'] + "-" +month
console.log("===strCurdate", strCurDate)
var query_url = '&curDate=' + strCurDate
_this.setData({
curDate : strCurDate,
})
var strUrl = config.activity_query_url + "?pageCount=" + 100
+ "&pageNum=" + 1 + query_url
getData(strUrl, "").then(res => {
console.log(res.data)
if(res.data.length >0) //有数据
{
var strMonth = _this.__data__.curDate.split("-")[1]
var list = []
var result = {}
for (var i = 0; i < res.data.length; i++) {
var title = res.data[i].title.substr(0, 6)
var start_datetime = res.data[i].startDatetime
var end_datetime = res.data[i].endDatetime
_this.getYearAndMonthAndDay(start_datetime, end_datetime, strMonth, title, result)
}
//进行setLabel
console.log("====",result);
var days = []
for(var key in result) {
var list = key.split("-")
var value = {
year: parseInt(list[0]),
month: parseInt(list[1]),
day: parseInt(list[2]),
todoText: result[key].slice(0,3).join("\n"),
color: '#f40' // 单独定义代办颜色 (标记点、文字)
}
days.push(value)
}
this.calendar.setTodoLabels({
// 待办点标记设置
pos: 'bottom', // 待办点标记位置 ['top', 'bottom']
dotColor: '', // 待办点标记颜色
circle: false, // 待办圆圈标记设置(如圆圈标记已签到日期),该设置与点标记设置互斥
showLabelAlways: false, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效
days: days,
});
}
else
{
console.log("==onLoad_userInfo success")
}
})
},
afterTapDay(e) {
const options = {
lunar: false // 在配置showLunar为false, 但需返回农历信息时使用该选项
}
const todoLabels = this.calendar.getTodoLabels(options);
console.log("===todoLabels", todoLabels);
const selectedDay = this.calendar.getSelectedDay(options);
console.log("===selectedDay", selectedDay);
console.log('===afterTapDay', e.detail); // => { currentSelect: {}, allSelectedDays: [] }
},
// 当日期改变的时候
whenChangeMonth(e)
{
var _this = this;
console.log('===whenChangeMonth', e.detail);
var month = e.detail.next['month'].toString().length==1?'0'+e.detail.next['month']:e.detail.next['month']
var strCurDate = e.detail.next['year'] + "-" +month
console.log("===strCurDate: ", strCurDate)
var query_url = '&curDate=' + strCurDate
_this.setData({
curDate : strCurDate,
})
var strUrl = config.activity_query_url + "?pageCount=" + 100
+ "&pageNum=" + 1 + query_url
getData(strUrl, "").then(res => {
console.log(res.data)
if(res.data.length >0) //无数据
{
//
var strMonth = _this.__data__.curDate.split("-")[1]
var list = []
var result = {}
for (var i = 0; i < res.data.length; i++) {
var title = res.data[i].title.substr(0, 6)
var start_datetime = res.data[i].startDatetime
var end_datetime = res.data[i].endDatetime
_this.getYearAndMonthAndDay(start_datetime, end_datetime, strMonth, title, result)
}
//进行setLabel
console.log("====");
var days = []
for(var key in result) {
var list = key.split("-")
var value = {
year: parseInt(list[0]),
month: parseInt(list[1]),
day: parseInt(list[2]),
todoText: result[key].slice(0,3).join("\n"),
color: '#f40' // 单独定义代办颜色 (标记点、文字)
}
days.push(value)
}
this.calendar.setTodoLabels({
// 待办点标记设置
pos: 'bottom', // 待办点标记位置 ['top', 'bottom']
dotColor: '', // 待办点标记颜色
circle: false, // 待办圆圈标记设置(如圆圈标记已签到日期),该设置与点标记设置互斥
showLabelAlways: false, // 点击时是否显示待办事项(圆点/文字),在 circle 为 true 及当日历配置 showLunar 为 true 时,此配置失效
days: days,
});
}
else
{
console.log("==onLoad_userInfo success")
}
})
},
// 获取Activities数据
getYearAndMonthAndDay: function(start, end, strMonth, title, result){
var i=0;
var startTime = new Date(start.split('-').join('/'));
var endTime = new Date(end.split('-').join('/'));
var len = 0
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(month == strMonth && result.hasOwnProperty(strKey))
{
result[strKey].push(title);
}
else if(month == strMonth)
{
result[strKey] = [title];
}
else
{
result[strKey] = [];
}
startTime.setDate(startTime.getDate()+1);
i+=1;
}
}
})
//通过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)
}
})
})
}
\ No newline at end of file
{
{
"usingComponents": {
"calendar": "/component/calendar/index"
}
}
\ No newline at end of file
<view class="page">
<view class="page">
<calendar
calendarConfig="{{calendarConfig}}"
bind:onTapDay="onTapDay"
bind:afterTapDay="afterTapDay"
bind:onSwipe="onSwipe"
bind:whenChangeWeek="whenChangeWeek"
bind:whenChangeMonth="whenChangeMonth"
bind:afterCalendarRender="afterCalendarRender"
>
</calendar>
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 100rpx;
height: 100rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
.avatar{
width: 100rpx;
height: 100rpx;
overflow:hidden;
border-radius: 50%;
}
// pages/activity/activity.js
// pages/activity/activity.js
const app = getApp()
var config = wx.getStorageSync("config");
var event = require('./../../../utils/event.js')
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : "", // 商家信息
collects: [],
// {
// 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,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
}
// step2: todo temp 暂时设置所有用户为个人(可以查看个人->商家管理)
// step3 数据载入页面, 初始化
wx.setStorageSync('likeDictStorage', {})
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: '我的收藏',
})
//初始载入5个收藏活动
if(_this.__data__.collects.length == 0)
{
//消费collects
_this.getCollects(0, 1, 5);
}
// event 订阅, 主要接受activity-info.js里 emit 发送的消息
event.on('LikeChanged', this, function(data) {
var activity_id = data['activity_id']
var collects = _this.__data__.collects;
// step1: 在这个页面只能直接取消; 故直接从collects里去除该记录
for(var index=0; index< collects.length; index++)
{
if(activity_id == collects[index]['activity_id'])
{
collects.splice(index, 1)
}
}
_this.setData({
collects: collects,
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
event.remove('LikeChanged', this);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getCollects(1, pageIndex, 5);
}, 1000)
}
else {
console.log('没有更多')
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 用户自定义函数
*
*/
// 获取collects数据
// scrollType: 是否是翻页
/*
搜索逻辑:
1. 搜索框, tag=strSearch + title=strSearch
2. tab, tag=strSearch
3. 新增的search tab, '搜索'tab的时候,需要转换为搜索的关键词(_this.__data__.strSearch)
*/
getCollects: function (scrollType, pageNum, pageCount) {
var _this = this;
var userId = _this.__data__.nyxCode
var query_url = '&userId=' + userId
var strUrl = config.collect_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;
}
// 设置全局的点赞标记 step1
var likeDictStorage = wx.getStorageSync('likeDictStorage') || {}
for (var i = 0; i < res.data.data.length; i++) {
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
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
// 设置全局的点赞标记 step2
likeDictStorage[result["activity_id"]] = 1
var url_quiz = "../../activity/quiz-info/quiz-info?"
+"activity_id="+result["activity_id"]
+"&index_id="+i
+"&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="+i
+"&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)
}
// 设置全局的点赞标记 step3
wx.setStorageSync('likeDictStorage', likeDictStorage)
//进行翻页设置(加载更多)
if (scrollType == 1) {
var collectsList = _this.__data__.collects;
list = collectsList.concat(list)
}
_this.setData({
collects: list,
pageIndex: pageNum + 1,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
})
//通过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)
}
})
})
}
<wxs module="tutil" src="./../../../utils/date.wxs"></wxs>
<wxs module="tutil" src="./../../../utils/date.wxs"></wxs>
<view class="page">
<!-- 收藏列表 -->
<view class="top_placeholder"></view>
<!--
title
unit_price
date
member_name 进店 >
-->
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{collects}}" 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;
}
/* narBar -> 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;
}
.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: 80rpx;
height: 80rpx;
}
.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*/
.top_placeholder {
position: relative;
width: 100%;
height: 40rpx;
line-height: 10rpx;
}
// pages/my/my-member/my-member.js
// pages/my/my-member/my-member.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : "", // 商家信息
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
}
/**
* 系统配置:主要用于置底页面设置 step2
*/
var windowHeight = wx.getSystemInfoSync().windowHeight;//获取设备高度,小程序自带的方法
this.setData({
windowHeight: windowHeight
})
/* end */
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
var _this = this;
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
onSwitchTab: function() {
wx.switchTab({
url: "/pages/member/activity-post/activity-post"
})
}
})
\ No newline at end of file
{
{
"usingComponents": {},
"navigationBarTitleText": "商家管理"
}
\ No newline at end of file
<!--pages/my/my-members/my-members.wxml-->
<!--pages/my/my-members/my-members.wxml-->
<wxs module="tutil" src="../../../utils/date.wxs"></wxs>
<view class="page">
<view class="workbench">
<text class="title">活动</text>
<view class="list">
<view class="items">
<view bindtap="onSwitchTab">
<image src="/icon/my/activity.png"></image>
</view>
<text>活动创建</text>
</view>
<view class="items">
<navigator url="/pages/member/schedule/schedule">
<image src="/icon/member/schedule.png"></image>
</navigator>
<text>活动日历</text>
</view>
</view>
</view>
</view>
.workbench{
.workbench{
font-size: 30rpx;
background: #fff;
padding-bottom: 30rpx;
margin-bottom:10rpx;
color: #333;
}
.workbench .title{
font-size: 35rpx;
padding: 20rpx 20rpx;
margin-bottom: 40rpx;
display: block;
}
.workbench .items{
width: 100rpx;
flex:1;
text-align: center;
}
.workbench .items image{
width: 100rpx;
height: 100rpx;
}
.workbench .items image.service-icon{
width: 50rpx;
height: 50rpx;
}
.workbench .items text{
display: block;
text-align: center;
margin-top: 0rpx;
margin-bottom: 0rpx;
}
.workbench .items text.top{
display: block;
text-align: center;
margin-bottom: 0rpx;
}
.workbench .items text.bottom{
display: block;
text-align: center;
margin-top: 0rpx;
}
.workbench .list{
display: flex;
flex-direction: row;
flex:1;
}
/* end */
\ No newline at end of file
// pages/my/my-orders/my-orders.js
// pages/my/my-orders/my-orders.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
members : [],
//选中barcode的qrcode和url
qrcode : "",
qrcode_url : "",
/* 模态框 */
showModalPoints: false,
showModalBarcode : false,
//活动列表
orders : [],
//选中barcode的qrcode和url
qrcode : "",
qrcode_url : "",
// {
// rankId : "rid_001",
// defaultType : "1",
// matchType : "竞答",
// title : "泥煤怪兽",
// rank : "1",
// score : "200",
// ratio : "96%",
// },
isHideLoadMore: false,
/* 模态框 */
showModalPoints: false,
showModalBarcode : false,
/* 订单 可使用/不可用状态 */
pageIndex : 1,
orderStatus: "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
wx.setNavigationBarTitle({
title: '我的活动',
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members: wx.getStorageSync('members'),
})
}
//初始载入四个积分
if(_this.__data__.orders.length == 0)
{
//getPoints(scrollType, pageNum, pageCount, matchStatus)
//onLoad的时候展示可使用的订单
var orderStatus = '10::20'
_this.getOrders(0, 1, 6, orderStatus);
_this.setData({
orderStatus : orderStatus, // 默认为可使用 tab
isHideLoadMore : _this.__data__.orders.length < 4 ? true : false,
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var orderStatus = _this.__data__.orderStatus
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getOrders(1, pageIndex, 6, orderStatus);
}, 1000)
}
else {
console.log('没有更多')
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
/*
*/
/* 点击barcode */
onClickBarcode: function(e){
var _this = this;
//指明具体是list的哪一个item
var indexId = e.currentTarget.dataset.id
var qrcode_url = _this.__data__.orders[indexId].qrcode_url
var qrcode = _this.__data__.orders[indexId].order_id
    this.setData({
      showModalBarcode : true,
qrcode : qrcode,
qrcode_url : qrcode_url
    })
},
  // 弹出层里面的弹窗
  ok: function () {
    this.setData({
      showModalPoints: false,
showModalBarcode: false
    })
  },
/**
* tab切换
*/
tab: function(e) {
var _this = this;
var pageIndex = _this.__data__.pageIndex
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var id = e.currentTarget.id;
var dataId = e.currentTarget.dataset.id
_this.getOrders(0, 1, 6, dataId);
_this.setData({
orderStatus: dataId,
})
},
/**
* 用户自定义函数
*
*/
// 获取orders数据
// scrollType: 是否是翻页, 0-不翻页 | 1-翻页
getOrders: function (scrollType, pageNum, pageCount, orderStatus) {
var _this = this;
var userId = _this.data.nyxCode
var query_url = '&orderStatus='+orderStatus + '&userId='+userId
var strUrl = config.order_detail_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;
}
var orders = []
/*
orderInfo :
{
"oid_001" : {},
"oid_002" : {},
"oid_003" : {},
}
*/
var orderInfo = {}
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
var order_item = {}
result["order_id"] = res.data.data[i].orderId
if(orderInfo.hasOwnProperty(result["order_id"]))
{
order_item["product_desc"] = res.data.data[i].productDesc
order_item["unit_price"] = res.data.data[i].unitPrice
order_item["quantity"] = res.data.data[i].quantity
orderInfo[result["order_id"]]['order_item'].push(order_item)
}
else
{
result["member_name"] = res.data.data[i].memberName
result["title"] = res.data.data[i].title
result["total_price"] = parseFloat(res.data.data[i].totalPrice).toFixed(2)
order_item["product_desc"] = res.data.data[i].productDesc
order_item["unit_price"] = res.data.data[i].unitPrice
order_item["quantity"] = res.data.data[i].quantity
result['order_item'] = [order_item]
result["order_status"] = res.data.data[i].orderStatus
result["product_image"] = res.data.data[i].productImage
result["qrcode_url"] = res.data.data[i].qrcodeUrl
orderInfo[result["order_id"]] = result
}
console.log("===", orderInfo)
}
var list = []
for(var key in orderInfo) {
var len = orderInfo[key]['order_item'].length
var row_height = 0
var content = ""
// Renaissance Bar威士忌四小杯特 的字符长度为29
for(var i=0; i<orderInfo[key]['order_item'].length;i++ )
{
content = orderInfo[key].title + "·" + orderInfo[key]['order_item'][i].product_desc
row_height += app.gblen(content) > 29 ? 76.8 * 2 : 60 * 2
}
// item_height : 130 + 20 + 120*2 + 30*3,
// basic + margin-bottom(coupon-list: 20rpx) + item(n) + margin(note-row: n+1)
//new:
//member_name: 60(height)+20(margin-top)
//item: 2* 76.8 * len //title=2行
//item: 2* 60 * len //title=1行
//margin: 30 * (len+2), 这次包括price的margin-bottom
//price: 2* 25.6
//margin-bottom: 20rpx (coupon-list)
var item_height = 130 + 20 + 120*len + 30*(len+1) // 控制item的高度
item_height = 2*30 + 20 + row_height + 30 * (len+2) + 25.6 + 20
orderInfo[key]['item_height'] = item_height
list.push(orderInfo[key])
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var orderList = _this.__data__.orders;
list = orderList.concat(list)
}
_this.setData({
orders: list,
pageIndex: pageNum + 1,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
// 获取bonus points数据
getBonus: function (matchId) {
var _this = this;
var query_url = '?matchId='+matchId
var strUrl = config.bonus_query_url + 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 = []
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
result["match_id"] = res.data.data[i].matchId
result["user_name"] = res.data.data[i].userName
result["bonus_point"] = res.data.data[i].bonusPoint
list.push(result)
}
_this.setData({
bonus_info: list,
})
}
}
})
},
})
<view class="page">
<view class="page">
<!-- Tab: refer to 有品·优惠券 -->
<view class="weui-flex" style="height: 120rpx;">
<view class="weui-flex__item weui-flex justify align border" data-id="10::20" id="id-10::20" bindtap="tab">
<view class="placeholder">
<text class="text {{orderStatus=='10::20'?'selected':''}}">可使用</text>
</view></view>
<!-- <view class="weui-flex__item weui-flex justify align border" data-id="10" id="id-10" bindtap="tab">
<view class="placeholder">
<text class="text {{selectTab=='10'?'selected':''}}">待付款</text>
</view></view> -->
<view class="weui-flex__item weui-flex justify align border" data-id="00::30" id="id-00::30" bindtap="tab">
<view class="placeholder">
<text class="text {{orderStatus=='00::30'?'selected':''}}">不可用</text>
</view></view>
</view>
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{orders}}" wx:for-item="item" wx:key="{{index}}">
<view class="item stamp stamp01" style="height:{{item.item_height}}rpx;">
<!-- 商家信息 -->
<view class="note-info">
<view class="note-member" style="font-weight: bold">
<view class="member-left">{{item.member_name}}</view>
<view class="member-right" bindtap="onClickBarcode" data-id='{{index}}'>
<image src="../../../icon/my/logo-barcode.png"></image>
</view>
</view>
</view>
<!-- 商品信息 -->
<block wx:for="{{item.order_item}}" wx:for-item="sub_item" wx:key="{{index}}">
<view class="note-row">
<image class="writer-image" src="{{item.product_image}}"/>
<view class="note-column">
<span>{{item.title}}·{{sub_item.product_desc}}</span>
<span>
<view class="price-row">
<view class="sub-price">¥{{sub_item.unit_price}}</view>
<view class="sub-quantity">x{{sub_item.quantity}}</view>
</view>
</span>
</view>
</view>
</block>
<view class="note-row">
<view class="note-price-left">
<span>总价:</span>
</view>
<view class="note-column">
<view class="note-price-right">
¥{{item.total_price}}
</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>
<!-- 查看优惠券码-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalBarcode}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalBarcode}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">请扫描以下券码验券 </text>
</view>
<view class="title-right" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-barcode">
<view class="text">券码:{{qrcode}}</view>
<image src="{{qrcode_url}}"></image>
</view>
<view class="list-barcode-image">
</view>
</view>
<!-- end 遮罩层 -->
</view>
\ No newline at end of file
.page{
.page{
/* height: 100vh; */
background: #F2F2F2;
}
.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: 710rpx; margin: 0 auto}
.coupon-list .item{width: 710rpx; height: 340rpx; margin-bottom: 20rpx;}
.coupon-list .item .float-li{width: 710rpx; 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;}
.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{width:700rpx; height: 250rpx;margin-bottom:50rpx;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-left{
color: #000;
font-size: 16px;
margin-left: 5%;
width: 120rpx;
}
/* 右边: 具体价格 */
.note-price-right{
color: #000;
font-size: 16px;
margin-top: 0;
font-weight: bold;
}
.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;
margin-bottom: 30rpx;
margin-top: 30rpx;
}
.note-column{
display: flex;
flex-direction: column;
margin-left: 30rpx;
margin-right: 5%;
width: 540rpx;
}
.writer-image{
width: 120rpx;
height: 120rpx;
margin-left: 5%;
}
.price-row{
display: flex;
flex-direction: row;
}
.sub-price{
font-size: 16px;
margin-right: 5%;
margin-top: 0;
text-align:justify;
flex: 1;
}
.sub-quantity{
display: flex;
font-size: 16px;
justify-content: flex-end;
}
\ No newline at end of file
// pages/my/rank/rank.js
// pages/my/rank/rank.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
//用户信息初始化
nyxCode: "",
authStatus: "",
userInfo: {},
//积分信息
points : [],
//助力信息
bonus_info : [],
//选中barcode的qrcode和url
qrcode : "",
qrcode_url : "",
// {
// rankId : "rid_001",
// defaultType : "1",
// matchType : "竞答",
// title : "泥煤怪兽",
// rank : "1",
// score : "200",
// ratio : "96%",
// },
isHideLoadMore: false,
/* 模态框 */
showModalPoints: false,
showModalBarcode : false,
/* 优惠券 可使用/不可用状态 */
validStatus : true,
matchStatus : "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this;
wx.setNavigationBarTitle({
title: '我的积分',
})
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members: wx.getStorageSync('members'),
})
}
//初始载入四个积分
if(_this.__data__.points.length == 0)
{
//onLoad的时候展示可使用的积分
var matchStatus = "01"
_this.getPoints(0, 1, 6, matchStatus);
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('页面上拉触底')
var _this = this;
var matchStatus = _this.__data__.matchStatus
var isHideLoadMore = _this.__data__.isHideLoadMore;
var pageIndex = _this.__data__.pageIndex;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if (!isHideLoadMore) {
console.log('加载更多')
setTimeout(() => {
_this.getPoints(1, pageIndex, 6, matchStatus);
}, 1000)
}
else {
console.log('没有更多')
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 用户自定义函数
/*
*/
/* 点击好友助力 */
onClickPoints: function(e){
var _this = this;
var indexId = e.currentTarget.dataset.id
var match_id = _this.__data__.points[indexId].match_id
_this.getBonus(match_id)
    _this.setData({
      showModalPoints: true
    })
},
/* 点击barcode */
onClickBarcode: function(e){
var _this = this;
//指明具体是list的哪一个item
var indexId = e.currentTarget.dataset.id
var qrcode_url = _this.__data__.points[indexId].qrcode_url
var qrcode = _this.__data__.points[indexId].match_id
    this.setData({
      showModalBarcode : true,
qrcode : qrcode,
qrcode_url : qrcode_url
    })
},
  // 弹出层里面的弹窗
  ok: function () {
    this.setData({
      showModalPoints: false,
showModalBarcode: false
    })
  },
/**
* tab切换
*/
tab: function(e) {
var _this = this;
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var id = e.currentTarget.id;
var dataId = e.currentTarget.dataset.id
_this.setData({
validStatus: dataId=="tab0"?true:false,
})
var matchStatus = dataId=="tab0" ? "01" : "00"
_this.setData({
matchStatus : matchStatus,
})
_this.getPoints(0, 1, 6, matchStatus)
},
/**
* 用户自定义函数
*
*/
// 获取points数据
// scrollType: 是否是翻页, 0-不翻页 | 1-翻页
getPoints: function (scrollType, pageNum, pageCount, memberStatus) {
var _this = this;
var query_url = '&matchStatus='+memberStatus
var strUrl = config.match_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 result = {}
result["total_point"] = res.data.data[i].totalPoint
result["member_name"] = res.data.data[i].memberName
result["bonus_count"] = res.data.data[i].bonusCount
result["bonus_point"] = res.data.data[i].bonusPoint
result["match_id"] = res.data.data[i].matchId
result["qrcode_url"] = res.data.data[i].qrcodeUrl
list.push(result)
}
//进行翻页设置(加载更多)
if (scrollType == 1) {
var pointsList = _this.__data__.points;
list = pointsList.concat(list)
}
_this.setData({
points: list,
pageIndex: pageNum + 1,
isHideLoadMore: bisHideLoadMoreType,
})
}
}
})
},
// 获取bonus points数据
getBonus: function (matchId) {
var _this = this;
var query_url = '?matchId='+matchId
var strUrl = config.bonus_query_url + 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 = []
for (var i = 0; i < res.data.data.length; i++) {
var result = {}
result["match_id"] = res.data.data[i].matchId
result["user_name"] = res.data.data[i].userName
result["bonus_point"] = res.data.data[i].bonusPoint
list.push(result)
}
_this.setData({
bonus_info: list,
})
}
}
})
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<!-- Tab: refer to 有品·优惠券 -->
<view class="weui-flex" style="height: 120rpx;">
<view class="weui-flex__item weui-flex justify align border" data-id="tab0" id="id-tab0" bindtap="tab">
<view class="placeholder">
<text class="text {{validStatus==true?'selected':''}}">可使用</text>
</view></view>
<view class="weui-flex__item weui-flex justify align border" data-id="tab1" id="id-tab1" bindtap="tab">
<view class="placeholder">
<text class="text {{validStatus==false?'selected':''}}">不可用</text>
</view></view>
</view>
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{points}}" wx:for-item="item" wx:key="{{index}}">
<view class="item stamp {{validStatus==true?'stamp01':'stamp06'}}">
<!-- 积分详情 -->
<view class="float-li t1">
<view class="coupon-left">
<view class="t1">
<view class="t1-left">
{{item.total_point}}
</view>
<view class="t1-right">{{item.member_name}}优惠积分</view>
</view>
<!-- <view class="t2">
<view class="t2-left">有效期至:2020/07/31 23:59</view>
<view class="t2-right" hidden="{{validStatus==true?true:false}}">
已过期
</view>
</view> -->
<view class="t3">
<view class="t3-left">好友助力:助力{{item.bonus_count}}人,共{{item.bonus_count}}积分</view>
<view class="t3-right" bindtap="onClickPoints" data-id='{{index}}'>
<image src="../../../icon/my/points-detail.png"></image>
</view>
</view>
<view class="t4">
<view class="t4-left">优惠券码:{{item.match_id}}</view>
<view class="t4-right" bindtap="onClickBarcode" data-id='{{index}}' hidden="{{validStatus==false?true:false}}">
<image src="../../../icon/my/logo-barcode.png"></image>
</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>
<!-- 查看好友助力-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalPoints}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalPoints}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">助力清单</text>
</view>
<view class="title-right" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-point">
<view class="text" wx:for="{{bonus_info}}" wx:for-item="item" wx:key="{{index}}" >
{{item.user_name}}助力{{item.bonus_point}}积分
</view>
</view>
</view>
<!-- end 遮罩层 -->
<!-- 查看优惠券码-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalBarcode}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalBarcode}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">请扫描以下券码验券 </text>
</view>
<view class="title-right" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-barcode">
<view class="text">券码:{{qrcode}}</view>
<image src="{{qrcode_url}}"></image>
</view>
<view class="list-barcode-image">
</view>
</view>
<!-- end 遮罩层 -->
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.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: 710rpx; margin: 0 auto}
.coupon-list .item{width: 710rpx; height: 260rpx; margin-bottom: 20rpx;}
.coupon-list .item .float-li{width: 710rpx; 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: 80rpx; color: #fff; align-items: center;}
.coupon-left .t1-left{width: 160rpx; font-size: 60rpx; font-weight: bold}
.coupon-left .t1-right{
width: 520rpx;
font-size: 40rpx;
/* 单行文本 溢出 显示省略号 */
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
/* .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{width:700rpx; height: 250rpx;margin-bottom:50rpx;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: #F39B00}
.stamp02{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #D24161 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #D24161}
.stamp03{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #D24161 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #7EAB1E }
.stamp04{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #D24161 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #50ADD3 }
.stamp05{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #D24161 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #f0229b}
.stamp05{background:radial-gradient(rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 30rpx, #D24161 30rpx);background-size:10rpx 10rpx;background-position:9rpx 3rpx; background: #f0229b}
/* 失效样式 */
.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 加载更多*/
\ No newline at end of file
// pages/my/my.js
// pages/my/my.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../utils/log.js')
Page({
/**
* 页面的初始数据
*/
data: {
/* 用户信息及商家信息 */
nyxCode : "",
authStatus : "", // 授权状态: 00-未授权, 01-已授权
userInfo : {},
members : [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _this = this
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members : wx.getStorageSync('members'),
})
}
wx.setNavigationBarTitle({
title: '酒肆活动',
});
console.log("my_onLoad_nyxCode", _this.data.nyxCode)
console.log("my_onLoad_authStatus", _this.data.authStatus)
console.log("my_onLoad_userInfo", _this.data.userInfo)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var _this = this
//初始化数据
if (wx.getStorageSync('nyxCode')) {
_this.setData({
nyxCode: wx.getStorageSync('nyxCode'),
userInfo: wx.getStorageSync('userInfo'),
authStatus: wx.getStorageSync('authStatus'),
members: wx.getStorageSync('members'),
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onToUser :function(e){
wx.navigateTo({
url: '/pages/my/user/user',
})
},
//具体的登陆及授权功能 - 在用户信息加密后(encryptedData)传到java后台, 后台进一步处理
login: function (e) {
config.debug==1?console.log("==login_登陆及授权"):""
var _this = this;
wx.login({
success: function (res) {
var code = res.code;
config.debug==1? console.log("===login_code_", code):""
wx.getUserInfo({
success: function (res) {
config.debug == 1 ? console.log("===wx.getUserInfo_res_获取用户信息成功", res) : ""
log.info("===wx.getUserInfo_res_获取用户信息成功", res)
//userInfo直接获取
/* userInfo
- nickName
- avatarUrl
- gender
- province
- city
- country
*/
wx.setStorageSync('userInfo', res.userInfo)
_this.setData({
userInfo: res.userInfo,
})
//通过openid换取唯一的nyxCode
//同时更新userInfo
var nyxCode = _this.data.nyxCode
wx.request({
url: config.user_login_url,
method: 'post',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: { encryptedData: res.encryptedData, iv: res.iv, code: code, userId : nyxCode },
success: function (res) {
config.debug==1?console.info("===wx.login_data_", res):""
log.info("===wx.login_data_", res)
wx.setStorageSync('nyxCode', res.data.data.id)
wx.setStorageSync('authStatus', res.data.data.authStatus)
_this.setData({
nyxCode: res.data.data.id,
authStatus: res.data.data.authStatus,
})
//载入页面
getCurrentPages()[getCurrentPages().length - 1].onLoad()
},
fail: function () {
console.log('系统错误')
}
})
//平台登录
},
fail: function (res) {
config.debug == 1 ? console.log("获取用户信息失败", res) : ""
}
})
}
})
},
//跳转设置页面授权
openSetting: function () {
var _this = this
if (wx.openSetting) {
wx.openSetting({
success: function (res) {
//尝试再次登录并授权
_this.login()
}
})
} else {
wx.showModal({
title: '授权提示',
content: '小程序需要您的微信授权才能使用哦~'
})
}
},
// 获取用户授权信息
getUserInfo: function (e) {
let _this = this;
config.debug==1?console.log("===getUserInfo_e_"+e):""
// 获取用户信息
wx.getSetting({
success(res) {
config.debug == 1 ? console.log("===getUserInfo_res_" + res) : ""
if (res.authSetting['scope.userInfo']) { // 判断获取用户信息是否授权
config.debug == 1 ? console.log("已授权=====") : ""
// 已经授权, 可以直接调用 getUserInfo 获取用户信息
_this.login()
} else {
config.debug == 1 ? console.log("未授权=====") : ""
//重新进行授权
_this.openSetting()
}
}
})
},
})
\ No newline at end of file
<view class="page">
<view class="page">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access">
<view class="userInfo">
<block wx:if="{{authStatus=='01'}}" >
<!-- 已登录 -->
<view class="userInfo" bindtap="onToUser">
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
<view>{{userInfo.nickName}}</view>
</view>
</block>
<block wx:else>
<!-- 未登陆 -->
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo" style="border:0px solid red;background-color:#fff;font-size:17px" plain='true'>
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
<view style="line-height:1; font-size:14px">{{userInfo.nickName}}</view>
<view style="line-height:1">立即登录</view>
</button>
</block>
</view>
</view>
</view>
<view class="weui-cells">
<!-- todo 0820 以活动为主, 积分暂时也不实现 -->
<!-- <navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/my-points/my-points">
<view class="weui-cell__hd">
<image src="/icon/activity/points.png" />
</view>
<view class="weui-cell__bd">我的积分</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator> -->
<!-- jscat 20200828 与商家商谈之后再考虑 -->
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/my-orders/my-orders">
<view class="weui-cell__hd">
<image src="/icon/my/activity.png" />
</view>
<view class="weui-cell__bd">我的预订</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/my-collects/my-collects">
<view class="weui-cell__hd">
<image src="/icon/my/fav.png" />
</view>
<view class="weui-cell__bd">我的收藏</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<!-- 只针对member商家开放 -->
<block wx:if="{{members.length> 0}}">
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/my-members/my-members">
<view class="weui-cell__hd">
<image src="/icon/my/tools.png" />
</view>
<view class="weui-cell__bd">商家管理</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</block>
</view>
</view>
\ No newline at end of file
.page{
.page{
height: 100vh;
background: #F4F8FB;
}
.weui-cell__hd {
font-size: 0;
}
.weui-cell__hd image {
width: 80rpx;
height: 80rpx;
margin-right: 18px;
margin-left: 5px;
vertical-align: middle;
}
.weui-cell__ft_in-access {
padding-right:13px;
position:relative;
}
.userInfo{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
overflow: hidden;
}
.thumb{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.name{
margin: 30rpx;
}
.avatar{
width: 100rpx;
height: 100rpx;
overflow:hidden;
border-radius: 50%;
}
// pages/user/user.js
// pages/user/user.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">
<view class="userInfo">
<view class="userinfo">
<view class="head-img">
<open-data class="thumb"type="userAvatarUrl"></open-data>
<open-data class="name" lang="zh_CN" type="userNickName"></open-data>
</view>
<view class="userMessage">
<view class="messageBox">
<view class="focus">
<span class="focusNum">0</span>
<span>关注</span>
</view>
<view class="border">|</view>
<view class="fans">
<span class="fansNum">1</span>
<span>粉丝</span>
</view>
<view class="border">|</view>
<view class="praise-collect">
<span class="colllectNum">0</span>
<span>赞与收藏</span>
</view>
</view>
</view>
</view>
<view class="grade">
<!-- <image class="grade-icon" src="/icon/grade-img.png"></image> -->
<span>等级:</span>
</view>
<view class="userDesc">
<span>还没有简介</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/post/edit/edit.js
// pages/post/edit/edit.js
var config = wx.getStorageSync("config");
var app = getApp();
Page({
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
that.setData({
scrollTop: a-200
})
}
})
},
onReady: function (e) {
},
// Page Flow
navigateToSubmit() {
let promise = app.onCheckText(app.globalData.postData.photoTag)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
wx.navigateTo({ url: './../submit/submit' })
},
function (value) {
console.log("===enter promise then_failed_" + value)
},);
},
// Date Flow
// 输入该组图片的标签
bindKeyInput(e) {
var _this = this;
_this.setData({
inputValue: e.detail.value
})
//全局赋值
app.globalData.postData.photoTag = e.detail.value
},
})
{
{
"navigationBarTitleText": "添加标签"
}
\ No newline at end of file
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<!-- /page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<view class="page" style="height:100%;width:100%">
<block>
<button type="default" bindtap="navigateToSubmit">下一步</button>
</block>
<view class="weui-cells__title">#添加亮点</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyInput" placeholder="请输入亮点" />
</view>
</view>
</view>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
\ No newline at end of file
// pages/post/post.js
// pages/post/post.js
var config = wx.getStorageSync("config");
var app = getApp();
var log = require('./../../utils/log.js')
var util = require('./../../utils/util.js')
/*
提交流程
1. post.js 生成图片的临时路径
2. edit.js 编辑标签
3. submit.js 上传阿里云oss, 将内容上传到数据库
- 获取token
- 上传oss
- 上传数据库
*/
const base64 = require('../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
Page({
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
that.setData({
scrollTop: a-200
})
}
})
},
data: {
photoArray: [],
sourceTypeIndex: 2,
sourceType: ['拍照', '相册', '拍照或相册'],
sizeTypeIndex: 2,
sizeType: ['压缩', '原图', '压缩或原图'],
countIndex: 8,
count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
//定义图片尺寸
imageSize: '',
},
sourceTypeChange(e) {
this.setData({
sourceTypeIndex: e.detail.value
})
},
sizeTypeChange(e) {
this.setData({
sizeTypeIndex: e.detail.value
})
},
countChange(e) {
this.setData({
countIndex: e.detail.value
})
},
//在进入页面时就执行,用于初始化
onReady: function (e) {
},
// Page Flow
navigateToEdit() {
var _this = this;
var newFilePaths = _this.data.photoArray
// let promise = app.onCheckPic(newFilePaths)
// //在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
// //then后的括号里应该是参数param
// //https://www.cnblogs.com/qlongbg/p/11603328.html
// promise.then(function (value) {
// console.log("===checkPic_enter promise then_" + value)
// //同步更新全局变量
// app.globalData.postData.photoArray = newFilePaths
// wx.navigateTo({ url: './edit/edit' })
// });
app.globalData.postData.photoArray = newFilePaths
wx.navigateTo({ url: './edit/edit' })
},
// Date Flow
/*
step1: 选定图片,可以预览
step2: 添加描述文字,选择tag
step3: 上传
1. chooseImage
2. 进行图片编辑
3. 点击下一步验证图片是否合法合规 navigateToEdit
通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
1) > 2M会出现 45002, content size out of limit 错误
2) 自动裁剪成4:3 或 1:1
*/
addPhoto: function (res) {
var _this = this;
_this.setData({
photoArray: []
})
console.log("===this is addPhoto");
wx.chooseImage({
sizeType: ['original, compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var canvasId = "photoCanvasId";
console.log("===addPhoto_上传图片参数", res)
_this.onEditPic(res, canvasId)
}
})
},
previewImage(e) {
const current = e.target.dataset.src
wx.previewImage({
current,
urls: this.data.photoArray
})
},
//保存图形的tmp地址
saveData(newFilePaths){
var _this = this;
console.log("===saveData", newFilePaths)
_this.setData({
photoArray: newFilePaths
})
app.globalData.postData.photoArray = newFilePaths;
},
//小程序图片处理主函数
editPic(tempFilePaths, index, canvasId) {
var _this = this;
var photoArray = _this.data.photoArray
if (index < tempFilePaths.length){
var pic = tempFilePaths[index]
wx.getImageInfo({
src: pic, //图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径,
success: function (res) {
// util.imageUtil 用于计算长宽比
var i = index + 1
console.log("第"+i+"张上传图片参数", res)
var imageSize = util.imageUtil(res);
console.log("success on getImageInfo_"+index);
console.log(imageSize)
_this.setData({
imageSize: imageSize
})
const ctx = wx.createCanvasContext(canvasId);
//ctx.drawImage(pic, 0, 0, imageSize.swidth, imageSize.sheight);
ctx.drawImage(pic, imageSize.sx, imageSize.sy, imageSize.swidth, imageSize.sheight,
imageSize.x, imageSize.y, imageSize.width, imageSize.height);
// 需要注意的是 draw 方法是异步的,如果图片还没加载成功,有可能画出来的是空的
// 所以 draw 方法通常都会带有定时器这样的回调
ctx.draw(false, setTimeout(function () {
//ctx.draw(false, function () {
var i = index + 1
console.log("==enter draw_"+i);
wx.canvasToTempFilePath({
canvasId: canvasId,
fileType:"jpg",
success: function (res) {
console.log("===success_", res)
console.log("===第"+i+"图处理成功")
photoArray.push(res.tempFilePath)
_this.setData({
photoArray: photoArray
})
index = index + 1
_this.editPic(tempFilePaths, index, canvasId); // 用于多个图片压缩
},
fail: function (e) {
var i = index + 1
console.log("===第"+i+"图处理失败")
}
});
},1000));
//});
},
fail: function(e) {
console.log("failed", e);
},
complete: function(e) {
var i = index + 1
console.log("complete on getImageInfo_"+i, e);
}
})
}
},
// 通过size或其他方式判断是否进行图片处理(裁切,填满,留白,充满)
// 1) > 2M会出现45002, content size out of limit错误
// 2) 自动裁剪成4:3(高/宽 1080) 或 1:1 有品默认1:1
// refer1 微信小程序图片压缩 https://www.jianshu.com/p/1b8a1e96a6d5
// refer2 小程序压缩图片(canvas) https://www.jianshu.com/p/ec1f95008dce
onEditPic(res, canvasId) {
var _this = this;
var tempFilePaths = res.tempFilePaths;
var index = 0;
_this.editPic(tempFilePaths, index, canvasId)
}
})
{
{
"navigationBarTitleText": "分享你的精彩"
}
\ No newline at end of file
<view class="page" style="height:100%;width:100%">
<view class="page" style="height:100%;width:100%">
<block>
<button type="default" bindtap="navigateToEdit">下一步</button>
</block>
<form>
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">
<view class="weui-uploader">
<view class="weui-uploader__hd">
<view class="weui-uploader__title">图片上传</view>
<view class="weui-uploader__info">{{photoArray.length}}/{{count[countIndex]}}</view>
</view>
<view class="weui-uploader__bd">
<view class="weui-uploader__files">
<block wx:for="{{photoArray}}" wx:for-item="image">
<view class="weui-uploader__file">
<image class="weui-uploader__img" src="{{image}}" data-src="{{image}}" bindtap="previewImage"></image>
</view>
</block>
</view>
<view class="weui-uploader__input-box">
<view class="weui-uploader__input" bindtap="addPhoto"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</form>
<canvas canvas-id='photoCanvasId' class='myCanvas' style='width:{{imageSize.width}}px;height:{{imageSize.height}}px'>
</canvas>
</view>
\ No newline at end of file
page{
page{
height: 100vh;
background-color:#f5f8fa;
}
.banner{
position: relative;
}
.banner image{
height: 200px;
width:100%;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
.banner .play{
width: 40px;
height: 40px;
position: absolute;
bottom: 10px;
right:10px;
z-index: 10;
}
.mdetail{
overflow: hidden;
height:55px;
padding:5px 10px;
border-bottom:1px solid #dbdbdb;
}
.mdetail image{
float:left;
width:55px;
height:55px;
}
.minfo{
float:left;
margin-left:10px;
padding:10px 0;
}
.detailLeft{
float:left;
}
.detailRight{
float:right;
}
.mname{
font-size: 14px;
margin-bottom:10px;
}
.mauthor{
font-size: 12px;
color:#dbdbdb;
}
/*
隐藏 canvas,避免显示错误
*/
.myCanvas {
position: absolute;
top: -9999px;
left: -9999px;
}
// pages/post/submit/submit.js
// pages/post/submit/submit.js
const base64 = require('../../../utils/base64.js');//Base64,hmac,sha1,crypto相关算法
var config = wx.getStorageSync("config");
var app = getApp();
Page({
onLoad: function () {
var that = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
that.setData({
scrollTop: a-200
})
}
})
},
data : {
//阿里云 OSS相关参数
accessid: "",
policy: "",
signature: "",
host: "",
dir: "",
expire: "",
securityToken: "",
//评论标题+内容相关参数
inputTitle: "",
inputContent: "",
},
onReady: function (e) {
var _this = this;
//进入页面就自动获取oss参数
_this.oss();
},
// Date Flow
// 提交oss和数据库
onSubmitPost: function (e) {
var _this = this;
var title = e.detail.value.inputTitle;//获取title
var content = e.detail.value.inputContent;//获取content
app.globalData.postData.title = title
app.globalData.postData.content = content
if (content != undefined && content != "") {
//step1, 上传至oss-获取token,在onReady()提前准备
//_this.oss();
//step2, 判断文本是否合规
let promise = app.onCheckText(title+content)
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
//then后的括号里应该是参数param
//https://www.cnblogs.com/qlongbg/p/11603328.html
promise.then(function (value) {
console.log("===enter promise then_pass_" + value)
//step3, 上传至oss-上传图片
_this.releaseOss(title, content);
},
function (value) {
console.log("===enter promise then_failed_" + value)
});
//step4, 上传信息到数据库
//上传数据库在oss sdk的callback函数里设置
//需要java后台支持
}
},
oss: function () {
var _this = this;
console.log("===this is oss");
//token信息
var strUrl = config.oss_token_url + "?tokenName=ios&userName=1234"
wx.request({
url: strUrl,
method: 'GET',
header: {
'content-type': 'application/json'
},
success: res => {
if (res.statusCode == 200) {
console.log("=== oss getToken 返回值_", res.data)
_this.setData({
accessid: res.data.data.accessid,
policy: res.data.data.policy,
signature: res.data.data.signature,
host: res.data.data.host,
dir: res.data.data.dir,
expire: res.data.data.expire,
securityToken: res.data.data.securityToken,
})
}
}
})
},
//上传照片(阿里云)
uploadAli: function (tag, title, content, photoArr) {
var _this = this;
console.log("===uploadAli_data_tag: ",tag)
console.log("===uploadAli_data_title: ",title)
console.log("===uploadAli_data_content: ",content)
console.log("===uploadAli_data_photoArr: ",photoArr)
var promise = Promise.all(photoArr.map((pic, index) => {
//pic是多图上传模式中的单张图片 index => 0 : length-1
console.log(pic)
//传给阿里云的参数
var policy = this.data.policy;
var accessid = this.data.accessid;
var securityToken = this.data.securityToken;
var signature = this.data.signature;
var path = this.data.host + "/" + this.data.dir;
console.log("policy: " + policy);
console.log("signature: " + signature);
console.log("accessid: " + accessid);
console.log("path: " + path)
var babyData = {
'Filename': '${filename}',
'name': pic.replace('http://tmp/', "").replace('wxfile://', ""),
'key': this.data.dir + '${filename}',
'policy': policy,
'OSSAccessKeyId': accessid,
'success_action_status': '200', //让服务端返回200,不然,默认会返回204
'signature': signature,
'x-oss-security-token': securityToken
}
// 多图n上传流程,通过promise.all实现异步控制
// n-1图直接上传
// 第n图上传+设置callback,在java后台提交参数到数据库
if (index == photoArr.length - 1)
{
var photoArrsm = [];
//由于微信小程序生成的临时路径在上传阿里云的时候不需要上传.所以需要对路径进行处理,但是在手机端上传和PC端上传,图片临时路径的前缀不同,所以需要进行分别的处理
// pc: http://tmp/
// wx: wxfile://
for (let i = 0; i < photoArr.length; i++) {
photoArrsm.push(path + photoArr[i].replace('http://tmp/', "").replace('wxfile://', ""));
}
//生成最终的文件字符串 file1.jpg::file2.png (数据库解析格式)
var image = photoArrsm.join("::")
var userId = wx.getStorageSync('nyxCode')
var strUrl = config.oss_callback_url
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag=' + encodeURI(encodeURI(tag)) + '&title=' + encodeURI(encodeURI(title)) + '&content=' + encodeURI(encodeURI(content)) + '&image=' + image + '&userId=' + userId,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
babyData['callback'] = base64_callback_body
}
return new Promise(function (resolve, reject) {
var host = _this.data.host;
wx.uploadFile({
url: host,
formData: babyData,
name: 'file',
filePath: pic,
header: {
'content-type': 'multipart/form-data'
},
success: function (res) {
console.log("=== index_"+index)
console.log(res)
resolve(res.data);
},
fail: function (err) {
reject(new Error('failed to upload file'));
console.log("fail to upload file")
},
complete: function () {
console.log("complete to upload file");
}
});
});
})).then(_this.switchTab());
},
//发布按钮
releaseOss: function (title, content) {
var _this = this;
console.log("===this is releaseOss");
//获取照片数组
var photoArr = app.globalData.postData.photoArray;
//时间搓
var expire = this.data.expire;
//获取当前时间搓
var expireNow = Date.parse(new Date()) / 1000;
//如果当前时间大于获取的时间 则重新获取oss;
if (expire == undefined || expireNow > expire) {
//重新获取oss
_this.oss();
expire = this.data.expire;
}
var tag = app.globalData.postData.photoTag
this.uploadAli(tag, title, content, photoArr)
},
switchTab() {
app.globalData.postData = {}
wx.switchTab({
url: '/pages/discover/discover'
});
},
})
{
{
"navigationBarTitleText": "上传"
}
\ No newline at end of file
<view class="post" style="height:100%;width:100%">
<view class="post" style="height:100%;width:100%">
<view class="page-body">
<form catchsubmit="onSubmitPost" >
<view class="btn-area">
<button type="normal" formType="submit">上传</button>
</view>
<view class="weui-cells__title">#添加标题</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" name="inputTitle" placeholder="请输入标题" />
</view>
</view>
</view>
<view class="weui-cells__title">#添加内容</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea class="weui-textarea" bindinput='bindKeyInput' name="inputContent" placeholder="请输入内容" style="height: 3.3em" />
<view class="weui-textarea-counter">{{inputContent.length}}/300</view>
</view>
</view>
</view>
</form>
</view>
</view>
\ No newline at end of file
page{
page{
height: 100%;
background-color:#f5f8fa;
}
.post{
position: absolute;
bottom: 0;
right:0px;
}
import { LETTERS, HOT_CITY_LIST } from '../../locale/citydata'
import { LETTERS, HOT_CITY_LIST } from '../../locale/citydata'
import { commonMessage } from '../../locale/commonMessageZhCn'
import { AutoPredictor } from '../../utils/autoPredictor'
import utils from '../../utils/utils'
const {
isNotEmpty,
safeGet,
getCityListSortedByInitialLetter,
getLocationUrl,
getCountyListUrl,
getIndexUrl,
getListUrl,
onFail,
} = utils;
const appInstance = getApp();
Page({
data: {
sideBarLetterList: [],
winHeight: 0,
cityList: [],
hotCityList: HOT_CITY_LIST,
showChosenLetterToast: false,
scrollTop: 0,//置顶高度
scrollTopId: '',//置顶id
city: commonMessage['location.getting'],
currentCityCode: '',
inputName: '',
completeList: [],
city: '',
county: '',
showCountyPicker: false,
auto: true, // 自动手动定位开关
LatestCityList: [{ cityCode: 310000, city: '上海' }, { cityCode: 110000, city: '北京' }],
// 数据更新的页面
update_type: "",
},
onLoad: function (options) {
// 生命周期函数--监听页面加载
const cityListSortedByInitialLetter = getCityListSortedByInitialLetter();
const sysInfo = wx.getSystemInfoSync();
const winHeight = sysInfo.windowHeight;
const sideBarLetterList = LETTERS.map(letter => ({ name: letter }));
var city = ""
var update_type = ""
if (options.city != "" && options.city != undefined)
{
city = options.city;
update_type = options.type;
}
this.setData({
winHeight,
sideBarLetterList,
cityList: cityListSortedByInitialLetter,
city: city,
update_type: update_type,
});
// 定位
// this.getLocation();
},
onShow: function() {
var _this = this;
// 获取历史搜索
_this.getRecentCity();
},
touchSideBarLetter: function (e) {
const chosenLetter = safeGet(['currentTarget', 'dataset', 'letter'], e)
this.setData({
toastShowLetter: chosenLetter,
showChosenLetterToast: true,
scrollTopId: chosenLetter,
})
// close toast of chosenLetter
setTimeout(() => { this.setData({ showChosenLetterToast: false }) }, 500)
},
//选择城市
chooseCity: function (e) {
var _this = this;
const { city, code } = safeGet(['currentTarget', 'dataset'], e)
_this.setData({
auto: false,
showCountyPicker: false,
city,
currentCityCode: code,
scrollTop: 0,
completeList: [],
county: ''
})
//无须再选择county
//this.getCountyList()
//直接更新app.globalData
appInstance.globalData.defaultCity = city
appInstance.globalData.defaultCounty = ''
// 同步更新storage记录
// start 记录最近访问
let LatestCityList = wx.getStorageSync('LatestCityList') || [];
var item = { cityCode: code, city: city }
LatestCityList.unshift(item);
var list = []
var result = {}
for(var i=0; i< LatestCityList.length && list.length != 3; i++)
{
var key = LatestCityList[i]['cityCode']
if(!result.hasOwnProperty(key))
{
result[key] = 1
list.push(LatestCityList[i])
}
}
wx.setStorageSync('LatestCityList', list)
result = {}
// end of 最近访问 去重
// 返回首页
var update_type = _this.__data__.update_type
update_type == "index" ? _this.updateIndex() : _this.updateList()
},
updateIndex: function(e){
var url = getIndexUrl()
wx.switchTab({
url: url,
success: function (e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
// 更新首页的数据
page.onUpdateData();
}
})
},
updateList: function(e)
{
var url = getListUrl()
wx.redirectTo({
url: url,
success: function (e) {
// jscat 20200827 在activity-list页面的onload里更新
// page.onLoad();
}
})
},
chooseCounty: function (e) {
const county = safeGet(['currentTarget', 'dataset', 'city'], e)
this.setData({ county })
appInstance.globalData.defaultCounty = county
// 返回首页
wx.switchTab({ url: getIndexUrl() })
},
//点击热门城市回到顶部
hotCity: function () {
this.setData({ scrollTop: 0 })
},
bindScroll: function (e) {
// console.log(e.detail)
},
getCountyList: function () {
console.log(commonMessage['location.county.getting']);
const code = this.data.currentCityCode
wx.request({
url: getCountyListUrl(code),
success: res => this.setCountyList(res),
fail: onFail(commonMessage['location.county.fail']),
})
},
setCountyList: function (res) {
const resultArray = safeGet(['data', 'result'], res)
const countyList = isNotEmpty(resultArray) ? resultArray[0] : []
this.setData({ countyList })
},
getLocation: function () {
//console.log(commonMessage['location.city.getting'])
this.setData({ county: '' })
wx.getLocation({
type: 'wgs84',
success: res => this.getLocationFromGeoCoord(res),
fail: onFail(commonMessage['location.city.fail']),
})
},
getLocationFromGeoCoord: function (geoCoord) {
const { latitude, longitude } = geoCoord
wx.request({
url: getLocationUrl(latitude, longitude),
success: location => this.setCityCounty(location)
})
},
setCityCounty: function (location) {
const { city, adcode, district } = safeGet(['data', 'result', 'ad_info'], location)
if (this.data.auto) { // 如果开始手动选择,以手动为准
this.setData({
city,
currentCityCode: adcode,
county: district
})
appInstance.globalData.defaultCity = city
// this.getCountyList();
}
},
// method2: from wxml
reGetLocation: function () {
const { city, county } = this.data
appInstance.globalData.defaultCity = city
appInstance.globalData.defaultCounty = county
console.log(appInstance.globalData.defaultCity);
//返回首页, 同时刷新首页数据
wx.switchTab({
url: getIndexUrl(),
success: function (e) {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
page.onUpdateData();
}
})
},
// 失焦时清空输入框
bindBlur: function (e) {
this.setData({
inputName: '',
completeList: []
})
},
// 输入框输入时
bindKeyInput: function (e) {
let inputName = e.detail.value.trim()
this.setData({ inputName })
if (!inputName) {
this.setData({ completeList: [] })
}
this.useAutoPredictor(inputName)
},
// 输入框自动联想搜索
useAutoPredictor: function (content) {
let autoPredictor = new AutoPredictor(content)
let completeList = autoPredictor.associativeSearch()
this.setData({ completeList })
},
/*
与switchcity无关的自定义函数
*/
/**
* 获取历史搜索
*/
getRecentCity: function () {
var _this = this;
var LatestCityList = wx.getStorageSync('LatestCityList');
_this.setData({ LatestCityList });
},
})
<view class="input">
<view class="input">
<input bindinput="bindKeyInput" bindblur="bindBlur" placeholder="输入城市名或拼音查询" placeholder-style="font-size: 30rpx" value="{{inputName}}"></input>
</view>
<view class="container-inner">
<view class="side-bar-letter-list touch-class">
<view class="side-bar-hot-city" bindtap="hotCity">
<view style="margin-top:0;">当前</view>
<view style="margin-top:0;">热门</view>
</view>
<view wx:for="{{sideBarLetterList}}" style="color:#8BC34A;font-size:20rpx;" wx:key="*this" data-letter="{{item.name}}" catchtouchend="touchSideBarLetter">{{item.name}}</view>
</view>
<view class="container">
<block wx:if="{{showChosenLetterToast}}">
<view class="show-chosen-letter">
{{toastShowLetter}}
</view>
</block>
<scroll-view scroll-y="true" style="height:{{winHeight}}px" bindscroll="bindScroll" scroll-into-view="{{scrollTopId}}" scroll-top="{{scrollTop}}">
<ul class="ul">
<li wx:for="{{completeList}}" wx:key="*this" bindtap="chooseCity" data-city="{{item.city}}" data-code="{{item.code}}" class="li">{{item.city}}</li>
</ul>
<view class="city-picker">
<view class="hotcity-common">当前: {{city}}</view>
<!-- start 最近访问 -->
<view class="hotcity-common">最近访问</view>
<view class="hot-city" wx:key="initial">
<view wx:for="{{LatestCityList}}" wx:key="cityCode">
<view class="weui-grid" data-code="{{item.cityCode}}" data-city="{{item.city}}" bindtap="chooseCity">
<view class="weui-grid-label">{{item.city}}</view>
</view>
</view>
</view>
<!-- end 最近访问 -->
<!-- start 热门城市 -->
<view class="hotcity-common">热门城市</view>
<view class="hot-city" wx:key="initial">
<view wx:for="{{hotCityList}}" wx:key="cityCode">
<view class="weui-grid" data-code="{{item.cityCode}}" data-city="{{item.city}}" bindtap="chooseCity">
<view class="weui-grid-label">{{item.city}}</view>
</view>
</view>
</view>
<!-- end 热门城市 -->
</view>
<view class="selection" wx:for="{{cityList}}" wx:key="initial">
<view class="item-letter" id="{{item.initial}}">{{item.initial}}</view>
<view class="item-city" wx:for="{{item.cityInfo}}" wx:for-item="ct" wx:key="id" data-code="{{ct.code}}" data-city="{{ct.city}}" bindtap="chooseCity">
{{ct.city}}
</view>
</view>
</scroll-view>
</view>
</view>
.container-inner {
.container-inner {
display: flex;
flex-direction: row-reverse;
}
.container {
flex-grow: 1;
display: flex;
flex-direction: column;
padding: 10rpx;
}
input {
text-align: center;
font-size: 32rpx;
padding: 5px;
}
scroll-view {
padding-left:16rpx;
}
.side-bar-letter-list {
flex-shrink: 0;
width: 80rpx;
text-align: center;
display: flex;
flex-direction: column;
color: #666;
}
.side-bar-letter-list view {
margin-top: 20rpx;
}
.touch-class {
background-color: #fff;
color: #fff;
padding-top: 16rpx;
padding-bottom: 16rpx;
}
.show-chosen-letter {
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
top: 50%;
left: 50%;
margin: -100rpx;
width: 200rpx;
height: 200rpx;
border-radius: 20rpx;
font-size: 52rpx;
z-index: 1;
}
.selection {
display: flex;
width: 100%;
flex-direction: column;
margin-top: 10rpx;
}
.city-picker {
padding: 16rpx 0 16rpx 16rpx;
background-color: #f5f5f5;
margin-bottom: -10rpx;
}
.county-picker {
padding-left: 20rpx;
margin-bottom: 10rpx;
}
.county-picker-title {
font-size: 24rpx;
color: #666;
padding-bottom: 0;
margin: 8rpx 0;
padding-left:4px;
}
.hot-city {
background-color: #f5f5f5;
margin-bottom: -10rpx;
display: flex;
flex-wrap: wrap;
}
.item-letter {
display: flex;
background-color: #f5f5f5;
height: 40rpx;
padding-left: 34rpx;
align-items: center;
font-size: 24rpx;
color: #666;
}
.item-city {
display: flex;
background-color: #fff;
height: 100rpx;
padding-left: 34rpx;
align-items: center;
border-bottom: 1rpx solid #ededed;
font-size: 24rpx;
color: #666;
}
.hotcity-common {
font-size: 24rpx;
color: #666;
padding-bottom: 0;
margin: 8rpx 0;
margin-left: 16rpx;
}
.county-picker-list {
padding-right: 50rpx;
margin: auto;
}
.current-city {
display: inline-block;
border: 1rpx solid #8BC34A;
border-radius: 8rpx;
padding: 10rpx;
font-size: 24rpx;
color: #8BC34A;
text-align: center;
min-width: 149.5rpx;
margin: 16rpx;
}
.side-bar-hot-city {
color: #8BC34A;
font-size: 20rpx;
margin: 0 !important;
}
.slectCity {
border-color: #8BC34A !important;
}
.slectCity view {
color: #8BC34A !important;
}
.weui-grid {
padding: 10rpx 0;
width: 200rpx;
box-sizing: border-box;
border: 1rpx solid #ececec;
border-radius: 8rpx;
background-color: white;
margin: 8rpx 0 8rpx 8rpx;
}
.weui-grids {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.weui-grid-label {
display: block;
text-align: center;
color: #333;
font-size: 24rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.ul {
display: block;
color: grey;
margin-left: 20rpx;
}
.li {
display: block;
font-weight: 100;
font-size: 28rpx;
padding: 16rpx 0;
}
input {
background-color: #eee;
}
.input {
padding: 16rpx;
border-bottom: 1rpx solid #f1f1f1;
}
.county {
display: flex;
flex-wrap: wrap;
}
{
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false
},
"compileType": "miniprogram",
"libVersion": "2.9.4",
"appid": "wx72555e77d9e5cee2",
"projectname": "nyx-master",
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
{
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
page{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}icon{vertical-align:middle}.weui-cells{position:relative;margin-top:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}.weui-cell_switch{padding-top:12px;padding-bottom:12px}.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}.weui-footer{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-grids{border-top:1rpx solid rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:rgba(0,0,0,.9);font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes d{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:g 1.6s step-start infinite;animation:g 1.6s step-start infinite}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes g{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}.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}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,.1)}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:16px;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}icon[type=success]:after,icon[type=success]:before{color:#07c160!important}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree__text{color:rgba(0,0,0,.5)}.weui-agree__link{display:inline;color:#576b95}.weui-agree__checkbox{position:absolute;left:-9999px}.weui-agree__checkbox-icon{position:relative;top:2px;display:inline-block;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:11px;height:11px}.weui-agree__checkbox-icon-check{position:absolute;top:1px;left:1px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
@-webkit-keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.weui-animate-slide-up{-webkit-animation:a ease .3s forwards;animation:a ease .3s forwards}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.weui-animate-slide-down{-webkit-animation:b ease .3s forwards;animation:b ease .3s forwards}@-webkit-keyframes c{0%{opacity:0}to{opacity:1}}@keyframes c{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{-webkit-animation:c ease .3s forwards;animation:c ease .3s forwards}@-webkit-keyframes d{0%{opacity:1}to{opacity:0}}@keyframes d{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{-webkit-animation:d ease .3s forwards;animation:d ease .3s forwards}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_cell{position:relative;display:block;margin-left:auto;margin-right:auto;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;padding:16px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden;background-color:#fff}.weui-btn_cell+.weui-btn_cell{margin-top:16px}.weui-btn_cell:active{background-color:#ececec}.weui-btn_cell__icon{display:inline-block;vertical-align:middle;width:24px;height:24px;margin:-.2em .34em 0 0}.weui-btn_cell-default{color:rgba(0,0,0,.9)}.weui-btn_cell-primary{color:#576b95}.weui-btn_cell-warn{color:#fa5151}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_default{color:#06ae56;background-color:#f2f2f2}.weui-btn_default:not(.weui-btn_disabled):visited{color:#06ae56}.weui-btn_default:not(.weui-btn_disabled):active{color:#06ae56;background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_disabled{color:rgba(0,0,0,.18);background-color:#fafafa}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn{position:relative;display:block;width:184px;margin-left:auto;margin-right:auto;padding:8px 24px;box-sizing:border-box;font-weight:700;font-size:17px;text-align:center;text-decoration:none;color:#fff;line-height:1.41176471;border-radius:4px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden}.weui-btn_block{width:auto}.weui-btn_inline{display:inline-block}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_loading .weui-loading{margin:-.2em .34em 0 0}.weui-btn_loading.weui-btn_primary{color:#fff}.weui-btn_loading.weui-btn_default{background-color:#d9d9d9}.weui-btn_loading.weui-btn_primary{background-color:#06ad56}.weui-btn_loading.weui-btn_warn{background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_plain-primary{color:#07c160;border:1px solid #1aad19}.weui-btn_plain-primary:not(.weui-btn_plain-disabled):active{color:#06ae56;border-color:#179c16;background-color:rgba(0,0,0,.1)}.weui-btn_plain-primary:after{border-width:0}.weui-btn_plain-default{color:#353535;border:1px solid #353535}.weui-btn_plain-default:not(.weui-btn_plain-disabled):active{color:#323232;border-color:#323232;background-color:rgba(0,0,0,.1)}.weui-btn_plain-default:after{border-width:0}.weui-btn_plain-disabled{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_primary{background-color:#07c160}.weui-btn_primary:not(.weui-btn_disabled):visited{color:#fff}.weui-btn_primary:not(.weui-btn_disabled):active{color:#fff;background-color:#06ad56}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn_warn{color:#fa5151;background-color:#f2f2f2}.weui-btn_warn:not(.weui-btn_disabled):visited{color:#fa5151}.weui-btn_warn:not(.weui-btn_disabled):active{color:#fa5151;background-color:#d9d9d9}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-btn+.weui-btn{margin-top:16px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:16px}.weui-btn-area{margin:48px 16px 8px}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:16px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_access{color:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell__ft_in-access{padding-right:16px;position:relative}.weui-cell__ft_in-access:after{content:" ";display:inline-block;height:8px;width:8px;border-width:2px 2px 0 0;border-color:#b2b2b2;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-5px;right:0}.weui-cell_link{color:#576b95;font-size:17px}.weui-cell_link:active{background-color:#ececec}.weui-cell_link:first-child:before{display:block}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells{position:relative;margin-top:8px;background-color:#fff;line-height:1.41176471;font-size:17px}.weui-cells:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-cells:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-cells__title{margin-top:16px;margin-bottom:3px;padding-left:16px;padding-right:16px;color:rgba(0,0,0,.5);font-size:14px}.weui-cells_after-title{margin-top:0}.weui-cells__tips{margin-top:3px;color:rgba(0,0,0,.5);padding-left:16px;padding-right:16px;font-size:14px}.weui-cell{padding:16px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-cell:first-child:before{display:none}.weui-cell_active{background-color:#ececec}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:rgba(0,0,0,.5)}.weui-cell_label-block,.weui-cell_wxss.weui-cell_wxss:before{display:block}.weui-cell_label-block .weui-label{width:auto;word-break:normal;-webkit-hyphens:auto;hyphens:auto}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells_checkbox .weui-check__label:before{left:55px}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999px}.weui-check__hd_in-checkbox{padding-right:16px}.weui-cell__ft_in-radio{padding-left:16px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-form-preview:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-form-preview__value{font-size:14px}.weui-form-preview__value_in-hd{font-size:26px}.weui-form-preview__hd{position:relative;padding:16px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}.weui-form-preview__bd{padding:16px;font-size:.9em;text-align:right;color:rgba(0,0,0,.5);line-height:2}.weui-form-preview__ft{position:relative;line-height:56px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:rgba(0,0,0,.5);text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;text-align:center;font-weight:700;font-size:17px}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_active{background-color:#ececec}.weui-form-preview__btn_default{color:rgba(0,0,0,.9)}.weui-form-preview__btn_primary{color:#576b95}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}.weui-cell_input{padding-top:0;padding-bottom:0}.weui-label{width:105px;word-wrap:break-word;word-break:break-all}.weui-input{height:1.41176471em;min-height:1.41176471em;line-height:1.41176471}.weui-textarea{display:block;width:100%}.weui-textarea-counter{color:rgba(0,0,0,.3);text-align:right}.weui-cell_warn,.weui-textarea-counter_warn{color:#fa5151}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_select{padding:0;overflow:hidden}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:56px;line-height:56px;position:relative;z-index:1;padding-left:16px}.weui-cell_select-before{padding-right:16px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-cell_select-before .weui-cell__hd:before{content:" ";width:12px;height:24px;-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%;background-color:currentColor;color:rgba(0,0,0,.3);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E");position:absolute;top:50%;right:16px;margin-top:-12px}.weui-cell_select-before .weui-cell__bd{padding-left:16px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-before.weui-cell_access .weui-cell__hd{line-height:56px;padding-left:32px}.weui-cell_select-after{padding-left:16px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_select-after.weui-cell_access .weui-cell__bd{line-height:56px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:3.29411765em;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1rpx solid rgba(0,0,0,.1);line-height:3.29411765em;font-size:17px;color:#576b95;white-space:nowrap}button.weui-vcode-btn{min-height:0;background-color:transparent;border:0;outline:0}.weui-vcode-btn:active{color:#767676}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-gallery{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;opacity:0;visibility:hidden;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-gallery_show{display:-webkit-box;display:-webkit-flex;display:flex;visibility:visible;opacity:1}.weui-gallery__img__wrp{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;font-size:0}.weui-gallery__img{background:50% no-repeat;background-size:contain;position:absoulte;width:100%;height:100%}.weui-gallery__opr{background-color:#0d0d0d;color:#fff;line-height:60px;min-height:60px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);text-align:center}.weui-gallery__opr navigator{color:#fff}.weui-gallery__del{display:block}.weui-gallery__info{color:#fff;font-size:17px;line-height:60px;min-height:60px;text-align:center}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
:host{width:100%}.weui-slideview{overflow:hidden;position:relative}.weui-slideview__left{position:relative;z-index:10}.weui-slideview__right{position:absolute;z-index:1;left:100%;top:0;height:100%}.weui-slideview__btn__wrp{position:absolute;left:0;bottom:0;text-align:center;min-width:69px;height:100%;white-space:nowrap}.weui-slideview__btn{color:#fff;padding:0 17px}.weui-slideview__btn-group_default .weui-slideview__btn{background:#c7c7cc}.weui-slideview__btn-group_default~.weui-slideview__btn-group_default:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_default:first-child:before{display:none}.weui-slideview__btn-group_warn .weui-slideview__btn{background:#fe3b30}.weui-slideview__btn-group_warn~.weui-slideview__btn-group_warn:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #fff;color:#fff}.weui-slideview__btn-group_warn:first-child:before{display:none}.weui-slideview_icon .weui-slideview__btn__wrp{background:transparent;font-size:0}.weui-slideview_icon .weui-slideview__btn__wrp:after{content:"";width:0;height:100%;vertical-align:middle;display:inline-block}.weui-slideview_icon .weui-slideview__btn__wrp:first-child{padding-left:16px}.weui-slideview_icon .weui-slideview__btn__wrp:last-child{padding-right:8px}.weui-slideview_icon .weui-slideview__btn{width:48px;height:48px;line-height:48px;padding:0;display:inline-block;vertical-align:middle;border-radius:50%;background-color:#fff}.weui-slideview_icon .weui-slideview__btn__icon{display:inline-block;vertical-align:middle;width:22px;height:22px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cell_switch{padding-top:12px;padding-bottom:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-uploader{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__hd{padding-bottom:16px}.weui-uploader__overview{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__tips{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;padding-top:4px}.weui-uploader__info{color:rgba(0,0,0,.3)}.weui-uploader__bd{margin-bottom:-8px;margin-right:-8px;overflow:hidden}.weui-uploader__file{float:left;margin-right:8px;margin-bottom:8px}.weui-uploader__img{display:block;width:96px;height:96px}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file-content{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__input-box{float:left;position:relative;margin-right:8px;margin-bottom:8px;width:96px;height:96px;box-sizing:border-box;background-color:#ededed}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#a3a3a3}.weui-uploader__input-box:before{width:2px;height:32px}.weui-uploader__input-box:after{width:32px;height:2px}.weui-uploader__input-box:active{border-color:#8b8b8b}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#8b8b8b}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-footer{color:rgba(0,0,0,.3);font-size:14px;line-height:1.4;text-align:center}.weui-footer_fixed-bottom{position:fixed;bottom:16px;bottom:calc(16px + constant(safe-area-inset-bottom));bottom:calc(16px + env(safe-area-inset-bottom));left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 8px;position:relative;font-size:14px;color:#576b95}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid #c7c7c7;color:#c7c7c7;left:-8px;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-grids{border-top:1rpx solid rgba(0,0,0,.1);border-left:1rpx solid rgba(0,0,0,.1);overflow:hidden}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box;border-right:1rpx solid rgba(0,0,0,.1);border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-grid_active{background-color:#ececec}.weui-grid__icon{display:block;width:28px;height:28px;margin:0 auto}.weui-grid__label{margin-top:5px;display:block;text-align:center;color:rgba(0,0,0,.9);font-size:14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
icon[type=success]:after,icon[type=success]:before{color:#07c160!important}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.wx_dot_loading,.wx_dot_loading:after,.wx_dot_loading:before{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;background-color:rgba(0,0,0,.3);font-size:0;-webkit-animation:b 1.6s step-start infinite;animation:b 1.6s step-start infinite}.wx_dot_loading{position:relative}.wx_dot_loading:before{content:"";position:absolute;left:-12px;background-color:rgba(0,0,0,.1);-webkit-animation:a 1.6s step-start infinite;animation:a 1.6s step-start infinite}.wx_dot_loading:after{content:"";position:absolute;right:-12px;background-color:rgba(0,0,0,.5);-webkit-animation:c 1.6s step-start infinite;animation:c 1.6s step-start infinite}@-webkit-keyframes a{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@keyframes a{0%,to{background-color:rgba(0,0,0,.1)}30%{background-color:rgba(0,0,0,.5)}60%{background-color:rgba(0,0,0,.3)}}@-webkit-keyframes b{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@keyframes b{0%,to{background-color:rgba(0,0,0,.3)}30%{background-color:rgba(0,0,0,.1)}60%{background-color:rgba(0,0,0,.5)}}@-webkit-keyframes c{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}@keyframes c{0%,to{background-color:rgba(0,0,0,.5)}30%{background-color:rgba(0,0,0,.3)}60%{background-color:rgba(0,0,0,.1)}}.wx_dot_loading_white{background-color:hsla(0,0%,100%,.3);-webkit-animation:e 1.6s step-start infinite;animation:e 1.6s step-start infinite}.wx_dot_loading_white:before{background-color:hsla(0,0%,100%,.5);-webkit-animation:d 1.6s step-start infinite;animation:d 1.6s step-start infinite}.wx_dot_loading_white:after{background-color:hsla(0,0%,100%,.1);-webkit-animation:f 1.6s step-start infinite;animation:f 1.6s step-start infinite}@-webkit-keyframes d{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@keyframes d{0%,to{background-color:hsla(0,0%,100%,.5)}30%{background-color:hsla(0,0%,100%,.1)}60%{background-color:hsla(0,0%,100%,.3)}}@-webkit-keyframes e{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@keyframes e{0%,to{background-color:hsla(0,0%,100%,.3)}30%{background-color:hsla(0,0%,100%,.5)}60%{background-color:hsla(0,0%,100%,.1)}}@-webkit-keyframes f{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}@keyframes f{0%,to{background-color:hsla(0,0%,100%,.1)}30%{background-color:hsla(0,0%,100%,.3)}60%{background-color:hsla(0,0%,100%,.5)}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-loading{margin:0 5px;width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:a 1s steps(12) infinite;animation:a 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-media-box{padding:16px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:1s6px}.weui-media-box:first-child:before{display:none}.weui-media-box__title{font-weight:400;font-size:17px;color:rgba(0,0,0,.9);width:auto;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc,.weui-media-box__title{line-height:1.4;overflow:hidden;text-overflow:ellipsis}.weui-media-box__desc{color:rgba(0,0,0,.5);font-size:14px;padding-top:4px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:16px;padding-bottom:4px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box__title_in-text{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box__thumb{width:100%;height:100%;vertical-align:top}.weui-media-box__hd_in-appmsg{margin-right:16px;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box__bd_in-appmsg{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-cells_in-small-appmsg{margin-top:0}.weui-cells_in-small-appmsg:before{display:none}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
page{--height:44px;--right:190rpx}.weui-navigation-bar{overflow:hidden}.weui-navigation-bar .android{--height:48px;--right:222rpx}.weui-navigation-bar__inner{position:fixed;top:0;left:0;z-index:5001;height:var(--height);padding-right:var(--right);width:calc(100% - var(--right))}.weui-navigation-bar__inner,.weui-navigation-bar__inner .weui-navigation-bar__left{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-navigation-bar__inner .weui-navigation-bar__left{position:relative;width:var(--right);padding-left:16px;-webkit-box-pack:center}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn{display:inline-block;vertical-align:middle;background-repeat:no-repeat}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback{font-size:12px;width:1em;height:2em;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cpath fill-opacity='.9' fill-rule='evenodd' d='M10 19.438L8.955 20.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42L8.955 3.5 10 4.563 2.682 12 10 19.438z'/%3E%3C/svg%3E");background-position:50% 50%;background-size:cover}.weui-navigation-bar__inner .weui-navigation-bar__left .weui-navigation-bar__btn_goback:active{opacity:.5}.weui-navigation-bar__inner .weui-navigation-bar__center{font-size:17px;text-align:center;position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-navigation-bar__inner .weui-navigation-bar__loading{font-size:0}.weui-navigation-bar__inner .weui-navigation-bar__loading .weui-loading{margin-left:0}.weui-navigation-bar__inner .weui-navigation-bar__right{margin-right:16px}.weui-navigation-bar__placeholder{height:var(--height);background:#f8f8f8;position:relative;z-index:50}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-article{padding:24px 16px;padding:24px calc(16px + constant(safe-area-inset-right)) calc(24px + constant(safe-area-inset-bottom)) calc(16px + constant(safe-area-inset-left));padding:24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));font-size:17px;color:rgba(0,0,0,.9)}.weui-article__section{margin-bottom:1.5em}.weui-article__h1{font-size:22px;font-weight:700;margin-bottom:.9em;line-height:1.4}.weui-article__h2{font-size:17px}.weui-article__h2,.weui-article__h3{font-weight:700;margin-bottom:.34em;line-height:1.4}.weui-article__h3{font-size:15px}.weui-article__p{margin:0 0 .8em}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-cells__group_form:first-child .weui-cells__title{margin-top:0}.weui-cells__group_form .weui-cells__title{margin-top:24px;margin-bottom:8px;padding:0 32px}.weui-cells__group_form .weui-cell:before,.weui-cells__group_form .weui-cells:before{left:32px;right:32px}.weui-cells__group_form .weui-cells_checkbox .weui-check__label:before{left:72px}.weui-cells__group_form .weui-cells:after{left:32px;right:32px}.weui-cells__group_form .weui-cell{padding:16px 32px;color:rgba(0,0,0,.9)}.weui-cells__group_form .weui-cell__hd{padding-right:16px}.weui-cells__group_form .weui-cell__ft{padding-left:16px}.weui-cells__group_form .weui-cell_warn input{color:#fa5151}.weui-cells__group_form .weui-label{max-width:5em;margin-right:8px}.weui-cells__group_form .weui-cells__tips{margin-top:8px;padding:0 32px;color:rgba(0,0,0,.3)}.weui-cells__group_form .weui-cells__tips a{font-weight:700}.weui-cells__group_form .weui-cell_vcode{padding:12px 32px}.weui-cells__group_form .weui-vcode-btn{font-size:16px;padding:0 12px;margin-left:0;height:auto;width:auto;line-height:2em;color:#06ae56;background-color:#f2f2f2}.weui-cells__group_form .weui-vcode-btn:before{display:none}.weui-cells__group_form .weui-cell_select{padding:0}.weui-cells__group_form .weui-cell_select .weui-select{padding:0 32px}.weui-cells__group_form .weui-cell_select .weui-cell__bd:after{right:32px}.weui-cells__group_form .weui-cell_select-before .weui-label{margin-right:24px}.weui-cells__group_form .weui-cell_select-before .weui-select{padding-right:24px;box-sizing:initial}.weui-cells__group_form .weui-cell_select-after{padding-left:32px}.weui-cells__group_form .weui-cell_select-after .weui-select{padding-left:0}.weui-cells__group_form .weui-cell_switch{padding:12px 32px}.weui-cells__group_wxss.weui-cells__group_wxss .weui-cells__title{margin-top:24px}.weui-form{padding:56px 0 0;padding:calc(56px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(56px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;min-height:100%;box-sizing:border-box;line-height:1.4;background-color:#fff}.weui-form a:not(.weui-btn){color:#576b95}.weui-form .weui-footer,.weui-form .weui-footer__link{font-size:12px}.weui-form .weui-agree{padding:0}.weui-form__text-area{padding:0 32px;color:rgba(0,0,0,.9);text-align:center}.weui-form__control-area{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:48px 0}.weui-form__extra-area,.weui-form__tips-area{margin-bottom:24px;text-align:center}.weui-form__opr-area{margin-bottom:64px}.weui-form__opr-area:last-child{margin-bottom:96px}.weui-form__title{font-size:22px;font-weight:700;line-height:1.36}.weui-form__desc{font-size:17px;margin-top:16px}.weui-form__tips{color:rgba(0,0,0,.5);font-size:12px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-msg{padding-top:36px;padding:calc(36px + constant(safe-area-inset-top)) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);padding:calc(36px + env(safe-area-inset-top)) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);text-align:center;line-height:1.4;min-height:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#fff}.weui-msg__link{color:#576b95;display:inline-block;vertical-align:baseline}.weui-msg__icon-area{margin-bottom:32px}.weui-msg__text-area{margin-bottom:32px;padding:0 32px;-webkit-box-flex:1;-webkit-flex:1;flex:1;line-height:1.6}.weui-msg__text-area:first-child{padding-top:96px}.weui-msg__title{margin-bottom:5px;font-weight:700;font-size:22px;word-wrap:break-word;word-break:break-all}.weui-msg__desc{font-size:17px;color:rgba(0,0,0,.9)}.weui-msg__desc,.weui-msg__desc-primary{word-wrap:break-word;word-break:break-all;margin-bottom:16px}.weui-msg__desc-primary{font-size:14px;color:rgba(0,0,0,.5)}.weui-msg__opr-area{margin-bottom:16px}.weui-msg__opr-area .weui-btn-area{margin:0 16px}.weui-msg__opr-area .weui-btn+.weui-btn{margin-bottom:16px}.weui-msg__opr-area:last-child{margin-bottom:96px}.weui-msg__opr-area+.weui-msg__extra-area{margin-top:48px}.weui-msg__tips-area{margin-bottom:16px;padding:0 40px}.weui-msg__opr-area+.weui-msg__tips-area{margin-bottom:48px}.weui-msg__tips-area:last-child{margin-bottom:64px}.weui-msg__extra-area,.weui-msg__tips{font-size:12px;color:rgba(0,0,0,.5)}.weui-msg__extra-area{position:static;margin-bottom:24px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1rpx solid rgba(0,0,0,.1)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:rgba(0,0,0,.1)}.weui-panel:after{bottom:0;border-bottom:1rpx solid rgba(0,0,0,.1)}.weui-panel__hd{padding:16px 16px 13px;color:rgba(0,0,0,.9);font-size:15px;font-weight:700;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1);left:16px}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__opr{margin-left:15px;font-size:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-search-bar{position:relative;padding:8px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#ededed;-webkit-text-size-adjust:100%;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-icon-search{margin-right:8px;font-size:14px;vertical-align:top;margin-top:.64em;height:1em;line-height:1em}.weui-icon-search_in-box{position:absolute;left:12px;top:50%;margin-top:-8px}.weui-search-bar__text{display:inline-block;font-size:14px;vertical-align:top}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;border-radius:4px;background:#fff}.weui-search-bar__box{position:relative;padding-left:32px;padding-right:32px;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__input{height:32px;line-height:32px;font-size:14px;caret-color:#07c160}.weui-icon-clear{position:absolute;top:0;right:0;bottom:0;padding:0 12px;font-size:0}.weui-icon-clear:after{content:"";height:100%;vertical-align:middle;display:inline-block;width:0;overflow:hidden}.weui-search-bar__label{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:4px;text-align:center;color:rgba(0,0,0,.5);background:#fff;line-height:32px}.weui-search-bar__cancel-btn{margin-left:8px;line-height:32px;color:#576b95;white-space:nowrap}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#fff;border-bottom:1rpx solid rgba(0,0,0,.1);padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.weui-navbar+.weui-tab__panel{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:16px;padding:calc(16px + constant(safe-area-inset-top)) 16px 16px;padding:calc(16px + env(safe-area-inset-top)) 16px 16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-navbar__item.weui-bar__item_on{background-color:#ececec}.weui-navbar__item:first-child{padding-left:calc(16px + constant(safe-area-inset-left));padding-left:calc(16px + env(safe-area-inset-left))}.weui-navbar__item:last-child{padding-right:calc(16px + constant(safe-area-inset-right));padding-right:calc(16px + env(safe-area-inset-right))}.weui-navbar__item:last-child:after{display:none}.weui-navbar__slider{position:absolute;content:" ";left:0;bottom:0;width:6em;height:2px;background-color:#07c160;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;display:none}.weui-navbar__title{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}.weui-tab{display:-webkit-box;display:-webkit-flex;display:flex;height:100%;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column}.weui-tab__panel{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;z-index:500;background-color:#f7f7f7}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 0 4px;padding-bottom:calc(8px + constant(safe-area-inset-bottom));padding-bottom:calc(8px + env(safe-area-inset-bottom));font-size:0;color:rgba(0,0,0,.5);text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item:first-child{padding-left:constant(safe-area-inset-left);padding-left:env(safe-area-inset-left)}.weui-tabbar__item:last-child{padding-right:constant(safe-area-inset-right);padding-right:env(safe-area-inset-right)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#07c160}.weui-tabbar__icon{display:inline-block;width:28px;height:28px;margin-bottom:2px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:rgba(0,0,0,.5)}.weui-tabbar__icon image{width:100%;height:100%}.weui-tabbar__label{color:rgba(0,0,0,.9);font-size:10px;line-height:1.4}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#eae7e8;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,.5);line-height:1.4;background:#fff}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,.9);background-color:#fff}.weui-actionsheet__action{margin-top:8px;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#fa5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#fa5151;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-dialog__wrp{position:fixed;z-index:5000;top:16px;bottom:16px;left:16px;right:16px;text-align:center;font-size:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__wrp .weui-dialog{max-height:100%}.weui-dialog{background-color:#fff;text-align:center;border-radius:12px;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;max-height:90%}.weui-dialog__hd{padding:32px 24px 16px}.weui-dialog__title{font-weight:700;font-size:17px;line-height:1.4}.weui-dialog__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 24px;margin-bottom:32px;min-height:40px;font-size:17px;line-height:1.4;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;color:rgba(0,0,0,.5)}.weui-dialog__bd:first-child{padding:32px 24px 0;font-weight:700;color:rgba(0,0,0,.9);-webkit-flex-direction:column;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.weui-dialog__bd:first-child,.weui-dialog__ft{display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft{position:relative;line-height:64px;min-height:64px;font-size:17px}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#576b95;font-weight:700;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#ececec}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1rpx solid rgba(0,0,0,.1);color:rgba(0,0,0,.1)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:rgba(0,0,0,.9)}@media screen and (min-width:352px){.weui-dialog{width:320px;margin:0 auto}}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#fff;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.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}.weui-loadmore_line{border-top:1px solid rgba(0,0,0,.1);margin-top:2.4em}.weui-loadmore__tips_in-line{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:rgba(0,0,0,.5)}.weui-loadmore__tips_in-dot{position:relative;padding:0 .16em;width:4px;height:1.6em}.weui-loadmore__tips_in-dot:before{content:" ";position:absolute;top:50%;left:50%;margin-top:-1px;margin-left:-2px;width:4px;height:4px;border-radius:50%;background-color:rgba(0,0,0,.1)}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
\ No newline at end of file
/*!
/*!
* WeUI v2.0.1 (https://github.com/weui/weui-wxss)
* Copyright 2019 Tencent, Inc.
* Licensed under the MIT license
*/
.weui-toptips{position:fixed;-webkit-transform:translateZ(0) translateY(-108%);transform:translateZ(0) translateY(-108%);text-align:center;top:8px;left:16px;right:16px;border-radius:4px;padding:8px;-webkit-border-radius:4px;color:hsla(0,0%,100%,.9);font-size:17px;line-height:1.4;background:rgba(250,81,81,.9);z-index:5000;word-wrap:break-word;word-break:break-all;-webkit-transition:all .4s ease-in-out;transition:all .4s ease-in-out}.weui-toptips_show{-webkit-transform:translateZ(0) translateY(0);transform:translateZ(0) translateY(0);opacity:1}.weui-toptips_warn{background-color:#fa5151}.weui-toptips_success{background-color:#09bb07}.weui-toptips_error{background-color:#fa5151}.weui-toptips_info{background-color:#10aeff}
\ No newline at end of file
import { CITY_LIST, CITY_NOT_FOUND } from '../locale/citydata'
import { CITY_LIST, CITY_NOT_FOUND } from '../locale/citydata'
import utils from 'utils'
const { isNotEmpty, isChinese, getSlicedName } = utils;
/*
* AutoPredictor 实例一定有两个对外的接口:
* 1. 接收 输入框输入的值
* 2. 返回 最终匹配到的数组
*/
export class AutoPredictor {
constructor(inputContent) {
this.content = inputContent.toLowerCase()
}
// 输入框自动联想搜索
associativeSearch() {
// search
let tempList = this.searchList(this.content)
// get final list to show
let resultList = this.showList(tempList)
return resultList
}
searchList(str) {
let targetCity
return CITY_LIST.filter(
city => {
targetCity = this.getTargetCity(str, city)
return (targetCity && targetCity == str)
}
)
}
getTargetCity(str, cityObj) {
if (isChinese(str)) {
const slicedChineseName = getSlicedName(cityObj, 'city', str.length)
return slicedChineseName
} else {
const slicedPinyinName = getSlicedName(cityObj, 'short', str.length).toLowerCase()
return slicedPinyinName
}
// 在城市数据中,添加简拼到“shorter”属性,就可以实现简拼搜索
// getSlicedName(cityObj, 'shorter', str.length).toLowerCase()
}
showList(array) {
return isNotEmpty(array) ? array.map(item => ({ city: item.city, code: item.code })) : CITY_NOT_FOUND
}
}
\ No newline at end of file
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
function encode(str) {
var out, i, len;
var c1, c2, c3;
len = str.length;
i = 0;
out = "";
while (i < len) {
c1 = str.charCodeAt(i++) & 0xff;
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt((c1 & 0x3) << 4);
out += "==";
break;
}
c2 = str.charCodeAt(i++);
if (i == len) {
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt((c2 & 0xF) << 2);
out += "=";
break;
}
c3 = str.charCodeAt(i++);
out += base64EncodeChars.charAt(c1 >> 2);
out += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
out += base64EncodeChars.charAt(c3 & 0x3F);
}
return out;
}
function decode(str) {
var c1, c2, c3, c4;
var i, len, out;
len = str.length;
i = 0;
out = "";
while (i < len) {
/* c1 */
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c1 == -1);
if (c1 == -1)
break;
/* c2 */
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff];
} while (i < len && c2 == -1);
if (c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
/* c3 */
do {
c3 = str.charCodeAt(i++) & 0xff;
if (c3 == 61)
return out;
c3 = base64DecodeChars[c3];
} while (i < len && c3 == -1);
if (c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
/* c4 */
do {
c4 = str.charCodeAt(i++) & 0xff;
if (c4 == 61)
return out;
c4 = base64DecodeChars[c4];
} while (i < len && c4 == -1);
if (c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
}
return out;
}
function utf16to8(str) {
var out, i, len, c;
out = "";
len = str.length;
for (i = 0; i < len; i++) {
c = str.charCodeAt(i);
if ((c >= 0x0001) && (c <= 0x007F)) {
out += str.charAt(i);
} else if (c > 0x07FF) {
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
} else {
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
}
}
return out;
}
function utf8to16(str) {
var out, i, len, c;
var char2, char3;
out = "";
len = str.length;
i = 0;
while (i < len) {
c = str.charCodeAt(i++);
switch (c >> 4) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
// 0xxxxxxx
out += str.charAt(i - 1);
break;
case 12: case 13:
// 110x xxxx 10xx xxxx
char2 = str.charCodeAt(i++);
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
break;
case 14:
// 1110 xxxx 10xx xxxx 10xx xxxx
char2 = str.charCodeAt(i++);
char3 = str.charCodeAt(i++);
out += String.fromCharCode(((c & 0x0F) << 12) |
((char2 & 0x3F) << 6) |
((char3 & 0x3F) << 0));
break;
}
}
return out;
}
module.exports = {
encode: encode,
decode: decode,
utf16to8: utf16to8,
utf8to16: utf8to16
}
\ No newline at end of file
//应写入腾讯地图的key,并改文件名为config.js
//应写入腾讯地图的key,并改文件名为config.js
module.exports = {
key: "xxxxxxxxxxx",
}
var formatTime = function (date) {
var formatTime = function (date) {
var date = getDate(date.split('-').join('/'))
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
var formatDate_md = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 02-04
var str = date.toString().substring(5, 10)
return str
}
var formatDate_md_week = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 02-04 周三
var str = date.toString().substring(5, 10)
if(date == "")
{
return ""
}
else if(str == "")
{
return date
}
else
{
var week = getWeekByDate_today_2(date)
return str + " " + week
}
}
var formatDate_ymd = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 2020-02-04
var str = date.toString().substring(0, 10)
return str
}
var formatDate_ymdw_today = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 2020年02月04日 星期三
var date1 = getDate(date.split('-').join('/'));
var year = date1.getFullYear()
var month = date1.getMonth() + 1
var day = date1.getDate()
var week = getWeekByDate_today(date)
return year +"年" + month + "月" + day + "日" + " " + week
}
var formatDate_ymdw_today_2 = function (date) {
// 输入 2020-02-04 19:33:00
// 返回 2020年02月04日 周三
date = date+""
var date1 = getDate(date.split('-').join('/'));
var year = date1.getFullYear()
var month = date1.getMonth() + 1
var day = date1.getDate()
var week = getWeekByDate_today_2(date)
return year +"年" + month + "月" + day + "日" + " " + week
}
var formatDate_mdw_interval = function(date1, date2){
// 输入 2020-02-04 19:30:00, 2020-02-05 22:00:00
// 返回 02-04 周一\n02-05 周二
// 输入 2020-02-04 19:30:00, 2020-02-04 22:00:00
// 返回 02-04 周一
var mdw1 = formatDate_md_week(date1);
var mdw2 = formatDate_md_week(date2);
if(date2 == "" || mdw1 == mdw2)
{
return mdw1
}
else
{
return mdw1 + " - " + mdw2
}
}
var formatDate_ymdw_today_interval = function(date1, date2){
// 输入 2020-02-04 19:30:00, 2020-02-04 22:00:00
// 返回 2020年02月04日 周一 - 2020年02月05日 周二
var ymdw1 = formatDate_ymdw_today_2(date1);
var ymdw2 = formatDate_ymdw_today_2(date2);
if(date2 == "" || ymdw1 == ymdw2)
{
return ymdw1
}
else
{
return ymdw1 + " - " + ymdw2
}
}
var formatDate_hm_interval = function (date_start, date_end) {
// 输入 2020-02-04 19:30:00, 2020-02-04 22:00:00
// 返回 19:30 - 22:00
date_start = date_start +""
date_end = date_end +""
var date1 = getDate(date_start.split('-').join('/'));
var date2 = getDate(date_end.split('-').join('/'));
var hm1 = formatNumber(date1.getHours()) + ":" +formatNumber(date1.getMinutes())
var hm2 = formatNumber(date2.getHours()) + ":" +formatNumber(date2.getMinutes())
if( hm1 == "00:00")
{
return "全天"
}
else if( hm1 == hm2)
{
return hm1
}
else
{
return hm1 + " - " + hm2
}
}
var getWeekByDate_today = function (date) {
// 变为星期几
var show_day = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
var date1 = getDate(date.split('-').join('/'));
var day = date1.getDay();
return show_day[day];
}
var getWeekByDate_today_2 = function (date) {
// 变为周几
var show_day = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
var date1 = getDate(date.split('-').join('/'));
var day = date1.getDay();
return show_day[day];
}
var formatNumber = function(n) {
// 输入 8
// 返回 08
n = n.toString()
return n[1] ? n : '0' + n
}
var toFix = function (value) {
return value*100 //此处由小数0.25变成25
}
var formatNumberLike = function (value) {
// 输入 1132
// 返回 1.1k
var num = value
if(num >= 100000)
{
num = "100k"
}
else if(num >= 1000)
{
num = value / 1000
num = num.toFixed(1) + "k"
}
return num
}
var formatNumberPrice = function (value) {
// 输入 1132
// 返回 1.1k
var num = value
if(num >= 100000)
{
num = "100k"
}
else if(num >= 10000)
{
num = value / 10000
num = num.toFixed(2) + "w"
}
else if(num >= 1000)
{
num = value / 1000
num = num.toFixed(2) + "k"
}
return num
}
//jscat 2020/03/03 将数字1234转为ABCD
var formatAnswer = function (n) {
answer = ""
n = n + ""
switch (n) {
case "1":
answer = "A"
break;
case "2":
answer = "B"
break;
case "3":
answer = "C"
break;
case "4":
answer = "D"
break;
case "5":
answer = "E"
break;
default:
break;
}
return answer
}
module.exports = {
formatDate_ymd: formatDate_ymd,
formatDate_ymdw_today: formatDate_ymdw_today,
formatDate_ymdw_today_2: formatDate_ymdw_today_2,
formatDate_md: formatDate_md,
formatTime: formatTime,
formatNumber: formatNumber,
toFix: toFix,
formatAnswer: formatAnswer,
formatDate_md_week: formatDate_md_week,
formatNumberLike: formatNumberLike,
formatNumberPrice: formatNumberPrice,
formatDate_ymdw_today_interval: formatDate_ymdw_today_interval,
formatDate_hm_interval: formatDate_hm_interval,
formatDate_mdw_interval: formatDate_mdw_interval
}
\ No newline at end of file
var events = {};
var events = {};
function on(name, self, callback) {
var tuple = [self, callback];
var callbacks = events[name];
if (Array.isArray(callbacks)) {
callbacks.push(tuple);
}
else {
events[name] = [tuple];
}
}
function remove(name, self) {
var callbacks = events[name];
if (Array.isArray(callbacks)) {
events[name] = callbacks.filter((tuple) => {
return tuple[0] != self;
})
}
}
function emit(name, data) {
var callbacks = events[name];
if (Array.isArray(callbacks)) {
callbacks.map((tuple) => {
var self = tuple[0];
var callback = tuple[1];
callback.call(self, data);
})
}
}
module.exports = {
on,
remove,
emit,
}
\ No newline at end of file
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
var log = wx.getRealtimeLogManager ? wx.getRealtimeLogManager() : null
module.exports = {
info() {
if (!log) return
log.info.apply(log, arguments)
},
warn() {
if (!log) return
log.warn.apply(log, arguments)
},
error() {
if (!log) return
log.error.apply(log, arguments)
},
setFilterMsg(msg) { // 从基础库2.7.3开始支持
if (!log || !log.setFilterMsg) return
if (typeof msg !== 'string') return
log.setFilterMsg(msg)
},
addFilterMsg(msg) { // 从基础库2.8.1开始支持
if (!log || !log.addFilterMsg) return
if (typeof msg !== 'string') return
log.addFilterMsg(msg)
}
}
\ No newline at end of file
function formatTime(date) {
function formatTime(date) {
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
function formatNumber(n) {
n = n.toString()
return n[1] ? n : '0' + n
}
function wxuuid () {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid
}
function imageUtil(e) {
var imageSize = {};
var originalWidth = e.width;//图片原始宽
var originalHeight = e.height;//图片原始高
var originalScale = originalHeight / originalWidth;//图片高宽比
console.log('原始宽: ' + originalWidth)
console.log('原始高: ' + originalHeight)
console.log('宽高比' + originalScale)
//获取屏幕宽高
//https://www.cnblogs.com/boboweiqi/p/9523793.html
wx.getSystemInfo({
success: function (res) {
// canvas 基础宽高调为 2 倍,避免图片压缩程度过高导致图片字体显示不清楚
// res.windowWidth = 375
var windowWidth = res.windowWidth;
var windowHeight = res.windowHeight;
var windowscale = windowHeight / windowWidth;//屏幕高宽比
var rpx2px = 1 / 750 * res.windowWidth; //
var imagescale = originalHeight / originalWidth;//屏幕高宽比
var targetWidth = windowWidth
var targetHeight = windowWidth * 4 / 3
if(imagescale > 1 ) // 图像压缩成长型4:3
{
targetWidth = windowWidth
targetHeight = windowWidth * 4 / 3
}
else if(imagescale == 1)
{
targetWidth = windowWidth
targetHeight = windowWidth
}
else
{
// 定义为4:3,那么kpl的那张横屏的图就会裁剪很多!!
targetWidth = windowWidth
targetHeight = windowWidth * 3 / 5
}
var dw = targetWidth/originalWidth //canvas与图片的宽高比
var dh = targetHeight/originalHeight
// 裁剪图片中间部分
if(originalWidth > targetWidth && originalHeight > targetHeight){
//以width为放缩标准,裁剪height
if (dw >= dh) {
imageSize.sx = 0
imageSize.sy = (originalHeight - targetHeight/dw)/2
imageSize.swidth = originalWidth
imageSize.sheight = targetHeight/dw
}
//以height为放缩标准,裁剪width
else {
imageSize.sx = (originalWidth - targetWidth/dh)/2
imageSize.sy = 0
imageSize.swidth = targetWidth/dh
imageSize.sheight = originalHeight
}
imageSize.width = targetWidth
imageSize.height = targetHeight
}
// 拉伸图片并裁剪
else if( originalWidth > targetWidth || originalHeight > targetHeight)
{
//宽度小于显示区域,拉伸宽度并裁剪
if(originalWidth < targetWidth){
imageSize.sx = 0
imageSize.sy = (originalHeight - targetHeight/dw)/2
imageSize.swidth = originalWidth
imageSize.sheight = targetHeight/dw
}
//原始图片仅高度小于显示区域
else {
imageSize.sx = (originalWidth - targetWidth/dh)/2
imageSize.sy = 0
imageSize.swidth = targetWidth/dh
imageSize.sheight = originalHeight
}
imageSize.width = targetWidth
imageSize.height = targetHeight
}
//
else
{
imageSize.sx = 0
imageSize.sy = 0
imageSize.swidth = originalWidth
imageSize.sheight = originalHeight
imageSize.width = originalWidth
imageSize.height = originalHeight
}
imageSize.x = 0
imageSize.y = 0
}
})
console.log('缩放后的sx: ' + imageSize.sx)
console.log('缩放后的sy: ' + imageSize.sy)
console.log('缩放后的宽: ' + imageSize.width)
console.log('缩放后的高: ' + imageSize.height)
return imageSize;
}
let app = getApp()
function rpx2px(rpx) {
return rpx * app.globalData.rpx2px;
}
module.exports = {
formatTime: formatTime,
wxuuid: wxuuid,
imageUtil: imageUtil,
rpx2px: rpx2px
}
import { LETTERS, CITY_LIST } from '../locale/citydata'
import { LETTERS, CITY_LIST } from '../locale/citydata'
import config from 'config'
// API
const getLocationUrl = (latitude, longitude) => (`https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=${config.key}`)
const getCountyListUrl = code => (`https://apis.map.qq.com/ws/district/v1/getchildren?&id=${code}&key=${config.key}`)
const getIndexUrl = () => ('../activity/activity')
const getListUrl = () => ('../activity/activity-list/activity-list')
/**
* 安全地在深层嵌套对象中取值
* get deeply nested data from an object safely, return null if not found
* @param {Array} keyList an Array of keys
* @param {Object} obj
*/
const safeGet = (keyList, obj) => keyList.reduce((preValue, curKey) => ((preValue && preValue[curKey]) ? preValue[curKey] : null), obj)
const isNotEmpty = array => (Array.isArray(array) && array.length > 0)
const isChinese = str => (/^[\u4e00-\u9fa5]+$/.test(str))
// 城市名按首字母分组
const getCityListSortedByInitialLetter = () => (
LETTERS.map(
letter => ({
initial: letter,
cityInfo: CITY_LIST.filter(city => city.initial == letter)
})
)
)
const getSlicedName = (cityObj, key, sliceLen) => (cityObj[key] && cityObj[key].slice(0, sliceLen))
const onFail = (err) => { console.log(err) } // add your logic here e.g. show a toast
export default {
getLocationUrl,
getCountyListUrl,
getIndexUrl,
getListUrl,
safeGet,
isNotEmpty,
isChinese,
getCityListSortedByInitialLetter,
getSlicedName,
onFail,
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="86dc399d-9323-4124-8c4f-671d1ecb849c" name="Default Changelist" comment=""> <list default="true" id="86dc399d-9323-4124-8c4f-671d1ecb849c" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../../内容-公众号及其他平台/规划/nyx_s1.pptx" beforeDir="false" afterPath="$PROJECT_DIR$/../../内容-公众号及其他平台/规划/nyx_s1.pptx" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../doc/create_table_sql/酒肆-产品功能模块.docx" beforeDir="false" afterPath="$PROJECT_DIR$/../doc/create_table_sql/酒肆-产品功能模块.docx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../nyx-master/config.js" beforeDir="false" afterPath="$PROJECT_DIR$/../nyx-master/config.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../nyx-master/config.js" beforeDir="false" afterPath="$PROJECT_DIR$/../nyx-master/config.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../nyx-master/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/../nyx-master/project.config.json" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../nyx-master/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/../nyx-master/project.config.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
...@@ -135,6 +135,15 @@ ...@@ -135,6 +135,15 @@
<workItem from="1597545220264" duration="5589000" /> <workItem from="1597545220264" duration="5589000" />
<workItem from="1597625681762" duration="10449000" /> <workItem from="1597625681762" duration="10449000" />
<workItem from="1597718033759" duration="585000" /> <workItem from="1597718033759" duration="585000" />
<workItem from="1599621864290" duration="2330000" />
<workItem from="1599909259516" duration="23046000" />
<workItem from="1600222354368" duration="21839000" />
<workItem from="1600607869538" duration="1515000" />
<workItem from="1600669905813" duration="3070000" />
<workItem from="1600737217790" duration="21414000" />
<workItem from="1600949363660" duration="9371000" />
<workItem from="1601092868981" duration="1938000" />
<workItem from="1601344951680" duration="1334000" />
</task> </task>
<servers /> <servers />
</component> </component>
...@@ -162,6 +171,21 @@ ...@@ -162,6 +171,21 @@
<line>160</line> <line>160</line>
<option name="timeStamp" value="3" /> <option name="timeStamp" value="3" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/web/controller/OssApiController.java</url>
<line>111</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_keyServiceImpl.java</url>
<line>845</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/api/src/main/java/cn/com/fun/nyxkey/api/service/impl/Rockwell_keyServiceImpl.java</url>
<line>876</line>
<option name="timeStamp" value="8" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论