Commit 5d11c903 by Sweet Zhang

Initial commit

parents
//app.js
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs);
var _this = this
wx.getSystemInfo({
success: function (response) {
if (response.model.toUpperCase().indexOf('IPHONE') >= 0 && response.model.toUpperCase().indexOf('X') >= 0) {
_this.globalData.isIpx = true;
}
}
})
wx.request({
url: 'https://m.zuihuibi.cn/api/authorize/obtainToken',
method: 'POST',
data: {
ticket: 'miniPro'
},
success: function (response) {
wx.setStorageSync('X-Authorization', response.data.data.token);
// 登录
wx.login({
success: function (res) {
if (res.code) {
//发起网络请求
wx.request({
url: 'https://m.zuihuibi.cn/api/jscode2session',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: {
appid: 'wx53a601e27aaf7897',
secret: 'f61707a62e46fee78ef46155330cdf45',
js_code: res.code
},
success: function (res) {
wx.setStorageSync('sessionKey', res.data.data.session_key);
wx.setStorageSync('openid', res.data.data.openid);
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
}
})
},
globalData: {
userInfo: null,
isIpx: false
}
})
\ No newline at end of file
{
{
"pages": [
"pages/index/index",
"pages/returnPage/returnPage",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "獴哥保险诊所",
"navigationBarTextStyle": "black"
}
}
\ No newline at end of file
/**app.wxss**/
/**app.wxss**/
.container {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #f6f7f2;
}
.linerGradient {
background: linear-gradient(270deg, #f10000, #ff4e18);
font-family: -apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
"Helvetica Neue",
Helvetica,
"PingFang SC",
"Hiragino Sans GB",
"Microsoft YaHei",
SimSun,
sans-serif;
}
.inputControl {
width: 595rpx;
height: 84rpx;
border: 2rpx solid rgba(61,70,103,0.5);
border-radius: 44rpx;
color: #000;
font-size: 36rpx;
padding-left: 40rpx;
margin: 0 auto;
}
.inputControl input {
width: 348rpx;
height: 100%;
}
.smallBtn {
display: inline-block;
width: 700rpx;
height: 94rpx;
line-height: 94rpx;
border-radius: 10rpx;
background-color: #fff;
color: #000;
font-size: 36rpx;
text-align: center;
border: 1px solid #dcdcdc;
}
.fix-iphonex-button {
width: 100%;
background-color: #f6f7f2;
}
.none-iphonex-button {
width: 100%;
background-color: #f6f7f2;
}
//index.js
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
timeCount: 60,
codeBtnHtml: '获取验证码',
mobileNo: '',
customerId: '',
name: '家庭管理服务测试',
verificationCode: '',
autogetPhoneNumber: false,
nameValider: false,
verificationCodeValider: false,
disableBtn: false,
userInfo: {},
isIpx: false,
hasUserInfo: false,
isBuy: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad: function() {
this.setData({
isIpx: app.globalData.isIpx
});
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
})
} else if (this.data.canIUse) {
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
wx.checkSession({
success: function() {
// console.log('未过期,并且在本生命周期一直有效')
//session_key 未过期,并且在本生命周期一直有效
},
fail: function() {
// console.log('已经失效,需要重新执行登录流程')
// session_key 已经失效,需要重新执行登录流程
// 登录
wx.login({
success: function(res) {
if (res.code) {
//发起网络请求
wx.request({
url: 'https://m.zuihuibi.cn/api/jscode2session',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: {
appid: 'wx53a601e27aaf7897',
secret: 'f61707a62e46fee78ef46155330cdf45',
js_code: res.code
},
success: function(res) {
wx.setStorageSync('sessionKey', res.data.data.openid)
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
}
})
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
/**
* 获取用户手机号码
*/
getPhoneNumber: function(e) {
const phoneNumber = {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
sessionKey: wx.getStorageSync('sessionKey')
}
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/getPhoneNumber',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: JSON.stringify(phoneNumber),
success: function(res) {
that.setData({
'mobileNo': res.data.data.mobileNo,
'customerId': res.data.data.customerId
})
console.log(res.data.data.mobileNo)
}
})
if (e.detail.encryptedData) {
this.setData({
'autogetPhoneNumber': true,
'verificationCodeValider': true
})
} else {
this.setData({
'autogetPhoneNumber': false,
'verificationCodeValider': false
})
}
// console.log(e.detail.errMsg)
// console.log(e.detail.iv)
// console.log(e.detail.encryptedData)
},
/**
* 失去焦点获取用户输入手机号
*/
inputMobileNo: function(e) {
if (e.detail.value.length === 11) {
this.setData({
'mobileNo': e.detail.value
});
}
},
/**
*
*/
getVerificationCode: function(e) {
if (e.detail.value.length === 4) {
this.setData({
'verificationCode': e.detail.value
});
if (this.data.mobileNo) {
this.checkVerificationCode();
}
}
},
/**
* 获取验证码
*/
getCode: function(e) {
var VerificationCodeRequest = {
mobileNo: this.data.mobileNo,
type: '1'
}
if (this.data.mobileNo.length === 11) {
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/verificationCode',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: JSON.stringify(VerificationCodeRequest),
success: function(res) {
if (res.data.success) {
wx.showToast({
title: '发送成功',
icon: 'success',
duration: 800
});
that.setData({
'disableBtn': true
});
var timeCount = that.data.timeCount;
var codeBtnHtml = that.data.codeBtnHtml;
var timer = setInterval(function() {
timeCount--;
codeBtnHtml = '(' + timeCount + ')s';
if (timeCount <= 0) {
codeBtnHtml = '重新获取';
clearInterval(timer);
timeCount = 60;
that.setData({
'disableBtn': false
});
}
that.setData({
'codeBtnHtml': codeBtnHtml
});
}, 1000)
} else {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 2000
})
}
}
})
} else {
wx.showToast({
title: '请检查您的手机号码是否正确',
icon: 'none',
duration: 2000
})
}
},
/**
* 验证验证码
*/
checkVerificationCode: function() {
var verificationCodeRequest = {
mobileNo: this.data.mobileNo,
verificationCode: this.data.verificationCode,
}
if (this.data.verificationCode) {
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/checkVerificationCode',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: JSON.stringify(verificationCodeRequest),
success: function(res) {
that.setData({
'verificationCodeValider': res.data.success
});
var mobileNo = {
mobileNo: that.data.mobileNo
}
wx.request({
url: 'https://m.zuihuibi.cn/api/login',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: JSON.stringify(mobileNo),
success: function(res) {
that.setData({
'customerId': res.data.data.customerId
});
}
})
if (!res.data.success) {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 2000
})
}
}
})
}
},
/**
* 立即购买
*/
buy: function(e) {
this.setData({
'isBuy': true
})
},
/**
* 姓名格式校验
*/
nameValid: function(e) {
var NAME_REGEXP = /(^[\u4e00-\u9fa5]{1}[\u4e00-\u9fa5\.·。]{0,48}[\u4e00-\u9fa5]{1}$)|(^[a-zA-Z]{1}[a-zA-Z\s]{0,48}[a-zA-Z]{1}$)/;
this.setData({
'nameValider': NAME_REGEXP.test(e.detail.value),
'name': e.detail.value
});
},
/**
* 立即支付
*/
goPay: function(e) {
if (!this.data.mobileNo) {
wx.showToast({
title: '请检查您的手机号码是否正确',
icon: 'none',
duration: 2000
})
} else if (!this.data.verificationCodeValider) {
wx.showToast({
title: '请检查您的验证码是否正确',
icon: 'none',
duration: 2000
})
} else if (!this.data.nameValider) {
wx.showToast({
title: '请检查您的姓名是否正确',
icon: 'none',
duration: 2000
})
} else {
const startDate = new Date();
const endDate = new Date(new Date(startDate).setFullYear(new Date(startDate).getFullYear() + 1));
endDate.setDate(endDate.getDate() - 1);
const data = {
customerId: this.data.customerId,
planId: '424',
startDate: startDate.getFullYear() + '-' + this.dateFormat((Number(startDate.getMonth()) + 1)) + '-' + this.dateFormat((Number(startDate.getDate()))),
endDate: endDate.getFullYear() + '-' + this.dateFormat((Number(endDate.getMonth()) + 1)) + '-' + this.dateFormat((Number(endDate.getDate()))),
price: '49',
openid: wx.getStorageSync('openid'),
holder: {
name: this.data.name,
mobileNo: this.data.mobileNo
},
paymentMethod: '4'
}
wx.request({
url: 'https://m.zuihuibi.cn/api/voucherBuy',
method: 'POST',
header: {
'X-Authorization': wx.getStorageSync('X-Authorization')
},
data: JSON.stringify(data),
success: function(res) {
if (res.data.success) {
wx.requestPayment({
'timeStamp': res.data.data.timeStamp,
'nonceStr': res.data.data.nonceStr,
'package': res.data.data.packageWX,
'signType': res.data.data.signType,
'paySign': res.data.data.paySign,
'success': function(res) {
// console.log(res);
console.log('成功');
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=1',
})
},
'fail': function(res) {
// console.log(res);
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=0',
})
console.log('失败');
},
'complete': function(res) {
// console.log(res);
console.log('失败和成功都会有')
}
})
} else {
if (res.data.data.errorCode === 'C01') {
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=2',
})
} else {
wx.showToast({
title: res.data.data.errorMessage,
icon: 'none',
duration: 2000
})
}
}
},
fail: function(res) {
console.log(res);
}
})
}
},
/**
* 时间格式修改
*/
dateFormat: function(e) {
if (Number(e) < 10) {
return '0' + e;
} else {
return e;
}
},
/**
* 关闭弹窗
*/
closeModalBox: function(e) {
this.setData({
'isBuy': false
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '1对1家庭风险管理服务',
imageUrl: '../images/share_img.png',
path: '/pages/index/index'
}
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--index.wxml-->
<!--index.wxml-->
<view class="container" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<image src='../images/bg.png' style='width:750rpx;height:5191rpx'></image>
<view class='footer'>
<view class='priceBox'>
<view style='font-weight:bold;font-size:40rpx'>
<text style='font-size:30rpx'>¥</text>49</view>
<view style='font-weight:300;font-size:26rpx' class='line-through'>原价:
<text style='font-size:20rpx'>¥</text>
<text>199/年</text>
</view>
</view>
<view class='redeemBtn linerGradient' bindtap="buy">立即购买</view>
</view>
</view>
<!-- 立即购买信息 -->
<block wx:if="{{isBuy}}">
<view class="modalBox">
<view class='inputBox'>
<!--获取手机号 -->
<view class="mobileNoSection inputControl">
<input type='number' maxlength="11" placeholder="输入手机号" placeholder-style="color: #b2b2b2;" bindinput="inputMobileNo" value='{{mobileNo}}' />
<view class='autoGet'>
<image class='wechatIcon' style="width: 46rpx; height: 46rpx;margin-top:20rpx;" src='../images/wechatIcon.png'></image>
<button class='getPhoneNumber commonBtn' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">自动获取</button>
</view>
</view>
<!--获取验证码 -->
<view class="codeSection inputControl" wx:if="{{!autogetPhoneNumber}}">
<input type='number' maxlength="4" placeholder="输入验证码" placeholder-style=" color: #b2b2b2;" bindblur="getVerificationCode" />
<view class='autoGet'>
<button class='getCode commonBtn' bindtap='getCode' disabled='{{disableBtn}}'>{{codeBtnHtml}}</button>
</view>
</view>
<!--姓名 -->
<view class="nameSection inputControl">
<input type='text' maxlength="50" placeholder="姓名" style="width:100%" placeholder-style=" color: #b2b2b2;" bindblur="nameValid" />
</view>
<!--立即支付 -->
<button class='goBuyBtn commonBtn' bindtap='goPay'>立即支付</button>
</view>
<!-- 关闭按钮 -->
<view class='closeModal' bindtap='closeModalBox'>X</view>
</view>
</block>
\ No newline at end of file
/**index.wxss**/
/**index.wxss**/
.redeemBtn {
position: absolute;
right: 0;
width: 400rpx;
height: 130rpx;
line-height: 130rpx;
text-align: center;
color: #fff;
font-size: 40rpx;
}
.priceBox {
width: 300rpx;
color: #fe3400;
text-align: center;
}
.footer {
display: flex;
align-items: center;
height: 130rpx;
background-color: rgb(255, 255, 255);
}
.line-through {
position: relative;
}
.line-through::after {
position: absolute;
top: 50%;
left: 0;
right: 0;
margin: 0 auto;
content: '';
width: 65%;
height: 1px;
background-color: #fe3400;
}
.modalBox {
position: fixed;
left: 0;
top: 0;
width: 750rpx;
height: 6000rpx;
background: rgba(0, 0, 0, 0.9);
z-index: 1;
}
.inputBox {
position: absolute;
top: 300rpx;
left: 30rpx;
width: 85%;
background-color: #f6f7f2;
padding: 60rpx 30rpx;
border-radius: 10rpx;
}
.mobileNoSection, .codeSection {
position: relative;
display: flex;
}
.codeSection, .nameSection {
margin-top: 40rpx;
}
.getPhoneNumber, .getCode {
width: 248rpx;
height: 84rpx;
color: #000;
border-radius: 44rpx;
font-size: 32rpx;
}
.getPhoneNumber {
padding-left: 80rpx;
}
.autoGet {
width: 248rpx;
height: 84rpx;
position: absolute;
right: 0rpx;
top: 0rpx;
}
.wechatIcon {
position: absolute;
left: 30rpx;
top: 0;
z-index: 1;
}
.commonBtn {
background: #16c4bb;
color: #fff;
}
.goBuyBtn {
width: 400rpx;
height: 90rpx;
line-height: 90rpx;
border-radius: 44rpx;
border: none;
margin-top: 100rpx;
}
.closeModal {
position: absolute;
right: 20rpx;
top: 20rpx;
color: #fff;
border: 2px solid #fff;
border-radius: 50%;
width: 60rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
cursor: pointer;
font-size: 44rpx;
}
//logs.js
//logs.js
const util = require('../../utils/util.js')
//获取应用实例
const app = getApp()
Page({
data: {
isIpx:false,
logs: []
},
onLoad: function () {
this.setData({
isIpx: app.globalData.isIpx,
logs: (wx.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
}
})
{
{
"navigationBarTitleText": "查看启动日志"
}
\ No newline at end of file
<!--logs.wxml-->
<!--logs.wxml-->
<view class="container log-list" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
</view>
.log-list {
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}
// pages/returnPage/returnPage.js
// pages/returnPage/returnPage.js
//获取应用实例
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
paymentStatus: '0',
isIpx:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ 'paymentStatus': options.paymentStatus, isIpx: app.globalData.isIpx })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
// console.log(res.target)
}
return {
title: '1对1家庭风险管理服务',
imageUrl: '../images/share_img.png',
path: '/pages/index/index'
}
}
})
\ No newline at end of file
<!--pages/returnPage/returnPage.wxml-->
<!--pages/returnPage/returnPage.wxml-->
<view class="container" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<view class="modal">
<block wx:if="{{paymentStatus=='0'}}">
<view class="statusBox">
<view style='text-align:center;margin-bottom:20rpx;'>
<icon type="warn" size="90" />
</view>
<view class='titleContainer' style="display: flex;justify-content: center;">
<view style='font-weight:400;font-size:40rpx;;margin-bottom:10rpx;'>支付失败</view>
</view>
</view>
</block>
<block wx:if="{{paymentStatus=='1'}}">
<view class="statusBox">
<view style='text-align:center;margin-bottom:20rpx;'>
<icon type="success" size="90" />
</view>
<view class='titleContainer' style="text-align:center">
<view style='font-weight:400;font-size:40rpx;margin-bottom:10rpx;'>支付成功</view>
<view class='stausText' style='display:flex;flex-direction:column'>
<text>谢谢购买家庭风险管理服务。</text>
<text>我们的风险分析师会在24小时内和您联系。</text>
</view>
</view>
</view>
</block>
<block wx:if="{{paymentStatus=='2'}}">
<view class="statusBox">
<view style='text-align:center;margin-bottom:20rpx;'>
<icon type="warn" size="90" />
</view>
<view class='titleContainer' style="display: flex;justify-content: center;">
<view style='font-weight:400;font-size:40rpx;;margin-bottom:10rpx;'>支付失败!!!!</view>
</view>
</view>
</block>
<view class="{{isIpx?'btnBlockFixedX':'btnBlock'}}">
<view class="btnBox">
<button open-type="share" class='shareBtn' hover-class="none">
<text class="smallBtn actived">分享好友</text>
</button>
</view>
<view class="btnBox">
<navigator url='/pages/index/index'>
<text class="smallBtn">返回首页</text>
</navigator>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* pages/returnPage/returnPage.wxss */
/* pages/returnPage/returnPage.wxss */
.modal {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #f6f7f2;
}
.statusBox {
margin-top: 10%;
}
.titleContainer {
padding: 40rpx;
}
.titleContainer .stausText {
font-size: 28rpx;
font-weight: 400;
text-align: center;
margin-bottom: 20rpx;
}
.btnBlock, .btnBlockFixedX {
width: 100%;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
margin-top: 10rpx;
}
.btnBlock .btnBox, .btnBlockFixedX .btnBox {
margin-bottom: 30rpx;
}
.shareBtn {
background: none;
border: none !important;
border-radius: 0;
line-height: 1;
}
.shareBtn::after {
border: none;
}
.actived {
background: rgba(22, 196, 187, 1);
color: #fff;
border: 1px solid rgba(22, 196, 187, 0.5);
}
{
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.0.9",
"appid": "wx53a601e27aaf7897",
"projectname": "49%E5%85%83%E4%BF%9D%E9%99%A9%E6%B4%BB%E5%8A%A8",
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
/*
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
function core_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the HMAC-MD5, of a key and some data
*/
function core_hmac_md5(key, data)
{
var bkey = str2binl(key);
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* Convert a string to an array of little-endian words
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
*/
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
return str;
}
/*
* Convert an array of little-endian words to a hex string.
*/
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
/*
* Convert an array of little-endian words to a base-64 string
*/
function binl2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}
module.exports = {
MD5:hex_md5
}
\ No newline at end of file
const formatTime = date => {
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
//app.js
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs);
var _this = this
wx.getSystemInfo({
success: function (response) {
if (response.model.toUpperCase().indexOf('IPHONE') >= 0 && response.model.toUpperCase().indexOf('X') >= 0) {
_this.globalData.isIpx = true;
}
}
})
wx.request({
url: 'https://m.zuihuibi.cn/api/authorize/obtainToken',
method: 'POST',
data: {
ticket: 'miniPro'
},
success: function (response) {
wx.setStorageSync('X-Authorization', response.data.data.token);
// 登录
wx.login({
success: function (res) {
if (res.code) {
//发起网络请求
wx.request({
url: 'https://m.zuihuibi.cn/api/jscode2session',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: {
appid: 'wx6ae60f33768036aa',
secret: 'd31f03454666a2a0dd261ee90c8aa6ce',
js_code: res.code
},
success: function (res) {
wx.setStorageSync('sessionKey', res.data.data.session_key);
wx.setStorageSync('openid', res.data.data.openid);
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
// // 获取用户信息
// wx.getSetting({
// success: res => {
// if (res.authSetting['scope.userInfo']) {
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
// // wx.getUserInfo({
// // success: res => {
// // // 可以将 res 发送给后台解码出 unionId
// // this.globalData.userInfo = res.userInfo
// // // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// // // 所以此处加入 callback 以防止这种情况
// // if (this.userInfoReadyCallback) {
// // this.userInfoReadyCallback(res)
// // }
// // }
// // })
// }
// }
// })
}
})
},
globalData: {
userInfo: null,
isIpx: false
}
})
\ No newline at end of file
{
{
"pages": [
"pages/index/index",
"pages/returnPage/returnPage",
"pages/fillInfo/fillInfo",
"pages/logs/logs"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
}
}
\ No newline at end of file
/**app.wxss**/
/**app.wxss**/
.container {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #000;
}
.linerGradient {
background: linear-gradient(#f7cb8e, #ac8b6e);
font-family: -apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
"Helvetica Neue",
Helvetica,
"PingFang SC",
"Hiragino Sans GB",
"Microsoft YaHei",
SimSun,
sans-serif;
}
.inputControl {
width: 624rpx;
height: 84rpx;
border: 2px solid #e3b870;
border-radius: 44rpx;
color: rgb(201, 181, 144);
font-size: 26rpx;
padding-left: 40rpx;
margin: 0 auto;
}
.inputControl input{
width:58%;
height:100%;
}
.smallBtn{
width: 166rpx;
height:70rpx;
line-height: 70rpx;
border-radius:34rpx;
background-color: #fff;
color: rgb(201,152,61);
font-size: 28rpx;
text-align: center;
}
.fix-iphonex-button {
height: 1448rpx;
width: 100%;
}
.none-iphonex-button {
height: 1206rpx;
width: 100%;
}
\ No newline at end of file
// pages/fillInfo/fillInfo.js
// pages/fillInfo/fillInfo.js
var MD5Util = require('../../utils/md5.js');
//获取应用实例
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
timeCount: 60,
codeBtnHtml: '获取验证码',
mobileNo: '',
customerId: '',
name: '',
verificationCode: '',
autogetPhoneNumber: false,
nameValider: false,
verificationCodeValider: false,
disableBtn: false,
isIpx:false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { this.setData({ isIpx: app.globalData.isIpx });},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
wx.checkSession({
success: function() {
// console.log('未过期,并且在本生命周期一直有效')
//session_key 未过期,并且在本生命周期一直有效
},
fail: function() {
// console.log('已经失效,需要重新执行登录流程')
// session_key 已经失效,需要重新执行登录流程
// 登录
wx.login({
success: function(res) {
if (res.code) {
//发起网络请求
wx.request({
url: 'https://m.zuihuibi.cn/api/jscode2session',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: {
appid: 'wx6ae60f33768036aa',
secret: 'd31f03454666a2a0dd261ee90c8aa6ce',
js_code: res.code
},
success: function(res) {
wx.setStorageSync('sessionKey', res.data.data.openid)
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
return {
title: '专属于你的保险经纪人服务',
imageUrl: '../images/share_mini.jpg',
path: '/pages/index/index'
}
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:', e.detail.value)
},
/**
* 获取用户手机号码
*/
getPhoneNumber: function(e) {
const phoneNumber = {
encryptedData: e.detail.encryptedData,
iv: e.detail.iv,
sessionKey: wx.getStorageSync('sessionKey')
}
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/getPhoneNumber',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: JSON.stringify(phoneNumber),
success: function(res) {
that.setData({
'mobileNo': res.data.data.mobileNo,
'customerId': res.data.data.customerId
})
console.log(res.data.data.mobileNo)
}
})
if (e.detail.encryptedData) {
this.setData({
'autogetPhoneNumber': true,
'verificationCodeValider': true
})
} else {
this.setData({
'autogetPhoneNumber': false,
'verificationCodeValider': false
})
}
// console.log(e.detail.errMsg)
// console.log(e.detail.iv)
// console.log(e.detail.encryptedData)
},
/**
* 失去焦点获取用户输入手机号
*/
inputMobileNo: function(e) {
if (e.detail.value.length === 11) {
this.setData({
'mobileNo': e.detail.value
});
}
},
/**
*
*/
getVerificationCode: function(e) {
if (e.detail.value.length === 4) {
this.setData({
'verificationCode': e.detail.value
});
if (this.data.mobileNo) {
this.checkVerificationCode();
}
}
},
/**
* 获取验证码
*/
getCode: function(e) {
var VerificationCodeRequest = {
mobileNo: this.data.mobileNo,
type: '1'
}
if (this.data.mobileNo.length === 11) {
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/verificationCode',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: JSON.stringify(VerificationCodeRequest),
success: function(res) {
if (res.data.success) {
wx.showToast({
title: '发送成功',
icon: 'success',
duration: 800
});
that.setData({
'disableBtn': true
});
var timeCount = that.data.timeCount;
var codeBtnHtml = that.data.codeBtnHtml;
var timer = setInterval(function() {
timeCount--;
codeBtnHtml = '(' + timeCount + ')s';
if (timeCount <= 0) {
codeBtnHtml = '重新获取';
clearInterval(timer);
timeCount = 60;
that.setData({
'disableBtn': false
});
}
that.setData({
'codeBtnHtml': codeBtnHtml
});
}, 1000)
} else {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 2000
})
}
}
})
} else {
wx.showToast({
title: '请检查您的手机号码是否正确',
icon: 'none',
duration: 2000
})
}
},
/**
* 验证验证码
*/
checkVerificationCode: function() {
var verificationCodeRequest = {
mobileNo: this.data.mobileNo,
verificationCode: this.data.verificationCode,
}
if (this.data.verificationCode) {
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/checkVerificationCode',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: JSON.stringify(verificationCodeRequest),
success: function(res) {
that.setData({
'verificationCodeValider': res.data.success
});
var mobileNo = {
mobileNo: that.data.mobileNo
}
wx.request({
url: 'https://m.zuihuibi.cn/api/login',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: JSON.stringify(mobileNo),
success: function(res) {
that.setData({
'customerId': res.data.data.customerId
});
}
})
if (!res.data.success) {
wx.showToast({
title: res.data.message,
icon: 'none',
duration: 2000
})
}
}
})
}
},
/**
* 立即支付
*/
goPay: function(e) {
if (!this.data.mobileNo) {
wx.showToast({
title: '请检查您的手机号码是否正确',
icon: 'none',
duration: 2000
})
} else if (!this.data.verificationCodeValider) {
wx.showToast({
title: '请检查您的验证码是否正确',
icon: 'none',
duration: 2000
})
} else if (!this.data.nameValider) {
wx.showToast({
title: '请检查您的姓名是否正确',
icon: 'none',
duration: 2000
})
} else {
const startDate = new Date();
const endDate = new Date(new Date(startDate).setFullYear(new Date(startDate).getFullYear() + 1));
endDate.setDate(endDate.getDate()-1);
const data = {
customerId: this.data.customerId,
planId: '293',
startDate: startDate.getFullYear() + '-' + this.dateFormat((Number(startDate.getMonth()) + 1)) + '-' + this.dateFormat((Number(startDate.getDate()))),
endDate: endDate.getFullYear() + '-' + this.dateFormat((Number(endDate.getMonth()) + 1)) + '-' + this.dateFormat((Number(endDate.getDate()))),
price: '9',
openid: wx.getStorageSync('openid'),
holder: {
name: this.data.name,
mobileNo: this.data.mobileNo
},
paymentMethod: '4'
}
wx.request({
url: 'https://m.zuihuibi.cn/api/voucherBuy',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: JSON.stringify(data),
success: function(res) {
if (res.data.success) {
wx.requestPayment({
'timeStamp': res.data.data.timeStamp,
'nonceStr': res.data.data.nonceStr,
'package': res.data.data.packageWX,
'signType': res.data.data.signType,
'paySign': res.data.data.paySign,
'success': function(res) {
// console.log(res);
console.log('成功');
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=1',
})
},
'fail': function(res) {
// console.log(res);
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=0',
})
console.log('失败');
},
'complete': function(res) {
// console.log(res);
console.log('失败和成功都会有')
}
})
} else {
if (res.data.data.errorCode === 'C01') {
wx.navigateTo({
url: '/pages/returnPage/returnPage?paymentStatus=2',
})
} else {
wx.showToast({
title: res.data.data.errorMessage,
icon: 'none',
duration: 2000
})
}
}
},
fail: function(res) {
console.log(res);
}
})
}
},
/**
* 姓名格式校验
*/
nameValid: function(e) {
var NAME_REGEXP = /(^[\u4e00-\u9fa5]{1}[\u4e00-\u9fa5\.·。]{0,48}[\u4e00-\u9fa5]{1}$)|(^[a-zA-Z]{1}[a-zA-Z\s]{0,48}[a-zA-Z]{1}$)/;
this.setData({
'nameValider': NAME_REGEXP.test(e.detail.value),
'name': e.detail.value
});
},
/**
* 时间格式修改
*/
dateFormat:function(e){
if(Number(e)<10){
return '0' + e;
}else{
return e;
}
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--pages/fillInfo/fillInfo.wxml-->
<!--pages/fillInfo/fillInfo.wxml-->
<view class='container' class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<image src='../images/fillInfo_bg.jpg' style='width:750rpx;height:1196rpx'></image>
<view class='inputBox'>
<!--获取手机号 -->
<view class="mobileNoSection inputControl">
<input type='number' maxlength="11" placeholder="输入手机号" placeholder-style="color: rgb(201, 181, 144);" bindblur="inputMobileNo" value='{{mobileNo}}' />
<view class='autoGet'>
<image class='wechatIcon' style="width: 46rpx; height: 46rpx;margin-top:20rpx;" src='../images/wechatIcon.png'></image>
<button class='getPhoneNumber linerGradient' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">自动获取</button>
</view>
</view>
<!--获取验证码 -->
<view class="codeSection inputControl" wx:if="{{!autogetPhoneNumber}}">
<input type='number' maxlength="4" placeholder="输入验证码" placeholder-style=" color: rgb(201, 181, 144);" bindblur="getVerificationCode" />
<view class='autoGet'>
<button class='getCode linerGradient' bindtap='getCode' disabled='{{disableBtn}}'>{{codeBtnHtml}}</button>
</view>
</view>
<!--姓名 -->
<view class="nameSection inputControl">
<input type='text' maxlength="50" placeholder="姓名" style="width:100%" placeholder-style=" color: rgb(201, 181, 144);" bindblur="nameValid" />
</view>
</view>
<!--立即领取 -->
<button class='redeemBtn' bindtap='goPay'>立即支付</button>
</view>
\ No newline at end of file
/* pages/fillInfo/fillInfo.wxss */
/* pages/fillInfo/fillInfo.wxss */
.redeemBtn {
position: absolute;
bottom: 188rpx;
left: 50%;
width: 400rpx;
height: 90rpx;
line-height: 90rpx;
margin-left: -200rpx;
text-align: center;
color: rgb(55, 28, 1);
font-size: 40rpx;
background: linear-gradient(#f7cb8e, #ac8b6e);
border-radius: 44rpx;
border: 4rpx solid #d3bd8d;
}
.inputBox {
position: absolute;
top: 442rpx;
left: 40rpx;
}
.mobileNoSection,.codeSection{
position: relative;
display: flex;
}
.codeSection, .nameSection {
margin-top: 40rpx;
}
.getPhoneNumber, .getCode {
width: 248rpx;
height: 84rpx;
color: rgb(55, 28, 1);
border-radius: 44rpx;
font-size: 32rpx;
}
.getPhoneNumber {
padding-left: 80rpx;
}
.autoGet {
width: 248rpx;
height: 84rpx;
position: absolute;
right: 0rpx;
top: 0rpx;
}
.wechatIcon {
position: absolute;
left: 30rpx;
top: 0;
z-index: 1;
}
.fix-iphonex-button {
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/vip9/fillInfo_bg.jpg');
}
.none-iphonex-button {
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/vip9/fillInfo_bg.jpg');
}
\ No newline at end of file
//index.js
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
userInfo: {},
isIpx:false,
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
onLoad: function () {
this.setData({ isIpx: app.globalData.isIpx});
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
})
} else if (this.data.canIUse){
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
}
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: '专属于你的保险经纪人服务',
imageUrl: '../images/share_mini.jpg',
path: '/pages/index/index'
}
}
})
{}
{}
\ No newline at end of file
<!--index.wxml-->
<!--index.wxml-->
<view class="container" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<!-- <view class="userinfo">
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view> -->
<image src='../images/index_bg.jpg' style='width:750rpx;height:1196rpx'></image>
<navigator url="/pages/fillInfo/fillInfo" hover-class="navigator-hover" class='redeemBtn linerGradient'>立即加入</navigator>
</view>
/**index.wxss**/
/**index.wxss**/
.redeemBtn {
position: absolute;
bottom: 30rpx;
left: 50%;
width: 400rpx;
height: 90rpx;
line-height: 90rpx;
margin-left: -200rpx;
text-align: center;
color: rgb(55, 28, 1);
font-size: 40rpx;
border-radius: 44rpx;
border: 4rpx solid #d3bd8d;
}
.info{
position: absolute;
bottom: 176rpx;
left: 0;
right:0;
z-index: 1;
color: #c9b590;
font-size: 26rpx;
text-align: center;
}
.fix-iphonex-button {
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/vip9/fillInfo_bg.jpg');
}
.none-iphonex-button {
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/vip9/fillInfo_bg.jpg');
}
\ No newline at end of file
//logs.js
//logs.js
const util = require('../../utils/util.js')
//获取应用实例
const app = getApp()
Page({
data: {
isIpx:false,
logs: []
},
onLoad: function () {
this.setData({
isIpx: app.globalData.isIpx,
logs: (wx.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
}
})
{
{
"navigationBarTitleText": "查看启动日志"
}
\ No newline at end of file
<!--logs.wxml-->
<!--logs.wxml-->
<view class="container log-list" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
</view>
.log-list {
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}
// pages/returnPage/returnPage.js
// pages/returnPage/returnPage.js
//获取应用实例
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
paymentStatus: '0',
isIpx:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({ 'paymentStatus': options.paymentStatus, isIpx: app.globalData.isIpx })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
// console.log(res.target)
}
return {
title: '专属于你的保险经纪人服务',
imageUrl:'../images/share_mini.jpg',
path: '/pages/index/index'
}
}
})
\ No newline at end of file
<!--pages/returnPage/returnPage.wxml-->
<!--pages/returnPage/returnPage.wxml-->
<view class="container" class="{{isIpx?'fix-iphonex-button':'none-iphonex-button'}}">
<view class="modal">
<block wx:if="{{paymentStatus=='0'}}">
<view class='modalContainer'>
<image src='../images/fail_ng.png' style='width:458rpx;height:521rpx'></image>
</view>
</block>
<block wx:if="{{paymentStatus=='1'}}">
<image src='../images/success_ng.png' style='width:750rpx;height:1121rpx'></image>
</block>
<block wx:if="{{paymentStatus=='2'}}">
<image src='../images/repeat.png' style='width:750rpx;height:1121rpx'></image>
</block>
<view class="{{isIpx?'btnBlockFixedX':'btnBlock'}}">
<button class="smallBtn" open-type="share">分享好友</button>
<navigator class="smallBtn" url='/pages/index/index'>返回首页</navigator>
</view>
</view>
</view>
\ No newline at end of file
/* pages/returnPage/returnPage.wxss */
/* pages/returnPage/returnPage.wxss */
.container {
position: relative;
width: 750rpx;
height: 1206rpx;
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/vip9/fillInfo_bg.jpg') repeat-y center;
background-size: 100% 100%;
}
.modal {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.btnBlock {
position: absolute;
top: 700rpx;
left: 197rpx;
display: flex;
}
.btnBlockFixedX{
position: absolute;
top: 785rpx;
left: 197rpx;
display: flex;
}
.btnBlock button,.btnBlockFixedX button{
padding:0;
margin-right: 30rpx;
}
.modalContainer{
width:100%;
height:100%;
background: rgba(0,0,0,.4);
display: flex;
justify-content: center;
align-items: center;
}
\ No newline at end of file
{
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "2.0.9",
"appid": "wx6ae60f33768036aa",
"projectname": "9%E5%85%83%E4%BC%9A%E5%91%98%E6%B4%BB%E5%8A%A8",
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
/*
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
function core_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the HMAC-MD5, of a key and some data
*/
function core_hmac_md5(key, data)
{
var bkey = str2binl(key);
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* Convert a string to an array of little-endian words
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
*/
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
return str;
}
/*
* Convert an array of little-endian words to a hex string.
*/
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
/*
* Convert an array of little-endian words to a base-64 string
*/
function binl2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}
module.exports = {
MD5:hex_md5
}
\ No newline at end of file
const formatTime = date => {
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime
}
App({
App({
globalData: {
// userInfo:null,
appId: 'xxx',
key: 'xxx' //AppSecret
},
onLaunch: function () {
wx.request({
url: 'https://m.zuihuibi.cn/api/authorize/obtainToken',
method:'POST',
data:{
ticket:'miniPro'
},
success:function(response){
wx.setStorageSync('X-Authorization', response.data.data.token);
wx.login({
success: function (res) {
if (res.code) {
//发起网络请求
wx.request({
url: 'https://m.zuihuibi.cn/api/jscode2session',
method: 'POST',
header: { 'X-Authorization': response.data.data.token },
data: {
js_code: res.code
},
success: function (res) {
wx.setStorageSync('openId', res.data.data.openid)
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
});
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope
wx.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
wx.authorize({
scope: 'scope.writePhotosAlbum',
success() {
wx.writePhotosAlbum()
}
})
}
}
})
}
})
}
})
\ No newline at end of file
{
{
"pages": [
"pages/list/list",
"pages/zhbQrcode/zhbQrcode",
"pages/packinglist/packinglist",
"pages/mine/mine",
"pages/myList/myList"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "旅行打包神器",
"navigationBarTextStyle": "black"
},
"tabBar": {
"selectedColor": "#DE0615",
"list": [
{
"pagePath": "pages/list/list",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home1.png"
},
{
"pagePath": "pages/mine/mine",
"text": "我的",
"iconPath": "images/my.png",
"selectedIconPath": "images/my1.png"
}
]
}
}
\ No newline at end of file
@import 'lib/weui.wxss';
@import 'lib/weui.wxss';
page {
height: 100%;
background-color: rgba(155, 205, 204, 0.8);
font-family: -apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
"Helvetica Neue",
Helvetica,
"PingFang SC",
"Hiragino Sans GB",
"Microsoft YaHei",
SimSun,
sans-serif;
}
.text-center {
text-align: center;
}
/*右上角*号 */
.sup {
display: inline-block;
padding: 0.15em 0.4em;
min-width: 8px;
color: #de0615;
line-height: 1.2;
text-align: center;
font-size: 32rpx;
vertical-align: middle;
}
.weui-icon-selected {
display: block;
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
height: 100%;
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/packing/pen-circle.svg') no-repeat center center;
background-size: contain;
z-index: 1;
}
.option-checkboxes__checkbox {
border: 2px solid #949897;
width: 22px;
height: 22px;
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
vertical-align: middle;
}
.option-checkboxes__checkbox_checked {
background: url('https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/packing/tick.svg') no-repeat center center;
}
.header {
color: #fff;
text-shadow: 0 2px 0 #79b1ae;
padding: 40rpx 0 20rpx 40rpx;
font-weight: bold;
line-height: 1.5em;
}
.logo {
position: absolute;
right: 0;
top: 0;
width: 280rpx;
height: 80rpx;
line-height: 80rpx;
padding-top: 20rpx;
background: #fff;
box-shadow: 0 3px 0 0 rgba(44, 103, 101, 0.2);
}
.logo_corner {
position: absolute;
left: -80rpx;
top: 0;
width: 80rpx;
height: 80rpx;
}
.logo_corner::before {
position: absolute;
top: 0;
right: 2px;
content: '';
display: block;
border-right: 40rpx solid rgba(44, 103, 101, 0.2);
border-top: 0 solid transparent;
border-left: 0 solid transparent;
border-bottom: 80rpx solid transparent;
box-shadow: 2px 0 0 0 rgba(44, 103, 101, 0.2);
}
.logo_corner::after {
position: absolute;
top: 0;
right: 0;
content: '';
display: block;
border-right: 40rpx solid #fff;
border-top: 0 solid transparent;
border-left: 0 solid transparent;
border-bottom: 100rpx solid transparent;
}
.list-item-new__add, .list-item__disable, .list-item__enable {
cursor: pointer;
float: right;
background: #a7d5d3 url(https://ajb-images.oss-cn-shanghai-finance-1-pub.aliyuncs.com/mini/packing/plus.svg) no-repeat center center;
background-size: 12px;
border-radius: 50%;
color: #fff;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
padding: 0;
display: block;
margin: 2px 0 0 5px;
}
.list-item__disable {
background-color: #e5c4bd;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.list-item__quantity {
float: right;
max-width: 80rpx;
min-height: 52rpx;
box-sizing: border-box;
border: 1px solid #ccc;
padding: 0 0 0 4px;
height: 52rpx;
font-size: 16px;
line-height: 52rpx;
box-shadow: none;
border-radius: 0;
background: #fff;
text-align: center;
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="17px" viewBox="-63.734 47.167 17.078 17" width="17.078px" version="1.1" y="0px" x="0px" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new -63.734 47.167 17.078 17">
<path d="m-48.873 61.306c0.199-0.224 0.298-0.511 0.28-0.807-0.017-0.298-0.15-0.57-0.373-0.769-0.446-0.395-1.184-0.349-1.578 0.094-1.193 1.341-2.902 2.111-4.689 2.111-3.45-0.006-6.26-2.817-6.267-6.266 0.007-3.452 2.817-6.262 6.266-6.268 1.386 0 2.7 0.443 3.799 1.284l0.685 0.524-2.606 2.598c-0.146 0.147-0.2 0.317-0.142 0.456 0.064 0.152 0.254 0.243 0.507 0.243h6.019c0.251 0 0.318-0.262 0.318-0.415v-6.1c0-0.276-0.275-0.338-0.382-0.338-0.068 0-0.166 0.017-0.244 0.094l-1.91 1.905-0.529-0.451c-1.537-1.312-3.496-2.035-5.513-2.035-4.686 0.001-8.499 3.814-8.5 8.5 0.001 4.686 3.815 8.499 8.5 8.5h0.002c2.431 0.001 4.748-1.042 6.357-2.86" fill="#3C4449"/>
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1523865510176" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3164" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M911.6 651.6l0 209.2c0 36-30.4 66.2-66.2 66.2l-699.6 1.2c-35.8 0-65-29.2-65-65.2l1.2-699.6c0-35.8 30.4-66.2 66.2-66.2l387 0L535.2 20.2 148.2 20.2c-81.8 0-143 82.8-143 156.8l0 686c0 77.6 63 140.8 140.8 140.8l686 0c82 0 156.6-68.2 156.6-143L988.6 651.6 911.6 651.6 911.6 651.6zM730.2 60.8l288.6 289.2L730.2 639l0-165.2c0 0-286.4-31.8-453.6 206.6 0 0 52.6-454.4 453.6-454.4L730.2 60.8 730.2 60.8z" p-id="3165" fill="#ffffff"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1523865510176" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3164" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M911.6 651.6l0 209.2c0 36-30.4 66.2-66.2 66.2l-699.6 1.2c-35.8 0-65-29.2-65-65.2l1.2-699.6c0-35.8 30.4-66.2 66.2-66.2l387 0L535.2 20.2 148.2 20.2c-81.8 0-143 82.8-143 156.8l0 686c0 77.6 63 140.8 140.8 140.8l686 0c82 0 156.6-68.2 156.6-143L988.6 651.6 911.6 651.6 911.6 651.6zM730.2 60.8l288.6 289.2L730.2 639l0-165.2c0 0-286.4-31.8-453.6 206.6 0 0 52.6-454.4 453.6-454.4L730.2 60.8 730.2 60.8z" p-id="3165" fill="#ffffff"></path></svg>
\ No newline at end of file
/*!
/*!
* weui.js v1.1.0 (https://github.com/weui/weui-wxss)
* Copyright 2016, wechat ui team
* 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: 1.17647059em;
background-color: #FFFFFF;
line-height: 1.41176471;
font-size: 17px;
}
.weui-cells:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #D9D9D9;
color: #D9D9D9;
}
.weui-cells:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #D9D9D9;
color: #D9D9D9;
}
.weui-cells__title {
margin-top: .77em;
margin-bottom: .3em;
padding-left: 15px;
padding-right: 15px;
color: #999999;
font-size: 14px;
}
.weui-cells_after-title {
margin-top: 0;
}
.weui-cells__tips {
margin-top: .3em;
color: #999999;
padding-left: 15px;
padding-right: 15px;
font-size: 14px;
}
.weui-cell {
padding: 10px 15px;
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 #D9D9D9;
color: #D9D9D9;
left: 15px;
}
.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: #999999;
}
.weui-cell_access {
color: inherit;
}
.weui-cell__ft_in-access {
padding-right: 13px;
position: relative;
}
.weui-cell__ft_in-access:after {
content: " ";
display: inline-block;
height: 6px;
width: 6px;
border-width: 2px 2px 0 0;
border-color: #C8C8CD;
border-style: solid;
-webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
position: relative;
top: -2px;
position: absolute;
top: 50%;
margin-top: -4px;
right: 2px;
}
.weui-cell_link {
color: #586C94;
font-size: 14px;
}
.weui-cell_link:active {
background-color: #ECECEC;
}
.weui-cell_link:first-child:before {
display: block;
}
.weui-icon-radio {
margin-left: 3.2px;
margin-right: 3.2px;
}
.weui-icon-checkbox_circle,
.weui-icon-checkbox_success {
margin-left: 4.6px;
margin-right: 4.6px;
}
.weui-check__label:active {
background-color: #ECECEC;
}
.weui-check {
position: absolute;
left: -9999px;
}
.weui-check__hd_in-checkbox {
padding-right: 0.35em;
}
.weui-cell__ft_in-radio {
padding-left: 0.35em;
}
.weui-cell_input {
padding-top: 0;
padding-bottom: 0;
}
.weui-label {
width: 105px;
word-wrap: break-word;
word-break: break-all;
}
.weui-input {
height: 2.58823529em;
min-height: 2.58823529em;
line-height: 2.58823529em;
}
.weui-toptips {
position: fixed;
-webkit-transform: translateZ(0);
transform: translateZ(0);
top: 0;
left: 0;
right: 0;
padding: 5px;
font-size: 14px;
text-align: center;
color: #FFFFFF;
z-index: 5000;
word-wrap: break-word;
word-break: break-all;
}
.weui-toptips_warn {
background-color: #E64340;
}
.weui-textarea {
display: block;
width: 100%;
}
.weui-textarea-counter {
color: #B2B2B2;
text-align: right;
}
.weui-textarea-counter_warn {
color: #E64340;
}
.weui-cell_warn {
color: #E64340;
}
.weui-form-preview {
position: relative;
background-color: #FFFFFF;
}
.weui-form-preview:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #D9D9D9;
color: #D9D9D9;
}
.weui-form-preview:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #D9D9D9;
color: #D9D9D9;
}
.weui-form-preview__value {
font-size: 14px;
}
.weui-form-preview__value_in-hd {
font-size: 26px;
}
.weui-form-preview__hd {
position: relative;
padding: 10px 15px;
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 #D9D9D9;
color: #D9D9D9;
left: 15px;
}
.weui-form-preview__bd {
padding: 10px 15px;
font-size: .9em;
text-align: right;
color: #999999;
line-height: 2;
}
.weui-form-preview__ft {
position: relative;
line-height: 50px;
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 #D5D5D6;
color: #D5D5D6;
}
.weui-form-preview__item {
overflow: hidden;
}
.weui-form-preview__label {
float: left;
margin-right: 1em;
min-width: 4em;
color: #999999;
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: #3CC51F;
text-align: center;
}
.weui-form-preview__btn:after {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 1rpx solid #D5D5D6;
color: #D5D5D6;
}
.weui-form-preview__btn:first-child:after {
display: none;
}
.weui-form-preview__btn_active {
background-color: #EEEEEE;
}
.weui-form-preview__btn_default {
color: #999999;
}
.weui-form-preview__btn_primary {
color: #0BB20C;
}
.weui-cell_select {
padding: 0;
}
.weui-select {
position: relative;
padding-left: 15px;
padding-right: 30px;
height: 2.58823529em;
min-height: 2.58823529em;
line-height: 2.58823529em;
border-right: 1rpx solid #D9D9D9;
}
.weui-select:before {
content: " ";
display: inline-block;
height: 6px;
width: 6px;
border-width: 2px 2px 0 0;
border-color: #C8C8CD;
border-style: solid;
-webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
position: relative;
top: -2px;
position: absolute;
top: 50%;
right: 15px;
margin-top: -4px;
}
.weui-select_in-select-after {
padding-left: 0;
}
.weui-cell__hd_in-select-after,
.weui-cell__bd_in-select-before {
padding-left: 15px;
}
.weui-cell_vcode {
padding-right: 0;
}
.weui-vcode-img {
margin-left: 5px;
height: 2.58823529em;
vertical-align: middle;
}
.weui-vcode-btn {
display: inline-block;
height: 2.58823529em;
margin-left: 5px;
padding: 0 0.6em 0 0.7em;
border-left: 1px solid #E5E5E5;
line-height: 2.58823529em;
vertical-align: middle;
font-size: 17px;
color: #3CC51F;
white-space: nowrap;
}
.weui-vcode-btn:active {
color: #52a341;
}
.weui-cell_switch {
padding-top: 6px;
padding-bottom: 6px;
}
.weui-uploader__hd {
display: -webkit-box;
display: -webkit-flex;
display: flex;
padding-bottom: 10px;
-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__info {
color: #B2B2B2;
}
.weui-uploader__bd {
margin-bottom: -4px;
margin-right: -9px;
overflow: hidden;
}
.weui-uploader__file {
float: left;
margin-right: 9px;
margin-bottom: 9px;
}
.weui-uploader__img {
display: block;
width: 79px;
height: 79px;
}
.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, 0.5);
}
.weui-uploader__file-content {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
color: #FFFFFF;
}
.weui-uploader__input-box {
float: left;
position: relative;
margin-right: 9px;
margin-bottom: 9px;
width: 77px;
height: 77px;
border: 1px solid #D9D9D9;
}
.weui-uploader__input-box:before,
.weui-uploader__input-box:after {
content: " ";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #D9D9D9;
}
.weui-uploader__input-box:before {
width: 2px;
height: 39.5px;
}
.weui-uploader__input-box:after {
width: 39.5px;
height: 2px;
}
.weui-uploader__input-box:active {
border-color: #999999;
}
.weui-uploader__input-box:active:before,
.weui-uploader__input-box:active:after {
background-color: #999999;
}
.weui-uploader__input {
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.weui-article {
padding: 20px 15px;
font-size: 15px;
}
.weui-article__section {
margin-bottom: 1.5em;
}
.weui-article__h1 {
font-size: 18px;
font-weight: 400;
margin-bottom: .9em;
}
.weui-article__h2 {
font-size: 16px;
font-weight: 400;
margin-bottom: .34em;
}
.weui-article__h3 {
font-weight: 400;
font-size: 15px;
margin-bottom: .34em;
}
.weui-article__p {
margin: 0 0 .8em;
}
.weui-msg {
padding-top: 36px;
text-align: center;
}
.weui-msg__link {
display: inline;
color: #586C94;
}
.weui-msg__icon-area {
margin-bottom: 30px;
}
.weui-msg__text-area {
margin-bottom: 25px;
padding: 0 20px;
}
.weui-msg__title {
margin-bottom: 5px;
font-weight: 400;
font-size: 20px;
}
.weui-msg__desc {
font-size: 14px;
color: #999999;
}
.weui-msg__opr-area {
margin-bottom: 25px;
}
.weui-msg__extra-area {
margin-bottom: 15px;
font-size: 14px;
color: #999999;
}
@media screen and (min-height: 438px) {
.weui-msg__extra-area {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
}
}
.weui-flex {
display: -webkit-box;
display: -webkit-flex;
display: flex;
}
.weui-flex__item {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.weui-btn {
margin-top: 15px;
}
.weui-btn:first-child {
margin-top: 0;
}
.weui-btn-area {
margin: 1.17647059em 15px 0.3em;
}
.weui-agree {
display: block;
padding: .5em 15px;
font-size: 13px;
}
.weui-agree__text {
color: #999999;
}
.weui-agree__link {
display: inline;
color: #586C94;
}
.weui-agree__checkbox {
position: absolute;
left: -9999px;
}
.weui-agree__checkbox-icon {
position: relative;
top: 2px;
display: inline-block;
border: 1px solid #D1D1D1;
background-color: #FFFFFF;
border-radius: 3px;
width: 11px;
height: 11px;
}
.weui-agree__checkbox-icon-check {
position: absolute;
top: 1px;
left: 1px;
}
.weui-footer {
color: #999999;
font-size: 14px;
text-align: center;
}
.weui-footer_fixed-bottom {
position: fixed;
bottom: .52em;
left: 0;
right: 0;
}
.weui-footer__links {
font-size: 0;
}
.weui-footer__link {
display: inline-block;
vertical-align: top;
margin: 0 .62em;
position: relative;
font-size: 14px;
color: #586C94;
}
.weui-footer__link:before {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 1rpx solid #C7C7C7;
color: #C7C7C7;
left: -0.65em;
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 #D9D9D9;
border-left: 1rpx solid #D9D9D9;
overflow: hidden;
}
.weui-grid {
position: relative;
float: left;
padding: 20px 10px;
width: 33.33333333%;
box-sizing: border-box;
border-right: 1rpx solid #D9D9D9;
border-bottom: 1rpx solid #D9D9D9;
}
.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: #000000;
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: 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%;
}
@-webkit-keyframes weuiLoading {
0% {
-webkit-transform: rotate3d(0, 0, 1, 0deg);
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
@keyframes weuiLoading {
0% {
-webkit-transform: rotate3d(0, 0, 1, 0deg);
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
.weui-badge {
display: inline-block;
padding: .15em .4em;
min-width: 8px;
border-radius: 18px;
background-color: #F43530;
color: #FFFFFF;
line-height: 1.2;
text-align: center;
font-size: 12px;
vertical-align: middle;
}
.weui-badge_dot {
padding: .4em;
min-width: 0;
}
.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 #E5E5E5;
margin-top: 2.4em;
}
.weui-loadmore__tips_in-line {
position: relative;
top: -0.9em;
padding: 0 .55em;
background-color: #FFFFFF;
color: #999999;
}
.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: #E5E5E5;
}
.weui-panel {
background-color: #FFFFFF;
margin-top: 10px;
position: relative;
overflow: hidden;
}
.weui-panel:first-child {
margin-top: 0;
}
.weui-panel:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #E5E5E5;
color: #E5E5E5;
}
.weui-panel:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #E5E5E5;
color: #E5E5E5;
}
.weui-panel__hd {
padding: 14px 15px 10px;
color: #999999;
font-size: 13px;
position: relative;
}
.weui-panel__hd:after {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1rpx solid #E5E5E5;
color: #E5E5E5;
left: 15px;
}
.weui-media-box {
padding: 15px;
position: relative;
}
.weui-media-box:before {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #E5E5E5;
color: #E5E5E5;
left: 15px;
}
.weui-media-box:first-child:before {
display: none;
}
.weui-media-box__title {
font-weight: 400;
font-size: 17px;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
word-wrap: break-word;
word-break: break-all;
}
.weui-media-box__desc {
color: #999999;
font-size: 13px;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.weui-media-box__info {
margin-top: 15px;
padding-bottom: 5px;
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: .8em;
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: absolute;
z-index: 500;
top: 0;
width: 100%;
border-bottom: 1rpx solid #CCCCCC;
}
.weui-navbar__item {
position: relative;
display: block;
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
padding: 13px 0;
text-align: center;
font-size: 0;
}
.weui-navbar__item.weui-bar__item_on {
color: #1AAD19;
}
.weui-navbar__slider {
position: absolute;
content: " ";
left: 0;
bottom: 0;
width: 6em;
height: 3px;
background-color: #1AAD19;
-webkit-transition: -webkit-transform .3s;
transition: -webkit-transform .3s;
transition: transform .3s;
transition: transform .3s, -webkit-transform .3s;
}
.weui-navbar__title {
display: inline-block;
font-size: 15px;
max-width: 8em;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
}
.weui-tab {
position: relative;
height: 100%;
}
.weui-tab__panel {
box-sizing: border-box;
height: 100%;
padding-top: 50px;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
.weui-search-bar {
position: relative;
padding: 8px 10px;
display: -webkit-box;
display: -webkit-flex;
display: flex;
box-sizing: border-box;
background-color: #EFEFF4;
border-top: 1rpx solid #D7D6DC;
border-bottom: 1rpx solid #D7D6DC;
}
.weui-icon-search {
margin-right: 8px;
font-size: inherit;
}
.weui-icon-search_in-box {
position: absolute;
left: 10px;
top: 7px;
}
.weui-search-bar__text {
display: inline-block;
font-size: 14px;
vertical-align: middle;
}
.weui-search-bar__form {
position: relative;
-webkit-box-flex: 1;
-webkit-flex: auto;
flex: auto;
border-radius: 5px;
background: #FFFFFF;
border: 1rpx solid #E6E6EA;
}
.weui-search-bar__box {
position: relative;
padding-left: 30px;
padding-right: 30px;
width: 100%;
box-sizing: border-box;
z-index: 1;
}
.weui-search-bar__input {
height: 28px;
line-height: 28px;
font-size: 14px;
}
.weui-icon-clear {
position: absolute;
top: 0;
right: 0;
padding: 7px 8px;
font-size: 0;
}
.weui-search-bar__label {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
border-radius: 3px;
text-align: center;
color: #9B9B9B;
background: #FFFFFF;
line-height: 28px;
}
.weui-search-bar__cancel-btn {
margin-left: 10px;
line-height: 28px;
color: #09BB07;
white-space: nowrap;
}
// pages/list/list.js
// pages/list/list.js
Page({
/**
* 页面的初始数据
*/
data: {
hasUserInfo:false,
checkboxItems: [
{ name: '滑雪', value: 'skiing' },
{ name: '海滩', value: 'beach' },
{ name: '野营', value: 'camping' },
{ name: '徒步', value: 'hiking' }
],
selectedWhere: null,
selectedDays: null,
selectedWash: null,
selectedTemperature: null,
selectedGender: null,
btnActived: null,
results: [],
packingListEntry: {
gender: null,
temperature: null,
ifWashClothes: null,
region: null,
travelDays: null,
skiing: null,
beach: null,
camping: null,
hiking: null
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
// 多选点击事件
checkboxChange: function (e) {
var checkboxItems = this.data.checkboxItems, values = e.detail.value, packingListEntry = this.data.packingListEntry;
for (var i = 0, lenI = checkboxItems.length; i < lenI; ++i) {
checkboxItems[i].checked = false;
for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
if (checkboxItems[i].value == values[j]) {
checkboxItems[i].checked = true;
break;
}
}
if (checkboxItems[i].value === 'skiing') {
if (checkboxItems[i].checked === true) {
packingListEntry.skiing = 1
} else {
packingListEntry.skiing = null
}
} else if (checkboxItems[i].value === 'beach') {
if (checkboxItems[i].checked === true) {
packingListEntry.beach = 1
} else {
packingListEntry.beach = null
}
} else if (checkboxItems[i].value === 'camping') {
if (checkboxItems[i].checked === true) {
packingListEntry.camping = 1
} else {
packingListEntry.camping = null
}
} else if (checkboxItems[i].value === 'hiking') {
if (checkboxItems[i].checked === true) {
packingListEntry.hiking = 1
} else {
packingListEntry.hiking = null
}
}
}
this.setData({
checkboxItems: checkboxItems,
packingListEntry: packingListEntry
});
},
// 选择目的地
selectWhere: function (e) {
var results = this.data.results;
var packingListEntry = this.data.packingListEntry;
results['selectedWhere'] = e.target.dataset;
packingListEntry.region = e.target.dataset.value;
this.setData({ selectedWhere: e.target.dataset.value, packingListEntry: packingListEntry });
this.updateOptionResult();
},
// 选择天数
selectDay: function (e) {
var results = this.data.results;
var packingListEntry = this.data.packingListEntry;
results['selectedDays'] = e.target.dataset;
packingListEntry.travelDays = e.target.dataset.value;
this.setData({ selectedDays: e.target.dataset.value, packingListEntry: packingListEntry });
this.updateOptionResult();
},
selectWash: function (e) {
var results = this.data.results;
var packingListEntry = this.data.packingListEntry;
results['selectedWash'] = e.target.dataset;
packingListEntry.ifWashClothes = e.target.dataset.value;
this.setData({ selectedWash: e.target.dataset.value, packingListEntry: packingListEntry });
this.updateOptionResult();
},
selectTemperature: function (e) {
var results = this.data.results;
var packingListEntry = this.data.packingListEntry;
packingListEntry.temperature = e.target.dataset.value;
results['selectedTemperature'] = e.target.dataset;
this.setData({ selectedTemperature: e.target.dataset.value, packingListEntry: packingListEntry });
this.updateOptionResult();
},
selectGender: function (e) {
var results = this.data.results;
var packingListEntry = this.data.packingListEntry;
packingListEntry.gender = e.target.dataset.value;
results['selectedGender'] = e.target.dataset;
this.setData({ selectedGender: e.target.dataset.value, packingListEntry: packingListEntry });
this.updateOptionResult();
},
// 生成列表
makeLists: function (e) {
wx.request({
url: 'https://m.zuihuibi.cn/api/promotion/packingListQry',
data: this.data.packingListEntry,
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization')},
dataType: 'json',
success: function (res) {
wx.setStorageSync('packingCategoryList', res.data.data.packingCategoryList);
wx.navigateTo({
url: '../packinglist/packinglist',
})
}
})
},
// 更新选项答案
updateOptionResult: function () {
var indexArray = [];
for (var i in this.data.results) {
indexArray.push(i);
}
var btnActived = indexArray.length === 5;
this.setData({ btnActived, btnActived })
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<block wx:if="{{!hasUserInfo}}">
<block wx:if="{{!hasUserInfo}}">
<view class='header'>
<view style='font-size:36rpx'>创建你的终极</view>
<view style='font-size:48rpx'>旅行</view>
<view style='font-size:48rpx'>打包清单</view>
</view>
<view class='logo'>
<view class='logo_corner'></view>
<image src='/images/logo.png' style='width:258rpx;height:60rpx;'></image>
</view>
<view class="page">
<view class='text-center wx_title'>关于你的旅行</view>
<!--选项模块 -->
<view class='optionsBox'>
<view class='part'>
<view class="weui-cell__bd">
<view style="display: inline-block; vertical-align: middle">性别</view>
<view class="sup">*</view>
</view>
<view class="weui-flex" bindtap='selectGender'>
<view class="weui-flex__item">
<view class="option" data-value='1'>男
<view class="weui-icon-selected" wx:if="{{selectedGender=='1'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-value='2'>女
<view class="weui-icon-selected" wx:if="{{selectedGender=='2'}}"></view>
</view>
</view>
</view>
</view>
<view class='part'>
<view class="weui-cell__bd">
<view style="display: inline-block; vertical-align: middle">气候</view>
<view class="sup">*</view>
</view>
<view class="weui-flex" bindtap='selectTemperature'>
<view class="weui-flex__item">
<view class="option" data-value='1'>冷
<view class="weui-icon-selected" wx:if="{{selectedTemperature=='1'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-value='2'>热
<view class="weui-icon-selected" wx:if="{{selectedTemperature=='2'}}"></view>
</view>
</view>
</view>
</view>
<view class='part'>
<view class="weui-cell__bd">
<view style="display: inline-block; vertical-align: middle">需要洗衣服吗?</view>
<view class="sup">*</view>
</view>
<view class="weui-flex" bindtap='selectWash'>
<view class="weui-flex__item">
<view class="option" data-value='1'>需要
<view class="weui-icon-selected" wx:if="{{selectedWash=='1'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-value='0'>不需要
<view class="weui-icon-selected" wx:if="{{selectedWash=='0'}}"></view>
</view>
</view>
</view>
</view>
<view class='part'>
<view class="weui-cell__bd">
<view style="display: inline-block; vertical-align: middle">去哪里?</view>
<view class="sup">*</view>
</view>
<view class="weui-flex" bindtap='selectWhere'>
<view class="weui-flex__item">
<view class="option" data-name="where" data-value="1">国内
<view class="weui-icon-selected" wx:if="{{selectedWhere=='1'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-name="where" data-value="2">国外
<view class="weui-icon-selected" wx:if="{{selectedWhere=='2'}}"></view>
</view>
</view>
</view>
</view>
<view class='part'>
<view class="weui-cell__bd">
<view style="display: inline-block; vertical-align: middle">天数</view>
<view class="sup">*</view>
</view>
<view class="weui-flex" bindtap='selectDay'>
<view class="weui-flex__item">
<view class="option" data-value="3">3
<view class="weui-icon-selected" wx:if="{{selectedDays=='3'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-value="7">7
<view class="weui-icon-selected" wx:if="{{selectedDays=='7'}}"></view>
</view>
</view>
<view class="weui-flex__item">
<view class="option" data-value="14">14
<view class="weui-icon-selected" wx:if="{{selectedDays=='14'}}"></view>
</view>
</view>
</view>
</view>
<view class='part'>
<text class='title'>你要去做什么?</text>
<view class="weui-cells weui-cells_after-title">
<checkbox-group bindchange="checkboxChange">
<label class="weui-cell weui-check__label" wx:for="{{checkboxItems}}" wx:key="value">
<checkbox class="weui-check" value="{{item.value}}" checked="{{item.checked}}" />
<view class="weui-cell__hd weui-check__hd_in-checkbox">
<view class='option-checkboxes__checkbox' wx:if="{{!item.checked}}"></view>
<view class='option-checkboxes__checkbox option-checkboxes__checkbox_checked' wx:if="{{item.checked}}"></view>
</view>
<view class="weui-cell__bd">{{item.name}}</view>
</label>
</checkbox-group>
</view>
</view>
<view class='part filters__actions' bindtap='makeLists'>
<button class="btn" disabled wx:if="{{!btnActived}}">生成你的打包列表</button>
<button class="btn btn-active" wx:if="{{btnActived}}">生成你的打包列表</button>
</view>
</view>
</view>
</block>
<!-- <block wx:if="{{!hasUserInfo}}">
<view class='warp' hidden='{{eye}}'>
<button open-type="getUserInfo" hover-class='none' bindgetuserinfo="getUserInfoFun">允许授权才能使用打包神器</button>
</view>
</block> -->
\ No newline at end of file
/* pages/list/list.wxss */
/* pages/list/list.wxss */
.page {
position: relative;
width: 90%;
margin: 0 auto;
margin-bottom: 60rpx;
background-color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
border-bottom-left-radius: 40rpx;
border-bottom-right-radius: 40rpx;
font-size: 32rpx;
overflow: hidden;
padding-bottom: 20rpx;
}
.page::after{
display: block;
content: '';
position: absolute;
right: 0;
left: 0;
bottom: 0;
height: 12px;
background: repeating-linear-gradient(-45deg,rgba(255,255,255,0),rgba(255,255,255,0) 6px,#de0615 6px,#de0615 8px);
}
.wx_title {
height: 80rpx;
line-height: 80rpx;
background-color: #de0615;
color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
}
.optionsBox {
padding: 30rpx;
}
.option {
width: 100%;
text-align: center;
border: 2px solid #949897;
border-width: 4rpx 2rpx;
padding: 20rpx 10rpx;
box-sizing: border-box;
cursor: pointer;
color: #3b4449;
position: relative;
font-size: 28rpx;
}
.part {
margin-bottom: 16rpx;
}
.btn {
display: block;
width: 100%;
text-align: center;
background-size: 44rpx;
color: #fff !important;
text-transform: uppercase;
border-radius: 0 20px 0 20px;
padding: 8px 0;
cursor: pointer;
font-size: 16px;
background-color: #949897 !important;
box-shadow: 0 5px 0 #868a89;
font-weight: bold;
}
.btn-active {
background: #de0615 !important;
box-shadow: 0 5px 0 #930205;
font-weight: bold;
}
.filters__actions {
clear: both;
box-sizing: border-box;
margin: 0;
padding: 20px 20px 0;
text-align: center;
}
Page({
Page({
data: {
packingRecordList: [],
packingCategoryList: []
},
onShareAppMessage: function (res) {
},
onLoad: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
var openId = wx.getStorageSync('openId');
var that = this;
wx.request({
url: 'https://m.zuihuibi.cn/api/promotion/userPackingListQry',
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
data: {
openid: openId
},
success: function (res) {
var packingRecordList = res.data.data.packingRecordList;
that.setData({ packingRecordList: packingRecordList });
}
})
},
goMyList: function (e) {
var packingNo = e.currentTarget.dataset.packingno;
var packingRecordList = this.data.packingRecordList;
var packingCategoryList = this.data.packingCategoryList;
for (var i = 0; i < packingRecordList.length; i++) {
if (packingRecordList[i].packingNo == packingNo) {
packingCategoryList = packingRecordList[i].packingCategoryList;
wx.setStorageSync('packingCategoryList', packingRecordList[i].packingCategoryList);
}
}
this.setData({ packingRecordList, packingRecordList, packingCategoryList: packingCategoryList });
wx.navigateTo({
url: '/pages/myList/myList'
})
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--pages/mine/mine.wxml-->
<!--pages/mine/mine.wxml-->
<block wx:if="{{!packingRecordList}}">
<view class='noLists'>
<view>暂没有打包记录</view>
<view>还在等什么,快去打包吧~~~</view>
<navigator class='goBtn' url="/pages/list/list" open-type="switchTab" hover-class="other-navigator-hover">GO!</navigator>
</view>
</block>
<block wx:if="{{packingRecordList}}">
<view class="weui-cells__title">最近两次的打包清单记录</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_access" wx:if="{{packingRecordList.length>0}}" data-packingNo="{{packingRecordList[0].packingNo}}" hover-class="weui-cell_active" bindtap='goMyList'>
<view class="weui-cell__hd">
<image src="../../images/1-.png" style="margin-right: 5px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">
<view>最新</view>
<view style='color:#8a8a8a'>{{packingRecordList[0].packingDate}}</view>
</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view>
<view class="weui-cell weui-cell_access" wx:if="{{packingRecordList.length>1}}" data-packingNo="{{packingRecordList[1].packingNo}}" hover-class="weui-cell_active" bindtap='goMyList'>
<view class="weui-cell__hd">
<image src="../../images/2-.png" style="margin-right: 5px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">
<view>前一个</view>
<view style='color:#8a8a8a'>{{packingRecordList[1].packingDate}}</view>
</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view>
</view>
</block>
\ No newline at end of file
/* pages/mine/mine.wxss */
/* pages/mine/mine.wxss */
.weui-cells__title {
background-color: #fff;
font-size: 38rpx;
color: #4a4a4a;
font-weight: bold;
margin: 0;
padding: 16rpx 0rpx 16rpx 30rpx;
}
.noLists {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: -50rpx;
flex-direction: column;
}
.goBtn {
font-size: 34rpx;
background: #de0615;
color: #fff;
text-align: center;
padding: 12rpx 0;
width: 200rpx;
margin: 80rpx auto 0;
}
// pages/myList/myList.js
// pages/myList/myList.js
Page({
/**
* 页面的初始数据
*/
data: {
packingCategoryList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var packingCategoryList = this.data.packingCategoryList;
packingCategoryList = wx.getStorageSync('packingCategoryList');
this.setData({ packingCategoryList: packingCategoryList });
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--pages/myList/myList.wxml-->
<!--pages/myList/myList.wxml-->
<view class='logo'>
<view class='logo_corner'></view>
<image src='/images/logo.png' style='width:258rpx;height:60rpx;'></image>
</view>
<view class='mineLists'>
<block wx:if="{{ packingCategoryList.length }}">
<view class='clothing' wx:for="{{packingCategoryList}}" wx:key="{{id}}">
<view class="weui-cells__title category__title">{{item.categoryName}}</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell list-item {{ subItem.completed ? '' : 'completed' }}" wx:for="{{item.packingItemList}}" wx:for-index="subIndex" wx:for-item="subItem" wx:key="{{ itemId }}">
<view class="weui-cell__bd name">{{subItem.itemName}}</view>
<view class="weui-cell__ft">
<view class="weui-cell__bd">
x {{subItem.quantity}}
</view>
</view>
</view>
</view>
</view>
</block>
<!--服装End -->
</view>
\ No newline at end of file
/* pages/myList/myList.wxss */
/* pages/myList/myList.wxss */
.mineLists {
margin-top: 90rpx;
background-color: #fff;
padding-bottom: 30rpx;
}
.weui-cells__title {
font-size: 38rpx;
color: #4a4a4a;
font-weight: bold;
}
.list-item {
color: #4a4a4a;
font-size: 30rpx;
padding: 16rpx 0rpx;
margin: 0 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #ccc;
}
.weui-cell:before {
border: none;
}
// pages/packinglist/packinglist.js
// pages/packinglist/packinglist.js
Page({
/**
* 页面的初始数据
*/
data: {
// 弹出确认框
refreshFlag: false,
packingCategoryList: [],
packingCategoryListEntry: []
},
save: function () {
// 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
wx.setStorageSync('packingCategoryList', this.data.packingCategoryList);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
var packingCategoryList = wx.getStorageSync('packingCategoryList');
if (!packingCategoryList) { var packingCategoryList = this.data.packingCategoryList };
for (var i = 0; i < packingCategoryList.length; i++) {
var length = packingCategoryList[i].packingItemList.length;
packingCategoryList[i].input = '';
packingCategoryList[i].newQuantity = 1;
for (var j = 0; j < length; j++) {
if (packingCategoryList[i].packingItemList[j].completed == null) {
packingCategoryList[i].packingItemList[j].completed = true;
}
}
}
this.setData({ packingCategoryList: packingCategoryList });
this.save();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
console.log(res.target)
}
return {
title: '旅行达人出行必备的打包神器',
path: 'pages/list/list',
imageUrl: '../../images/share.jpg',
success: function (res) {
console.log(res)
// 转发成功
},
fail: function (res) {
// 转发失败
}
}
},
// 增加还是删除
action: function (e) {
var index = e.currentTarget.dataset.index;
var subIndex = e.currentTarget.dataset.subindex;
var packingCategoryList = this.data.packingCategoryList;
packingCategoryList[index].packingItemList[subIndex].completed = !packingCategoryList[index].packingItemList[subIndex].completed;
this.setData({
packingCategoryList: packingCategoryList
});
this.save();
},
// ===== 事项内容事件处理函数 =====
inputChangeHandle: function (e) {
var index = e.currentTarget.dataset.index;
var packingCategoryList = this.data.packingCategoryList;
packingCategoryList[index].input = e.detail.value
this.setData({ packingCategoryList: packingCategoryList });
},
// ====数量处理函数
inputQuantityChangeHandle: function (e) {
var index = e.currentTarget.dataset.index;
var packingCategoryList = this.data.packingCategoryList;
packingCategoryList[index].newQuantity = e.detail.value
this.setData({ packingCategoryList: packingCategoryList });
this.save();
},
// 单条数量修改
quantityChangeHandle: function (e) {
var index = e.currentTarget.dataset.index;
var subIndex = e.currentTarget.dataset.subindex;
var packingCategoryList = this.data.packingCategoryList;
packingCategoryList[index].packingItemList[subIndex].quantity = e.detail.value
this.setData({ packingCategoryList: packingCategoryList });
this.save();
},
// 新增
addTodoHandle: function (e) {
var index = e.currentTarget.dataset.index;
var categoryid = e.currentTarget.dataset.categoryid;
var packingCategoryList = this.data.packingCategoryList
if (!packingCategoryList[index].input || !packingCategoryList[index].input.trim()) return;
packingCategoryList[index].packingItemList.push({ categoryId: categoryid, itemId: '-1', itemName: packingCategoryList[index].input, quantity: packingCategoryList[index].newQuantity, completed: true });
packingCategoryList[index].input = '';
packingCategoryList[index].newQuantity = 1;
this.setData({
packingCategoryList: packingCategoryList,
});
this.save();
},
// 创建新清单
refresh: function (e) {
var refreshFlag = this.data.refreshFlag;
refreshFlag = true;
this.setData({ refreshFlag: refreshFlag })
},
answer: function (e) {
var value = e.target.dataset.value;
var refreshFlag = this.data.refreshFlag;
if (value === '1') {
refreshFlag = true;
wx.removeStorageSync('packingCategoryList')
wx.switchTab({
url: '/pages/list/list',
})
} else if (value === '0') {
refreshFlag = false;
}
this.setData({ refreshFlag: refreshFlag })
},
saveLists: function (e) {
var openId = wx.getStorageSync('openId');
var packingCategoryList = wx.getStorageSync('packingCategoryList');
var packingCategoryListEntry = this.data.packingCategoryListEntry;
var packingItemLists = [];
packingCategoryListEntry = packingCategoryList;
for (let i = 0; i < packingCategoryListEntry.length; i++) {
packingItemLists = packingCategoryListEntry[i].packingItemList;
for (let j = 0; j < packingItemLists.length; j++) {
if (packingItemLists[j].completed === false) {
packingItemLists.splice(packingItemLists.indexOf(packingItemLists[j]), 1);
j--;
}
}
if (packingCategoryListEntry[i].packingItemList.length <= 0) {
packingCategoryListEntry.splice(packingCategoryListEntry.indexOf(packingCategoryListEntry[i]), 1)
}
};
// 用户打包清单保存接口
wx.request({
url: 'https://m.zuihuibi.cn/api/promotion/userPackingListSave',
data: {
openid: openId,
packingCategoryList: packingCategoryListEntry
},
method: 'POST',
header: { 'X-Authorization': wx.getStorageSync('X-Authorization') },
dataType: 'json',
success: function (res) {
wx.showToast({
title: '保存成功',
icon: 'success',
duration: 3000
})
},
fail: function (res) {
wx.showToast({
title: '保存失败',
icon: 'none',
duration: 3000
})
}
})
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--pages/packinglist/packinglist.wxml-->
<!--pages/packinglist/packinglist.wxml-->
<view class='header'>
<view style='font-size:36rpx'>创建你的终极</view>
<view style='font-size:48rpx'>旅行</view>
<view style='font-size:48rpx'>打包清单</view>
</view>
<view class='logo'>
<view class='logo_corner'></view>
<image src='/images/logo.png' style='width:258rpx;height:60rpx;'></image>
</view>
<!--模块-->
<view class='container_list'>
<view class="weui-flex tabContainer">
<view class="weui-flex__item">
<view class='newList' bindtap='refresh'>
<view class='newListTitle'>
<image src='../../images/refresh.svg' style='width:100%;height:100%;'></image>
</view>
创建新清单
</view>
</view>
<view class="weui-flex__item weui-flex__item_last newList tap-active">
<view class='newListTitle'>
<image src='../../images/share.svg' style='width:100%;height:100%;'></image>
</view>
<view>
<button class="shareBtn weui-btn" type="default" plain="true" open-type="share">分享给好友</button>
</view>
</view>
</view>
<view class='totalBox'>
<!--服装 -->
<block wx:if="{{ packingCategoryList.length }}">
<view class='clothing' wx:for="{{packingCategoryList}}" wx:key="{{category}}">
<view class="weui-cells__title category__title">{{item.categoryName}}</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell list-item {{ subItem.completed ? '' : 'completed' }}" wx:for="{{item.packingItemList}}" wx:for-index="subIndex" wx:for-item="subItem" wx:key="{{ itemName }}">
<view class="weui-cell__bd name">{{subItem.itemName}}</view>
<view class="weui-cell__ft">
<view class="weui-cell__bd">
<input class="weui-input list-item__quantity" type="number" value='{{subItem.quantity}}' data-subindex="{{ subIndex }}" data-index="{{ index }}" bindinput="quantityChangeHandle" maxlength="2" />
</view>
<view class="weui-cell__hd weui-check__hd_in-checkbox">
<view class='{{ subItem.completed ? "list-item__disable" : "list-item__enable" }} ' bindtap='action' data-subindex="{{ subIndex }}" data-index="{{ index }}"></view>
</view>
</view>
</view>
</view>
<view class="header_title">
<view class="weui-cell list-item-new-weui-cell">
<view class="weui-cell__bd name">
<input class="list-item-new__title-input" value="{{ item.input }}" placeholder="添加事项..." bindinput="inputChangeHandle" data-categoryId="{{item.id}}" data-index="{{index}}" data-name="{{item.input}}" data-quantity="{{ item.newQuantity }}" />
</view>
<view class="weui-cell__ft">
<view class="weui-cell__bd">
<input class="weui-input list-item__quantity" type="number" value='{{ item.newQuantity }}' bindinput="inputQuantityChangeHandle" maxlength="2" data-category="{{item.id}}" data-index="{{index}}" data-name="{{item.input}}" data-quantity="{{ item.newQuantity }}"
/>
</view>
<view class="weui-cell__hd weui-check__hd_in-checkbox">
<view class='{{ item.completed ? "list-item__disable" : "list-item__enable" }} ' bindtap='addTodoHandle' data-categoryId="{{item.id}}" data-index="{{index}}" data-name="{{item.input}}" data-quantity="{{ item.newQuantity }}"></view>
</view>
</view>
</view>
</view>
</view>
</block>
<!--服装End -->
</view>
<block wx:if="{{ packingCategoryList.length }}">
<view class='saveBtn' bindtap='saveLists'>保存</view>
</block>
<block wx:if="{{ packingCategoryList.length }}">
<view class='markBlock'></view>
</block>
</view>
<!--旅行保险 -->
<block wx:if="{{ packingCategoryList.length }}">
<view class='quote text-center'>
<!-- <text class='quote_message'></text> -->
<view class='quote_message'>
<view>不要忘了打包一份</view>
<view>旅行保险哦!</view>
</view>
<navigator class='quoteBtn' url="/pages/zhbQrcode/zhbQrcode" hover-class="navigator-hover">获取报价</navigator>
</view>
</block>
<block wx:if="{{refreshFlag}}">
<view class='confirmDialogContainer'>
<view class='content'>
<text class='popup__title'>你确定要创建一个新的清单吗?</text>
<view class="popup__body">您将失去当前列表,包括您所做的任何更改。</view>
<view class='popup__actions' bindtap='answer'>
<view class='popup-actions-button' data-value='1'>确定</view>
<view class='popup-actions-cancel' data-value='0'>取消</view>
</view>
</view>
</view>
</block>
\ No newline at end of file
/* pages/packinglist/packinglist.wxss */
/* pages/packinglist/packinglist.wxss */
.header {
padding-bottom: 100rpx;
}
.container_list {
background: #fff;
border-top: 5px solid #8ebfbc;
margin: 0;
position: relative;
z-index: 3;
}
.newList {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.tabContainer .newListTitle {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
margin-top: -20rpx;
}
.container_list .tap-active {
background: #de0615 !important;
border-color: #ce0613 !important;
}
.container_list .tap-active .shareBtn {
color: #fff !important;
font-size: 32rpx;
}
.totalBox {
margin: 0 auto;
padding: 0 40rpx;
}
.category__title {
color: #3b4449;
font-weight: bold;
font-size: 36rpx;
padding-left: 0;
}
.list-item {
margin: 0;
padding: 5px 0;
opacity: 1;
border-top: 1px solid #ccc;
font-weight: normal;
}
.completed .name {
text-decoration: line-through;
color: #888;
}
.weui-cell__ft {
display: flex;
justify-content: center;
align-items: center;
}
.weui-cell:before {
border: none;
}
.list-item-new-weui-cell {
padding: 20rpx 0px;
}
.list-item-new__title-input {
display: block;
width: 90%;
box-sizing: border-box;
border: 1px solid #ccc;
padding: 0 4px;
height: 50rpx;
font-size: 32rpx;
line-height: 50rpx;
box-shadow: none;
border-radius: 0;
background: #fff;
}
.quote {
padding: 20rpx 0;
}
.markBlock{
padding-bottom: 80rpx;
}
.quote .quote_message {
font-size: 32rpx;
}
.quoteBtn {
font-size: 34rpx;
background: #de0615;
color: #fff;
text-align: center;
padding: 12rpx 0;
border-radius: 120rpx;
width: 300rpx;
margin: 10rpx auto 0;
}
.tabContainer {
font-size: 32rpx;
margin: -78rpx auto 0;
width: 100%;
}
.tabContainer .weui-flex__item {
text-align: center;
box-sizing: border-box;
padding: 0 20rpx;
background: #eee;
color: #3b4449;
border-radius: 20rpx 20rpx 0 0;
margin-right: 10rpx;
font-weight: 400;
font-size: 32rpx;
border-bottom: 5px solid #ddd;
cursor: pointer;
height: 80rpx;
line-height: 80rpx;
}
.tabContainer .weui-flex__item_last {
margin-right: 0;
}
.shareBtn {
padding: 0;
}
button[plain], button[type=default][plain] {
border: none;
}
.confirmDialogContainer {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 10;
}
.confirmDialogContainer .content {
position: absolute;
left: 0;
right: 0;
top: calc(50vh - 500rpx/2);
margin: 0 auto;
width: 560rpx;
height: 420rpx;
background: #fff;
padding: 20px;
z-index: 1002;
}
.popup__title {
font-weight: bold;
color: #3a4348;
padding: 0;
margin: 0;
font-size: 40rpx;
line-height: 1em;
}
.popup__body {
font-size: 32rpx;
margin: 20rpx 0 0;
padding: 0;
}
.popup__actions {
margin: 30rpx 0 0;
padding: 30rpx 0 0;
border-top: 3px dotted #d1d1d1;
overflow: hidden;
text-align: center;
}
.popup__actions .popup-actions-button {
background: #de0615;
border-radius: 40rpx;
color: #fff;
padding: 16rpx 0;
}
.popup__actions .popup-actions-cancel {
text-decoration: underline;
color: #de0615;
line-height: 100rpx;
}
.saveBtn {
width: 150rpx;
height: 65rpx;
line-height: 65rpx;
text-align: center;
border-radius: 5px;
background-color: #9bcdcc;
margin-bottom: 20rpx;
font-size: 30rpx;
margin-right: 57rpx;
color: #fff;
margin-left: 40rpx;
}
// pages/zhbQrcode/zhbQrcode.js
// pages/zhbQrcode/zhbQrcode.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
//保存至相册
saveImageToPhotosAlbum: function () {
wx.saveImageToPhotosAlbum({
filePath: '/images/qrcode.jpg',
success: (res) => {
wx.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
})
},
fail: (err) => {
console.log(err)
}
})
}
})
\ No newline at end of file
{}
{}
\ No newline at end of file
<!--pages/zhbQrcode/zhbQrcode.wxml-->
<!--pages/zhbQrcode/zhbQrcode.wxml-->
<view class='eqrcodeContainer'>
<view class='zhbQrcodeBox'>
<image style='width:220rpx;height:220rpx' mode="scaleToFill" src="/images/qrcode.jpg" bindtap='saveImageToPhotosAlbum'></image>
<view class='saveBtn' bindtap='saveImageToPhotosAlbum'>确认保存二维码</view>
</view>
<view class="icon-box">
<icon type="info" size="20" color='#de0615'></icon>
<view class="icon-box__ctn" style='margin-left:16rpx;'>
<view class="icon-box__desc" style='font-size:32rpx;margin:16rpx 0;'>请按图示内容进行操作哦~</view>
</view>
</view>
<image style='width:688rpx;height:820rpx' mode="scaleToFill" src="/images/eqrcode.jpg"></image>
</view>
\ No newline at end of file
/* pages/zhbQrcode/zhbQrcode.wxss */
/* pages/zhbQrcode/zhbQrcode.wxss */
.eqrcodeContainer{
padding:60rpx 30rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.zhbQrcodeBox{
display: flex;
align-items: flex-end;
justify-content: center;
}
.zhbQrcodeBox .saveBtn{
width: 300rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
background-color: #de0615;
color: #fff;
border-radius: 10rpx;
text-align: center;
margin-left: 30rpx;
}
.icon-box{
display: flex;
align-items: center;
}
\ No newline at end of file
{
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true
},
"compileType": "miniprogram",
"libVersion": "1.9.98",
"appid": "wx11f9698a3aff2540",
"projectname": "wxapp",
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
/*
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
function core_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the HMAC-MD5, of a key and some data
*/
function core_hmac_md5(key, data)
{
var bkey = str2binl(key);
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* Convert a string to an array of little-endian words
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
*/
function str2binl(str)
{
var bin = Array();
var mask = (1 << chrsz) - 1;
for(var i = 0; i < str.length * chrsz; i += chrsz)
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
return bin;
}
/*
* Convert an array of little-endian words to a string
*/
function binl2str(bin)
{
var str = "";
var mask = (1 << chrsz) - 1;
for(var i = 0; i < bin.length * 32; i += chrsz)
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
return str;
}
/*
* Convert an array of little-endian words to a hex string.
*/
function binl2hex(binarray)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var str = "";
for(var i = 0; i < binarray.length * 4; i++)
{
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
}
return str;
}
/*
* Convert an array of little-endian words to a base-64 string
*/
function binl2b64(binarray)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
for(var i = 0; i < binarray.length * 4; i += 3)
{
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
}
}
return str;
}
module.exports = {
MD5:hex_md5
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment