From 1c29817928f45b12bf4629fe74511f9c1880b356 Mon Sep 17 00:00:00 2001
From: jiangping <898885815@qq.com>
Date: 星期二, 07 五月 2024 09:45:12 +0800
Subject: [PATCH] meeting
---
h5/pages/meeting/mine/mine.vue | 207 +
h5/static/meeting/icon/xiaoxi_ic_gonggao@2x.png | 0
h5/static/meeting/common/364.png | 0
h5/main.js | 13
h5/pages/meeting/myAppointment/myAppointment.vue | 618 +++++
h5/static/meeting/icon/wd_ic_yuyue@2x.png | 0
h5/static/meeting/icon/ic_upload@2x.png | 0
h5/utils/qrcode.js | 1201 ++++++++++
h5/components/Li-Calendar/Li-Calendar.vue | 702 +++++
h5/static/meeting/icon/ar_open@2x.png | 0
h5/static/meeting/icon/ic_copy@2x.png | 0
h5/components/Li-Calendar/Li-Calendar.css | 219 +
h5/static/meeting/icon/ic_time@2x.png | 0
h5/static/meeting/common/nav_home@2x.png | 0
h5/static/meeting/common/default_user@2x.png | 0
h5/static/meeting/icon/ic_fenxiang@2x.png | 0
h5/static/meeting/icon/ic_choose_sel@2x.png | 0
h5/components/you-scroll.vue | 271 ++
h5/pages/meeting/manage/manage.vue | 407 +++
h5/utils/http.api.js | 12
h5/static/meeting/icon/renyuan_ic_open@2x.png | 0
h5/pages/meeting/login/login.vue | 139 +
h5/components/Header.vue | 66
h5/components/Li-Calendar/sloarToLunar.js | 195 +
h5/components/tarbar.vue | 147 +
h5/pages/meeting/personal/personal.vue | 484 ++++
h5/utils/login.js | 60
h5/pages/meeting/index/index.vue | 487 ++++
h5/static/meeting/customicons.ttf | 0
h5/static/meeting/common/nav_home_sel@2x.png | 0
h5/static/meeting/icon/wd_ic_ziliao@2x.png | 0
h5/pages/meeting/changePassword/changePassword.vue | 177 +
h5/static/meeting/common/nav_wode@2x.png | 0
h5/components/tki-qrcode/qrcode.js | 1201 ++++++++++
h5/static/meeting/icon/ar_left_disable.png | 0
h5/static/meeting/icon/ic_edit@2x.png | 0
h5/static/meeting/icon/xiaoxi_ic_gonggao@2x(1).png | 0
h5/static/meeting/icon/ar_right@2x.png | 0
h5/static/meeting/icon/ic_cancel@2x.png | 0
h5/static/meeting/common/nav_yuyue@2x.png | 0
h5/static/meeting/customicons.css | 20
h5/static/meeting/icon/wd_ic_guanli@2x.png | 0
h5/static/meeting/icon/wd_ic_mima@2x.png | 0
h5/static/meeting/common/nav_wode_sel@2x.png | 0
h5/components/Li-Calendar/readme.md | 148 +
h5/utils/meetingHttp.js | 71
h5/utils/utils.js | 98
h5/static/meeting/common/123.png | 0
h5/static/meeting/icon/home_ic_notice@2x.png | 0
h5/components/tki-qrcode/tki-qrcode.vue | 210 +
h5/static/meeting/icon/ar_left@2x.png | 0
h5/static/meeting/icon/ic_choose@2x.png | 0
52 files changed, 7,147 insertions(+), 6 deletions(-)
diff --git a/h5/components/Header.vue b/h5/components/Header.vue
new file mode 100644
index 0000000..2b36fab
--- /dev/null
+++ b/h5/components/Header.vue
@@ -0,0 +1,66 @@
+<template>
+ <view class="custombar" :style="{height:statusbarHeight + navHeight +'px'}">
+ <view class="status_bar" :style="{height:statusbarHeight+'px'}"></view>
+ <view class="nav_bar" :style="{height:navHeight +'px'}">
+ <view class="title">
+ <text>{{Title}}</text>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ import { mapState } from 'vuex'
+
+ export default {
+ props: {
+ Title: {
+ type: String,
+ default: ''
+ }
+ },
+ computed: {
+ ...mapState(['statusbarHeight', 'navHeight'])
+ }
+ }
+</script>
+
+<style lang="less" scoped>
+ .custombar{
+ position: sticky;
+ top: 0rpx;
+ left: 0;
+ width: 100%;
+ z-index: 999;
+ height: 45px;
+ background-color: #ffffff;
+ .nav_bar{
+ position: relative;
+ z-index: 999;
+ .return{
+ position: absolute;
+ transform: translateY(-50%);
+ width: 40rpx;
+ height: 40rpx;
+ top: 50%;
+ left: 30rpx;
+ z-index: 99;
+ }
+ .title{
+ position: relative;
+ transform: translate(-50%, -50%);
+ left: 50%;
+ top: 50%;
+ font-size: 0;
+ padding-left: 30rpx;
+ box-sizing: border-box;
+ text{
+ font-size: 36rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #111111;
+ }
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/h5/components/Li-Calendar/Li-Calendar.css b/h5/components/Li-Calendar/Li-Calendar.css
new file mode 100644
index 0000000..c3913d5
--- /dev/null
+++ b/h5/components/Li-Calendar/Li-Calendar.css
@@ -0,0 +1,219 @@
+.calendar-Time-header{
+ /* text-align: center;
+ height: 50upx;
+ line-height: 50upx;
+ vertical-align: middle;
+ padding: 20upx; */
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 20rpx;
+}
+.header-left {
+ display: flex;
+ align-items: center;
+}
+.header-left image {
+ width: 30rpx;
+ height: 30rpx;
+}
+.header-left text {
+ font-size: 32rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ margin: 0 40rpx
+}
+.header-right {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #0055FF;
+}
+.calendar-TimeH{
+}
+.calendar-lastMonth{
+ width: 100upx;
+ font-size: 35upx;
+ margin-right: 10%;
+ padding: 0 5px;
+ text-align: center;
+}
+.calendar-nextMonth{
+ width: 100upx;
+ text-align: center;
+ margin-left: 10%;
+ font-size: 35upx;
+ padding: 0 5px;
+}
+.calendar-backToToday{
+ text-align: center;
+ font-size: 24upx;
+ position: absolute;
+ right: 5px;
+}
+
+.calendar-row:before,
+.calendar-row:after {
+ display: table;
+ content: ' ';
+}
+
+.calendar-row:after {
+ clear: both;
+}
+
+.calendar-col {
+ width: 14.285714%;
+ max-width: 14.285714%;
+ position: relative;
+ float: left;
+ font-weight: 500;
+ min-height: 80upx;
+ font-size: 28rpx;
+ /* color: #999999; */
+ color: #222222;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ overflow: hidden;
+
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.aligncanter {
+ text-align: center;
+ /* border-bottom: 1rpx solid #E5E5E5; */
+}
+
+.calendar-header {
+ color: gray;
+ height: 40upx;
+ line-height: 40upx;
+ vertical-align: middle;
+ font-size: 24upx;
+}
+
+.calendar-day {
+ height: 80upx;
+ transform: translate3d(0px, 0px, 0px) translateZ(0px); transition-duration: 0ms; transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
+}
+
+
+.calendar-content {
+}
+
+.calendar-date{
+ /* color: #000; */
+}
+.calendar-today {
+ /* border-radius: 6upx;
+ background-color: #0055FF; */
+ color: #0055FF;
+ /* -moz-box-shadow: 0px 2upx 10upx #ABABAB;
+ -webkit-box-shadow: 0px 2upx 10upx #ABABAB;
+ box-shadow: 0px 2upx 10upx #ABABAB; */
+}
+.calendar-today .calendar-point{
+ color: white !important;
+}
+
+.calendar-today .calendar-text{
+ color: white !important;
+}
+
+.calendar-col-lastMonth .calendar-text{
+ color: gray;
+}
+
+.calendar-col-nextMonth .calendar-text{
+ color: gray;
+}
+
+/* .calendar-today .calendar-date{
+ color: white;
+} */
+
+.calendar-active {
+ color:#FFFFFF !important;
+ background-color: #0055FF;
+ /* -moz-box-shadow: 0px 2upx 10upx #ABABAB;
+ -webkit-box-shadow: 0px 2upx 10upx #ABABAB;
+ box-shadow: 0px 2upx 10upx #ABABAB; */
+}
+/* 鑼冨洿鏍囪 */
+.calendar-range {
+ /* color:#01AAED; */
+ border-radius: 0px;
+ background-color: #D9D9D9;
+ -moz-box-shadow: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+
+
+
+.ClearBoth {
+ clear: both;
+}
+.calendar-col-nextMonth{
+ color:gray;
+}
+.calendar-col-lastMonth{
+ color:gray;
+}
+.calendar-btn-disabled{
+ color:gainsboro;
+}
+.calendar-point{
+ width: 28rpx;
+ height: 28rpx;
+ box-sizing: border-box;
+ background-color: #F62710;
+ border-radius: 50%;
+ font-size: 16upx;
+ color: #FFFFFF;
+ top:2upx;
+ right: 2upx;
+ position: absolute;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+.calendar-text{
+ padding: 4rpx 0;
+ width:100%;font-size: 20upx;color: #F62710;top:40upx;left: 0px;position: absolute;overflow:hidden;
+}
+.dayValue{
+ text-align: center;
+ /* color: #000000; */
+}
+
+.calendar-day-6-7{
+ /* color: orangered; */
+}
+
+/* 瓒呭嚭鏃ユ湡鑼冨洿 */
+.calendar-out-of-Date{
+ background-color: #EAEAEA;
+}
+.calendar-out-of-Date .calendar-date{
+ color: gray;
+}
+
+
+
+
+
+/* 浠ヤ笅涓哄疄鐜�0.5px搴曢儴杈圭晫 */
+.under_line{position: relative;}
+.under_line:before,
+.under_line:after{position: absolute;content: " ";height: 1px;width: 100%;left: 0;transform-origin: 0 0;-webkit-transform-origin: 0 0;}
+/* .fineLine:before{椤堕儴top: 0;background: #000;} */
+.under_line:after{bottom: 0;}
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5){.under_line:after,.under_line:before{-webkit-transform: scaleY(.667);}}
+@media only screen and (-webkit-min-device-pixel-ratio: 2){.under_line:after,.under_line:before{-webkit-transform: scaleY(.5);}}
+/* 浠ヤ笂涓哄疄鐜�0.5px搴曢儴杈圭晫 */
\ No newline at end of file
diff --git a/h5/components/Li-Calendar/Li-Calendar.vue b/h5/components/Li-Calendar/Li-Calendar.vue
new file mode 100644
index 0000000..48bfd1d
--- /dev/null
+++ b/h5/components/Li-Calendar/Li-Calendar.vue
@@ -0,0 +1,702 @@
+<template>
+ <view>
+ <view class='calendar-Time-header under_line'>
+ <view class="header-left">
+ <!-- <image :src="lastDisabled ? disable : nodisable" mode="widthFix" @tap="subMonth"></image> -->
+ <image :src="nodisable" mode="widthFix" @tap="subMonth"></image>
+ <text>{{title_time}}</text>
+ <image src="@/static/icon/ar_right@2x.png" mode="widthFix" @tap="addMonth"></image>
+ </view>
+ <view class="header-right" @tap="backToToday">鍥炲埌浠婂ぉ</view>
+ <!-- <text class='calendar-lastMonth' @tap="subMonth" v-bind:class="{'calendar-btn-disabled' : lastDisabled }">{{lastText}}</text>
+ <text class='calendar-TimeH'>{{title_time}}</text>
+ <text class='calendar-nextMonth' @tap="addMonth" v-bind:class="{'calendar-btn-disabled' : nextDisabled }">{{nextText}}</text>
+ <text class='calendar-backToToday' @tap="backToToday">鍥炲埌浠婂ぉ</text> -->
+ </view>
+ <view class='ClearBoth'></view>
+ <view class="calendar-content">
+ <view class="calendar-row calendar-header">
+ <view class="calendar-col aligncanter">鍛ㄦ棩</view>
+ <view class="calendar-col aligncanter">鍛ㄤ竴</view>
+ <view class="calendar-col aligncanter">鍛ㄤ簩</view>
+ <view class="calendar-col aligncanter">鍛ㄤ笁</view>
+ <view class="calendar-col aligncanter">鍛ㄥ洓</view>
+ <view class="calendar-col aligncanter">鍛ㄤ簲</view>
+ <view class="calendar-col aligncanter">鍛ㄥ叚</view>
+ </view>
+ <view class="calendar-row calendar-day" v-bind:style="{'transform':transformObj, 'transition-duration':transformTimeObj}" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend">
+ <view class="calendar-col aligncanter calendar-col-lastMonth" v-for='item in beforeDateList' v-bind:key='item.key'
+ @tap="subMonth" v-bind:class="{'calendar-out-of-Date' : item.outOfDate }">{{item.dateIndex}}
+ <text class='calendar-text'>{{item.markText}}</text>
+ </view>
+
+ <view class="calendar-col aligncanter currentDays" v-bind:class="{'calendar-active' : item.dateIndex == currentSelectTime
+ , 'calendar-today' : item.isToday
+ , 'calendar-range' : item.isRanges
+ , 'calendar-out-of-Date' : item.outOfDate }"
+ v-for='item in dateList' v-bind:key='item.key' @tap="selectedDateFun(item.dateIndex)">
+ <view class='dayValue'>
+ <text class='calendar-date calendar-day-6-7' v-if="item.isDaySunOrSat">{{item.dateIndex}}</text>
+ <text v-else class='calendar-date'>{{item.dateIndex}}</text>
+ <text class='calendar-point' v-if="item.pointText" v-bind:style="{'color':item.pointTextColor?item.pointTextColor:maskColor}">{{item.pointText}}</text>
+ <text class='calendar-text' v-bind:style="{'color':item.markTextColor?item.markTextColor:maskColor}">{{item.markText}}</text>
+ </view>
+ </view>
+
+ <view class="calendar-col aligncanter calendar-col-nextMonth" v-for='item in afterDateList' v-bind:key='item.key'
+ @tap="addMonth" v-bind:class="{'calendar-out-of-Date' : item.outOfDate }">{{item.dateIndex}}
+ <text class='calendar-text'>{{item.markText}}</text>
+ </view>
+ </view>
+ <view class="ClearBoth"></view>
+ </view>
+ </view>
+</template>
+
+<script>
+ import lunarYearTool from './sloarToLunar.js'
+ import { getDay } from '@/utils/utils.js'
+ export default {
+ name: 'Li-Calendar',
+ props: {
+ /**
+ * @description 褰撳墠鏃堕棿 yyyy-MM-dd
+ */
+ currentTime: {
+ type: String,
+ default: function() {
+ let timeObj = new Date();
+ return timeObj.getFullYear() + "-" + (timeObj.getMonth() + 1) + "-" + timeObj.getDate();
+ }
+ },
+ /**
+ * @description 鏍囪鐐瑰垪琛�
+ * time 鏍囪鏃堕棿 yyyy-MM-dd
+ * text 鏍囪鍐呭
+ * markPoint 鏄惁鏄剧ず鏍囪鐐� 榛樿false
+ * markTextColor 鏍囪鍐呭棰滆壊
+ * pointText 宸︿笂瑙掓爣璁扮偣鍐呭
+ * pointTextColor 鏍囪鐐归鑹�
+ */
+ mark: {
+ type: Array,
+ default: function() {
+ return undefined;
+ }
+ },
+ /**
+ * @description 涓婃湀鏂囧瓧
+ */
+ lastText: {
+ type: String,
+ default: '銆�'
+ },
+ /**
+ * @description 涓嬫湀鏂囧瓧
+ */
+ nextText: {
+ type: String,
+ default: '銆�'
+ },
+ /**
+ * @description 鍏ㄥ眬鏍囪鐐归鑹诧紝鍖呮嫭鐐瑰拰鏂囧瓧
+ */
+ maskColor: {
+ type: String,
+ default: '#01AAED'
+ },
+ /**
+ * @description 鏄惁鏄剧ず鍐滃巻锛宮ask浼樺厛绾ч珮
+ */
+ showLunar: {
+ type: Boolean,
+ default: true
+ },
+ /**
+ * @description 璁剧疆鏍囪鑼冨洿
+ */
+ range: {
+ type: Object,
+ default: function() {
+ return {
+ rangeStart: undefined, //璁剧疆鏍囪鑼冨洿寮�濮嬶紝yyyy-MM-dd
+ rangeEnd: undefined //璁剧疆鏍囪鑼冨洿缁撴潫锛寉yyy-MM-dd
+ }
+ }
+ },
+ /**
+ * @description 鏄惁寮�鍚寖鍥撮�夋嫨妯″紡
+ */
+ rangeMode: {
+ type: Boolean,
+ default: false
+ },
+ /**
+ * @description 鏃ュ巻璧峰鏃堕棿 yyyy-MM-dd
+ */
+ dateStart: {
+ type: String,
+ default: '1970-01-01'
+ },
+ /**
+ * @description 鏃ュ巻缁撴潫鏃堕棿 yyyy-MM-dd
+ */
+ dateEnd: {
+ type: String,
+ default: '2100-12-31'
+ },
+ /**
+ * @description 鏄惁鍙互婊氬姩
+ */
+ canDrag:{
+ type: Boolean,
+ default: true
+ },
+ },
+ created() {
+ this.render();
+ },
+ data() {
+ return {
+ nodisable: require('@/static/icon/ar_left@2x.png'),
+ disable: require('@/static/icon/ar_left_disable.png'),
+
+ nextDisabled: false,
+ lastDisabled: true,
+ currentSelectTime: undefined, //鐐瑰嚮鏃朵繚瀛樼殑dateIndex
+ title_time: '', //椤跺ご鏂囨湰
+ year: undefined, //褰撳墠骞�
+ month: undefined, //褰撳墠鏈�
+ beforeDateList: [], //涓婁釜鏈堢殑鏃ユ湡鍒楄〃
+ dateList: [], //鏈湀鐨勬棩鏈熷垪琛�
+ afterDateList: [], //涓嬩釜鏈堢殑鏃ユ湡鍒楄〃
+ firstRangeSelected: false, // 鑼冨洿寮�濮嬫椂闂存槸鍚﹀凡缁忛�夋嫨
+ rangeStart_: undefined, //鏍囪鑼冨洿寮�濮嬶紝yyyyMM-dd
+ rangeEnd_: undefined, //鏍囪鑼冨洿缁撴潫锛寉yyyMM-dd
+ transform_x:0,
+ transform_time:0,
+ };
+ },
+ methods: {
+ render(setTimeStr) { //鍒濆鍖�
+ let that = this;
+ let currentTimeStr = setTimeStr ? setTimeStr : that.currentTime;
+ let timeObj = this.toDateByStr(currentTimeStr); //褰撳墠閫夊畾鐨勬椂闂�
+ //璁$畻澶撮儴鏄剧ず鐨勫勾鏈�
+ let _tempTileMonth = (timeObj.getMonth() + 1);
+ if (_tempTileMonth < 10)
+ _tempTileMonth = '0' + _tempTileMonth;
+ this.title_time = timeObj.getFullYear() + "骞�" + _tempTileMonth + "鏈�";
+
+ //鑾峰彇褰撳墠鏃堕棿鏈堜唤1鍙�
+ let firstDayStr = timeObj.getFullYear() + "/" + (timeObj.getMonth() + 1) + "/01";
+ let date = that.toDateByStr(firstDayStr);
+ that.year = date.getFullYear();
+ that.month = date.getMonth() + 1;
+ let firstDayWeek = date.getDay(); //绗竴澶╂槸鏄熸湡鍑�
+ let grid_sum = 0; //鎬绘牸瀛愭暟 锛岀敤浜庡悗闈㈠~婊℃牸瀛�
+ //鑾峰彇涓婁竴涓湀鐨勫ぉ鏁�
+ let TempMonth;
+ let TempYear;
+ if (that.month == 1) { //璺ㄥ勾
+ TempMonth = 12;
+ TempYear = that.year - 1;
+ } else {
+ TempYear = that.year;
+ TempMonth = that.month - 1;
+ }
+ let TempLastMonthStr = TempYear + "/" + TempMonth + "/01";
+ let lastMonthTotalDay = that.getTotalDay(TempLastMonthStr);
+ let lastMonthStartDay = lastMonthTotalDay - firstDayWeek;
+
+ let _dateStart = that.toDateByStr1(that.dateStart);
+ let _dateEnd = that.toDateByStr1(that.dateEnd);
+ // 鍒涘缓鍓嶉潰鐨勬棩鏈�
+ that.beforeDateList = [];
+ for (let i = 0; i < firstDayWeek; i++) {
+ grid_sum++;
+ lastMonthStartDay++;
+ let tempObj = {
+ dateIndex: lastMonthStartDay,
+ key: 'before_' + i
+ };
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ let _tempBeforeDate = new Date(TempYear + "/" + TempMonth + "/" + lastMonthStartDay);
+ if (_dateStart > _tempBeforeDate || _tempBeforeDate > _dateEnd) {
+ tempObj.outOfDate = true;
+ }
+
+ //鑾峰彇鍐滃巻
+ if (that.showLunar) {
+ let LunarDate = that.sloarToLunar(TempYear, TempMonth, lastMonthStartDay);
+ let tempLunarDay = LunarDate.lunarDay == '鍒濅竴' ? LunarDate.lunarMonth + '鏈�' : LunarDate.lunarDay;
+ tempObj.markText = tempLunarDay;
+ }
+
+ that.beforeDateList.push(tempObj);
+ }
+
+ //鑾峰彇涓�涓湀鐨勫ぉ鏁�
+ let totalDay = that.getTotalDay(currentTimeStr);
+
+ //鐢熸垚鏈湀鏃ュ巻
+ let today = new Date();
+ let today_year = today.getFullYear();
+ let today_month = today.getMonth() + 1;
+ let today_day = today.getDate();
+ that.dateList = [];
+ for (let i = 1; i <= totalDay; i++) { //寰幆鏃�
+ grid_sum++;
+
+ let tempObj = {
+ dateIndex: i,
+ key: 'date_' + i,
+ isRanges: false,
+ isToday: false
+ };
+ //褰撳墠鏃ユ湡鍙橀噺
+ let tempDay = that.toDateByStr(that.year + "/" + that.month + "/" + i);
+
+ //鍒ゆ柇鏄惁涓哄綋澶�
+ if (today_year == that.year && today_month == that.month && today_day == i)
+ tempObj.isToday = true;
+
+ //鍛ㄥ叚鍜屽懆鏃ワ紝鐗规畩澶勭悊
+ let tempCurrWeek = tempDay.getDay();
+ if (tempCurrWeek == 0 || tempCurrWeek == 6)
+ tempObj.isDaySunOrSat = true;
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ if (_dateStart > tempDay || tempDay > _dateEnd) {
+ tempObj.outOfDate = true;
+ }
+
+ //鑾峰彇鍐滃巻
+ if (that.showLunar) {
+ let LunarDate = that.sloarToLunar(that.year, that.month, i);
+ that.lunarMonth = LunarDate.lunarMonth;
+ that.lunarYear = LunarDate.lunarYear;
+ let tempLunarDay = LunarDate.lunarDay == '鍒濅竴' ? LunarDate.lunarMonth + '鏈�' : LunarDate.lunarDay;
+ tempObj.lunarMonth = LunarDate.lunarMonth;
+ tempObj.lunarYear = LunarDate.lunarYear;
+ tempObj.lunarDay = LunarDate.lunarDay;
+ tempObj.markText = tempLunarDay;
+ tempObj.markTextColor = '#454545';
+ }
+
+ //璁剧疆浜嗘爣璁扮偣
+ if (that.mark) {
+ for (let z = 0; z < that.mark.length; z++) { //鍒ゆ柇鏄惁涓烘爣璁扮偣
+ let tempDayMark = that.toDateByStr1(that.mark[z].time.trim())
+ if (tempDay.getTime() == tempDayMark.getTime()) {
+ let tempTextStr = that.mark[z].text
+ if (that.mark[z].markPoint != false) { // 鏄惁鏄剧ず鐐�
+ tempObj.pointText = that.mark[z].pointText ? that.mark[z].pointText : '鈼�';
+ tempObj.pointTextColor = that.mark[z].pointTextColor ? that.mark[z].pointTextColor : undefined;
+ }
+ if (tempTextStr != undefined && tempTextStr != "") { // 鏄惁鏄剧ず鏂囧瓧
+ tempObj.markText = tempTextStr;
+ tempObj.markTextColor = that.mark[z].markTextColor ? that.mark[z].markTextColor : undefined;
+ }
+ break;
+ }
+ }
+ }
+
+ that.dateList.push(tempObj);
+ }
+
+ that.setRange();
+
+ // 鍒涘缓鍚庨潰鐨勭┖鐧斤紝琛ュ浜旇
+ that.afterDateList = [];
+ if (grid_sum < 42) { // 鍒涘缓鍚庨潰鐨勭┖鐧斤紝琛ュ浜旇
+ let j = 0;
+
+ //鑾峰彇涓嬩竴鏈�
+ let TempMonthNext;
+ let TempYearNext;
+ if (that.month == 12) { //璺ㄥ勾
+ TempMonthNext = 1;
+ TempYearNext = that.year + 1;
+ } else {
+ TempYearNext = that.year;
+ TempMonthNext = that.month + 1;
+ }
+
+ for (let i = grid_sum; i < 42; i++) {
+ j++;
+
+ let tempObj = {
+ dateIndex: j,
+ key: 'after_' + j
+ };
+ //鑾峰彇鍐滃巻
+ if (that.showLunar) {
+ let LunarDate = that.sloarToLunar(TempYearNext, TempMonthNext, j);
+ let tempLunarDay = LunarDate.lunarDay == '鍒濅竴' ? LunarDate.lunarMonth + '鏈�' : LunarDate.lunarDay;
+ tempObj.markText = tempLunarDay;
+ }
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ let _tempAfterDate = new Date(TempYearNext + "/" + TempMonthNext + "/" + j);
+ if (_dateStart > _tempAfterDate || _tempAfterDate > _dateEnd) {
+ tempObj.outOfDate = true;
+ }
+
+ that.afterDateList.push(tempObj);
+ }
+ }
+ },
+ sloarToLunar(year,month,day){
+ // console.log('----')
+ // console.log(year + "--" +month+ "--" + day)
+ let result = lunarYearTool.sloarToLunar(year,month,day);
+ //console.log(result)
+ return result;
+ },
+ getTotalDay(time) { //鑾峰彇鏈� 鏃ユ湡鎬绘暟
+ time = time.replace(/-/g, "/");
+ let selectedDate = new Date(time);
+ if (selectedDate == "Invalid Date") {
+ selectedDate = new Date(time + "/01");
+ }
+
+ let dayMany = new Date(selectedDate.getFullYear(),(selectedDate.getMonth() + 1), 0).getDate()
+ return dayMany;
+ },
+ toDateByStr(timeStr) { //瀛楃涓茶浆鎹㈡椂闂达紝杞崲澶辫触鎴栬�呬笉浼犲瓧绗︿覆鍒欒繑鍥炲綋鍓�
+ let timeObj;
+ if (timeStr) {
+ timeObj = new Date(timeStr.replace(/-/g, "/"));
+ }
+ if (!timeStr || timeObj == "Invalid Date")
+ timeObj = new Date();
+ return timeObj;
+ },
+ toDateByStr1(timeStr) { //瀛楃涓茶浆鎹㈡椂闂达紝杞崲澶辫触鎴栬�呬笉浼犲瓧绗︿覆鍒檔ull
+ try {
+ let timeObj;
+ if (timeStr) {
+ timeObj = new Date(timeStr.replace(/-/g, "/"));
+ }
+ if (!timeStr || timeObj == "Invalid Date")
+ return null;
+ return timeObj;
+ } catch (e) {
+ return null;
+ }
+ },
+ getTimeStrFormat(timeStr) { //鑾峰彇鏍煎紡鍖栫殑鏃堕棿 yyyy-MM-dd
+ let timeObj;
+ if (timeStr) {
+ timeObj = new Date(timeStr.replace(/-/g, "/"));
+ }
+ if (!timeStr || timeObj == "Invalid Date")
+ timeObj = new Date();
+ return timeObj.getFullYear() + "-" + (timeObj.getMonth() + 1) + "-" + timeObj.getDate();
+ },
+ selectedDateFun(index) { //鐐瑰嚮鏃ユ湡
+ let that = this;
+ let selectObj = that.dateList[index - 1];
+ selectObj.year = that.year;
+ selectObj.month = that.month;
+ selectObj.day = index;
+ selectObj.time = that.year + "-" + that.month + "-" + index;
+ that.$emit('dayChange', selectObj);
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ if (that.checkOutOfDate(selectObj.time)) {
+ return;
+ }
+
+ that.currentSelectTime = index;
+
+ console.log(index)
+
+ //寮�鍚簡鑼冨洿閫夋嫨妯″紡
+ if (that.rangeMode) {
+ if (!that.firstRangeSelected) { //閫夋嫨寮�濮嬫椂闂�
+ that.firstRangeSelected = !that.firstRangeSelected
+ that.rangeStart_ = selectObj.time;
+ that.rangeEnd_ = undefined;
+ that.clearRange();
+ } else { //閫夋嫨浜嗙粨鏉熸椂闂�
+ that.rangeEnd_ = selectObj.time;
+ that.firstRangeSelected = !that.firstRangeSelected
+ that.$emit('rangeChange', {
+ start: that.rangeStart_,
+ end: that.rangeEnd_,
+ });
+ that.setRange();
+ }
+ }
+ },
+ addMonth() { //鍔犱竴涓湀
+ let that = this;
+ that.currentSelectTime = ''
+ let _Month = that.month;
+ let _Year = that.year;
+ if (that.month == 12) { //璺ㄥ勾
+ _Month = 1;
+ _Year += 1;
+ } else {
+ _Month += 1;
+ }
+
+ let str = _Year + "/" + _Month + "/01";
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ if (that.checkOutOfDate(str)) {
+ that.nextDisabled = true;
+ return;
+ }
+
+ that.month = _Month;
+ that.year = _Year;
+ that.lastDisabled = false;
+
+ //妫�鏌ユ棩鏈熶笂闄愬�兼槸鍚﹀湪褰撴湀鍐咃紝濡傛灉鍦ㄥ垯涓嶈兘鍐嶅垏鎹笅涓湀
+ if (that.checkDateRange(that.year, that.month, 1)) {
+ that.nextDisabled = true;
+ }
+
+ if (that.rangeMode) { //寮�鍚簡鑼冨洿妯″紡
+ that.currentSelectTime = undefined;
+ }
+
+ that.$emit('monthChange', {
+ date: str
+ });
+ that.render(str);
+ },
+ subMonth() { //鍑忎竴涓湀
+ let that = this;
+
+ that.currentSelectTime = ''
+
+ let _Month = that.month;
+ let _Year = that.year;
+ if (that.month == 1) { //璺ㄥ勾
+ _Month = 12;
+ _Year -= 1;
+ } else {
+ _Month -= 1;
+ }
+
+ let str = _Year + "/" + _Month + "/01";
+
+ //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿
+ let _totalDay = that.getTotalDay(str);
+ if (that.checkOutOfDate(_Year + "/" + _Month + "/" + _totalDay)) {
+ that.lastDisabled = true;
+ return;
+ }
+
+ that.month = _Month;
+ that.year = _Year;
+ that.nextDisabled = false;
+
+ //妫�鏌ユ棩鏈熶笅闄愬�兼槸鍚﹀湪褰撴湀鍐咃紝濡傛灉鍦ㄥ垯涓嶈兘鍐嶅垏鎹笂涓湀
+ if (that.checkDateRange(that.year, that.month)) {
+ that.lastDisabled = true;
+ }
+
+ if (that.rangeMode) { //寮�鍚簡鑼冨洿妯″紡
+ that.currentSelectTime = undefined;
+ }
+
+ that.$emit('monthChange', {
+ date: str
+ });
+ that.render(str);
+ },
+ backToToday() { //鍥炲埌浠婂ぉ
+ let currDate = new Date();
+ let _year = currDate.getFullYear();
+ let _month = currDate.getMonth() + 1;
+
+ this.currentSelectTime = getDay().day
+
+ this.$emit('dayChange', { time: getDay().date });
+
+ //濡傛灉宸茬粡鏄綋鏈�
+ if (_year == this.year && _month == this.month) {
+ return;
+ }
+
+ let value = _year + "/" + _month + "/" + currDate.getDate();
+ this.$emit('monthChange', {
+ date: value
+ });
+ this.lastDisabled = true
+
+ this.render(value);
+ },
+ setRange() { //璁剧疆鑼冨洿
+ let that = this;
+ let rangeStartDate = that.toDateByStr1(that.rangeStart_);
+ let rangeEndDate = that.toDateByStr1(that.rangeEnd_);
+ if (!rangeStartDate || !rangeEndDate)
+ return;
+ if (rangeStartDate > rangeEndDate) { //闃叉鑼冨洿鍑洪敊
+ let tempD = rangeEndDate;
+ rangeEndDate = rangeStartDate;
+ rangeStartDate = tempD;
+ }
+
+ //寰幆鍒ゆ柇鑼冨洿
+ for (let i = 0; i < that.dateList.length; i++) {
+ let _TempDtStr = that.year + "/" + that.month + "/" + that.dateList[i].dateIndex;
+ let _TempDt = that.toDateByStr1(_TempDtStr);
+ that.dateList[i].isRanges = false;
+ if (rangeStartDate <= _TempDt && _TempDt <= rangeEndDate) //鏃堕棿鍦ㄨ寖鍥村唴
+ that.dateList[i].isRanges = true;
+ }
+ },
+ clearRange() { //鍏抽棴鑼冨洿妯″紡鑼冨洿
+ let that = this;
+ //寰幆鍒ゆ柇鑼冨洿
+ for (let i = 0; i < that.dateList.length; i++) {
+ that.dateList[i].isRanges = false;
+ }
+ },
+ checkOutOfDate(time) { //鍒ゆ柇鏄惁瓒呭嚭鏃ユ湡鑼冨洿,yyyy-MM-dd
+ let that = this;
+ let _dateStart = that.toDateByStr1(that.dateStart);
+ let _dateEnd = that.toDateByStr1(that.dateEnd);
+ let _tempDate = that.toDateByStr1(time);
+ if (_dateStart > _tempDate || _tempDate > _dateEnd) {
+ return true;
+ } else
+ return false;
+ },
+ checkDateRange(year, month, type) { //鍒ゆ柇鑼冨洿鐣岄檺鍊兼槸鍚﹀湪褰撴湀鍐�,yyyy-MM-dd,type锛�1 涓婇檺鍊�,鍏朵粬锛氫笅闄愬��
+ let that = this;
+
+ let totalDay = that.getTotalDay(year + '/' + month + '/01');
+ let firstD = that.toDateByStr1(year + '/' + month + '/01');
+ let lastD = that.toDateByStr1(year + '/' + month + '/' + totalDay);
+
+ if (type == 1) { //涓婇檺鍊�
+ let _dateEnd = that.toDateByStr1(that.dateEnd);
+ if (firstD <= _dateEnd && _dateEnd <= lastD) {
+ return true;
+ } else
+ return false;
+ } else { //涓嬮檺鍊�
+ let _dateStart = that.toDateByStr1(that.dateStart);
+ if (firstD <= _dateStart && _dateStart <= lastD) {
+ return true;
+ } else
+ return false;
+ }
+ },
+ calendarTransform(x,time){ //鏃ュ巻婊戝姩鍔ㄧ敾
+ this.transform_x = x;
+ this.transform_time = time;
+ },
+ touchstart(event) {
+ if(!this.canDrag)
+ return;
+ this.startPageX = event.touches[0].pageX;
+ this.startPageY = event.touches[0].pageY;
+ },
+ touchmove(event) {
+ if(!this.canDrag)
+ return;
+ let touchmovePageX = event.touches[0].pageX;
+ let result = touchmovePageX - this.startPageX;
+ this.calendarTransform(result,0);
+ },
+ touchend(event) {
+ if(!this.canDrag)
+ return;
+ let that = this;
+ let endPageX = event.changedTouches[0].pageX;
+ let endPageY = event.changedTouches[0].pageY;
+ let x = Math.abs(that.startPageX - endPageX); //妯潗鏍囦箣宸�
+ let y = Math.abs(that.startPageY - endPageY); //绾靛潗鏍囦箣宸�
+
+ let screenX = 0;
+ try {
+ const res = uni.getSystemInfoSync();
+ screenX = res.windowWidth;
+ } catch (e) {
+ console.error(e)
+ return;
+ }
+ if (that.startPageX > endPageX) { //宸︽粦
+ let a = Math.atan(y / x);
+ let Rate = x / screenX;
+ if (a < Math.PI / 6 && Rate > 0.3) {
+ screenX = -screenX;
+ that.calendarTransform(screenX,300);
+ setTimeout(function(){
+ that.addMonth();
+ that.calendarTransform(0,0);
+ },300);
+ }
+ else{
+ that.calendarTransform(0,300);
+ }
+ } else {
+ let a = Math.atan(y / x);
+ let Rate = x / screenX;
+ if (a < Math.PI / 6 && Rate > 0.3) {
+ that.calendarTransform(screenX,300);
+ setTimeout(function(){
+ that.subMonth();
+ that.calendarTransform(0,0);
+ },300);
+ }
+ else{
+ that.calendarTransform(0,300);
+ }
+ }
+ }
+ },
+ watch: {
+ currentTime: function(val, oldVal) { //鏃堕棿鏀瑰彉
+ let dateNew = this.toDateByStr1(val);
+ if (dateNew.getFullYear() == this.year && (dateNew.getMonth() + 1) == this.month) {
+ console.log('time is not change')
+ } else {
+ this.currentSelectTime = dateNew.getDate();
+ this.render();
+ }
+ },
+ range: function(val, oldVal) { //鑼冨洿鏀瑰彉
+ if (val.rangeStart != oldVal.rangeStart || val.rangeEnd != oldVal.rangeEnd) {
+ this.rangeStart_ = val.rangeStart;
+ this.rangeEnd_ = val.rangeEnd;
+ this.setRange();
+ }
+ },
+ mark: function(val, oldVal) { //鏍囪鏀瑰彉
+ this.render();
+ },
+ rangeMode: function(val, oldVal) { //鑼冨洿鏀瑰彉
+ if (!val) { //濡傛灉鏄叧闂寖鍥存ā寮�
+ this.rangeStart_ = undefined; //鏍囪鑼冨洿寮�濮嬶紝yyyyMM-dd
+ this.rangeEnd_ = undefined; //鏍囪鑼冨洿缁撴潫锛寉yyyMM-dd
+ this.firstRangeSelected = false;
+ this.clearRange()
+ }
+ },
+ },
+ computed: {
+ transformObj:function () {
+ return 'translate3d(' + this.transform_x + 'px, 0px, 0px) translateZ(0px)';
+ },
+ transformTimeObj:function () {
+ return this.transform_time + 'ms';
+ }
+ },
+ }
+</script>
+
+<style>
+ @import url("./Li-Calendar.css");
+</style>
diff --git a/h5/components/Li-Calendar/readme.md b/h5/components/Li-Calendar/readme.md
new file mode 100644
index 0000000..315f3cd
--- /dev/null
+++ b/h5/components/Li-Calendar/readme.md
@@ -0,0 +1,148 @@
+### 閫氱敤鏃ュ巻锛屽彲鏍囪锛岄�夋嫨鑼冨洿锛岄珮搴﹁嚜瀹氫箟
+
+缁勪欢鍚嶏細``Li-Calendar``銆�
+
+1.閫氱敤鏃ュ巻,h5,5+app,寰俊灏忕▼搴忔祴璇曢�氳繃, 澶ч儴鍒嗗唴瀹瑰彲浠ヨ嚜瀹氫箟
+
+2.鍙爣璁帮紝璁剧疆浠绘剰鏍囪鍐呭鍜屾樉绀哄彸涓婅鐐�
+
+3.閫夋嫨鑼冨洿锛岄�夋嫨鎸囧畾鏃ユ湡鑼冨洿鎴栬�呰缃棩鏈熻寖鍥�
+
+4.闄愬埗鏃ュ巻鏄剧ず鑼冨洿锛岃缃棩鏈熺殑涓婁笅闄�
+
+5.鏄剧ず鍐滃巻锛屽彲浠ラ�夋嫨鍏抽棴锛岃缃簡鏍囪鐐圭殑浼樺厛鏄剧ず鏍囪鐐广��
+
+
+
+**浣跨敤鏂瑰紡锛�**
+
+鍦� ``script`` 涓紩鐢ㄧ粍浠�
+
+```javascript
+import Calendar from '@/components/Li-Calendar/Li-Calendar.vue';
+export default {
+ components: {Calendar}
+}
+```
+
+鍦� ``template`` 涓娇鐢ㄧ粍浠�
+
+```html
+ <view class="Mtext">----榛樿---</view>
+
+ <Calendar :currentTime='currentTime' @dayChange='dayChange' @monthChange='monthChange'
+ :rangeMode='rangeMode' @rangeChange='rangeChange' :showLunar='false'>
+ </Calendar>
+
+ <view class="Mtext">鏄剧ず鍐滃巻鍜屾爣璁扮偣</view>
+
+ <Calendar :currentTime='currentTime' :mark='mark' @dayChange='dayChange' @monthChange='monthChange' :rangeMode='rangeMode'
+ :range='range' @rangeChange='rangeChange' :dateStart='dateStart' :dateEnd='dateEnd' :canDrag='true'>
+ </Calendar>
+
+
+```
+
+```javascript
+ export default {
+ components: {
+ Calendar
+ },
+ data() {
+ return {
+ mark: [
+ {
+ time: '2019-8-23',
+ text: '鏍囪',
+ markPoint: true,
+ markTextColor:'blue',
+ pointText: '濂�',
+ pointTextColor:'red'
+ },
+ {
+ time: '2019-8-24',
+ text: '涓婂北鎵撹�佽檸',
+ markPoint: true,
+ pointText: '2',
+ }],
+ range:{
+ rangeStart:undefined, //璁剧疆鏍囪鑼冨洿寮�濮嬶紝yyyyMM-dd
+ rangeEnd:undefined //璁剧疆鏍囪鑼冨洿缁撴潫锛寉yyyMM-dd
+ },
+ rangeMode:false,
+ currentTime: '2019-8-23',
+ title: 'Hello',
+ dateStart: '2019-6-15',
+ dateEnd: '2020-6-15'
+ }
+ },
+ onLoad() {
+
+ },
+ methods: {
+ dayChange(data){
+ console.log(data)
+ },
+ monthChange(data){
+ console.log(data)
+ },
+ setDate(){
+ this.currentTime = '2019-7-10'
+ },
+ setRange(){
+ this.range = {
+ rangeStart:'2019-8-10', //璁剧疆鏍囪鑼冨洿寮�濮嬶紝yyyyMM-dd
+ rangeEnd:'2019-8-20' //璁剧疆鏍囪鑼冨洿缁撴潫锛寉yyyMM-dd
+ }
+ },
+ setRangeMode(){
+ this.rangeMode = !this.rangeMode;
+ },
+ rangeChange(data){
+ console.log(data)
+ }
+ }
+ }
+```
+
+**灞炴�ц鏄庯細**
+
+|灞炴�у悕 |绫诲瀷|榛樿鍊� |璇存槑|
+|---|----|---|---|
+|currentTime |String |褰撳墠鏃堕棿|褰撳墠璁惧畾鏃堕棿 yyyy-MM-dd|
+|mark |Array |-|鏍囪鐐瑰垪琛� |
+|lastText |String |'銆�'|涓婁釜鏈堟寜閿枃瀛梶
+|nextText |String |'銆�'|涓嬩釜鏈堟寜閿枃瀛梶
+|maskColor |String |#01AAED|鍏ㄥ眬鏍囪鐐归鑹诧紝鍖呮嫭鐐瑰拰鏂囧瓧|
+|showLunar |Boolean |true|鏄惁鏄剧ず鍐滃巻锛宮ask浼樺厛绾ч珮|
+|range |Object |-|璁剧疆鏍囪鑼冨洿|
+|rangeMode |Boolean |false|鏄惁寮�鍚寖鍥撮�夋嫨妯″紡|
+|dateStart |String |'1970-01-01'|鏃ュ巻璧峰鏃堕棿 yyyy-MM-dd|
+|dateEnd |String |'2100-12-31'|鏃ュ巻缁撴潫鏃堕棿 yyyy-MM-dd|
+|canDrag |Boolean |true|鏄惁鍙互婊氬姩|
+
+**mark 鏍囪鐐瑰垪琛� 灞炴�ц鏄庯細**
+
+|灞炴�у悕 |绫诲瀷|榛樿鍊� |璇存槑|
+|---|----|---|---|
+|time |String |-|鏍囪鏃堕棿 yyyy-MM-dd|
+|text |Array |-|鏍囪鍐呭 |
+|markPoint |Boolean |false|鏄惁鏄剧ず鏍囪鐐� |
+|markTextColor |String |-|鏍囪鍐呭棰滆壊|
+|pointText |String |-|宸︿笂瑙掓爣璁扮偣鍐呭|
+|pointTextColor |String |-|鏍囪鐐归鑹瞸
+
+**range 璁剧疆鑼冨洿 灞炴�ц鏄庯細**
+
+|灞炴�у悕 |绫诲瀷|榛樿鍊� |璇存槑|
+|---|----|---|---|
+|rangeStart |String |-|璁剧疆鏍囪鑼冨洿寮�濮嬶紝yyyy-MM-dd|
+|rangeEnd |String |-|璁剧疆鏍囪鑼冨洿缁撴潫锛寉yyy-MM-dd |
+
+**浜嬩欢璇存槑锛�**
+
+|灞炴�у悕 |璇存槑|
+|---|---|
+|@dayChange |褰撴湀鏃ユ湡鏀瑰彉|
+|@monthChange |鏈堜唤鏀瑰彉|
+|@rangeChange |鑼冨洿鏀瑰彉|
diff --git a/h5/components/Li-Calendar/sloarToLunar.js b/h5/components/Li-Calendar/sloarToLunar.js
new file mode 100644
index 0000000..551bcb6
--- /dev/null
+++ b/h5/components/Li-Calendar/sloarToLunar.js
@@ -0,0 +1,195 @@
+/* 鍏巻杞啘鍘嗕唬鐮佹�濊矾锛�
+1銆佸缓绔嬪啘鍘嗗勾浠芥煡璇㈣〃
+2銆佽绠楄緭鍏ュ叕鍘嗘棩鏈熶笌鍏巻鍩哄噯鐨勭浉宸ぉ鏁�
+3銆佷粠鍐滃巻鍩哄噯寮�濮嬮亶鍘嗗啘鍘嗘煡璇㈣〃锛岃绠楄嚜鍐滃巻鍩哄噯涔嬪悗姣忎竴骞寸殑澶╂暟锛屽苟鐢ㄧ浉宸ぉ鏁颁緷娆$浉鍑忥紝纭畾鍐滃巻骞翠唤
+4銆佸埄鐢ㄥ墿浣欑浉宸ぉ鏁颁互鍙婂啘鍘嗘瘡涓湀鐨勫ぉ鏁扮‘瀹氬啘鍘嗘湀浠�
+5銆佸埄鐢ㄥ墿浣欑浉宸ぉ鏁扮‘瀹氬啘鍘嗗摢涓�澶� */
+var lunarYearTool = {
+ // 鍐滃巻1949-2100骞存煡璇㈣〃
+ lunarYearArr: [
+ 0x0b557, //1949
+ 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959
+ 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969
+ 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979
+ 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989
+ 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999
+ 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009
+ 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019
+ 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029
+ 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039
+ 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049
+ 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059
+ 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069
+ 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079
+ 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089
+ 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099
+ 0x0d520 //2100
+ ],
+ lunarMonth: ['姝�', '浜�', '涓�', '鍥�', '浜�', '鍏�', '涓�', '鍏�', '涔�', '鍗�', '鍐�', '鑵�'],
+ lunarDay: ['涓�', '浜�', '涓�', '鍥�', '浜�', '鍏�', '涓�', '鍏�', '涔�', '鍗�', '鍒�', '寤�'],
+ tianGan: ['鐢�', '涔�', '涓�', '涓�', '鎴�', '宸�', '搴�', '杈�', '澹�', '鐧�'],
+ diZhi: ['瀛�', '涓�', '瀵�', '鍗�', '杈�', '宸�', '鍗�', '鏈�', '鐢�', '閰�', '鎴�', '浜�'],
+ /**
+ * @description 鍏巻杞啘鍘嗗嚱鏁�
+ * @param {int} sy 骞翠唤
+ * @param {int} sm 鏈堜唤
+ * @param {int} sd 鏃ユ湡
+ * */
+ sloarToLunar: function(sy, sm, sd) { //
+ let that = this;
+ // 杈撳叆鐨勬湀浠藉噺1澶勭悊
+ sm -= 1;
+
+ // 璁$畻涓庡叕鍘嗗熀鍑嗙殑鐩稿樊澶╂暟
+ // Date.UTC()杩斿洖鐨勬槸璺濈鍏巻1970骞�1鏈�1鏃ョ殑姣鏁�,浼犲叆鐨勬湀浠介渶瑕佸噺1
+ let daySpan = (Date.UTC(sy, sm, sd) - Date.UTC(1949, 0, 29)) / (24 * 60 * 60 * 1000) + 1;
+ let ly, lm, ld;
+ // 纭畾杈撳嚭鐨勫啘鍘嗗勾浠�
+ for (let j = 0; j < that.lunarYearArr.length; j++) {
+ let tempDaySpan = that.lunarYearDays(that.lunarYearArr[j]);
+ daySpan -= tempDaySpan
+ if (daySpan <= 0) {
+ ly = 1949 + j;
+ // 鑾峰彇鍐滃巻骞翠唤纭畾鍚庣殑鍓╀綑澶╂暟
+ daySpan += tempDaySpan;
+ break
+ }
+ }
+
+ // 纭畾杈撳嚭鐨勫啘鍘嗘湀浠�
+ let lunarYearMonthsList = that.lunarYearMonths(that.lunarYearArr[ly - 1949])
+ let hasLeapMonth_Result = that.hasLeapMonth(that.lunarYearArr[ly - 1949]);
+ for (let k = 0; k < lunarYearMonthsList.length; k++) {
+ daySpan -= lunarYearMonthsList[k];
+ if (daySpan <= 0) {
+ // 鏈夐棸鏈堟椂锛屾湀浠界殑鏁扮粍闀垮害浼氬彉鎴�13锛屽洜姝わ紝褰撻棸鏈堟湀浠藉皬浜庣瓑浜巏鏃讹紝lm涓嶉渶瑕佸姞1
+ if (hasLeapMonth_Result && hasLeapMonth_Result <= k) {
+ if (hasLeapMonth_Result < k) {
+ lm = k;
+ } else if (hasLeapMonth_Result === k) {
+ lm = '闂�' + k;
+ } else {
+ lm = k + 1;
+ }
+ } else {
+ lm = k + 1;
+ }
+ // 鑾峰彇鍐滃巻鏈堜唤纭畾鍚庣殑鍓╀綑澶╂暟
+ daySpan += lunarYearMonthsList[k];
+ break
+ }
+ }
+
+ // 纭畾杈撳嚭鍐滃巻鍝竴澶�
+ ld = daySpan;
+
+ // 灏嗚绠楀嚭鏉ョ殑鍐滃巻鏈堜唤杞崲鎴愭眽瀛楁湀浠斤紝闂版湀闇�瑕佸湪鍓嶉潰鍔犱笂闂板瓧
+ if (hasLeapMonth_Result && (typeof(lm) === 'string' && lm.indexOf('闂�') > -1)) {
+ lm = `闂�${this.lunarMonth[/\d/.exec(lm) - 1]}`
+ } else {
+ lm = that.lunarMonth[lm - 1];
+ }
+
+ // 灏嗚绠楀嚭鏉ョ殑鍐滃巻骞翠唤杞崲涓哄ぉ骞插湴鏀勾
+ ly = that.getTianGan(ly) + that.getDiZhi(ly);
+
+ // 灏嗚绠楀嚭鏉ョ殑鍐滃巻澶╂暟杞崲鎴愭眽瀛�
+ if (ld < 11) {
+ ld = `${this.lunarDay[10]}${this.lunarDay[ld-1]}`
+ } else if (ld > 10 && ld < 20) {
+ ld = `${this.lunarDay[9]}${this.lunarDay[ld-11]}`
+ } else if (ld === 20) {
+ ld = `${this.lunarDay[1]}${this.lunarDay[9]}`
+ } else if (ld > 20 && ld < 30) {
+ ld = `${this.lunarDay[11]}${this.lunarDay[ld-21]}`
+ } else if (ld === 30) {
+ ld = `${this.lunarDay[2]}${this.lunarDay[9]}`
+ }
+
+ return {
+ lunarYear: ly,
+ lunarMonth: lm,
+ lunarDay: ld,
+ }
+ },
+ /**
+ * @description 璁$畻鍐滃巻骞存槸鍚︽湁闂版湀锛屽弬鏁颁负瀛樺偍鍐滃巻骞寸殑16杩涘埗
+ * 鍐滃巻骞翠唤淇℃伅鐢�16杩涘埗瀛樺偍锛屽叾涓�16杩涘埗鐨勬渶鍚�1浣嶅彲浠ョ敤浜庡垽鏂槸鍚︽湁闂版湀
+ * */
+ hasLeapMonth: function(ly) {
+ // 鑾峰彇16杩涘埗鐨勬渶鍚�1浣嶏紝闇�瑕佺敤鍒�&涓庤繍绠楃
+ if (ly & 0xf) {
+ return ly & 0xf
+ } else {
+ return false
+ }
+ },
+ /**
+ * @description 濡傛灉鏈夐棸鏈堬紝璁$畻鍐滃巻闂版湀澶╂暟锛屽弬鏁颁负瀛樺偍鍐滃巻骞寸殑16杩涘埗
+ * 鍐滃巻骞翠唤淇℃伅鐢�16杩涘埗瀛樺偍锛屽叾涓�16杩涘埗鐨勭1浣嶏紙0x闄ゅ锛夊彲浠ョ敤浜庤〃绀洪棸鏈堟槸澶ф湀杩樻槸灏忔湀
+ * */
+ leapMonthDays: function(ly) {
+ if (this.hasLeapMonth(ly)) {
+ // 鑾峰彇16杩涘埗鐨勭1浣嶏紙0x闄ゅ锛�
+ return (ly & 0xf0000) ? 30 : 29
+ } else {
+ return 0
+ }
+ },
+ /**
+ * @description 璁$畻鍐滃巻涓�骞寸殑鎬诲ぉ鏁帮紝鍙傛暟涓哄瓨鍌ㄥ啘鍘嗗勾鐨�16杩涘埗
+ * 鍐滃巻骞翠唤淇℃伅鐢�16杩涘埗瀛樺偍锛屽叾涓�16杩涘埗鐨勭2-4浣嶏紙0x闄ゅ锛夊彲浠ョ敤浜庤〃绀烘甯告湀鏄ぇ鏈堣繕鏄皬鏈�
+ * */
+ lunarYearDays: function(ly) {
+ let totalDays = 0;
+
+ // 鑾峰彇姝e父鏈堢殑澶╂暟锛屽苟绱姞
+ // 鑾峰彇16杩涘埗鐨勭2-4浣嶏紝闇�瑕佺敤鍒�>>绉讳綅杩愮畻绗�
+ for (let i = 0x8000; i > 0x8; i >>= 1) {
+ let monthDays = (ly & i) ? 30 : 29;
+ totalDays += monthDays;
+ }
+ // 濡傛灉鏈夐棸鏈堬紝闇�瑕佹妸闂版湀鐨勫ぉ鏁板姞涓�
+ if (this.hasLeapMonth(ly)) {
+ totalDays += this.leapMonthDays(ly);
+ }
+
+ return totalDays
+ },
+ /**
+ * @description 鑾峰彇鍐滃巻姣忎釜鏈堢殑澶╂暟 鍙傛暟闇�浼犲叆16杩涘埗鏁板��
+ * */
+ lunarYearMonths: function(ly) {
+ let monthArr = [];
+ let that = this;
+ // 鑾峰彇姝e父鏈堢殑澶╂暟锛屽苟娣诲姞鍒癿onthArr鏁扮粍涓�
+ // 鑾峰彇16杩涘埗鐨勭2-4浣嶏紝闇�瑕佺敤鍒�>>绉讳綅杩愮畻绗�
+ for (let i = 0x8000; i > 0x8; i >>= 1) {
+ monthArr.push((ly & i) ? 30 : 29);
+ }
+ // 濡傛灉鏈夐棸鏈堬紝闇�瑕佹妸闂版湀鐨勫ぉ鏁板姞涓�
+ if (this.hasLeapMonth(ly)) {
+ monthArr.splice(this.hasLeapMonth(ly), 0, that.leapMonthDays(ly));
+ }
+
+ return monthArr
+ },
+ /**
+ * @description 灏嗗啘鍘嗗勾杞崲涓哄ぉ骞诧紝鍙傛暟涓哄啘鍘嗗勾
+ * */
+ getTianGan: function(ly) {
+ let tianGanKey = (ly - 3) % 10;
+ if (tianGanKey === 0) tianGanKey = 10;
+ return this.tianGan[tianGanKey - 1]
+ },
+ /**
+ * @description 灏嗗啘鍘嗗勾杞崲涓哄湴鏀紝鍙傛暟涓哄啘鍘嗗勾
+ * */
+ getDiZhi: function(ly) {
+ let diZhiKey = (ly - 3) % 12;
+ if (diZhiKey === 0) diZhiKey = 12;
+ return this.diZhi[diZhiKey - 1]
+ }
+}
+
+export default lunarYearTool;
\ No newline at end of file
diff --git a/h5/components/tarbar.vue b/h5/components/tarbar.vue
new file mode 100644
index 0000000..97e5d9c
--- /dev/null
+++ b/h5/components/tarbar.vue
@@ -0,0 +1,147 @@
+<template>
+ <view>
+ <view class="zw" :style="{ backgroundColor: color }"></view>
+ <view class="tabbar">
+ <view class="tabbar-item" v-for="(item, index) in list" :key="index" @click="tabbarChange(item.path)">
+ <image :class="index === 1 ? 'item-img1 big' : 'item-img1'" :src="item.iconPath" v-if="current == index"></image>
+ <image :class="index === 1 ? 'item-img1 big' : 'item-img1'" :src="item.icon" v-else></image>
+ <view class="tabbar-item-y" v-if="index === 1"></view>
+ <text :style="current == index ? 'color: #111111;' : ''" v-if="index !== 1">{{item.text}}</text>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ export default {
+ name: "tarbar",
+ props: {
+ current: String,
+ color: String
+ },
+ data() {
+ return {
+ list: [
+ {
+ text: '棣栭〉',
+ icon: '/static/common/nav_home@2x.png',
+ iconPath: '/static/common/nav_home_sel@2x.png',
+ path: "/pages/index/index"
+ },
+ {
+ text: '鍥炴敹',
+ icon: '/static/common/nav_yuyue@2x.png',
+ iconPath: '/static/common/nav_yuyue@2x.png',
+ path: "/packagesMine/reservation/reservation"
+ },
+ {
+ text: '鎴戠殑',
+ icon: '/static/common/nav_wode@2x.png',
+ iconPath: '/static/common/nav_wode_sel@2x.png',
+ path: '/pages/mine/mine'
+ }
+ ]
+ }
+ },
+ methods: {
+ tabbarChange(path) {
+ if (path === '/packagesMine/reservation/reservation') {
+ uni.navigateTo({
+ url: path
+ });
+ } else {
+ uni.switchTab({
+ url: path
+ });
+ }
+ }
+ }
+ }
+</script>
+
+<style scoped>
+ .tabbarActive {
+ color: #79D5AD !important;
+ }
+
+ .top {
+ margin-top: 50rpx !important;
+ }
+
+ .zw {
+ width: 100%;
+ height: calc(118rpx + env(safe-area-inset-bottom));
+ background-color: #F7F7F7;
+ }
+
+ .tabbar-item-y {
+ position: absolute;
+ top: -22rpx;
+ left: 50%;
+ width: 118rpx;
+ height: 118rpx;
+ border-radius: 50%;
+ transform: translate(-50%, 0);
+ background-color: #ffffff;
+ box-shadow: inset 0px 2px 0px 0px #EEEEEE;
+ }
+
+ .tabbar {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+ width: 100%;
+ height: 118rpx;
+ background-color: #ffffff;
+ box-shadow: inset 0rpx 2rpx 0rpx 0rpx #EEEEEE;
+ z-index: 1111;
+ padding: 0 0 env(safe-area-inset-bottom) 0;
+ }
+
+ .tabbar-item {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ position: relative;
+ }
+
+ .tabbar-item .big {
+ width: 110rpx;
+ height: 110rpx;
+ position: absolute;
+ top: -20rpx;
+ left: 50%;
+ z-index: 1111;
+ transform: translate(-50%, 0);
+ }
+
+
+
+ .tabbar-item text {
+ font-size: 20rpx;
+ font-weight: 400;
+ color: #999999;
+ }
+
+ /* 閫変腑鍚� */
+ .item-img {
+ width: 104rpx;
+ height: 104rpx;
+ border-radius: 50%;
+ box-shadow: 0rpx 0rpx 10rpx 10rpx #EEEFF0;
+ }
+
+ /* 閫変腑鍓� */
+ .item-img1 {
+ width: 44rpx;
+ height: 44rpx;
+ margin-top: 8rpx;
+ }
+</style>
diff --git a/h5/components/tki-qrcode/qrcode.js b/h5/components/tki-qrcode/qrcode.js
new file mode 100644
index 0000000..d1a71f1
--- /dev/null
+++ b/h5/components/tki-qrcode/qrcode.js
@@ -0,0 +1,1201 @@
+let QRCode = {};
+(function () {
+ /**
+ * 鑾峰彇鍗曚釜瀛楃鐨剈tf8缂栫爜
+ * unicode BMP骞抽潰绾�65535涓瓧绗�
+ * @param {num} code
+ * return {array}
+ */
+ function unicodeFormat8(code) {
+ // 1 byte
+ var c0, c1, c2;
+ if (code < 128) {
+ return [code];
+ // 2 bytes
+ } else if (code < 2048) {
+ c0 = 192 + (code >> 6);
+ c1 = 128 + (code & 63);
+ return [c0, c1];
+ // 3 bytes
+ } else {
+ c0 = 224 + (code >> 12);
+ c1 = 128 + (code >> 6 & 63);
+ c2 = 128 + (code & 63);
+ return [c0, c1, c2];
+ }
+ }
+ /**
+ * 鑾峰彇瀛楃涓茬殑utf8缂栫爜瀛楄妭涓�
+ * @param {string} string
+ * @return {array}
+ */
+ function getUTF8Bytes(string) {
+ var utf8codes = [];
+ for (var i = 0; i < string.length; i++) {
+ var code = string.charCodeAt(i);
+ var utf8 = unicodeFormat8(code);
+ for (var j = 0; j < utf8.length; j++) {
+ utf8codes.push(utf8[j]);
+ }
+ }
+ return utf8codes;
+ }
+ /**
+ * 浜岀淮鐮佺畻娉曞疄鐜�
+ * @param {string} data 瑕佺紪鐮佺殑淇℃伅瀛楃涓�
+ * @param {num} errorCorrectLevel 绾犻敊绛夌骇
+ */
+ function QRCodeAlg(data, errorCorrectLevel) {
+ this.typeNumber = -1; //鐗堟湰
+ this.errorCorrectLevel = errorCorrectLevel;
+ this.modules = null; //浜岀淮鐭╅樀锛屽瓨鏀炬渶缁堢粨鏋�
+ this.moduleCount = 0; //鐭╅樀澶у皬
+ this.dataCache = null; //鏁版嵁缂撳瓨
+ this.rsBlocks = null; //鐗堟湰鏁版嵁淇℃伅
+ this.totalDataCount = -1; //鍙娇鐢ㄧ殑鏁版嵁閲�
+ this.data = data;
+ this.utf8bytes = getUTF8Bytes(data);
+ this.make();
+ }
+ QRCodeAlg.prototype = {
+ constructor: QRCodeAlg,
+ /**
+ * 鑾峰彇浜岀淮鐮佺煩闃靛ぇ灏�
+ * @return {num} 鐭╅樀澶у皬
+ */
+ getModuleCount: function () {
+ return this.moduleCount;
+ },
+ /**
+ * 缂栫爜
+ */
+ make: function () {
+ this.getRightType();
+ this.dataCache = this.createData();
+ this.createQrcode();
+ },
+ /**
+ * 璁剧疆浜屼綅鐭╅樀鍔熻兘鍥惧舰
+ * @param {bool} test 琛ㄧず鏄惁鍦ㄥ鎵炬渶濂芥帺鑶滈樁娈�
+ * @param {num} maskPattern 鎺╄啘鐨勭増鏈�
+ */
+ makeImpl: function (maskPattern) {
+ this.moduleCount = this.typeNumber * 4 + 17;
+ this.modules = new Array(this.moduleCount);
+ for (var row = 0; row < this.moduleCount; row++) {
+ this.modules[row] = new Array(this.moduleCount);
+ }
+ this.setupPositionProbePattern(0, 0);
+ this.setupPositionProbePattern(this.moduleCount - 7, 0);
+ this.setupPositionProbePattern(0, this.moduleCount - 7);
+ this.setupPositionAdjustPattern();
+ this.setupTimingPattern();
+ this.setupTypeInfo(true, maskPattern);
+ if (this.typeNumber >= 7) {
+ this.setupTypeNumber(true);
+ }
+ this.mapData(this.dataCache, maskPattern);
+ },
+ /**
+ * 璁剧疆浜岀淮鐮佺殑浣嶇疆鎺㈡祴鍥惧舰
+ * @param {num} row 鎺㈡祴鍥惧舰鐨勪腑蹇冩í鍧愭爣
+ * @param {num} col 鎺㈡祴鍥惧舰鐨勪腑蹇冪旱鍧愭爣
+ */
+ setupPositionProbePattern: function (row, col) {
+ for (var r = -1; r <= 7; r++) {
+ if (row + r <= -1 || this.moduleCount <= row + r) continue;
+ for (var c = -1; c <= 7; c++) {
+ if (col + c <= -1 || this.moduleCount <= col + c) continue;
+ if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+ this.modules[row + r][col + c] = true;
+ } else {
+ this.modules[row + r][col + c] = false;
+ }
+ }
+ }
+ },
+ /**
+ * 鍒涘缓浜岀淮鐮�
+ * @return {[type]} [description]
+ */
+ createQrcode: function () {
+ var minLostPoint = 0;
+ var pattern = 0;
+ var bestModules = null;
+ for (var i = 0; i < 8; i++) {
+ this.makeImpl(i);
+ var lostPoint = QRUtil.getLostPoint(this);
+ if (i == 0 || minLostPoint > lostPoint) {
+ minLostPoint = lostPoint;
+ pattern = i;
+ bestModules = this.modules;
+ }
+ }
+ this.modules = bestModules;
+ this.setupTypeInfo(false, pattern);
+ if (this.typeNumber >= 7) {
+ this.setupTypeNumber(false);
+ }
+ },
+ /**
+ * 璁剧疆瀹氫綅鍥惧舰
+ * @return {[type]} [description]
+ */
+ setupTimingPattern: function () {
+ for (var r = 8; r < this.moduleCount - 8; r++) {
+ if (this.modules[r][6] != null) {
+ continue;
+ }
+ this.modules[r][6] = (r % 2 == 0);
+ if (this.modules[6][r] != null) {
+ continue;
+ }
+ this.modules[6][r] = (r % 2 == 0);
+ }
+ },
+ /**
+ * 璁剧疆鐭鍥惧舰
+ * @return {[type]} [description]
+ */
+ setupPositionAdjustPattern: function () {
+ var pos = QRUtil.getPatternPosition(this.typeNumber);
+ for (var i = 0; i < pos.length; i++) {
+ for (var j = 0; j < pos.length; j++) {
+ var row = pos[i];
+ var col = pos[j];
+ if (this.modules[row][col] != null) {
+ continue;
+ }
+ for (var r = -2; r <= 2; r++) {
+ for (var c = -2; c <= 2; c++) {
+ if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) {
+ this.modules[row + r][col + c] = true;
+ } else {
+ this.modules[row + r][col + c] = false;
+ }
+ }
+ }
+ }
+ }
+ },
+ /**
+ * 璁剧疆鐗堟湰淇℃伅锛�7浠ヤ笂鐗堟湰鎵嶆湁锛�
+ * @param {bool} test 鏄惁澶勪簬鍒ゆ柇鏈�浣虫帺鑶滈樁娈�
+ * @return {[type]} [description]
+ */
+ setupTypeNumber: function (test) {
+ var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+ for (var i = 0; i < 18; i++) {
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+ this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+ }
+ },
+ /**
+ * 璁剧疆鏍煎紡淇℃伅锛堢籂閿欑瓑绾у拰鎺╄啘鐗堟湰锛�
+ * @param {bool} test
+ * @param {num} maskPattern 鎺╄啘鐗堟湰
+ * @return {}
+ */
+ setupTypeInfo: function (test, maskPattern) {
+ var data = (QRErrorCorrectLevel[this.errorCorrectLevel] << 3) | maskPattern;
+ var bits = QRUtil.getBCHTypeInfo(data);
+ // vertical
+ for (var i = 0; i < 15; i++) {
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ if (i < 6) {
+ this.modules[i][8] = mod;
+ } else if (i < 8) {
+ this.modules[i + 1][8] = mod;
+ } else {
+ this.modules[this.moduleCount - 15 + i][8] = mod;
+ }
+ // horizontal
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ if (i < 8) {
+ this.modules[8][this.moduleCount - i - 1] = mod;
+ } else if (i < 9) {
+ this.modules[8][15 - i - 1 + 1] = mod;
+ } else {
+ this.modules[8][15 - i - 1] = mod;
+ }
+ }
+ // fixed module
+ this.modules[this.moduleCount - 8][8] = (!test);
+ },
+ /**
+ * 鏁版嵁缂栫爜
+ * @return {[type]} [description]
+ */
+ createData: function () {
+ var buffer = new QRBitBuffer();
+ var lengthBits = this.typeNumber > 9 ? 16 : 8;
+ buffer.put(4, 4); //娣诲姞妯″紡
+ buffer.put(this.utf8bytes.length, lengthBits);
+ for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
+ buffer.put(this.utf8bytes[i], 8);
+ }
+ if (buffer.length + 4 <= this.totalDataCount * 8) {
+ buffer.put(0, 4);
+ }
+ // padding
+ while (buffer.length % 8 != 0) {
+ buffer.putBit(false);
+ }
+ // padding
+ while (true) {
+ if (buffer.length >= this.totalDataCount * 8) {
+ break;
+ }
+ buffer.put(QRCodeAlg.PAD0, 8);
+ if (buffer.length >= this.totalDataCount * 8) {
+ break;
+ }
+ buffer.put(QRCodeAlg.PAD1, 8);
+ }
+ return this.createBytes(buffer);
+ },
+ /**
+ * 绾犻敊鐮佺紪鐮�
+ * @param {buffer} buffer 鏁版嵁缂栫爜
+ * @return {[type]}
+ */
+ createBytes: function (buffer) {
+ var offset = 0;
+ var maxDcCount = 0;
+ var maxEcCount = 0;
+ var length = this.rsBlock.length / 3;
+ var rsBlocks = new Array();
+ for (var i = 0; i < length; i++) {
+ var count = this.rsBlock[i * 3 + 0];
+ var totalCount = this.rsBlock[i * 3 + 1];
+ var dataCount = this.rsBlock[i * 3 + 2];
+ for (var j = 0; j < count; j++) {
+ rsBlocks.push([dataCount, totalCount]);
+ }
+ }
+ var dcdata = new Array(rsBlocks.length);
+ var ecdata = new Array(rsBlocks.length);
+ for (var r = 0; r < rsBlocks.length; r++) {
+ var dcCount = rsBlocks[r][0];
+ var ecCount = rsBlocks[r][1] - dcCount;
+ maxDcCount = Math.max(maxDcCount, dcCount);
+ maxEcCount = Math.max(maxEcCount, ecCount);
+ dcdata[r] = new Array(dcCount);
+ for (var i = 0; i < dcdata[r].length; i++) {
+ dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+ }
+ offset += dcCount;
+ var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+ var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+ var modPoly = rawPoly.mod(rsPoly);
+ ecdata[r] = new Array(rsPoly.getLength() - 1);
+ for (var i = 0; i < ecdata[r].length; i++) {
+ var modIndex = i + modPoly.getLength() - ecdata[r].length;
+ ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+ }
+ }
+ var data = new Array(this.totalDataCount);
+ var index = 0;
+ for (var i = 0; i < maxDcCount; i++) {
+ for (var r = 0; r < rsBlocks.length; r++) {
+ if (i < dcdata[r].length) {
+ data[index++] = dcdata[r][i];
+ }
+ }
+ }
+ for (var i = 0; i < maxEcCount; i++) {
+ for (var r = 0; r < rsBlocks.length; r++) {
+ if (i < ecdata[r].length) {
+ data[index++] = ecdata[r][i];
+ }
+ }
+ }
+ return data;
+
+ },
+ /**
+ * 甯冪疆妯″潡锛屾瀯寤烘渶缁堜俊鎭�
+ * @param {} data
+ * @param {} maskPattern
+ * @return {}
+ */
+ mapData: function (data, maskPattern) {
+ var inc = -1;
+ var row = this.moduleCount - 1;
+ var bitIndex = 7;
+ var byteIndex = 0;
+ for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+ if (col == 6) col--;
+ while (true) {
+ for (var c = 0; c < 2; c++) {
+ if (this.modules[row][col - c] == null) {
+ var dark = false;
+ if (byteIndex < data.length) {
+ dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+ }
+ var mask = QRUtil.getMask(maskPattern, row, col - c);
+ if (mask) {
+ dark = !dark;
+ }
+ this.modules[row][col - c] = dark;
+ bitIndex--;
+ if (bitIndex == -1) {
+ byteIndex++;
+ bitIndex = 7;
+ }
+ }
+ }
+ row += inc;
+ if (row < 0 || this.moduleCount <= row) {
+ row -= inc;
+ inc = -inc;
+ break;
+ }
+ }
+ }
+ }
+ };
+ /**
+ * 濉厖瀛楁
+ */
+ QRCodeAlg.PAD0 = 0xEC;
+ QRCodeAlg.PAD1 = 0x11;
+ //---------------------------------------------------------------------
+ // 绾犻敊绛夌骇瀵瑰簲鐨勭紪鐮�
+ //---------------------------------------------------------------------
+ var QRErrorCorrectLevel = [1, 0, 3, 2];
+ //---------------------------------------------------------------------
+ // 鎺╄啘鐗堟湰
+ //---------------------------------------------------------------------
+ var QRMaskPattern = {
+ PATTERN000: 0,
+ PATTERN001: 1,
+ PATTERN010: 2,
+ PATTERN011: 3,
+ PATTERN100: 4,
+ PATTERN101: 5,
+ PATTERN110: 6,
+ PATTERN111: 7
+ };
+ //---------------------------------------------------------------------
+ // 宸ュ叿绫�
+ //---------------------------------------------------------------------
+ var QRUtil = {
+ /*
+ 姣忎釜鐗堟湰鐭鍥惧舰鐨勪綅缃�
+ */
+ PATTERN_POSITION_TABLE: [
+ [],
+ [6, 18],
+ [6, 22],
+ [6, 26],
+ [6, 30],
+ [6, 34],
+ [6, 22, 38],
+ [6, 24, 42],
+ [6, 26, 46],
+ [6, 28, 50],
+ [6, 30, 54],
+ [6, 32, 58],
+ [6, 34, 62],
+ [6, 26, 46, 66],
+ [6, 26, 48, 70],
+ [6, 26, 50, 74],
+ [6, 30, 54, 78],
+ [6, 30, 56, 82],
+ [6, 30, 58, 86],
+ [6, 34, 62, 90],
+ [6, 28, 50, 72, 94],
+ [6, 26, 50, 74, 98],
+ [6, 30, 54, 78, 102],
+ [6, 28, 54, 80, 106],
+ [6, 32, 58, 84, 110],
+ [6, 30, 58, 86, 114],
+ [6, 34, 62, 90, 118],
+ [6, 26, 50, 74, 98, 122],
+ [6, 30, 54, 78, 102, 126],
+ [6, 26, 52, 78, 104, 130],
+ [6, 30, 56, 82, 108, 134],
+ [6, 34, 60, 86, 112, 138],
+ [6, 30, 58, 86, 114, 142],
+ [6, 34, 62, 90, 118, 146],
+ [6, 30, 54, 78, 102, 126, 150],
+ [6, 24, 50, 76, 102, 128, 154],
+ [6, 28, 54, 80, 106, 132, 158],
+ [6, 32, 58, 84, 110, 136, 162],
+ [6, 26, 54, 82, 110, 138, 166],
+ [6, 30, 58, 86, 114, 142, 170]
+ ],
+ G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+ G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+ G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+ /*
+ BCH缂栫爜鏍煎紡淇℃伅
+ */
+ getBCHTypeInfo: function (data) {
+ var d = data << 10;
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+ d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+ }
+ return ((data << 10) | d) ^ QRUtil.G15_MASK;
+ },
+ /*
+ BCH缂栫爜鐗堟湰淇℃伅
+ */
+ getBCHTypeNumber: function (data) {
+ var d = data << 12;
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+ d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+ }
+ return (data << 12) | d;
+ },
+ /*
+ 鑾峰彇BCH浣嶄俊鎭�
+ */
+ getBCHDigit: function (data) {
+ var digit = 0;
+ while (data != 0) {
+ digit++;
+ data >>>= 1;
+ }
+ return digit;
+ },
+ /*
+ 鑾峰彇鐗堟湰瀵瑰簲鐨勭煫姝e浘褰綅缃�
+ */
+ getPatternPosition: function (typeNumber) {
+ return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+ },
+ /*
+ 鎺╄啘绠楁硶
+ */
+ getMask: function (maskPattern, i, j) {
+ switch (maskPattern) {
+ case QRMaskPattern.PATTERN000:
+ return (i + j) % 2 == 0;
+ case QRMaskPattern.PATTERN001:
+ return i % 2 == 0;
+ case QRMaskPattern.PATTERN010:
+ return j % 3 == 0;
+ case QRMaskPattern.PATTERN011:
+ return (i + j) % 3 == 0;
+ case QRMaskPattern.PATTERN100:
+ return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+ case QRMaskPattern.PATTERN101:
+ return (i * j) % 2 + (i * j) % 3 == 0;
+ case QRMaskPattern.PATTERN110:
+ return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+ case QRMaskPattern.PATTERN111:
+ return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+ default:
+ throw new Error("bad maskPattern:" + maskPattern);
+ }
+ },
+ /*
+ 鑾峰彇RS鐨勭籂閿欏椤瑰紡
+ */
+ getErrorCorrectPolynomial: function (errorCorrectLength) {
+ var a = new QRPolynomial([1], 0);
+ for (var i = 0; i < errorCorrectLength; i++) {
+ a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+ }
+ return a;
+ },
+ /*
+ 鑾峰彇璇勪环
+ */
+ getLostPoint: function (qrCode) {
+ var moduleCount = qrCode.getModuleCount(),
+ lostPoint = 0,
+ darkCount = 0;
+ for (var row = 0; row < moduleCount; row++) {
+ var sameCount = 0;
+ var head = qrCode.modules[row][0];
+ for (var col = 0; col < moduleCount; col++) {
+ var current = qrCode.modules[row][col];
+ //level 3 璇勪环
+ if (col < moduleCount - 6) {
+ if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
+ if (col < moduleCount - 10) {
+ if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
+ lostPoint += 40;
+ }
+ } else if (col > 3) {
+ if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
+ lostPoint += 40;
+ }
+ }
+ }
+ }
+ //level 2 璇勪环
+ if ((row < moduleCount - 1) && (col < moduleCount - 1)) {
+ var count = 0;
+ if (current) count++;
+ if (qrCode.modules[row + 1][col]) count++;
+ if (qrCode.modules[row][col + 1]) count++;
+ if (qrCode.modules[row + 1][col + 1]) count++;
+ if (count == 0 || count == 4) {
+ lostPoint += 3;
+ }
+ }
+ //level 1 璇勪环
+ if (head ^ current) {
+ sameCount++;
+ } else {
+ head = current;
+ if (sameCount >= 5) {
+ lostPoint += (3 + sameCount - 5);
+ }
+ sameCount = 1;
+ }
+ //level 4 璇勪环
+ if (current) {
+ darkCount++;
+ }
+ }
+ }
+ for (var col = 0; col < moduleCount; col++) {
+ var sameCount = 0;
+ var head = qrCode.modules[0][col];
+ for (var row = 0; row < moduleCount; row++) {
+ var current = qrCode.modules[row][col];
+ //level 3 璇勪环
+ if (row < moduleCount - 6) {
+ if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
+ if (row < moduleCount - 10) {
+ if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
+ lostPoint += 40;
+ }
+ } else if (row > 3) {
+ if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
+ lostPoint += 40;
+ }
+ }
+ }
+ }
+ //level 1 璇勪环
+ if (head ^ current) {
+ sameCount++;
+ } else {
+ head = current;
+ if (sameCount >= 5) {
+ lostPoint += (3 + sameCount - 5);
+ }
+ sameCount = 1;
+ }
+ }
+ }
+ // LEVEL4
+ var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+ lostPoint += ratio * 10;
+ return lostPoint;
+ }
+
+ };
+ //---------------------------------------------------------------------
+ // QRMath浣跨敤鐨勬暟瀛﹀伐鍏�
+ //---------------------------------------------------------------------
+ var QRMath = {
+ /*
+ 灏唍杞寲涓篴^m
+ */
+ glog: function (n) {
+ if (n < 1) {
+ throw new Error("glog(" + n + ")");
+ }
+ return QRMath.LOG_TABLE[n];
+ },
+ /*
+ 灏哸^m杞寲涓簄
+ */
+ gexp: function (n) {
+ while (n < 0) {
+ n += 255;
+ }
+ while (n >= 256) {
+ n -= 255;
+ }
+ return QRMath.EXP_TABLE[n];
+ },
+ EXP_TABLE: new Array(256),
+ LOG_TABLE: new Array(256)
+
+ };
+ for (var i = 0; i < 8; i++) {
+ QRMath.EXP_TABLE[i] = 1 << i;
+ }
+ for (var i = 8; i < 256; i++) {
+ QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
+ }
+ for (var i = 0; i < 255; i++) {
+ QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+ }
+ //---------------------------------------------------------------------
+ // QRPolynomial 澶氶」寮�
+ //---------------------------------------------------------------------
+ /**
+ * 澶氶」寮忕被
+ * @param {Array} num 绯绘暟
+ * @param {num} shift a^shift
+ */
+ function QRPolynomial(num, shift) {
+ if (num.length == undefined) {
+ throw new Error(num.length + "/" + shift);
+ }
+ var offset = 0;
+ while (offset < num.length && num[offset] == 0) {
+ offset++;
+ }
+ this.num = new Array(num.length - offset + shift);
+ for (var i = 0; i < num.length - offset; i++) {
+ this.num[i] = num[i + offset];
+ }
+ }
+ QRPolynomial.prototype = {
+ get: function (index) {
+ return this.num[index];
+ },
+ getLength: function () {
+ return this.num.length;
+ },
+ /**
+ * 澶氶」寮忎箻娉�
+ * @param {QRPolynomial} e 琚箻澶氶」寮�
+ * @return {[type]} [description]
+ */
+ multiply: function (e) {
+ var num = new Array(this.getLength() + e.getLength() - 1);
+ for (var i = 0; i < this.getLength(); i++) {
+ for (var j = 0; j < e.getLength(); j++) {
+ num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+ }
+ }
+ return new QRPolynomial(num, 0);
+ },
+ /**
+ * 澶氶」寮忔ā杩愮畻
+ * @param {QRPolynomial} e 妯″椤瑰紡
+ * @return {}
+ */
+ mod: function (e) {
+ var tl = this.getLength(),
+ el = e.getLength();
+ if (tl - el < 0) {
+ return this;
+ }
+ var num = new Array(tl);
+ for (var i = 0; i < tl; i++) {
+ num[i] = this.get(i);
+ }
+ while (num.length >= el) {
+ var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
+
+ for (var i = 0; i < e.getLength(); i++) {
+ num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+ }
+ while (num[0] == 0) {
+ num.shift();
+ }
+ }
+ return new QRPolynomial(num, 0);
+ }
+ };
+
+ //---------------------------------------------------------------------
+ // RS_BLOCK_TABLE
+ //---------------------------------------------------------------------
+ /*
+ 浜岀淮鐮佸悇涓増鏈俊鎭痆鍧楁暟, 姣忓潡涓殑鏁版嵁鍧楁暟, 姣忓潡涓殑淇℃伅鍧楁暟]
+ */
+ var RS_BLOCK_TABLE = [
+ // L
+ // M
+ // Q
+ // H
+ // 1
+ [1, 26, 19],
+ [1, 26, 16],
+ [1, 26, 13],
+ [1, 26, 9],
+
+ // 2
+ [1, 44, 34],
+ [1, 44, 28],
+ [1, 44, 22],
+ [1, 44, 16],
+
+ // 3
+ [1, 70, 55],
+ [1, 70, 44],
+ [2, 35, 17],
+ [2, 35, 13],
+
+ // 4
+ [1, 100, 80],
+ [2, 50, 32],
+ [2, 50, 24],
+ [4, 25, 9],
+
+ // 5
+ [1, 134, 108],
+ [2, 67, 43],
+ [2, 33, 15, 2, 34, 16],
+ [2, 33, 11, 2, 34, 12],
+
+ // 6
+ [2, 86, 68],
+ [4, 43, 27],
+ [4, 43, 19],
+ [4, 43, 15],
+
+ // 7
+ [2, 98, 78],
+ [4, 49, 31],
+ [2, 32, 14, 4, 33, 15],
+ [4, 39, 13, 1, 40, 14],
+
+ // 8
+ [2, 121, 97],
+ [2, 60, 38, 2, 61, 39],
+ [4, 40, 18, 2, 41, 19],
+ [4, 40, 14, 2, 41, 15],
+
+ // 9
+ [2, 146, 116],
+ [3, 58, 36, 2, 59, 37],
+ [4, 36, 16, 4, 37, 17],
+ [4, 36, 12, 4, 37, 13],
+
+ // 10
+ [2, 86, 68, 2, 87, 69],
+ [4, 69, 43, 1, 70, 44],
+ [6, 43, 19, 2, 44, 20],
+ [6, 43, 15, 2, 44, 16],
+
+ // 11
+ [4, 101, 81],
+ [1, 80, 50, 4, 81, 51],
+ [4, 50, 22, 4, 51, 23],
+ [3, 36, 12, 8, 37, 13],
+
+ // 12
+ [2, 116, 92, 2, 117, 93],
+ [6, 58, 36, 2, 59, 37],
+ [4, 46, 20, 6, 47, 21],
+ [7, 42, 14, 4, 43, 15],
+
+ // 13
+ [4, 133, 107],
+ [8, 59, 37, 1, 60, 38],
+ [8, 44, 20, 4, 45, 21],
+ [12, 33, 11, 4, 34, 12],
+
+ // 14
+ [3, 145, 115, 1, 146, 116],
+ [4, 64, 40, 5, 65, 41],
+ [11, 36, 16, 5, 37, 17],
+ [11, 36, 12, 5, 37, 13],
+
+ // 15
+ [5, 109, 87, 1, 110, 88],
+ [5, 65, 41, 5, 66, 42],
+ [5, 54, 24, 7, 55, 25],
+ [11, 36, 12],
+
+ // 16
+ [5, 122, 98, 1, 123, 99],
+ [7, 73, 45, 3, 74, 46],
+ [15, 43, 19, 2, 44, 20],
+ [3, 45, 15, 13, 46, 16],
+
+ // 17
+ [1, 135, 107, 5, 136, 108],
+ [10, 74, 46, 1, 75, 47],
+ [1, 50, 22, 15, 51, 23],
+ [2, 42, 14, 17, 43, 15],
+
+ // 18
+ [5, 150, 120, 1, 151, 121],
+ [9, 69, 43, 4, 70, 44],
+ [17, 50, 22, 1, 51, 23],
+ [2, 42, 14, 19, 43, 15],
+
+ // 19
+ [3, 141, 113, 4, 142, 114],
+ [3, 70, 44, 11, 71, 45],
+ [17, 47, 21, 4, 48, 22],
+ [9, 39, 13, 16, 40, 14],
+
+ // 20
+ [3, 135, 107, 5, 136, 108],
+ [3, 67, 41, 13, 68, 42],
+ [15, 54, 24, 5, 55, 25],
+ [15, 43, 15, 10, 44, 16],
+
+ // 21
+ [4, 144, 116, 4, 145, 117],
+ [17, 68, 42],
+ [17, 50, 22, 6, 51, 23],
+ [19, 46, 16, 6, 47, 17],
+
+ // 22
+ [2, 139, 111, 7, 140, 112],
+ [17, 74, 46],
+ [7, 54, 24, 16, 55, 25],
+ [34, 37, 13],
+
+ // 23
+ [4, 151, 121, 5, 152, 122],
+ [4, 75, 47, 14, 76, 48],
+ [11, 54, 24, 14, 55, 25],
+ [16, 45, 15, 14, 46, 16],
+
+ // 24
+ [6, 147, 117, 4, 148, 118],
+ [6, 73, 45, 14, 74, 46],
+ [11, 54, 24, 16, 55, 25],
+ [30, 46, 16, 2, 47, 17],
+
+ // 25
+ [8, 132, 106, 4, 133, 107],
+ [8, 75, 47, 13, 76, 48],
+ [7, 54, 24, 22, 55, 25],
+ [22, 45, 15, 13, 46, 16],
+
+ // 26
+ [10, 142, 114, 2, 143, 115],
+ [19, 74, 46, 4, 75, 47],
+ [28, 50, 22, 6, 51, 23],
+ [33, 46, 16, 4, 47, 17],
+
+ // 27
+ [8, 152, 122, 4, 153, 123],
+ [22, 73, 45, 3, 74, 46],
+ [8, 53, 23, 26, 54, 24],
+ [12, 45, 15, 28, 46, 16],
+
+ // 28
+ [3, 147, 117, 10, 148, 118],
+ [3, 73, 45, 23, 74, 46],
+ [4, 54, 24, 31, 55, 25],
+ [11, 45, 15, 31, 46, 16],
+
+ // 29
+ [7, 146, 116, 7, 147, 117],
+ [21, 73, 45, 7, 74, 46],
+ [1, 53, 23, 37, 54, 24],
+ [19, 45, 15, 26, 46, 16],
+
+ // 30
+ [5, 145, 115, 10, 146, 116],
+ [19, 75, 47, 10, 76, 48],
+ [15, 54, 24, 25, 55, 25],
+ [23, 45, 15, 25, 46, 16],
+
+ // 31
+ [13, 145, 115, 3, 146, 116],
+ [2, 74, 46, 29, 75, 47],
+ [42, 54, 24, 1, 55, 25],
+ [23, 45, 15, 28, 46, 16],
+
+ // 32
+ [17, 145, 115],
+ [10, 74, 46, 23, 75, 47],
+ [10, 54, 24, 35, 55, 25],
+ [19, 45, 15, 35, 46, 16],
+
+ // 33
+ [17, 145, 115, 1, 146, 116],
+ [14, 74, 46, 21, 75, 47],
+ [29, 54, 24, 19, 55, 25],
+ [11, 45, 15, 46, 46, 16],
+
+ // 34
+ [13, 145, 115, 6, 146, 116],
+ [14, 74, 46, 23, 75, 47],
+ [44, 54, 24, 7, 55, 25],
+ [59, 46, 16, 1, 47, 17],
+
+ // 35
+ [12, 151, 121, 7, 152, 122],
+ [12, 75, 47, 26, 76, 48],
+ [39, 54, 24, 14, 55, 25],
+ [22, 45, 15, 41, 46, 16],
+
+ // 36
+ [6, 151, 121, 14, 152, 122],
+ [6, 75, 47, 34, 76, 48],
+ [46, 54, 24, 10, 55, 25],
+ [2, 45, 15, 64, 46, 16],
+
+ // 37
+ [17, 152, 122, 4, 153, 123],
+ [29, 74, 46, 14, 75, 47],
+ [49, 54, 24, 10, 55, 25],
+ [24, 45, 15, 46, 46, 16],
+
+ // 38
+ [4, 152, 122, 18, 153, 123],
+ [13, 74, 46, 32, 75, 47],
+ [48, 54, 24, 14, 55, 25],
+ [42, 45, 15, 32, 46, 16],
+
+ // 39
+ [20, 147, 117, 4, 148, 118],
+ [40, 75, 47, 7, 76, 48],
+ [43, 54, 24, 22, 55, 25],
+ [10, 45, 15, 67, 46, 16],
+
+ // 40
+ [19, 148, 118, 6, 149, 119],
+ [18, 75, 47, 31, 76, 48],
+ [34, 54, 24, 34, 55, 25],
+ [20, 45, 15, 61, 46, 16]
+ ];
+
+ /**
+ * 鏍规嵁鏁版嵁鑾峰彇瀵瑰簲鐗堟湰
+ * @return {[type]} [description]
+ */
+ QRCodeAlg.prototype.getRightType = function () {
+ for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
+ var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
+ if (rsBlock == undefined) {
+ throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
+ }
+ var length = rsBlock.length / 3;
+ var totalDataCount = 0;
+ for (var i = 0; i < length; i++) {
+ var count = rsBlock[i * 3 + 0];
+ var dataCount = rsBlock[i * 3 + 2];
+ totalDataCount += dataCount * count;
+ }
+ var lengthBytes = typeNumber > 9 ? 2 : 1;
+ if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
+ this.typeNumber = typeNumber;
+ this.rsBlock = rsBlock;
+ this.totalDataCount = totalDataCount;
+ break;
+ }
+ }
+ };
+
+ //---------------------------------------------------------------------
+ // QRBitBuffer
+ //---------------------------------------------------------------------
+ function QRBitBuffer() {
+ this.buffer = new Array();
+ this.length = 0;
+ }
+ QRBitBuffer.prototype = {
+ get: function (index) {
+ var bufIndex = Math.floor(index / 8);
+ return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1);
+ },
+ put: function (num, length) {
+ for (var i = 0; i < length; i++) {
+ this.putBit(((num >>> (length - i - 1)) & 1));
+ }
+ },
+ putBit: function (bit) {
+ var bufIndex = Math.floor(this.length / 8);
+ if (this.buffer.length <= bufIndex) {
+ this.buffer.push(0);
+ }
+ if (bit) {
+ this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+ }
+ this.length++;
+ }
+ };
+
+
+
+ // xzedit
+ let qrcodeAlgObjCache = [];
+ /**
+ * 浜岀淮鐮佹瀯閫犲嚱鏁帮紝涓昏鐢ㄤ簬缁樺埗
+ * @param {鍙傛暟鍒楄〃} opt 浼犻�掑弬鏁�
+ * @return {}
+ */
+ QRCode = function (opt) {
+ //璁剧疆榛樿鍙傛暟
+ this.options = {
+ text: '',
+ size: 256,
+ correctLevel: 3,
+ background: '#ffffff',
+ foreground: '#000000',
+ pdground: '#000000',
+ image: '',
+ imageSize: 30,
+ canvasId: opt.canvasId,
+ context: opt.context,
+ usingComponents: opt.usingComponents,
+ showLoading: opt.showLoading,
+ loadingText: opt.loadingText,
+ };
+ if (typeof opt === 'string') { // 鍙紪鐮丄SCII瀛楃涓�
+ opt = {
+ text: opt
+ };
+ }
+ if (opt) {
+ for (var i in opt) {
+ this.options[i] = opt[i];
+ }
+ }
+ //浣跨敤QRCodeAlg鍒涘缓浜岀淮鐮佺粨鏋�
+ var qrCodeAlg = null;
+ for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
+ if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
+ qrCodeAlg = qrcodeAlgObjCache[i].obj;
+ break;
+ }
+ }
+ if (i == l) {
+ qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
+ qrcodeAlgObjCache.push({
+ text: this.options.text,
+ correctLevel: this.options.correctLevel,
+ obj: qrCodeAlg
+ });
+ }
+ /**
+ * 璁$畻鐭╅樀鐐圭殑鍓嶆櫙鑹�
+ * @param {Obj} config
+ * @param {Number} config.row 鐐箈鍧愭爣
+ * @param {Number} config.col 鐐箉鍧愭爣
+ * @param {Number} config.count 鐭╅樀澶у皬
+ * @param {Number} config.options 缁勪欢鐨刼ptions
+ * @return {String}
+ */
+ let getForeGround = function (config) {
+ var options = config.options;
+ if (options.pdground && (
+ (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+ (config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+ (config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+ )) {
+ return options.pdground;
+ }
+ return options.foreground;
+ }
+ // 鍒涘缓canvas
+ let createCanvas = function (options) {
+ if (options.showLoading) {
+ uni.showLoading({
+ title: options.loadingText,
+ mask: true
+ });
+ }
+ var ctx = uni.createCanvasContext(options.canvasId, options.context);
+ var count = qrCodeAlg.getModuleCount();
+ var ratioSize = options.size;
+ var ratioImgSize = options.imageSize;
+ //璁$畻姣忎釜鐐圭殑闀垮
+ var tileW = (ratioSize / count).toPrecision(4);
+ var tileH = (ratioSize / count).toPrecision(4);
+ //缁樺埗
+ for (var row = 0; row < count; row++) {
+ for (var col = 0; col < count; col++) {
+ var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW));
+ var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW));
+ var foreground = getForeGround({
+ row: row,
+ col: col,
+ count: count,
+ options: options
+ });
+ ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
+ ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
+ }
+ }
+ if (options.image) {
+ var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+ var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+ drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true)
+ ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
+ // 鐢诲渾瑙掔煩褰�
+ function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
+ ctxi.setLineWidth(lineWidth);
+ ctxi.setFillStyle(options.background);
+ ctxi.setStrokeStyle(options.background);
+ ctxi.beginPath(); // draw top and top right corner
+ ctxi.moveTo(x + r, y);
+ ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
+ ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
+ ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
+ ctxi.arcTo(x, y, x + r, y, r);
+ ctxi.closePath();
+ if (fill) {
+ ctxi.fill();
+ }
+ if (stroke) {
+ ctxi.stroke();
+ }
+ }
+ }
+ setTimeout(() => {
+ ctx.draw(true, () => {
+ // 淇濆瓨鍒颁复鏃跺尯鍩�
+ setTimeout(() => {
+ uni.canvasToTempFilePath({
+ width: options.width,
+ height: options.height,
+ destWidth: options.width,
+ destHeight: options.height,
+ canvasId: options.canvasId,
+ quality: Number(1),
+ success: function (res) {
+ if (options.cbResult) {
+ options.cbResult(res.tempFilePath)
+ }
+ },
+ fail: function (res) {
+ if (options.cbResult) {
+ options.cbResult(res)
+ }
+ },
+ complete: function () {
+ if (options.showLoading){
+ uni.hideLoading();
+ }
+ },
+ }, options.context);
+ }, options.text.length + 100);
+ });
+ }, options.usingComponents ? 0 : 150);
+ }
+ createCanvas(this.options);
+ // 绌哄垽瀹�
+ let empty = function (v) {
+ let tp = typeof v,
+ rt = false;
+ if (tp == "number" && String(v) == "") {
+ rt = true
+ } else if (tp == "undefined") {
+ rt = true
+ } else if (tp == "object") {
+ if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+ } else if (tp == "string") {
+ if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+ } else if (tp == "function") {
+ rt = false
+ }
+ return rt
+ }
+ };
+ QRCode.prototype.clear = function (fn) {
+ var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context)
+ ctx.clearRect(0, 0, this.options.size, this.options.size)
+ ctx.draw(false, () => {
+ if (fn) {
+ fn()
+ }
+ })
+ };
+})()
+
+export default QRCode
\ No newline at end of file
diff --git a/h5/components/tki-qrcode/tki-qrcode.vue b/h5/components/tki-qrcode/tki-qrcode.vue
new file mode 100644
index 0000000..29f88b8
--- /dev/null
+++ b/h5/components/tki-qrcode/tki-qrcode.vue
@@ -0,0 +1,210 @@
+<template xlang="wxml" minapp="mpvue">
+ <view class="tki-qrcode">
+ <!-- #ifndef MP-ALIPAY -->
+ <canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
+ <!-- #endif -->
+ <!-- #ifdef MP-ALIPAY -->
+ <canvas :id="cid" :width="cpSize" :height="cpSize" class="tki-qrcode-canvas" />
+ <!-- #endif -->
+ <image v-show="show" :src="result" :style="{width:cpSize+'px',height:cpSize+'px'}" />
+ </view>
+</template>
+
+<script>
+import QRCode from "./qrcode.js"
+let qrcode
+export default {
+ name: "tki-qrcode",
+ props: {
+ cid: {
+ type: String,
+ default: 'tki-qrcode-canvas'
+ },
+ size: {
+ type: Number,
+ default: 200
+ },
+ unit: {
+ type: String,
+ default: 'upx'
+ },
+ show: {
+ type: Boolean,
+ default: true
+ },
+ val: {
+ type: String,
+ default: ''
+ },
+ background: {
+ type: String,
+ default: '#ffffff'
+ },
+ foreground: {
+ type: String,
+ default: '#000000'
+ },
+ pdground: {
+ type: String,
+ default: '#000000'
+ },
+ icon: {
+ type: String,
+ default: ''
+ },
+ iconSize: {
+ type: Number,
+ default: 40
+ },
+ lv: {
+ type: Number,
+ default: 3
+ },
+ onval: {
+ type: Boolean,
+ default: false
+ },
+ loadMake: {
+ type: Boolean,
+ default: false
+ },
+ usingComponents: {
+ type: Boolean,
+ default: true
+ },
+ showLoading: {
+ type: Boolean,
+ default: true
+ },
+ loadingText: {
+ type: String,
+ default: '浜岀淮鐮佺敓鎴愪腑'
+ },
+ },
+ data() {
+ return {
+ result: '',
+ }
+ },
+ methods: {
+ _makeCode() {
+ let that = this
+ if (!this._empty(this.val)) {
+ qrcode = new QRCode({
+ context: that, // 涓婁笅鏂囩幆澧�
+ canvasId:that.cid, // canvas-id
+ usingComponents: that.usingComponents, // 鏄惁鏄嚜瀹氫箟缁勪欢
+ showLoading: that.showLoading, // 鏄惁鏄剧ずloading
+ loadingText: that.loadingText, // loading鏂囧瓧
+ text: that.val, // 鐢熸垚鍐呭
+ size: that.cpSize, // 浜岀淮鐮佸ぇ灏�
+ background: that.background, // 鑳屾櫙鑹�
+ foreground: that.foreground, // 鍓嶆櫙鑹�
+ pdground: that.pdground, // 瀹氫綅瑙掔偣棰滆壊
+ correctLevel: that.lv, // 瀹归敊绾у埆
+ image: that.icon, // 浜岀淮鐮佸浘鏍�
+ imageSize: that.iconSize,// 浜岀淮鐮佸浘鏍囧ぇ灏�
+ cbResult: function (res) { // 鐢熸垚浜岀淮鐮佺殑鍥炶皟
+ that._result(res)
+ },
+ });
+ } else {
+ uni.showToast({
+ title: '浜岀淮鐮佸唴瀹逛笉鑳戒负绌�',
+ icon: 'none',
+ duration: 2000
+ });
+ }
+ },
+ _clearCode() {
+ this._result('')
+ qrcode.clear()
+ },
+ _saveCode() {
+ let that = this;
+ if (this.result != "") {
+ uni.saveImageToPhotosAlbum({
+ filePath: that.result,
+ success: function () {
+ uni.showToast({
+ title: '浜岀淮鐮佷繚瀛樻垚鍔�',
+ icon: 'success',
+ duration: 2000
+ });
+ }
+ });
+ }
+ },
+ _result(res) {
+ this.result = res;
+ this.$emit('result', res)
+ },
+ _empty(v) {
+ let tp = typeof v,
+ rt = false;
+ if (tp == "number" && String(v) == "") {
+ rt = true
+ } else if (tp == "undefined") {
+ rt = true
+ } else if (tp == "object") {
+ if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+ } else if (tp == "string") {
+ if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+ } else if (tp == "function") {
+ rt = false
+ }
+ return rt
+ }
+ },
+ watch: {
+ size: function (n, o) {
+ if (n != o && !this._empty(n)) {
+ this.cSize = n
+ if (!this._empty(this.val)) {
+ setTimeout(() => {
+ this._makeCode()
+ }, 100);
+ }
+ }
+ },
+ val: function (n, o) {
+ if (this.onval) {
+ if (n != o && !this._empty(n)) {
+ setTimeout(() => {
+ this._makeCode()
+ }, 0);
+ }
+ }
+ }
+ },
+ computed: {
+ cpSize() {
+ if(this.unit == "upx"){
+ return uni.upx2px(this.size)
+ }else{
+ return this.size
+ }
+ }
+ },
+ mounted: function () {
+ if (this.loadMake) {
+ if (!this._empty(this.val)) {
+ setTimeout(() => {
+ this._makeCode()
+ }, 0);
+ }
+ }
+ },
+}
+</script>
+<style>
+.tki-qrcode {
+ position: relative;
+}
+.tki-qrcode-canvas {
+ position: fixed;
+ top: -99999upx;
+ left: -99999upx;
+ z-index: -99999;
+}
+</style>
diff --git a/h5/components/you-scroll.vue b/h5/components/you-scroll.vue
new file mode 100644
index 0000000..821f963
--- /dev/null
+++ b/h5/components/you-scroll.vue
@@ -0,0 +1,271 @@
+<template>
+ <view class="you-scroll" ref="youScroll">
+ <view class="pullDown" :style="{ transform: 'translateY('+translateY+'px)', transition: isDown ? '0s' : '0.3s' }">
+ <slot name="pullDown">
+ <!-- <img src="../static/pullDown.jpg" :class="{'down-icon': true,'animate': pullDownStatus == 3}"></img> -->
+ <span>
+ <block v-if="pullDownStatus == 1">{{downPullToRefresh}}</block>
+ <block v-if="pullDownStatus == 2">{{downReleaseToRefresh}}</block>
+ <block v-if="pullDownStatus == 3">{{downRefreshing}}</block>
+ </span>
+ </slot>
+ </view>
+ <scroll-view class="you-scroll-inner" ref="youScrollInner" :scroll-top="scrollToTop" scroll-with-animation scroll-y :style="{ transform: 'translateY('+translateY+'px)', transition: isDown ? '0s' : 'transform 0.3s' }"
+ @touchstart="startFn" @touchmove="moveFn" @touchend="endFn" @touchcancel="endFn" @scroll="scroll">
+ <view class="you-scroll-content">
+ <slot></slot>
+ </view>
+ </scroll-view>
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ scrollToTop: 0,
+ scrollTop: 0,
+ oldTop: 0,
+ sPageY: 0,
+ mPageY: 0,
+ ePageY: 0,
+ translateY: 0,
+ pullDownStatus: 1, // 1锛氫笅鎷夊埛鏂� 2锛氭澗寮�鍒锋柊 3锛氬埛鏂颁腑
+ isDown: false
+ };
+ },
+ props: {
+ pullDownDistance: {
+ type: Number,
+ default: 50 // 涓嬫媺鍒锋柊璺濈
+ },
+ reachBottomDistance: {
+ type: Number,
+ default: 30 // 涓婃媺鍔犺浇璺濈
+ },
+ downPullToRefresh: {
+ type: String,
+ default: '涓嬫媺鍒锋柊'
+ },
+ downReleaseToRefresh: {
+ type: String,
+ default: '鏉惧紑鍒锋柊'
+ },
+ downRefreshing: {
+ type: String,
+ default: '鍒锋柊涓��'
+ },
+ },
+ methods: {
+ startFn(e) {
+ this.isDown = true;
+ this.sPageY = e.changedTouches[0].pageY;
+ this.pointY = this.translateY;
+ },
+ moveFn(e) {
+ let view = uni.createSelectorQuery().in(this).select(".you-scroll-inner");
+ view.fields({
+ size: true,
+ scrollOffset: true
+ }, data => {
+ this.scrollTop = data.scrollTop;
+ this.mPageY = e.changedTouches[0].pageY;
+ if (this.scrollTop <= 0) {
+ let translateY = ((this.mPageY - this.sPageY) / 2) + this.pointY;
+ this.translateY = (translateY < 0 ? 0 : translateY);
+
+ if(this.pullDownStatus != 3) {
+ if(this.translateY < this.pullDownDistance) {
+ this.pullDownStatus = 1;
+ } else if(this.translateY >= this.pullDownDistance) {
+ this.pullDownStatus = 2;
+ }
+ }
+ }
+ }).exec();
+
+ },
+ endFn(e) {
+ this.isDown = false;
+ this.ePageY = e.changedTouches[0].pageY;
+ setTimeout(() => {
+ this.translateY = this.translateY >= this.pullDownDistance ? this.pullDownDistance : 0;
+ if(this.pullDownStatus == 2) { // 寮�濮嬪埛鏂�
+ this.pullDownStatus = 3;
+ this.$emit('onPullDown',this.endPullDown);
+ }
+ },100)
+
+
+ },
+ endPullDown(mm) {
+ if(this.timeout) clearTimeout(this.timeout);
+ this.timeout = setTimeout(() => {
+ this.translateY = 0;
+ this.pullDownStatus = 1;
+ }, mm || 0);
+ },
+ prevent(e) {
+ if(this.translateY > 0) {
+ e.preventDefault();
+ }
+ },
+ scroll(e) {
+ this.$emit('onScroll',e);
+ this.oldTop = e.detail.scrollTop;
+
+ if(this.timeout) clearTimeout(this.timeout);
+ this.timeout = setTimeout(() => {
+ this.scrolltolower(e);
+ },20);
+ },
+ scrolltolower(e) {
+ let view = uni.createSelectorQuery().in(this).select(".you-scroll-inner");
+ view.fields({
+ size: true,
+ scrollOffset: true
+ }, data => {
+ if(data.scrollTop >= (e.detail.scrollHeight - data.height - this.reachBottomDistance)) {
+ this.$emit('onLoadMore',e);
+ }
+ }).exec();
+
+ },
+ isWeixinCient(){
+ var ua = navigator.userAgent.toLowerCase();
+ if(ua.match(/MicroMessenger/i)=="micromessenger") {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ goTop(top) {
+ this.scrollToTop = this.oldTop;
+ this.$nextTick(function() {
+ this.scrollToTop = top || 0;
+ });
+ }
+ },
+ mounted() {
+ // #ifdef H5
+ if(this.isWeixinCient()) {
+ document.body.addEventListener('touchmove', this.prevent);
+ }
+ // #endif
+ },
+ destroyed() {
+ // #ifdef H5
+ if(this.isWeixinCient()) {
+ document.body.removeEventListener('touchmove', this.prevent);
+ }
+ // #endif
+ }
+ }
+</script>
+
+<style scoped>
+ .you-scroll {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ position: relative;
+ // background-color: #eee;
+ }
+ .you-scroll .pullDown {
+ width: 100%;
+ height: 40px;
+ line-height: 50px;
+ text-align: center;
+ font-size: 14px;
+ overflow: hidden;
+ transform: translateY(-100%);
+ position: absolute;
+ top: -40px;
+ left: 0;
+ }
+ .you-scroll .pullDown .down-icon {
+ width: 40px;
+ height: 32px;
+ display: inline-block;
+ vertical-align: middle;
+ }
+ .you-scroll .pullDown .animate {
+ -webkit-animation: scaleIcon 1s infinite linear;
+ -moz-animation: scaleIcon 1s infinite linear;
+ -ms-animation: scaleIcon 1s infinite linear;
+ animation: scaleIcon 1s infinite linear;
+ }
+ .you-scroll .pullDown span {
+ white-space: nowrap;
+ overflow: hidden;
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ .you-scroll .you-scroll-inner {
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ position: relative;
+ }
+ .you-scroll-content {
+ overflow: hidden;
+ }
+
+ @-webkit-keyframes scaleIcon {
+ 0% {
+ transform: scaleY(1);
+ }
+ 40% {
+ transform: scaleY(0.8);
+ }
+ 80% {
+ transform: scaleY(0.9);
+ }
+ 100% {
+ transform: scaleY(1);
+ }
+ }
+ @-moz-keyframes scaleIcon {
+ 0% {
+ transform: scaleY(1);
+ }
+ 40% {
+ transform: scaleY(0.8);
+ }
+ 80% {
+ transform: scaleY(0.9);
+ }
+ 100% {
+ transform: scaleY(1);
+ }
+ }
+ @-ms-keyframes scaleIcon {
+ 0% {
+ transform: scaleY(1);
+ }
+ 40% {
+ transform: scaleY(0.8);
+ }
+ 80% {
+ transform: scaleY(0.9);
+ }
+ 100% {
+ transform: scaleY(1);
+ }
+ }
+ @keyframes scaleIcon {
+ 0% {
+ transform: scaleY(1);
+ }
+ 40% {
+ transform: scaleY(0.8);
+ }
+ 80% {
+ transform: scaleY(0.9);
+ }
+ 100% {
+ transform: scaleY(1);
+ }
+ }
+</style>
diff --git a/h5/main.js b/h5/main.js
index 2d18e67..9fdec70 100644
--- a/h5/main.js
+++ b/h5/main.js
@@ -5,17 +5,24 @@
import uView from "uview-ui"
import store from './store/index.js'
+import Tabbar from '@/components/tarbar.vue'
+import navigation from '@/components/Header.vue'
+
Vue.config.productionTip = false
-Vue.prototype.$baseUrl = 'api/';
+
// Vue.prototype.$baseUrl = 'https://dmtest.ahapp.net/h5_api/';
// Vue.prototype.$baseUrl = 'http://facepay.huasunsolar.com/web_interface/';
// Vue.prototype.$baseUrl = 'http://218.23.218.228:8018/web_interface/'
+Vue.use(uView)
+Vue.component('Tabbar', Tabbar)
+Vue.component('navigation', navigation)
Vue.prototype.$store = store;
-
+Vue.prototype.$onWait = new Promise((resolve) => {
+ Vue.prototype.$reslove = resolve
+})
App.mpType = 'app'
-Vue.use(uView)
const app = new Vue({
store,
diff --git a/h5/pages/meeting/changePassword/changePassword.vue b/h5/pages/meeting/changePassword/changePassword.vue
new file mode 100644
index 0000000..ac4867a
--- /dev/null
+++ b/h5/pages/meeting/changePassword/changePassword.vue
@@ -0,0 +1,177 @@
+<template>
+ <view class="change">
+ <view class="change_list">
+ <view class="change_list_item">
+ <view class="label">鏂板瘑鐮�</view>
+ <view class="input">
+ <input type="password" v-if="!isOpen" v-model="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜" placeholder-class="placeholder" />
+ <input type="text" v-else v-model="password" placeholder="璇疯緭鍏ユ柊瀵嗙爜" placeholder-class="placeholder" />
+ <u-icon name="eye-fill" color="#999999" size="20" v-if="!isOpen" @click="isOpen = true"></u-icon>
+ <u-icon name="eye-off" color="#999999" size="20" v-else @click="isOpen = false"></u-icon>
+ </view>
+ </view>
+ <view class="change_list_item">
+ <view class="label">纭瀵嗙爜</view>
+ <view class="input">
+ <input type="password" v-if="!isOpen1" v-model="confirmPassword" placeholder="璇峰啀娆¤緭鍏ユ柊瀵嗙爜" placeholder-class="placeholder" />
+ <input type="text" v-else v-model="confirmPassword" placeholder="璇峰啀娆¤緭鍏ユ柊瀵嗙爜" placeholder-class="placeholder" />
+ <u-icon name="eye-fill" color="#999999" size="20" v-if="!isOpen1" @click="isOpen1 = true"></u-icon>
+ <u-icon name="eye-off" color="#999999" size="20" v-else @click="isOpen1 = false"></u-icon>
+ </view>
+ </view>
+ </view>
+ <view class="change_info">瀵嗙爜瑙勫垯锛氬瓧姣嶃�佹暟瀛楃粍鍚堬紝涓嶅皯浜�8涓瓧绗�</view>
+ <view class="change_submit" @click="submit">纭</view>
+ <u-toast ref="uToast"></u-toast>
+ </view>
+</template>
+
+<script>
+ import { CheckPassWord } from '@/utils/utils.js'
+ import { mapState } from 'vuex'
+ export default {
+ data() {
+ return {
+ password: '',
+ confirmPassword: '',
+ isOpen: false,
+ isOpen1: false
+ };
+ },
+ computed: {
+ ...mapState(['userInfo'])
+ },
+ methods: {
+ submit() {
+ if (!this.password) {
+ uni.showToast({
+ title: '鏂板瘑鐮佷笉鑳戒负绌�',
+ icon: 'none',
+ duration: 2000
+ });
+ return
+ }
+ if (!CheckPassWord(this.password)) {
+ uni.showToast({
+ title: '瀵嗙爜蹇呴』涓哄瓧姣嶃�佹暟瀛楃粍鍚堬紝涓嶅皯浜�8涓瓧绗�',
+ icon: 'none',
+ duration: 2000
+ });
+ return
+ }
+ if (!this.confirmPassword) {
+ uni.showToast({
+ title: '纭瀵嗙爜涓嶈兘涓虹┖',
+ icon: 'none',
+ duration: 2000
+ });
+ return
+ }
+ if (this.password !== this.confirmPassword) {
+ uni.showToast({
+ title: '瀵嗙爜涓嶄竴鑷�',
+ icon: 'none',
+ duration: 2000
+ });
+ return
+ }
+ this.$u.api.resetPwd({ id: this.userInfo.id, password: this.password })
+ .then(res => {
+ uni.showToast({
+ title: '淇敼鎴愬姛',
+ mask: true,
+ icon: 'success',
+ duration: 2000,
+ complete() {
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1
+ });
+ }, 2000)
+ }
+ });
+ })
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ .change {
+ width: 100%;
+ padding-top: 20rpx;
+ box-sizing: border-box;
+ .change_list {
+ width: 100%;
+ padding: 0 30rpx;
+ background-color: #fff;
+ box-sizing: border-box;
+ .change_list_item {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1rpx solid #E5E5E5;
+ &:last-child {
+ border: none !important;
+ }
+ .label {
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #222222;
+ flex-shrink: 0;
+ margin-right: 30rpx;
+ }
+ .input {
+ flex: 1;
+ height: 100rpx;
+ line-height: 100rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .placeholder {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ input {
+ width: 100%;
+ height: 100%;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ text-align: right;
+ margin-right: 20rpx;
+ }
+ }
+ }
+ }
+ .change_info {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ margin-top: 24rpx;
+ margin-left: 32rpx;
+ }
+ .change_submit {
+ width: calc(100% - 60rpx);
+ margin-left: 30rpx;
+ box-sizing: border-box;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ background: #0055FF;
+ border-radius: 4rpx;
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #FFFFFF;
+ margin-top: 100rpx;
+ }
+ }
+</style>
diff --git a/h5/pages/meeting/index/index.vue b/h5/pages/meeting/index/index.vue
new file mode 100644
index 0000000..707942f
--- /dev/null
+++ b/h5/pages/meeting/index/index.vue
@@ -0,0 +1,487 @@
+<template>
+ <view class="container">
+ <!-- 鑷畾涔夊ご閮� -->
+ <navigation Title="鏅鸿兘浼氳瀹�"></navigation>
+ <you-scroll ref="scroll" @onPullDown="onPullDown" @More="More">
+ <!-- 閫氱煡鍏憡 -->
+ <view class="container_a" @click="jump">
+ <view class="container_a_left">
+ <image src="@/static/icon/home_ic_notice@2x.png" mode="widthFix"></image>
+ </view>
+ <view class="container_a_right">
+ <text>{{news.title}}</text>
+ <text>{{news.createDate ? news.createDate.substring(0, 10) : ''}}</text>
+ </view>
+ </view>
+
+ <!-- 灞曚綅 -->
+ <view class="zw"></view>
+
+ <!-- 鏃ュ巻 -->
+ <view class="container_b">
+ <Calendar
+ ref="Calendar"
+ :currentTime='currentTime1'
+ :mark='mark'
+ :showLunar="false"
+ @dayChange='dayChange'
+ @monthChange='monthChange'
+ :rangeMode='false'
+ :maskColor="'#ffffff'"
+ :dateStart='dateStart'
+ :dateEnd='dateEnd'
+ :canDrag='false'>
+ </Calendar>
+ </view>
+
+ <!-- 浠婃棩浼氳 -->
+ <view class="container_c">
+ <view class="container_c_head">
+ <view class="container_c_head_left">
+ <view class="container_c_head_left_h"></view>
+ <text>褰撴棩浼氳</text>
+ </view>
+ <view class="container_c_head_right" @click="show = true">
+ <text>{{roomName.length > 10 ? roomName.substring(0, 8) + '...' : roomName}}</text>
+ <image src="@/static/icon/ar_open@2x.png" mode="widthFix"></image>
+ </view>
+ </view>
+ <view class="container_c_list" v-if="list && list.length > 0">
+ <view class="container_c_list_item" v-for="(item, index) in list" :key="index" @click="jumpRoom(item.id)">
+ <view class="top">
+ <view class="top_left">
+ {{item.meetingName}}
+ </view>
+ <view class="top_right" v-if="getDay === item.meetingDate && item.meetingStatus === 1">
+ 鍗冲皢寮�濮�
+ </view>
+ <view class="top_right" v-else-if="getDay !== item.meetingDate && item.meetingStatus === 1">
+ 鏈紑濮�
+ </view>
+ <view class="top_right jx" v-else-if="item.meetingStatus === 2">
+ 杩涜涓�
+ </view>
+ <view class="top_right des" v-else-if="item.meetingStatus === 3">
+ 宸茬粨鏉�
+ </view>
+ </view>
+ <view class="item_zw"></view>
+ <view class="item_info">
+ <view class="item_info_label">浼氳鏃堕棿锛�</view>
+ <view class="item_info_content">{{item.meetingTime}}</view>
+ </view>
+ <view class="item_info">
+ <view class="item_info_label">浼氳瀹わ細</view>
+ <view class="item_info_content">{{item.roomName}}</view>
+ </view>
+ <view class="item_info">
+ <view class="item_info_label">棰勭害浜猴細</view>
+ <view class="item_info_content">{{item.bookingUser}}</view>
+ </view>
+ </view>
+ </view>
+ <view class="container_c_list" v-else>
+ <view class="container_c_list_wu">
+ <image src="@/static/common/364.png" mode="widthFix"></image>
+ </view>
+ </view>
+ </view>
+ </you-scroll>
+
+
+ <!-- 浼氳閫夋嫨 -->
+ <u-picker :show="show" @cancel="show = false" keyName="name" @confirm="confirm" :columns="columns"></u-picker>
+
+ <!-- 搴曢儴瀵艰埅 -->
+ <Tabbar :current="'0'"></Tabbar>
+ </view>
+</template>
+
+<script>
+ import youScroll from '@/components/you-scroll'
+ import Calendar from '@/components/Li-Calendar/Li-Calendar.vue';
+ import { getDay } from '@/utils/utils.js'
+ export default {
+ data() {
+ return {
+ show: false,
+ columns: [],
+ mark: [],
+ currentTime: '',
+ currentTime1: '',
+ title: 'Hello',
+ dateStart: '1999-05-01',
+ dateEnd: '2999-06-15',
+ roomName: '鍏ㄩ儴浼氳瀹�',
+ roomId: '',
+
+ page: 0,
+ next: false,
+ list: [],
+
+ news: []
+ }
+ },
+ components: { Calendar, youScroll },
+ onLoad() {
+ this.page = 0
+ this.next = false
+ this.list = []
+ this.mark = []
+ this.columns = []
+ this.currentTime = getDay().date
+ this.currentTime1 = getDay().date
+ this.$refs.Calendar.currentSelectTime = getDay().day
+ this.getRoom()
+ this.getNews()
+ this.getRoomList()
+ this.getDateNum()
+ },
+ onReachBottom(){
+ this.getRoomList()
+ },
+ methods: {
+ async onPullDown(done) {
+ this.page = 0
+ this.next = false
+ this.list = []
+ this.mark = []
+ this.columns = []
+ this.currentTime = getDay().date
+ this.currentTime1 = getDay().date
+ this.$refs.Calendar.currentSelectTime = getDay().day
+ await this.getRoom()
+ await this.getNews()
+ await this.getRoomList()
+ await this.getDateNum()
+ await done()
+ },
+ jumpRoom(id) {
+ uni.navigateTo({
+ url: `/packagesMine/meetingDetails/meetingDetails?id=${id}`
+ });
+ },
+ // 鑾峰彇鏌愭湀棰勭害鏃ユ湡
+ getDateNum() {
+ console.log('substring', this.currentTime1)
+ this.mark = []
+ this.$u.api.monthMeeting({
+ yearMonth: this.currentTime1.substring(0, 7)
+ }).then(res => {
+ res.data.forEach(item => {
+ // let day = new Date(getDay().date).getTime()
+ // let date = new Date(item.monthDate).getTime()
+ // date >= day &&
+ if (item.meetingNum > 0) {
+ this.mark.push({
+ time: item.monthDate,
+ markPoint: true,
+ pointText: item.meetingNum
+ })
+ }
+ })
+ })
+ },
+ getNews() {
+ this.$u.api.findNewNotice({})
+ .then(res => {
+ if (res.data) {
+ this.news = res.data
+ }
+ })
+ },
+ getRoomList() {
+ if (!this.next) {
+ this.page = this.page + 1
+ this.$u.api.myMeetingPage({
+ capacity: 10,
+ page: this.page,
+ model: {
+ queryDate: this.currentTime,
+ roomsId: this.roomId,
+ queryType: 1
+ }
+ }).then(res => {
+ if (res.data.records.length > 0) {
+ this.list = [...this.list, ...res.data.records]
+ }
+ if (res.data.records.length < 10) {
+ this.next = true
+ }
+ })
+ }
+ },
+ jump() {
+ uni.navigateTo({
+ url: '/packagesMine/notice/notice'
+ });
+ },
+ getRoom() {
+ this.$u.api.roomsList({})
+ .then(res => {
+ let room = []
+ room = res.data
+ room.unshift({ name: '鍏ㄩ儴浼氳瀹�', id: '' })
+ this.columns.push(res.data)
+ })
+ },
+ confirm(e) {
+ this.roomName = e.value[0].name
+ this.roomId = e.value[0].id
+ this.show = false
+ this.list = []
+ this.page = 0
+ this.next = false
+ this.getRoomList()
+ },
+ // 鐐瑰嚮鏌愬ぉ
+ dayChange(data){
+ console.log(data)
+ let date = data.time
+ let yyyy = data.time.substring(0, 4)
+ let mm = Number(data.time.substring(data.time.indexOf('-') + 1, data.time.lastIndexOf('-')))
+ let dd = Number(data.time.substring(data.time.lastIndexOf('-') + 1, data.time.length))
+ mm = mm < 10 ? `0${mm}` : mm
+ dd = dd < 10 ? `0${dd}` : dd
+ let riqi = `${yyyy}-${mm}-${dd}`
+ this.currentTime = riqi
+ this.list = []
+ this.next = false
+ this.page = 0
+ this.getRoomList()
+ },
+ // 涓嬩竴鏈�
+ monthChange(data){
+ let date = data.date.replace(/[/]/g, '-')
+ let yyyy = date.substring(0, 4)
+ let mm = Number(date.substring(date.indexOf('-') + 1, date.lastIndexOf('-')))
+ let dd = Number(date.substring(date.lastIndexOf('-') + 1, date.length))
+ mm = mm < 10 ? `0${mm}` : mm
+ dd = dd < 10 ? `0${dd}` : dd
+ let riqi = `${yyyy}-${mm}-${dd}`
+ console.log('鏃ユ湡', riqi)
+ this.currentTime1 = riqi
+ this.getDateNum()
+ },
+ setRangeMode(){
+ this.rangeMode = !this.rangeMode;
+ }
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .container {
+ width: 100%;
+ background-color: #fff;
+ .container_a {
+ width: 100%;
+ height: 80rpx;
+ background: #FFFFFF;
+ display: flex;
+ align-items: center;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ .container_a_left {
+ width: 40rpx;
+ height: 40rpx;
+ flex-shrink: 0;
+ margin-right: 20rpx;
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .container_a_right {
+ flex: 1;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ text {
+ &:first-child {
+ width: 400rpx;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ }
+ &:last-child {
+ flex-shrink: 0;
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ }
+ }
+ }
+ .zw {
+ width: 100%;
+ height: 20rpx;
+ background: #F7F7F7;
+ }
+ .container_b {
+ width: 100%;
+ padding: 30rpx;
+ background: #FFFFFF;
+ padding-top: 20rpx;
+ box-sizing: border-box;
+ }
+ .container_c {
+ width: 100%;
+ padding: 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ background-color: #F7F7F7;
+ .container_c_head {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .container_c_head_left {
+ display: flex;
+ align-items: center;
+ .container_c_head_left_h {
+ width: 6rpx;
+ height: 32rpx;
+ background: #0055FF;
+ border-radius: 4rpx;
+ margin-right: 16rpx;
+ }
+ text {
+ font-size: 32rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ }
+ .container_c_head_right {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ // width: 200rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+ height: 52rpx;
+ background: #FFFFFF;
+ border-radius: 26rpx;
+ border: 2rpx solid #EEEEEE;
+ box-sizing: border-box;
+ text {
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ margin-right: 22rpx;
+ }
+ image {
+ width: 20rpx;
+ height: 10rpx;
+ }
+ }
+ }
+ .container_c_list {
+ width: 100%;
+ margin-top: 32rpx;
+ display: flex;
+ flex-direction: column;
+ .container_c_list_wu {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 50rpx;
+ image {
+ width: 340rpx;
+ height: 364rpx;
+ }
+ }
+ .container_c_list_item {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ padding: 30rpx;
+ box-sizing: border-box;
+ background-color: #ffffff;
+ margin-bottom: 20rpx;
+ .top {
+ width: 100%;
+ height: 50rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .top_left {
+ flex: 1;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ font-size: 32rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .des {
+ color: #999999 !important;
+ border: 2rpx solid #999999 !important;
+ }
+ .jx {
+ color: #F62710 !important;
+ border: 2rpx solid #F62710 !important;
+ }
+ .top_right {
+ flex-shrink: 0;
+ margin-left: 20rpx;
+ // width: 104rpx;
+ padding: 4rpx 8rpx;
+ // height: 38rpx;
+ border-radius: 4rpx;
+ border: 2rpx solid #0055FF;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 22rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #0055FF;
+ }
+ }
+ .item_zw {
+ width: 100%;
+ height: 2rpx;
+ background-color: #E5E5E5;
+ margin: 28rpx 0 30rpx 0;
+ }
+ .item_info {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ margin-top: 24rpx;
+ &:first-child {
+ margin-top: 0 !important;
+ }
+ .item_info_label {
+ flex-shrink: 0;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ .item_info_content {
+ flex: 1;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ }
+ }
+ }
+ }
+ }
+ }
+</style>
diff --git a/h5/pages/meeting/login/login.vue b/h5/pages/meeting/login/login.vue
new file mode 100644
index 0000000..9d4bc9f
--- /dev/null
+++ b/h5/pages/meeting/login/login.vue
@@ -0,0 +1,139 @@
+<template>
+ <view class="login">
+ <!-- 澶撮儴鑳屾櫙鍥剧墖 -->
+ <view class="login_head"
+ :style="{ height: 'calc(' + height + ' + ' + '388rpx)', backgroundImage: 'url(' + backgroundImage + ')' }"></view>
+
+ <!-- 鐧诲綍妗� -->
+ <view class="login_box">
+ <view class="login_box_input">
+ <input type="text" v-model="from.account" placeholder="璇疯緭鍏ヨ处鍙峰悕绉�" placeholder-class="placeholder" />
+ </view>
+ <view class="login_box_input">
+ <input type="password" v-if="!isOpen" v-model="from.password" placeholder="璇疯緭鍏ュ瘑鐮�" placeholder-class="placeholder" />
+ <input type="text" v-else v-model="from.password" placeholder="璇疯緭鍏ュ瘑鐮�" placeholder-class="placeholder" />
+ <u-icon name="eye-fill" color="#999999" size="20" v-if="!isOpen" @click="isOpen = true"></u-icon>
+ <u-icon name="eye-off" color="#999999" size="20" v-else @click="isOpen = false"></u-icon>
+ </view>
+ <view class="login_box_sub" @click="login">鐧诲綍</view>
+ </view>
+
+ <u-toast ref="uToast"></u-toast>
+ </view>
+</template>
+
+<script>
+ import { mapState, mapMutations } from 'vuex'
+
+ export default {
+ data() {
+ return {
+ backgroundImage: 'https://dmtest.ahapp.net/file/projects/20230511/13f256b832db4a4fadc5e6770f5727bf.png',
+ from: {
+ account: '',
+ password: ''
+ },
+ isOpen: false
+ };
+ },
+ computed: {
+ ...mapState(['statusbarHeight', 'navHeight']),
+
+ height() {
+ return `${this.statusbarHeight + this.navHeight}px`;
+ }
+ },
+ methods: {
+ ...mapMutations(["setToken", "setUserInfo"]),
+
+ login() {
+ if (!this.from.account) return this.$refs.uToast.show({ message: '璐﹀彿涓嶈兘涓虹┖' })
+ if (!this.from.password) return this.$refs.uToast.show({ message: '瀵嗙爜涓嶈兘涓虹┖' })
+ var that = this
+ that.$u.api.ordinaryLogin(that.from)
+ .then(res => {
+ if (res.code === 200) {
+ that.setToken(res.data.token)
+ that.setUserInfo(res.data.userResponse)
+ uni.login({
+ provider: 'MP-WEIXIN',
+ success: function (loginRes) {
+ that.$u.api.wxEmpower({ code: loginRes.code })
+ .then(resa => {
+ uni.switchTab({
+ url: '/pages/index/index'
+ });
+ })
+ }
+ });
+ }
+ })
+ }
+ }
+ }
+</script>
+
+<style>
+ page {
+ background-color: #fff !important;
+ }
+</style>
+
+<style lang="scss">
+.login {
+ width: 100%;
+ .login_head {
+ width: 100%;
+ background-repeat: no-repeat;
+ background-size: 100%;
+ }
+ .login_box {
+ width: 100%;
+ position: relative;
+ top: -114rpx;
+ padding: 80rpx 60rpx;
+ box-sizing: border-box;
+ background-color: #ffffff;
+ border-radius: 48rpx 48rpx 0rpx 0rpx;
+ .login_box_input {
+ width: 100%;
+ height: 100rpx;
+ display: flex;
+ align-items: center;
+ background: #F7F7F7;
+ border-radius: 4rpx;
+ margin-bottom: 40rpx;
+ padding: 0 40rpx;
+ box-sizing: border-box;
+ .placeholder {
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ input {
+ width: 100%;
+ height: 100%;
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ margin-right: 20rpx;
+ }
+ }
+ .login_box_sub {
+ width: 100%;
+ height: 100rpx;
+ line-height: 100rpx;
+ text-align: center;
+ background: #0055FF;
+ border-radius: 4rpx;
+ font-size: 32rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ margin-top: 60rpx;
+ }
+ }
+}
+</style>
diff --git a/h5/pages/meeting/manage/manage.vue b/h5/pages/meeting/manage/manage.vue
new file mode 100644
index 0000000..8394353
--- /dev/null
+++ b/h5/pages/meeting/manage/manage.vue
@@ -0,0 +1,407 @@
+<template>
+ <page-meta :page-style="'overflow:'+(pageShow?'hidden':'visible')"></page-meta>
+ <view class="manage">
+ <view class="manage_head">
+ <view class="manage_head_input">
+ <u--input
+ placeholder="鎼滅储"
+ prefixIcon="search"
+ v-model="value"
+ @confirm="sou"
+ prefixIconStyle="font-size: 22px; color: #909399"
+ ></u--input>
+ </view>
+ </view>
+ <view class="manage_list" v-if="list && list.length > 0">
+ <view class="manage_list_item" v-for="(item, index) in list" :key="index">
+ <view class="top">
+ <view class="top_left">
+ <view class="top_left_image">
+ <image :src="item.imgurl ? item.prefixUrl + item.imgurl : icon" mode="aspectFit"></image>
+ </view>
+ <view class="top_left_content">
+ <text>{{item.name}}</text>
+ <view class="top_left_content_time">
+ <image src="@/static/icon/ic_time@2x.png" mode="widthFix"></image>
+ <text>{{item.startTime}}-{{item.endTime}}</text>
+ </view>
+ </view>
+ </view>
+ <view class="top_right" @click="openQR(item.id, item.name)">寮�闂ㄧ爜</view>
+ </view>
+ <view class="bottom" v-if="item.projectListName">
+ <view class="bottom_label">鏈嶅姟椤圭洰锛�</view>
+ <view class="bottom_content">{{item.projectListName}}</view>
+ </view>
+ </view>
+ </view>
+
+ <view class="manage_list" v-else>
+ <view class="manage_list_wu">
+ <image src="@/static/common/364.png" mode="widthFix"></image>
+ </view>
+ </view>
+
+ <!-- 寮�闂ㄧ爜 -->
+ <view class="details_ma">
+ <u-popup :show="show" :closeable="true" :safeAreaInsetBottom="false" :round="0" mode="center" @close="close">
+ <view class="box">
+ <text class="box_a">{{roomName || ''}}</text>
+ <text class="box_b" v-if="time > 0">浜岀淮鐮亄{time}}绉掑唴鏈夋晥</text>
+ <text class="box_b" v-else>浜岀淮鐮佸凡杩囨湡锛岃鐐瑰嚮浜岀淮鐮佸埛鏂�</text>
+ <view class="qrcode" @click="Refresh(1)">
+ <image :src="qrurl" mode="widthFix"></image>
+ </view>
+ <text class="box_c">鍑虹ず璇ヤ簩缁寸爜锛屾壂鐮佽繘鍏ヤ細璁</text>
+ </view>
+ </u-popup>
+ </view>
+
+ </view>
+</template>
+
+<script>
+ import { mapState } from 'vuex'
+ export default {
+ data() {
+ return {
+ value: '',
+ next: false,
+ list: [],
+ page: 0,
+ show: false,
+ val: '',
+ time: 0,
+ timer: null,
+ timeValue: '',
+ roomName: '',
+ qrurl: '',
+ id: '',
+ pageShow: false,
+ icon: require('@/static/common/123.png')
+ };
+ },
+ onLoad() {
+ this.getList()
+ this.getSYSTEM()
+ },
+ computed: {
+ ...mapState(['token'])
+ },
+ onReachBottom() {
+ this.getList()
+ },
+ methods: {
+ // 鍒锋柊浜岀淮鐮�
+ Refresh(type) {
+ if (this.time !== 0) return
+ uni.showLoading({
+ title: '鍔犺浇涓�',
+ mask: true
+ });
+ uni.request({
+ url: `${this.$baseUrl}web/rooms/getQrCodeImg?id=${this.id}&token=${this.token}`, //url鍦板潃
+ method: 'GET',
+ responseType: 'arraybuffer',
+ header: {
+ 'Content-Type': 'application/json'
+ },
+ success: res => {
+ const arrayBuffer = new Uint8Array(res.data)
+ const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer) //杩欓噷闇�瑕佹坊鍔犲墠缂�
+ this.qrurl = base64
+ if (type === 1) {
+ this.time = Number(this.timeValue) * 60
+ this.getTime()
+ }
+ },
+ complete() {
+ uni.hideLoading();
+ }
+ });
+ },
+ getTime() {
+ this.timer = setInterval(() => {
+ if (this.time === 0) {
+ clearInterval(this.timer)
+ this.timer = null
+ this.time = 0
+ return
+ }
+ this.time = this.time - 1
+ }, 1000)
+ },
+ getSYSTEM() {
+ this.$u.api.getSystemDictData({
+ dictCode: 'SYSTEM',
+ label: 'QR_OPENROOM_VALIDTIME'
+ }).then(res => {
+ this.time = Number(res.data.code) * 60
+ this.timeValue = Number(res.data.code)
+ })
+ },
+ openQR(id, name) {
+ this.id = id
+ this.roomName = name
+ this.time = 0
+
+ this.Refresh(2)
+ this.time = this.timeValue * 60
+ this.getTime()
+ this.pageShow = true
+
+ this.show = true
+ uni.setScreenBrightness({
+ value: 1,
+ success: function () {
+ console.log('success');
+ }
+ });
+ },
+ close() {
+ this.pageShow = false
+ this.show = false
+ this.time = 0
+ clearInterval(this.timer)
+ this.timer = null
+ uni.setScreenBrightness({
+ value: 0.5,
+ success: function () {
+ console.log('success');
+ }
+ });
+ },
+ sou() {
+ this.list = []
+ this.page = 0
+ this.next = false
+ this.getList()
+ },
+ getList() {
+ if (!this.next) {
+ this.page = this.page + 1
+ this.$u.api.myRoomsPage({
+ capacity: 10,
+ page: this.page,
+ model: {
+ roomsName: this.value
+ }
+ }).then(res => {
+ if (res.data.records.length > 0) {
+ res.data.records.forEach(item => {
+ if (item.projectList.length > 0) {
+ let names = item.projectList.map(item => item.projectName)
+ item.projectListName = names.join(' | ')
+ } else {
+ item.projectListName = ''
+ }
+ })
+ this.list = [...this.list, ...res.data.records]
+ }
+ if (res.data.records.length < 10) {
+ this.next = true
+ }
+ })
+ }
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ .manage {
+ width: 100%;
+ .details_ma /deep/ {
+ .u-popup__content {
+ width: 100%;
+ .box {
+ width: 100%;
+ padding: 80rpx 0;
+ box-sizing: border-box;
+ background-color: #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ .box_a {
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ font-size: 36rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .box_b {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #0055FF;
+ margin-top: 40rpx;
+ }
+ .qrcode {
+ width: 440rpx;
+ height: 440rpx;
+ margin-top: 40rpx;
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .box_c {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ margin-top: 40rpx;
+ }
+ .box_d {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ margin-top: 32rpx;
+ }
+ .box_e {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ }
+ }
+ .manage_head {
+ width: 100%;
+ padding: 20rpx 30rpx;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ position: sticky;
+ top: 0;
+ .manage_head_input /deep/ {
+ width: 100%;
+ height: 72rpx;
+ background: #F7F7F7;
+ border-radius: 4rpx;
+ .u-border {
+ border: none !important;
+ }
+ }
+ }
+ .manage_list {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ padding: 20rpx 30rpx;
+ box-sizing: border-box;
+ .manage_list_wu {
+ width: 100%;
+ margin-top: 50rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ image {
+ width: 340rpx;
+ height: 364rpx;
+ }
+ }
+ .manage_list_item {
+ width: 100%;
+ padding: 30rpx;
+ box-sizing: border-box;
+ background: #ffffff;
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 20rpx;
+ &:last-child {
+ margin-bottom: 0 !important;
+ }
+ .top {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .top_left {
+ display: flex;
+ align-items: center;
+ .top_left_image {
+ flex-shrink: 0;
+ width: 134rpx;
+ height: 100rpx;
+ border-radius: 4rpx;
+ margin-right: 20rpx;
+ overflow: hidden;
+ background-color: #ececec;
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .top_left_content {
+ display: flex;
+ height: 100rpx;
+ flex-direction: column;
+ justify-content: space-around;
+ text {
+ width: 300rpx;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ font-size: 30rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .top_left_content_time {
+ display: flex;
+ align-items: center;
+ image {
+ width: 26rpx;
+ height: 26rpx;
+ margin-right: 8rpx;
+ }
+ text {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ }
+ }
+ .top_right {
+ width: 136rpx;
+ height: 56rpx;
+ line-height: 56rpx;
+ text-align: center;
+ background: #0055FF;
+ border-radius: 4rpx;
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #FFFFFF;
+ }
+ }
+ .bottom {
+ width: 100%;
+ margin-top: 30rpx;
+ display: flex;
+ align-items: flex-start;
+ .bottom_label {
+ flex-shrink: 0;
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ .bottom_content {
+ flex: 1;
+ flex-wrap: wrap;
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ }
+ }
+ }
+ }
+ }
+</style>
diff --git a/h5/pages/meeting/mine/mine.vue b/h5/pages/meeting/mine/mine.vue
new file mode 100644
index 0000000..f2dfe82
--- /dev/null
+++ b/h5/pages/meeting/mine/mine.vue
@@ -0,0 +1,207 @@
+<template>
+ <view class="mine">
+ <!-- 澶撮儴鑳屾櫙鍥剧墖 -->
+ <view class="mine_head"
+ :style="{ height: 'calc(' + height + ' + ' + '236rpx)', backgroundImage: 'url(' + backgroundImage + ')' }">
+ <view :style="{width: '100%', height: statusbarHeight + 'px'}"></view>
+ <view class="mine_head_title" :style="{width: '100%', height: navHeight + 'px'}">
+ <text>鎴戠殑</text>
+ </view>
+ <view class="mine_head_user">
+ <image :src="userInfo.avatar ? `${userInfo.prefixUrl}${userInfo.avatar}` : avatar" mode="widthFix"></image>
+ <view class="mine_head_user_right">
+ <text>{{userInfo.realname}}</text>
+ <text>娆㈣繋鍥炴潵锝�</text>
+ </view>
+ </view>
+ </view>
+
+ <!-- 瀵艰埅鍐呭 -->
+ <view class="mine_list">
+ <view class="mine_list_item" v-for="(item, index) in list" :key="index" @click="jump(item.path)">
+ <view class="left">
+ <image :src="item.icon" mode="widthFix"></image>
+ <text>{{item.name}}</text>
+ </view>
+ <u-icon name="arrow-right" color="#999999" size="20"></u-icon>
+ </view>
+ </view>
+
+ <!-- 閫�鍑烘寜閽� -->
+ <view class="mine_exit" :style="{ bottom: 'calc(' + '198rpx' + ' + ' + 'env(safe-area-inset-bottom))' }" @click="exit">
+ <text>閫�鍑虹櫥褰�</text>
+ </view>
+
+ <!-- 搴曢儴瀵艰埅 -->
+ <Tabbar :current="'2'" color="#fff"></Tabbar>
+ </view>
+</template>
+
+<script>
+ import { mapState, mapMutations } from 'vuex'
+ export default {
+ data() {
+ return {
+ backgroundImage: 'https://dmtest.ahapp.net/file/projects/20230511/7d1f149816e24e68bb2df9011be53990.png',
+ avatar: require('@/static/common/default_user@2x.png'),
+ list: [
+ { name: '涓汉璧勬枡', path: '/pages/personal/personal', icon: require('@/static/icon/wd_ic_ziliao@2x.png') },
+ { name: '鎴戦绾︾殑浼氳瀹�', path: '/pages/myAppointment/myAppointment', icon: require('@/static/icon/wd_ic_yuyue@2x.png') },
+ { name: '鎴戠鐞嗙殑浼氳瀹�', path: '/pages/manage/manage', icon: require('@/static/icon/wd_ic_guanli@2x.png') },
+ { name: '淇敼瀵嗙爜', path: '/pages/changePassword/changePassword', icon: require('@/static/icon/wd_ic_mima@2x.png') }
+ ]
+ }
+ },
+ computed: {
+ ...mapState(['statusbarHeight', 'navHeight', 'userInfo']),
+ height() {
+ return `${this.statusbarHeight + this.navHeight}px`;
+ }
+ },
+ onLoad() {
+
+ },
+ methods: {
+ ...mapMutations(["empty"]),
+ jump(e) {
+ uni.navigateTo({
+ url: e
+ });
+ },
+ exit() {
+ this.empty()
+ uni.reLaunch({
+ url: '/pages/login/login'
+ });
+ }
+ }
+ }
+</script>
+
+<style>
+ page {
+ background-color: #fff !important;
+ }
+</style>
+
+<style lang="scss" scoped>
+ .mine {
+ width: 100%;
+ background-color: #fff;
+ .mine_head {
+ width: 100%;
+ background-repeat: no-repeat;
+ background-size: 100%;
+ .mine_head_title {
+ padding-left: 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ text {
+ font-size: 36rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #FFFFFF;
+ }
+ }
+ .mine_head_user {
+ width: 100%;
+ height: 108rpx;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ margin-top: 32rpx;
+ image {
+ flex-shrink: 0;
+ width: 108rpx;
+ height: 108rpx;
+ margin-right: 26rpx;
+ border-radius: 50%;
+ }
+ .mine_head_user_right {
+ flex: 1;
+ height: 108rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ text {
+ &:first-child {
+ font-size: 40rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #FFFFFF;
+ }
+ &:last-child {
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #FFFFFF;
+ }
+ }
+ }
+ }
+ }
+ .mine_exit {
+ position: fixed;
+ left: 50%;
+ transform: translate(-50%, 0);
+ width: 200rpx;
+ height: 72rpx;
+ line-height: 72rpx;
+ text-align: center;
+ border-radius: 4rpx;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ border: 1rpx solid #999999;
+ }
+ .mine_list {
+ width: 100%;
+ border-radius: 20rpx 20rpx 0rpx 0rpx;
+ position: relative;
+ top: -22rpx;
+ background-color: #fff;
+ padding: 40rpx 30rpx;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ .mine_list_item {
+ width: 100%;
+ height: 100rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 2rpx solid #E5E5E5;
+ position: relative;
+ overflow: hidden;
+ button {
+ width: 110%;
+ height: 110%;
+ position: absolute;
+ top: -10rpx;
+ left: -10rpx;
+ border: none !important;
+ background-color: rgba(0, 0, 0, 0);
+ z-index: 9;
+ }
+ .left {
+ display: flex;
+ align-items: center;
+ text {
+ font-size: 30rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #222222;
+ }
+ image {
+ width: 32rpx;
+ height: 32rpx;
+ margin-right: 20rpx;
+ }
+ }
+ }
+ }
+ }
+</style>
diff --git a/h5/pages/meeting/myAppointment/myAppointment.vue b/h5/pages/meeting/myAppointment/myAppointment.vue
new file mode 100644
index 0000000..1b31401
--- /dev/null
+++ b/h5/pages/meeting/myAppointment/myAppointment.vue
@@ -0,0 +1,618 @@
+<template>
+ <page-meta :page-style="'overflow:'+(pageShow?'hidden':'visible')"></page-meta>
+ <view class="yuyue">
+ <view class="yuyue_head">
+ <view class="yuyue_head_input">
+ <u--input
+ placeholder="鎼滅储"
+ prefixIcon="search"
+ v-model="meetingName"
+ @confirm="sou"
+ prefixIconStyle="font-size: 22px; color: #909399"
+ ></u--input>
+ </view>
+ <view class="yuyue_head_list">
+ <view class="yuyue_head_list_item" v-for="(item, index) in cate" :key="index" @click="clickItem(index)">
+ <text :class="i === index ? 'yuyue_head_list_item_active' : ''">{{item.name}}</text>
+ <view class="yuyue_head_list_item_h" v-show="i === index"></view>
+ </view>
+ </view>
+ </view>
+
+ <view class="yuyue_content" v-if="list && list.length > 0">
+ <view class="yuyue_content_item" v-for="(item, index) in list" :key="index">
+ <view class="item_a" @click="jump(item.id)">
+ <view class="item_a_title">{{item.meetingName}}</view>
+ <view class="item_a_1 item_a_two" v-if="item.meetingStatus === 1">鏈紑濮�</view>
+ <view class="item_a_1 item_a_one" v-else-if="item.meetingStatus === 2">杩涜涓�</view>
+ <view class="item_a_1 item_a_three" v-else>宸茬粨鏉�</view>
+ </view>
+ <view class="item_b" @click="jump(item.id)"></view>
+ <view class="item_c" @click="jump(item.id)">
+ <view class="item_c_item">
+ <text>浼氳鏃堕棿锛�</text>
+ <text>{{item.meetingDate}} {{item.meetingTime}}</text>
+ </view>
+ <view class="item_c_item">
+ <text>浼氳瀹わ細</text>
+ <text>{{item.roomName}}</text>
+ </view>
+ <view class="item_c_item">
+ <text>棰勭害浜猴細</text>
+ <text>{{item.bookingUser}}</text>
+ </view>
+ </view>
+ <view class="item_d" v-if="i === 0">
+ <view class="item_d_left">
+ <view class="item_d_left_item" @click.stop="copy(item)" v-if="item.meetingStatus !== 3">
+ <image src="@/static/icon/ic_copy@2x.png" mode="widthFix"></image>
+ <text>澶嶅埗</text>
+ </view>
+ <view class="item_d_left_item" @click="fenxiang(item)" v-if="item.meetingStatus !== 3">
+ <button open-type="share"></button>
+ <image src="@/static/icon/ic_fenxiang@2x.png" mode="widthFix"></image>
+ <text>鍒嗕韩</text>
+ </view>
+ <view class="item_d_left_item" v-if="item.meetingStatus === 1" @click.stop="closeRoom(item.meetingStatus, item.id)">
+ <image src="@/static/icon/ic_cancel@2x.png" mode="widthFix"></image>
+ <text>鍙栨秷</text>
+ </view>
+ </view>
+ <view class="item_d_right" @click.stop="getQrCodes(item.id, item.roomName)">
+ 寮�闂ㄧ爜
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <view class="yuyue_content" v-else>
+ <view class="yuyue_content_wu">
+ <image src="@/static/common/364.png" mode="widthFix"></image>
+ </view>
+ </view>
+
+ <!-- 寮�闂ㄧ爜 -->
+ <view class="details_ma">
+ <u-popup :show="show" :closeable="true" :safeAreaInsetBottom="false" :round="0" mode="center" @close="close">
+ <view class="box">
+ <text class="box_a">{{roomName || ''}}</text>
+ <!-- <text class="box_b">浜岀淮鐮亄{time}}绉掑唴鏈夋晥</text> -->
+ <text class="box_b" v-if="time > 0">浜岀淮鐮亄{time}}绉掑唴鏈夋晥</text>
+ <text class="box_b" v-else>浜岀淮鐮佸凡杩囨湡锛岃鐐瑰嚮浜岀淮鐮佸埛鏂�</text>
+ <view class="qrcode" @click="Refresh(1)">
+ <image :src="qrurl" mode="widthFix"></image>
+ </view>
+ <!-- <text class="box_c">鍑虹ず璇ヤ簩缁寸爜锛屾壂鐮佽繘鍏ヤ細璁</text>
+ <text class="box_d">濡傛灉鎵撲笉寮�璇疯仈绯荤鐞嗗憳锛�</text>
+ <text class="box_e">鏉庣孩鍜� 18899039483</text> -->
+ </view>
+ </u-popup>
+ </view>
+
+ <!-- 鍙栨秷浼氳 -->
+ <u-modal
+ :show="show1"
+ title="鎻愮ず"
+ content='鏄惁纭鍙栨秷褰撳墠浼氳'
+ @confirm="confirm"
+ @cancel="close1"
+ ref="uModal"
+ :showCancelButton="true"
+ asyncClose="true"></u-modal>
+ </view>
+</template>
+
+<script>
+ import { mapState } from 'vuex'
+ import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
+ export default {
+ data() {
+ return {
+ i: 0,
+ show: false,
+ cate: [
+ { name: '鏈紑濮�', id: 1 },
+ { name: '宸茬粨鏉�', id: 2 }
+ ],
+ pageShow: false,
+ id: '',
+ meetingName: '',
+ show1: false,
+ val: '',
+ list: [],
+ next: false,
+ page: 0,
+ time: 0,
+ roomName: '',
+ link: '',
+ qrurl: '',
+ timer: null,
+ timeValue: '',
+ Id: '',
+ share: {
+ title: '',
+ path: '',
+ imageUrl: 'https://dmtest.ahapp.net/file/projects/20230511/13f256b832db4a4fadc5e6770f5727bf.png'
+ }
+ };
+ },
+ computed: {
+ ...mapState(['token'])
+ },
+ components: { tkiQrcode },
+ onReachBottom() {
+ this.getList()
+ },
+ onLoad() {
+ this.getList()
+ this.getSYSTEM()
+ },
+ onShareAppMessage({from,target}) {
+ if (from == 'button') {
+ return this.share
+ }
+ },
+ methods: {
+ // 鍒嗕韩
+ fenxiang(item) {
+ this.share.title = item.meetingName
+ this.share.path = `/packagesMine/meetingDetails/meetingDetails?shareId=${item.id}`
+ },
+ // 鍒锋柊浜岀淮鐮�
+ Refresh(type) {
+ if (this.time !== 0) return
+ uni.showLoading({
+ title: '鍔犺浇涓�',
+ mask: true
+ });
+ uni.request({
+ url: `${this.$baseUrl}web/meeting/getQrCodeImg?id=${this.Id}&token=${this.token}`, //url鍦板潃
+ method: 'GET',
+ responseType: 'arraybuffer',
+ header: {
+ 'Content-Type': 'application/json'
+ },
+ success: res => {
+ const arrayBuffer = new Uint8Array(res.data)
+ const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBuffer) //杩欓噷闇�瑕佹坊鍔犲墠缂�
+ this.qrurl = base64
+ if (type === 1) {
+ this.time = Number(this.timeValue) * 60
+ this.getTime()
+ }
+ },
+ complete() {
+ uni.hideLoading();
+ }
+ });
+ },
+ getTime() {
+ this.timer = setInterval(() => {
+ if (this.time === 0) {
+ clearInterval(this.timer)
+ this.timer = null
+ this.time = 0
+ return
+ }
+ this.time = this.time - 1
+ }, 1000)
+ },
+ getSYSTEM() {
+ this.$u.api.getSystemDictData({
+ dictCode: 'SYSTEM',
+ label: 'QR_OPENBOOK_VALIDTIME'
+ }).then(res => {
+ this.time = Number(res.data.code) * 60
+ this.timeValue = Number(res.data.code)
+ })
+ this.$u.api.getSystemDictData({
+ dictCode: 'SYSTEM',
+ label: 'H5_LINK_ADDR'
+ }).then(res => {
+ this.link = res.data.code
+ })
+ },
+ sou() {
+ this.list = []
+ this.next = false
+ this.page = 0
+ this.getList()
+ },
+ copy(item) {
+ let val = `${item.bookingUser} 閭�璇锋偍鍔犲叆浼氳
+浼氳涓婚锛�${item.meetingName}
+浼氳瀹わ細${item.roomName}
+浼氳鏃堕棿锛�${item.meetingDate} ${item.meetingTime}
+鐐瑰嚮閾炬帴鐩存帴鍔犲叆浼氳锛�
+${this.link}?id=${item.id}`
+ uni.setClipboardData({
+ data: val,
+ success: function () {
+ uni.showToast({
+ title: '浼氳淇℃伅澶嶅埗鎴愬姛锛屽幓鍒嗕韩缁欏悓浜嬪惂~',
+ icon:'none',
+ duration: 2000
+ });
+ }
+ });
+ },
+ close1() {
+ this.show1 = false
+ },
+ closeRoom(status, id) {
+ if (status !== 1) {
+ uni.showToast({
+ title: '浼氳涓嶅彲鍙栨秷',
+ icon: "none",
+ duration: 2000
+ });
+ return
+ }
+ this.id = id
+ this.show1 = true;
+ },
+ confirm() {
+ this.$u.api.reservationCancel({
+ id: this.id
+ }).then(res => {
+ this.show1 = false;
+ if (res.code === 200) {
+ uni.showToast({
+ title: '鍙栨秷鎴愬姛',
+ icon: "none",
+ duration: 2000
+ });
+ this.list.forEach((item, index) => {
+ if (item.id === this.id) {
+ this.list.splice(index, 1)
+ }
+ })
+ }
+ })
+ },
+ jump(id) {
+ uni.navigateTo({
+ url: `/packagesMine/meetingDetails/meetingDetails?id=${id}`
+ });
+ },
+ close() {
+ this.time = 0
+ clearInterval(this.timer)
+ this.timer = null
+ this.show = false
+ this.pageShow = false
+ uni.setScreenBrightness({
+ value: 0.5,
+ success: function () {
+ console.log('success');
+ }
+ });
+ },
+ getQrCodes(id, roomName) {
+ this.Id = id
+ this.time = 0
+ this.Refresh()
+ this.time = this.timeValue * 60
+ this.getTime()
+ this.pageShow = true
+ this.roomName = roomName
+
+ this.show = true
+ uni.setScreenBrightness({
+ value: 1,
+ success: function () {
+ console.log('success');
+ }
+ });
+ },
+ clickItem(index) {
+ this.i = index
+ this.list = []
+ this.next = false
+ this.page = 0
+ this.getList()
+ },
+ getList() {
+ if (!this.next) {
+ this.page = this.page + 1
+ this.$u.api.myMeetingPage({
+ capacity: 10,
+ page: this.page,
+ model: {
+ queryType: 2,
+ roomsName: this.meetingName,
+ status: this.cate[this.i].id
+ }
+ }).then(res => {
+ if (res.data.records.length > 0) {
+ this.list = [...this.list, ...res.data.records]
+ }
+ if (res.data.records.length < 10) {
+ this.next = true
+ }
+ })
+ }
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ .yuyue {
+ width: 100%;
+ .details_ma /deep/ {
+ .u-popup__content {
+ width: 100%;
+ .box {
+ width: 100%;
+ padding: 80rpx 0;
+ box-sizing: border-box;
+ background-color: #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ .box_a {
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ font-size: 36rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .box_b {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #0055FF;
+ margin-top: 40rpx;
+ }
+ .qrcode {
+ width: 440rpx;
+ height: 440rpx;
+ margin-top: 40rpx;
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .box_c {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ margin-top: 40rpx;
+ }
+ .box_d {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ margin-top: 32rpx;
+ }
+ .box_e {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ }
+ }
+ .yuyue_head {
+ padding: 30rpx;
+ background-color: #ffffff;
+ box-sizing: border-box;
+ position: sticky;
+ top: 0;
+ z-index: 999;
+ .yuyue_head_input /deep/ {
+ width: 100%;
+ height: 72rpx;
+ background: #F7F7F7;
+ border-radius: 4rpx;
+ .u-border {
+ border: none !important;
+ }
+ }
+ .yuyue_head_list {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ margin-top: 30rpx;
+ .yuyue_head_list_item {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ position: relative;
+ text {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ .yuyue_head_list_item_active {
+ font-size: 30rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #222222;
+ }
+ .yuyue_head_list_item_h {
+ width: 60rpx;
+ height: 4rpx;
+ background: #0055FF;
+ border-radius: 3rpx;
+ position: absolute;
+ bottom: -30rpx;
+ left: 50%;
+ transform: translate(-50%, 0);
+ }
+ }
+ }
+ }
+ .yuyue_content {
+ width: 100%;
+ padding: 20rpx 30rpx;
+ box-sizing: border-box;
+ .yuyue_content_wu {
+ width: 100%;
+ margin-top: 50rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ image {
+ width: 340rpx;
+ height: 364rpx;
+ }
+ }
+ .yuyue_content_item {
+ width: 100%;
+ padding: 30rpx;
+ box-sizing: border-box;
+ background: #ffffff;
+ margin-bottom: 20rpx;
+ &:last-child {
+ margin-bottom: 0 !important;
+ }
+ .item_a {
+ width: 100%;
+ height: 50rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ .item_a_title {
+ flex: 1;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ font-size: 32rpx;
+ font-family: PingFangSC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #222222;
+ }
+ .item_a_one {
+ border: 2rpx solid #F62710 !important;
+ font-size: 22rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #F62710;
+ }
+ .item_a_two {
+ border: 2rpx solid #0055FF !important;
+ font-size: 22rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #0055FF;
+ }
+ .item_a_three {
+ border: 2rpx solid #999999 !important;
+ font-size: 22rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ .item_a_1 {
+ flex-shrink: 0;
+ padding: 0 8rpx;
+ height: 38rpx;
+ box-sizing: border-box;
+ line-height: 38rpx;
+ text-align: center;
+ border-radius: 4rpx;
+ margin-left: 20rpx;
+ }
+ }
+ .item_b {
+ width: 100%;
+ height: 1rpx;
+ background-color: #E5E5E5;
+ margin: 28rpx 0 30rpx 0;
+ }
+ .item_c {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ .item_c_item {
+ display: flex;
+ align-items: flex-start;
+ margin-bottom: 24rpx;
+ &:last-child {
+ margin-bottom: 0 !important;
+ }
+ text {
+ &:first-child {
+ flex-shrink: 0;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ &:last-child {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #333333;
+ }
+ }
+ }
+ }
+ .item_d {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 40rpx;
+ .item_d_left {
+ display: flex;
+ align-items: center;
+ .item_d_left_item {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-right: 40rpx;
+ position: relative;
+ overflow: hidden;
+ &:last-child {
+ margin-right: 0 !important;
+ }
+ button {
+ position: absolute;
+ width: 300rpx;
+ height: 300rpx;
+ border: none;
+ top: -20rpx;
+ left: -20rpx;
+ background: rgba(0, 0, 0, 0);
+ }
+ image {
+ width: 44rpx;
+ height: 44rpx;
+ margin-right: 8rpx;
+ }
+ text {
+ font-size: 26rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ }
+ }
+ }
+ .item_d_right {
+ width: 136rpx;
+ height: 56rpx;
+ line-height: 56rpx;
+ text-align: center;
+ background: #0055FF;
+ border-radius: 4rpx;
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #FFFFFF;
+ }
+ }
+ }
+ }
+ }
+</style>
diff --git a/h5/pages/meeting/personal/personal.vue b/h5/pages/meeting/personal/personal.vue
new file mode 100644
index 0000000..ff077b8
--- /dev/null
+++ b/h5/pages/meeting/personal/personal.vue
@@ -0,0 +1,484 @@
+<template>
+ <view class="personal">
+ <view class="personal_image">
+ <view class="personal_image_box">
+ <image :src="userInfo.avatar ? `${userInfo.prefixUrl}${userInfo.avatar}` : defaultAvatar" mode="widthFix"></image>
+ </view>
+ <button class="personal_image_box_btn" open-type="chooseAvatar" @chooseavatar="bindchooseavatar">鏇存崲澶村儚</button>
+ </view>
+ <view class="personal_list">
+ <view class="personal_list_item" @click="show1 = true">
+ <view class="label">鏄电О</view>
+ <view class="right">
+ <text :class="userInfo.wechatName ? 'right_info black' : 'right_info'">{{userInfo.wechatName ? userInfo.wechatName : '鐐瑰嚮鑾峰彇寰俊鏄电О'}}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ <view class="personal_list_item">
+ <view class="label">鎵嬫満鍙�</view>
+ <view class="right">
+ <text :class="userInfo.mobile ? 'right_info black' : 'right_info'">{{userInfo.mobile ? userInfo.mobile : '鐐瑰嚮鑾峰彇寰俊鎵嬫満鍙�'}}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ <view class="personal_list_item" @click="show = true">
+ <view class="label">鐪熷疄濮撳悕</view>
+ <view class="right">
+ <text :class="userInfo.realname ? 'right_info black' : 'right_info'">{{userInfo.realname ? userInfo.realname : '璇疯緭鍏ョ湡瀹炲鍚�'}}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ <view class="personal_list_item" @click="sex = true">
+ <view class="label">鎬у埆</view>
+ <view class="right">
+ <text class="right_info black" v-if="userInfo.sex === 1">鐢�</text>
+ <text class="right_info black" v-else-if="userInfo.sex === 2">濂�</text>
+ <text class="right_info" v-else>璇烽�夋嫨</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ <view class="personal_list_item" @click="isShow = true">
+ <view class="label">鐢熸棩</view>
+ <view class="right">
+ <text :class="userInfo.birthday ? 'right_info black' : 'right_info'">{{userInfo.birthday ? userInfo.birthday : '璇烽�夋嫨'}}</text>
+ <u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
+ </view>
+ </view>
+ </view>
+ <u-modal :show="show" title="鐪熷疄濮撳悕" :showCancelButton="true" @confirm="confirm1" @cancel="cancel">
+ <view class="personal_input">
+ <input type="text" v-model="from.realname" placeholder="璇疯緭鍏ョ湡瀹炲鍚�" placeholder-class="placeholder">
+ </view>
+ </u-modal>
+ <u-modal :show="show1" title="鏄电О" :showCancelButton="true" @confirm="confirm2" @cancel="cancel1">
+ <view class="personal_input">
+ <input type="nickname" @change="changeName" v-model="from.wechatName" placeholder="璇疯緭鍏ユ樀绉�" placeholder-class="placeholder">
+ </view>
+ </u-modal>
+ <u-picker
+ :show="sex"
+ :columns="columns"
+ @cancel="sex = false"
+ :immediateChange="true"
+ @confirm="confirm"
+ ></u-picker>
+ <u-datetime-picker
+ ref="datetimePicker"
+ :show="isShow"
+ v-model="value1"
+ :minDate="minDate"
+ :maxDate="maxDate"
+ mode="date"
+ @confirm="confirmDate"
+ @cancel="isShow = false"
+ ></u-datetime-picker>
+ </view>
+</template>
+
+<script>
+ import { mapState, mapMutations } from 'vuex'
+
+ export default {
+ data() {
+ return {
+ sex: false,
+ isShow: false,
+ show: false,
+ show1: false,
+ minDate: Number(new Date('1980-01-01')),
+ maxDate: Number(new Date()),
+ defaultAvatar: require('@/static/common/default_user@2x.png'),
+ columns: [
+ ['鐢�', '濂�']
+ ],
+ value1: Number(new Date()),
+ action: this.$baseUrl + 'public/uploadLocal',
+ from: {
+ realname: '',
+ wechatName: ''
+ }
+ }
+ },
+ computed: {
+ ...mapState(['userInfo'])
+ },
+ methods: {
+ ...mapMutations(["setUserInfo"]),
+ changeName(e) {
+ this.from.wechatName = e.detail.value
+ },
+ bindchooseavatar(e) {
+ var that = this
+ uni.uploadFile({
+ url: that.action,
+ files: 'filePath',
+ filePath: e.detail.avatarUrl,
+ name: 'file',
+ formData: {
+ 'folder': 'projects'
+ },
+ success: (uploadFileRes) => {
+ console.log(JSON.parse(uploadFileRes.data))
+ let avatar = JSON.parse(uploadFileRes.data).data.imgaddr
+ that.$u.api.editUserInfo({ avatar })
+ .then(res => {
+ that.getUser()
+ })
+ },
+ fail: (err) => {
+ uni.showToast({
+ title: '涓婁紶澶辫触',
+ icon: "error",
+ duration: 2000
+ });
+ }
+ });
+ },
+ confirm(e) {
+ let sex = null
+ if (e.value[0] === '鐢�') {
+ sex = 1
+ } else if (e.value[0] === '濂�') {
+ sex = 2
+ }
+ this.$u.api.editUserInfo({ sex })
+ .then(res => {
+ this.getUser()
+ this.sex = false
+ })
+ },
+ confirmDate(e) {
+ let birthday = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
+ this.$u.api.editUserInfo({ birthday })
+ .then(res => {
+ this.getUser()
+ this.isShow = false
+ })
+ },
+ // 纭鐪熷疄濮撳悕
+ confirm1() {
+ this.$u.api.editUserInfo({ realname: this.from.realname })
+ .then(res => {
+ this.getUser()
+ this.from.realname = ''
+ this.show = false
+ })
+ },
+ // 鏄电О
+ confirm2() {
+ this.$u.api.editUserInfo({ wechatName: this.from.wechatName })
+ .then(res => {
+ this.getUser()
+ this.from.wechatName = ''
+ this.show1 = false
+ })
+ },
+ cancel1() {
+ this.show1 = false
+ },
+ // 鍏抽棴鐪熷疄濮撳悕
+ cancel() {
+ this.show = false
+ },
+ getUser() {
+ this.$u.api.getUserInfo({})
+ .then(res => {
+ this.setUserInfo(res.data)
+ })
+ }
+ }
+ }
+</script>
+
+<style>
+ page {
+ background-color: #fff !important;
+ }
+</style>
+
+<style lang="scss" scoped>
+ .personal {
+ width: 100%;
+ background-color: #ffffff;
+ .personal_input {
+ width: 100%;
+ height: 98rpx;
+ background: #F8F9FB;
+ border-radius: 8rpx;
+ .placeholder {
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ input {
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ }
+ }
+ .personal_image {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ padding-top: 64rpx;
+ margin-bottom: 60rpx;
+ .personal_image_box {
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 50%;
+ overflow: hidden;
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ .personal_image_box_btn {
+ width: 136rpx;
+ height: 48rpx;
+ line-height: 48rpx;
+ padding: 0 !important;
+ border-radius: 32rpx;
+ border: 1rpx solid #005BFF;
+ font-size: 24rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #005BFF;
+ margin-top: 24rpx;
+ }
+ }
+ .personal_list {
+ display: flex;
+ flex-direction: column;
+ padding: 0 34rpx;
+ box-sizing: border-box;
+ .personal_list_item {
+ width: 100%;
+ height: 96rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 2rpx solid #E5E5E5;
+ &:last-child {
+ border: none !important;
+ }
+ .label {
+ flex-shrink: 0;
+ font-size: 32rpx;
+ font-family: PingFang SC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #333333;
+ margin-right: 30rpx;
+ }
+ .right {
+ display: flex;
+ align-items: center;
+ .black {
+ color: #000000 !important;
+ }
+ .right_info {
+ font-size: 28rpx;
+ font-family: PingFang SC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ text {
+ font-size: 28rpx;
+ font-family: PingFang SC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #666666;
+ margin-right: 12rpx;
+ }
+ }
+ }
+ }
+ .popup2 /deep/ {
+ width: 518rpx;
+ background: #FFFFFF;
+ border-radius: 24rpx;
+ .popup_text {
+ width: 100%;
+ text-align: center;
+ margin: 46rpx 0;
+ font-size: 32rpx;
+ font-family: PingFang SC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #333333;
+ }
+ .popup2_ipt {
+ width: 100%;
+ height: 98rpx;
+ overflow: hidden;
+ border-radius: 8rpx;
+ padding: 0 48rpx;
+ box-sizing: border-box;
+ margin-bottom: 48rpx;
+ .popup2_ipt_box {
+ width: 100%;
+ height: 100%;
+ background: #F8F9FB;
+ .popup2_ipt_p {
+ text-align: center;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #999999;
+ }
+ input {
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ font-size: 28rpx;
+ font-family: PingFangSC-Regular, PingFang SC;
+ font-weight: 400;
+ color: #000000;
+ }
+ }
+ }
+ .popup_box {
+ width: 100%;
+ height: 85rpx;
+ display: flex;
+ align-items: center;
+ border-top: 2rpx solid #C8C8C8;
+ .blue {
+ color: #005BFF !important;
+ }
+ .popup_box_item {
+ flex: 1;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 32rpx;
+ font-family: PingFang SC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #333333;
+ &:first-child {
+ border-right: 2rpx solid #C8C8C8;
+ }
+ }
+ }
+ }
+ .sex {
+ padding: 44rpx 32rpx;
+ background-color: #FFFFFF;
+ box-sizing: border-box;
+ .title {
+ width: 100%;
+ text-align: center;
+ position: relative;
+ text {
+ font-size: 32rpx;
+ font-family: PingFang SC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #333333;
+ }
+ .title_icon {
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+ }
+ .content {
+ width: 100%;
+ margin-top: 80rpx;
+ .picker-view {
+ width: 100%;
+ height: 200rpx;
+ .item {
+ height: 40px;
+ line-height: 40px;
+ text-align: center;
+ }
+ }
+ }
+ .submit {
+ width: 100%;
+ height: 72rpx;
+ line-height: 72rpx;
+ text-align: center;
+ background: #005BFF;
+ border-radius: 36rpx;
+ font-size: 32rpx;
+ font-family: PingFang SC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ margin-top: 50rpx;
+ }
+ }
+ .date {
+ padding: 44rpx 32rpx;
+ background-color: #FFFFFF;
+ box-sizing: border-box;
+ .title {
+ width: 100%;
+ text-align: center;
+ position: relative;
+ text {
+ font-size: 32rpx;
+ font-family: PingFang SC-Semibold, PingFang SC;
+ font-weight: 600;
+ color: #333333;
+ }
+ .title_icon {
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+ }
+ .content {
+ width: 100%;
+ margin-top: 80rpx;
+ .picker-view {
+ width: 100%;
+ height: 600rpx;
+ .item {
+ height: 40px;
+ line-height: 40px;
+ text-align: center;
+ }
+ }
+ }
+ .submit {
+ width: 100%;
+ height: 72rpx;
+ line-height: 72rpx;
+ text-align: center;
+ background: #005BFF;
+ border-radius: 36rpx;
+ font-size: 32rpx;
+ font-family: PingFang SC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ margin-top: 50rpx;
+ }
+ }
+ .personal_footer {
+ position: fixed;
+ width: 100%;
+ left: 0;
+ bottom: 0;
+ background-color: #FFFFFF;
+ box-sizing: border-box;
+ padding: 20rpx 30rpx calc(20rpx + env(safe-area-inset-bottom)) 30rpx;
+ .personal_footer_btn {
+ width: 100%;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ background: #005BFF;
+ border-radius: 44rpx;
+ font-size: 32rpx;
+ font-family: PingFangSC-Medium, PingFang SC;
+ font-weight: 500;
+ color: #FFFFFF;
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/h5/static/meeting/common/123.png b/h5/static/meeting/common/123.png
new file mode 100644
index 0000000..cc9cc35
--- /dev/null
+++ b/h5/static/meeting/common/123.png
Binary files differ
diff --git a/h5/static/meeting/common/364.png b/h5/static/meeting/common/364.png
new file mode 100644
index 0000000..106e065
--- /dev/null
+++ b/h5/static/meeting/common/364.png
Binary files differ
diff --git a/h5/static/meeting/common/default_user@2x.png b/h5/static/meeting/common/default_user@2x.png
new file mode 100644
index 0000000..768afbc
--- /dev/null
+++ b/h5/static/meeting/common/default_user@2x.png
Binary files differ
diff --git a/h5/static/meeting/common/nav_home@2x.png b/h5/static/meeting/common/nav_home@2x.png
new file mode 100644
index 0000000..acf9b90
--- /dev/null
+++ b/h5/static/meeting/common/nav_home@2x.png
Binary files differ
diff --git a/h5/static/meeting/common/nav_home_sel@2x.png b/h5/static/meeting/common/nav_home_sel@2x.png
new file mode 100644
index 0000000..4318c0f
--- /dev/null
+++ b/h5/static/meeting/common/nav_home_sel@2x.png
Binary files differ
diff --git a/h5/static/meeting/common/nav_wode@2x.png b/h5/static/meeting/common/nav_wode@2x.png
new file mode 100644
index 0000000..09dbde9
--- /dev/null
+++ b/h5/static/meeting/common/nav_wode@2x.png
Binary files differ
diff --git a/h5/static/meeting/common/nav_wode_sel@2x.png b/h5/static/meeting/common/nav_wode_sel@2x.png
new file mode 100644
index 0000000..0abd7d0
--- /dev/null
+++ b/h5/static/meeting/common/nav_wode_sel@2x.png
Binary files differ
diff --git a/h5/static/meeting/common/nav_yuyue@2x.png b/h5/static/meeting/common/nav_yuyue@2x.png
new file mode 100644
index 0000000..c2bd8c3
--- /dev/null
+++ b/h5/static/meeting/common/nav_yuyue@2x.png
Binary files differ
diff --git a/h5/static/meeting/customicons.css b/h5/static/meeting/customicons.css
new file mode 100644
index 0000000..14ed5fa
--- /dev/null
+++ b/h5/static/meeting/customicons.css
@@ -0,0 +1,20 @@
+@font-face {
+ font-family: "customicons"; /* Project id 2878519 */
+ src:url('/static/customicons.ttf') format('truetype');
+}
+
+.customicons {
+ font-family: "customicons" !important;
+}
+
+.youxi:before {
+ content: "\e60e";
+}
+
+.wenjian:before {
+ content: "\e60f";
+}
+
+.zhuanfa:before {
+ content: "\e610";
+}
diff --git a/h5/static/meeting/customicons.ttf b/h5/static/meeting/customicons.ttf
new file mode 100644
index 0000000..a3c8ab9
--- /dev/null
+++ b/h5/static/meeting/customicons.ttf
Binary files differ
diff --git a/h5/static/meeting/icon/ar_left@2x.png b/h5/static/meeting/icon/ar_left@2x.png
new file mode 100644
index 0000000..204b66b
--- /dev/null
+++ b/h5/static/meeting/icon/ar_left@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ar_left_disable.png b/h5/static/meeting/icon/ar_left_disable.png
new file mode 100644
index 0000000..ee2915e
--- /dev/null
+++ b/h5/static/meeting/icon/ar_left_disable.png
Binary files differ
diff --git a/h5/static/meeting/icon/ar_open@2x.png b/h5/static/meeting/icon/ar_open@2x.png
new file mode 100644
index 0000000..1731d0b
--- /dev/null
+++ b/h5/static/meeting/icon/ar_open@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ar_right@2x.png b/h5/static/meeting/icon/ar_right@2x.png
new file mode 100644
index 0000000..5092ad6
--- /dev/null
+++ b/h5/static/meeting/icon/ar_right@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/home_ic_notice@2x.png b/h5/static/meeting/icon/home_ic_notice@2x.png
new file mode 100644
index 0000000..6f7b0f8
--- /dev/null
+++ b/h5/static/meeting/icon/home_ic_notice@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_cancel@2x.png b/h5/static/meeting/icon/ic_cancel@2x.png
new file mode 100644
index 0000000..56a608e
--- /dev/null
+++ b/h5/static/meeting/icon/ic_cancel@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_choose@2x.png b/h5/static/meeting/icon/ic_choose@2x.png
new file mode 100644
index 0000000..5f08aed
--- /dev/null
+++ b/h5/static/meeting/icon/ic_choose@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_choose_sel@2x.png b/h5/static/meeting/icon/ic_choose_sel@2x.png
new file mode 100644
index 0000000..e0345ae
--- /dev/null
+++ b/h5/static/meeting/icon/ic_choose_sel@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_copy@2x.png b/h5/static/meeting/icon/ic_copy@2x.png
new file mode 100644
index 0000000..e1732b6
--- /dev/null
+++ b/h5/static/meeting/icon/ic_copy@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_edit@2x.png b/h5/static/meeting/icon/ic_edit@2x.png
new file mode 100644
index 0000000..df4cd44
--- /dev/null
+++ b/h5/static/meeting/icon/ic_edit@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_fenxiang@2x.png b/h5/static/meeting/icon/ic_fenxiang@2x.png
new file mode 100644
index 0000000..13a241d
--- /dev/null
+++ b/h5/static/meeting/icon/ic_fenxiang@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_time@2x.png b/h5/static/meeting/icon/ic_time@2x.png
new file mode 100644
index 0000000..28a156a
--- /dev/null
+++ b/h5/static/meeting/icon/ic_time@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/ic_upload@2x.png b/h5/static/meeting/icon/ic_upload@2x.png
new file mode 100644
index 0000000..e7cc69d
--- /dev/null
+++ b/h5/static/meeting/icon/ic_upload@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/renyuan_ic_open@2x.png b/h5/static/meeting/icon/renyuan_ic_open@2x.png
new file mode 100644
index 0000000..1f98d98
--- /dev/null
+++ b/h5/static/meeting/icon/renyuan_ic_open@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/wd_ic_guanli@2x.png b/h5/static/meeting/icon/wd_ic_guanli@2x.png
new file mode 100644
index 0000000..be86fb7
--- /dev/null
+++ b/h5/static/meeting/icon/wd_ic_guanli@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/wd_ic_mima@2x.png b/h5/static/meeting/icon/wd_ic_mima@2x.png
new file mode 100644
index 0000000..981e038
--- /dev/null
+++ b/h5/static/meeting/icon/wd_ic_mima@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/wd_ic_yuyue@2x.png b/h5/static/meeting/icon/wd_ic_yuyue@2x.png
new file mode 100644
index 0000000..5feea00
--- /dev/null
+++ b/h5/static/meeting/icon/wd_ic_yuyue@2x.png
Binary files differ
diff --git a/h5/static/meeting/icon/wd_ic_ziliao@2x.png b/h5/static/meeting/icon/wd_ic_ziliao@2x.png
new file mode 100644
index 0000000..26ced45
--- /dev/null
+++ b/h5/static/meeting/icon/wd_ic_ziliao@2x.png
Binary files differ
diff --git "a/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x\0501\051.png" "b/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x\0501\051.png"
new file mode 100644
index 0000000..78fdad8
--- /dev/null
+++ "b/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x\0501\051.png"
Binary files differ
diff --git a/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x.png b/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x.png
new file mode 100644
index 0000000..4ef0a85
--- /dev/null
+++ b/h5/static/meeting/icon/xiaoxi_ic_gonggao@2x.png
Binary files differ
diff --git a/h5/utils/http.api.js b/h5/utils/http.api.js
index 3dc870c..7b289fd 100644
--- a/h5/utils/http.api.js
+++ b/h5/utils/http.api.js
@@ -1,10 +1,16 @@
+export const baseUrl = 'api/'
+export const uploadUrl = `${baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do`
+
const install = (Vue, vm) => {
uni.$u.http.setConfig((config) => {
- config.baseURL = vm.$baseUrl;
- config.timeout = 60000;
+ config.baseURL = baseUrl;
+ config.timeout = 60000;
return config;
})
+
+ Vue.prototype.$baseUrl = baseUrl;
+ Vue.prototype.$uploadUrl = uploadUrl;
let wxAuthorize = (params = {}) => vm.$u.http.get('visitsAdmin/cloudService/web/visitor/wxAuthorize', { params }); // 璁垮寰俊鎺堟潈
let getSystemDictData = (params = {}) => vm.$u.http.get('visitsAdmin/cloudService/web/other/getSystemDictData', { params }); // 鏌ヨ瀛楀吀鍊兼暟鎹�
@@ -14,6 +20,8 @@
let getVisitedMember = (data = {}) => vm.$u.http.post('visitsAdmin/cloudService/web/visitor/getVisitedMember', data); // 鏌ヨ琚闂汉淇℃伅
let createFk = (data = {}) => vm.$u.http.post('visitsAdmin/cloudService/web/visitor/createFk', data); // 璁垮璁板綍鎻愪氦
let detail = (params = {}) => vm.$u.http.get('visitsAdmin/cloudService/web/visitor/detail', { params }); // 璁垮璁板綍璇︽儏
+
+
vm.$u.api = {
wxAuthorize,
diff --git a/h5/utils/login.js b/h5/utils/login.js
new file mode 100644
index 0000000..a9c95b5
--- /dev/null
+++ b/h5/utils/login.js
@@ -0,0 +1,60 @@
+import Vue from 'vue'
+
+// 鍒ゆ柇鏄惁鐧诲綍
+export function isLogin(type) {
+ // console.log('鍒ゆ柇鏄惁鐧诲綍');
+ if (type === 'empty') {
+ loginAction()
+ return
+ }
+ if (!uni.getStorageSync('token')) {
+ console.log('鏈櫥褰�');
+ loginAction()
+ } else {
+ console.log('宸茬櫥褰�');
+ let oldTime = Number(uni.getStorageSync('time'))
+ let s = (new Date().valueOf() - oldTime) / 1000
+ let h = s / 60 / 60
+ console.log(h)
+ if (h >= 120) {
+ console.log('杩囨湡');
+ loginAction()
+ } else {
+ console.log('鏈繃鏈�');
+ Vue.prototype.$reslove()
+ }
+ }
+}
+
+function loginAction() {
+ // console.log('getProvider 鍓�');
+ uni.getProvider({
+ service: 'oauth',
+
+ success: function(res) {
+ // console.log('鑾峰彇鎺堟潈鎴愬姛');
+ uni.login({
+ provider: res.provider,
+ scopes: 'auth_user',
+ success: function(loginRes) {
+
+ // #ifdef MP-WEIXIN
+ // wxLogin({ code: loginRes.code })
+ // .then(resData => {
+ // uni.setStorageSync('token', resData.data.token);
+ // uni.setStorageSync('avatarUrl', resData.data.member.avatarUrl);
+ // uni.setStorageSync('nickName', resData.data.member.nickName);
+ // uni.setStorageSync('realName', resData.data.member.realName);
+ // uni.setStorageSync('gender', resData.data.member.gender);
+ // uni.setStorageSync('mobile', resData.data.member.mobile);
+ // uni.setStorageSync('sessionKey', resData.data.sessionKey);
+ // uni.setStorageSync('time', new Date().valueOf());
+ // Vue.prototype.$reslove()
+ // })
+ // #endif
+ }
+ })
+ }
+ })
+}
+
diff --git a/h5/utils/meetingHttp.js b/h5/utils/meetingHttp.js
new file mode 100644
index 0000000..78881ad
--- /dev/null
+++ b/h5/utils/meetingHttp.js
@@ -0,0 +1,71 @@
+import { baseUrl } from './http.api'
+
+const install = (Vue, vm) => {
+
+ uni.$u.http.setConfig((config) => {
+ config.baseURL = baseURL;
+ config.timeout = 60000;
+ return config;
+ })
+
+ Vue.prototype.$baseUrl = baseUrl;
+ Vue.prototype.$uploadUrl = uploadUrl;
+
+ let ordinaryLogin = (params = {}) => uni.$u.http.get('web/account/ordinaryLogin', { params })
+ let wxEmpower = (params = {}) => uni.$u.http.get('web/account/wxEmpower', { params })
+ let editUserInfo = (data = {}) => vm.$u.http.post('web/account/editUserInfo', data);
+ let getUserInfo = (params = {}) => vm.$u.http.get('web/account/getUserInfo', { params });
+ let roomsList = (params = {}) => vm.$u.http.get('web/rooms/roomsList', { params });
+ let getRoomUseTime = (data = {}) => vm.$u.http.post('web/rooms/getRoomUseTime', data);
+ let userPage = (data = {}) => vm.$u.http.post('web/meeting/userPage', data);
+ let getRoomDetail = (params = {}) => vm.$u.http.get('web/rooms/getRoomDetail', { params });
+ let reservationMeeting = (data = {}) => vm.$u.http.post('web/meeting/reservationMeeting', data);
+ let meetingDetail = (params = {}) => vm.$u.http.get('web/meeting/meetingDetail', { params });
+ let getQrCode = (params = {}) => vm.$u.http.get('web/meeting/getQrCode', { params });
+ let reservationCancel = (params = {}) => vm.$u.http.get('web/meeting/reservationCancel', { params });
+ let resetPwd = (data = {}) => vm.$u.http.post('web/account/resetPwd', data);
+ let myMeetingPage = (data = {}) => vm.$u.http.post('web/meeting/myMeetingPage', data);
+ let myRoomsPage = (data = {}) => vm.$u.http.post('web/rooms/myRoomsPage', data);
+ let findNoticePage = (data = {}) => vm.$u.http.post('web/notice/findNoticePage', data);
+ let getMemberDTO = (params = {}) => vm.$u.http.get('web/notice/getMemberDTO', { params });
+ let findNewNotice = (params = {}) => vm.$u.http.get('web/notice/findNewNotice', { params });
+ let monthMeeting = (params = {}) => vm.$u.http.get('web/meeting/monthMeeting', { params });
+ let roomsGetQrCode = (params = {}) => vm.$u.http.get('web/rooms/getQrCode', { params });
+ let getSystemDictData = (params = {}) => vm.$u.http.get('web/util/getSystemDictData', { params });
+ let getQrCodeImg = (params = {}) => vm.$u.http.get('web/meeting/getQrCodeImg', { params });
+ let visitorLogin = (params = {}) => vm.$u.http.get('web/account/visitorLogin', { params });
+ let visitorWxPhone = (data = {}) => vm.$u.http.post('web/account/visitorWxPhone', data);
+ let getNoticeDetail = (params = {}) => vm.$u.http.get('web/notice/getNoticeDetail', { params });
+
+
+
+ vm.$u.api = {
+ ordinaryLogin,
+ wxEmpower,
+ editUserInfo,
+ getUserInfo,
+ roomsList,
+ getRoomUseTime,
+ userPage,
+ getRoomDetail,
+ reservationMeeting,
+ meetingDetail,
+ getQrCode,
+ reservationCancel,
+ resetPwd,
+ myMeetingPage,
+ myRoomsPage,
+ findNoticePage,
+ getMemberDTO,
+ findNewNotice,
+ monthMeeting,
+ roomsGetQrCode,
+ getSystemDictData,
+ getQrCodeImg,
+ visitorLogin,
+ visitorWxPhone,
+ getNoticeDetail
+ };
+}
+
+export default { install }
\ No newline at end of file
diff --git a/h5/utils/qrcode.js b/h5/utils/qrcode.js
new file mode 100644
index 0000000..d1a71f1
--- /dev/null
+++ b/h5/utils/qrcode.js
@@ -0,0 +1,1201 @@
+let QRCode = {};
+(function () {
+ /**
+ * 鑾峰彇鍗曚釜瀛楃鐨剈tf8缂栫爜
+ * unicode BMP骞抽潰绾�65535涓瓧绗�
+ * @param {num} code
+ * return {array}
+ */
+ function unicodeFormat8(code) {
+ // 1 byte
+ var c0, c1, c2;
+ if (code < 128) {
+ return [code];
+ // 2 bytes
+ } else if (code < 2048) {
+ c0 = 192 + (code >> 6);
+ c1 = 128 + (code & 63);
+ return [c0, c1];
+ // 3 bytes
+ } else {
+ c0 = 224 + (code >> 12);
+ c1 = 128 + (code >> 6 & 63);
+ c2 = 128 + (code & 63);
+ return [c0, c1, c2];
+ }
+ }
+ /**
+ * 鑾峰彇瀛楃涓茬殑utf8缂栫爜瀛楄妭涓�
+ * @param {string} string
+ * @return {array}
+ */
+ function getUTF8Bytes(string) {
+ var utf8codes = [];
+ for (var i = 0; i < string.length; i++) {
+ var code = string.charCodeAt(i);
+ var utf8 = unicodeFormat8(code);
+ for (var j = 0; j < utf8.length; j++) {
+ utf8codes.push(utf8[j]);
+ }
+ }
+ return utf8codes;
+ }
+ /**
+ * 浜岀淮鐮佺畻娉曞疄鐜�
+ * @param {string} data 瑕佺紪鐮佺殑淇℃伅瀛楃涓�
+ * @param {num} errorCorrectLevel 绾犻敊绛夌骇
+ */
+ function QRCodeAlg(data, errorCorrectLevel) {
+ this.typeNumber = -1; //鐗堟湰
+ this.errorCorrectLevel = errorCorrectLevel;
+ this.modules = null; //浜岀淮鐭╅樀锛屽瓨鏀炬渶缁堢粨鏋�
+ this.moduleCount = 0; //鐭╅樀澶у皬
+ this.dataCache = null; //鏁版嵁缂撳瓨
+ this.rsBlocks = null; //鐗堟湰鏁版嵁淇℃伅
+ this.totalDataCount = -1; //鍙娇鐢ㄧ殑鏁版嵁閲�
+ this.data = data;
+ this.utf8bytes = getUTF8Bytes(data);
+ this.make();
+ }
+ QRCodeAlg.prototype = {
+ constructor: QRCodeAlg,
+ /**
+ * 鑾峰彇浜岀淮鐮佺煩闃靛ぇ灏�
+ * @return {num} 鐭╅樀澶у皬
+ */
+ getModuleCount: function () {
+ return this.moduleCount;
+ },
+ /**
+ * 缂栫爜
+ */
+ make: function () {
+ this.getRightType();
+ this.dataCache = this.createData();
+ this.createQrcode();
+ },
+ /**
+ * 璁剧疆浜屼綅鐭╅樀鍔熻兘鍥惧舰
+ * @param {bool} test 琛ㄧず鏄惁鍦ㄥ鎵炬渶濂芥帺鑶滈樁娈�
+ * @param {num} maskPattern 鎺╄啘鐨勭増鏈�
+ */
+ makeImpl: function (maskPattern) {
+ this.moduleCount = this.typeNumber * 4 + 17;
+ this.modules = new Array(this.moduleCount);
+ for (var row = 0; row < this.moduleCount; row++) {
+ this.modules[row] = new Array(this.moduleCount);
+ }
+ this.setupPositionProbePattern(0, 0);
+ this.setupPositionProbePattern(this.moduleCount - 7, 0);
+ this.setupPositionProbePattern(0, this.moduleCount - 7);
+ this.setupPositionAdjustPattern();
+ this.setupTimingPattern();
+ this.setupTypeInfo(true, maskPattern);
+ if (this.typeNumber >= 7) {
+ this.setupTypeNumber(true);
+ }
+ this.mapData(this.dataCache, maskPattern);
+ },
+ /**
+ * 璁剧疆浜岀淮鐮佺殑浣嶇疆鎺㈡祴鍥惧舰
+ * @param {num} row 鎺㈡祴鍥惧舰鐨勪腑蹇冩í鍧愭爣
+ * @param {num} col 鎺㈡祴鍥惧舰鐨勪腑蹇冪旱鍧愭爣
+ */
+ setupPositionProbePattern: function (row, col) {
+ for (var r = -1; r <= 7; r++) {
+ if (row + r <= -1 || this.moduleCount <= row + r) continue;
+ for (var c = -1; c <= 7; c++) {
+ if (col + c <= -1 || this.moduleCount <= col + c) continue;
+ if ((0 <= r && r <= 6 && (c == 0 || c == 6)) || (0 <= c && c <= 6 && (r == 0 || r == 6)) || (2 <= r && r <= 4 && 2 <= c && c <= 4)) {
+ this.modules[row + r][col + c] = true;
+ } else {
+ this.modules[row + r][col + c] = false;
+ }
+ }
+ }
+ },
+ /**
+ * 鍒涘缓浜岀淮鐮�
+ * @return {[type]} [description]
+ */
+ createQrcode: function () {
+ var minLostPoint = 0;
+ var pattern = 0;
+ var bestModules = null;
+ for (var i = 0; i < 8; i++) {
+ this.makeImpl(i);
+ var lostPoint = QRUtil.getLostPoint(this);
+ if (i == 0 || minLostPoint > lostPoint) {
+ minLostPoint = lostPoint;
+ pattern = i;
+ bestModules = this.modules;
+ }
+ }
+ this.modules = bestModules;
+ this.setupTypeInfo(false, pattern);
+ if (this.typeNumber >= 7) {
+ this.setupTypeNumber(false);
+ }
+ },
+ /**
+ * 璁剧疆瀹氫綅鍥惧舰
+ * @return {[type]} [description]
+ */
+ setupTimingPattern: function () {
+ for (var r = 8; r < this.moduleCount - 8; r++) {
+ if (this.modules[r][6] != null) {
+ continue;
+ }
+ this.modules[r][6] = (r % 2 == 0);
+ if (this.modules[6][r] != null) {
+ continue;
+ }
+ this.modules[6][r] = (r % 2 == 0);
+ }
+ },
+ /**
+ * 璁剧疆鐭鍥惧舰
+ * @return {[type]} [description]
+ */
+ setupPositionAdjustPattern: function () {
+ var pos = QRUtil.getPatternPosition(this.typeNumber);
+ for (var i = 0; i < pos.length; i++) {
+ for (var j = 0; j < pos.length; j++) {
+ var row = pos[i];
+ var col = pos[j];
+ if (this.modules[row][col] != null) {
+ continue;
+ }
+ for (var r = -2; r <= 2; r++) {
+ for (var c = -2; c <= 2; c++) {
+ if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0)) {
+ this.modules[row + r][col + c] = true;
+ } else {
+ this.modules[row + r][col + c] = false;
+ }
+ }
+ }
+ }
+ }
+ },
+ /**
+ * 璁剧疆鐗堟湰淇℃伅锛�7浠ヤ笂鐗堟湰鎵嶆湁锛�
+ * @param {bool} test 鏄惁澶勪簬鍒ゆ柇鏈�浣虫帺鑶滈樁娈�
+ * @return {[type]} [description]
+ */
+ setupTypeNumber: function (test) {
+ var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
+ for (var i = 0; i < 18; i++) {
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
+ this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
+ }
+ },
+ /**
+ * 璁剧疆鏍煎紡淇℃伅锛堢籂閿欑瓑绾у拰鎺╄啘鐗堟湰锛�
+ * @param {bool} test
+ * @param {num} maskPattern 鎺╄啘鐗堟湰
+ * @return {}
+ */
+ setupTypeInfo: function (test, maskPattern) {
+ var data = (QRErrorCorrectLevel[this.errorCorrectLevel] << 3) | maskPattern;
+ var bits = QRUtil.getBCHTypeInfo(data);
+ // vertical
+ for (var i = 0; i < 15; i++) {
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ if (i < 6) {
+ this.modules[i][8] = mod;
+ } else if (i < 8) {
+ this.modules[i + 1][8] = mod;
+ } else {
+ this.modules[this.moduleCount - 15 + i][8] = mod;
+ }
+ // horizontal
+ var mod = (!test && ((bits >> i) & 1) == 1);
+ if (i < 8) {
+ this.modules[8][this.moduleCount - i - 1] = mod;
+ } else if (i < 9) {
+ this.modules[8][15 - i - 1 + 1] = mod;
+ } else {
+ this.modules[8][15 - i - 1] = mod;
+ }
+ }
+ // fixed module
+ this.modules[this.moduleCount - 8][8] = (!test);
+ },
+ /**
+ * 鏁版嵁缂栫爜
+ * @return {[type]} [description]
+ */
+ createData: function () {
+ var buffer = new QRBitBuffer();
+ var lengthBits = this.typeNumber > 9 ? 16 : 8;
+ buffer.put(4, 4); //娣诲姞妯″紡
+ buffer.put(this.utf8bytes.length, lengthBits);
+ for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
+ buffer.put(this.utf8bytes[i], 8);
+ }
+ if (buffer.length + 4 <= this.totalDataCount * 8) {
+ buffer.put(0, 4);
+ }
+ // padding
+ while (buffer.length % 8 != 0) {
+ buffer.putBit(false);
+ }
+ // padding
+ while (true) {
+ if (buffer.length >= this.totalDataCount * 8) {
+ break;
+ }
+ buffer.put(QRCodeAlg.PAD0, 8);
+ if (buffer.length >= this.totalDataCount * 8) {
+ break;
+ }
+ buffer.put(QRCodeAlg.PAD1, 8);
+ }
+ return this.createBytes(buffer);
+ },
+ /**
+ * 绾犻敊鐮佺紪鐮�
+ * @param {buffer} buffer 鏁版嵁缂栫爜
+ * @return {[type]}
+ */
+ createBytes: function (buffer) {
+ var offset = 0;
+ var maxDcCount = 0;
+ var maxEcCount = 0;
+ var length = this.rsBlock.length / 3;
+ var rsBlocks = new Array();
+ for (var i = 0; i < length; i++) {
+ var count = this.rsBlock[i * 3 + 0];
+ var totalCount = this.rsBlock[i * 3 + 1];
+ var dataCount = this.rsBlock[i * 3 + 2];
+ for (var j = 0; j < count; j++) {
+ rsBlocks.push([dataCount, totalCount]);
+ }
+ }
+ var dcdata = new Array(rsBlocks.length);
+ var ecdata = new Array(rsBlocks.length);
+ for (var r = 0; r < rsBlocks.length; r++) {
+ var dcCount = rsBlocks[r][0];
+ var ecCount = rsBlocks[r][1] - dcCount;
+ maxDcCount = Math.max(maxDcCount, dcCount);
+ maxEcCount = Math.max(maxEcCount, ecCount);
+ dcdata[r] = new Array(dcCount);
+ for (var i = 0; i < dcdata[r].length; i++) {
+ dcdata[r][i] = 0xff & buffer.buffer[i + offset];
+ }
+ offset += dcCount;
+ var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
+ var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
+ var modPoly = rawPoly.mod(rsPoly);
+ ecdata[r] = new Array(rsPoly.getLength() - 1);
+ for (var i = 0; i < ecdata[r].length; i++) {
+ var modIndex = i + modPoly.getLength() - ecdata[r].length;
+ ecdata[r][i] = (modIndex >= 0) ? modPoly.get(modIndex) : 0;
+ }
+ }
+ var data = new Array(this.totalDataCount);
+ var index = 0;
+ for (var i = 0; i < maxDcCount; i++) {
+ for (var r = 0; r < rsBlocks.length; r++) {
+ if (i < dcdata[r].length) {
+ data[index++] = dcdata[r][i];
+ }
+ }
+ }
+ for (var i = 0; i < maxEcCount; i++) {
+ for (var r = 0; r < rsBlocks.length; r++) {
+ if (i < ecdata[r].length) {
+ data[index++] = ecdata[r][i];
+ }
+ }
+ }
+ return data;
+
+ },
+ /**
+ * 甯冪疆妯″潡锛屾瀯寤烘渶缁堜俊鎭�
+ * @param {} data
+ * @param {} maskPattern
+ * @return {}
+ */
+ mapData: function (data, maskPattern) {
+ var inc = -1;
+ var row = this.moduleCount - 1;
+ var bitIndex = 7;
+ var byteIndex = 0;
+ for (var col = this.moduleCount - 1; col > 0; col -= 2) {
+ if (col == 6) col--;
+ while (true) {
+ for (var c = 0; c < 2; c++) {
+ if (this.modules[row][col - c] == null) {
+ var dark = false;
+ if (byteIndex < data.length) {
+ dark = (((data[byteIndex] >>> bitIndex) & 1) == 1);
+ }
+ var mask = QRUtil.getMask(maskPattern, row, col - c);
+ if (mask) {
+ dark = !dark;
+ }
+ this.modules[row][col - c] = dark;
+ bitIndex--;
+ if (bitIndex == -1) {
+ byteIndex++;
+ bitIndex = 7;
+ }
+ }
+ }
+ row += inc;
+ if (row < 0 || this.moduleCount <= row) {
+ row -= inc;
+ inc = -inc;
+ break;
+ }
+ }
+ }
+ }
+ };
+ /**
+ * 濉厖瀛楁
+ */
+ QRCodeAlg.PAD0 = 0xEC;
+ QRCodeAlg.PAD1 = 0x11;
+ //---------------------------------------------------------------------
+ // 绾犻敊绛夌骇瀵瑰簲鐨勭紪鐮�
+ //---------------------------------------------------------------------
+ var QRErrorCorrectLevel = [1, 0, 3, 2];
+ //---------------------------------------------------------------------
+ // 鎺╄啘鐗堟湰
+ //---------------------------------------------------------------------
+ var QRMaskPattern = {
+ PATTERN000: 0,
+ PATTERN001: 1,
+ PATTERN010: 2,
+ PATTERN011: 3,
+ PATTERN100: 4,
+ PATTERN101: 5,
+ PATTERN110: 6,
+ PATTERN111: 7
+ };
+ //---------------------------------------------------------------------
+ // 宸ュ叿绫�
+ //---------------------------------------------------------------------
+ var QRUtil = {
+ /*
+ 姣忎釜鐗堟湰鐭鍥惧舰鐨勪綅缃�
+ */
+ PATTERN_POSITION_TABLE: [
+ [],
+ [6, 18],
+ [6, 22],
+ [6, 26],
+ [6, 30],
+ [6, 34],
+ [6, 22, 38],
+ [6, 24, 42],
+ [6, 26, 46],
+ [6, 28, 50],
+ [6, 30, 54],
+ [6, 32, 58],
+ [6, 34, 62],
+ [6, 26, 46, 66],
+ [6, 26, 48, 70],
+ [6, 26, 50, 74],
+ [6, 30, 54, 78],
+ [6, 30, 56, 82],
+ [6, 30, 58, 86],
+ [6, 34, 62, 90],
+ [6, 28, 50, 72, 94],
+ [6, 26, 50, 74, 98],
+ [6, 30, 54, 78, 102],
+ [6, 28, 54, 80, 106],
+ [6, 32, 58, 84, 110],
+ [6, 30, 58, 86, 114],
+ [6, 34, 62, 90, 118],
+ [6, 26, 50, 74, 98, 122],
+ [6, 30, 54, 78, 102, 126],
+ [6, 26, 52, 78, 104, 130],
+ [6, 30, 56, 82, 108, 134],
+ [6, 34, 60, 86, 112, 138],
+ [6, 30, 58, 86, 114, 142],
+ [6, 34, 62, 90, 118, 146],
+ [6, 30, 54, 78, 102, 126, 150],
+ [6, 24, 50, 76, 102, 128, 154],
+ [6, 28, 54, 80, 106, 132, 158],
+ [6, 32, 58, 84, 110, 136, 162],
+ [6, 26, 54, 82, 110, 138, 166],
+ [6, 30, 58, 86, 114, 142, 170]
+ ],
+ G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
+ G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
+ G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
+ /*
+ BCH缂栫爜鏍煎紡淇℃伅
+ */
+ getBCHTypeInfo: function (data) {
+ var d = data << 10;
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
+ d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15)));
+ }
+ return ((data << 10) | d) ^ QRUtil.G15_MASK;
+ },
+ /*
+ BCH缂栫爜鐗堟湰淇℃伅
+ */
+ getBCHTypeNumber: function (data) {
+ var d = data << 12;
+ while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
+ d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18)));
+ }
+ return (data << 12) | d;
+ },
+ /*
+ 鑾峰彇BCH浣嶄俊鎭�
+ */
+ getBCHDigit: function (data) {
+ var digit = 0;
+ while (data != 0) {
+ digit++;
+ data >>>= 1;
+ }
+ return digit;
+ },
+ /*
+ 鑾峰彇鐗堟湰瀵瑰簲鐨勭煫姝e浘褰綅缃�
+ */
+ getPatternPosition: function (typeNumber) {
+ return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
+ },
+ /*
+ 鎺╄啘绠楁硶
+ */
+ getMask: function (maskPattern, i, j) {
+ switch (maskPattern) {
+ case QRMaskPattern.PATTERN000:
+ return (i + j) % 2 == 0;
+ case QRMaskPattern.PATTERN001:
+ return i % 2 == 0;
+ case QRMaskPattern.PATTERN010:
+ return j % 3 == 0;
+ case QRMaskPattern.PATTERN011:
+ return (i + j) % 3 == 0;
+ case QRMaskPattern.PATTERN100:
+ return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
+ case QRMaskPattern.PATTERN101:
+ return (i * j) % 2 + (i * j) % 3 == 0;
+ case QRMaskPattern.PATTERN110:
+ return ((i * j) % 2 + (i * j) % 3) % 2 == 0;
+ case QRMaskPattern.PATTERN111:
+ return ((i * j) % 3 + (i + j) % 2) % 2 == 0;
+ default:
+ throw new Error("bad maskPattern:" + maskPattern);
+ }
+ },
+ /*
+ 鑾峰彇RS鐨勭籂閿欏椤瑰紡
+ */
+ getErrorCorrectPolynomial: function (errorCorrectLength) {
+ var a = new QRPolynomial([1], 0);
+ for (var i = 0; i < errorCorrectLength; i++) {
+ a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
+ }
+ return a;
+ },
+ /*
+ 鑾峰彇璇勪环
+ */
+ getLostPoint: function (qrCode) {
+ var moduleCount = qrCode.getModuleCount(),
+ lostPoint = 0,
+ darkCount = 0;
+ for (var row = 0; row < moduleCount; row++) {
+ var sameCount = 0;
+ var head = qrCode.modules[row][0];
+ for (var col = 0; col < moduleCount; col++) {
+ var current = qrCode.modules[row][col];
+ //level 3 璇勪环
+ if (col < moduleCount - 6) {
+ if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
+ if (col < moduleCount - 10) {
+ if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
+ lostPoint += 40;
+ }
+ } else if (col > 3) {
+ if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
+ lostPoint += 40;
+ }
+ }
+ }
+ }
+ //level 2 璇勪环
+ if ((row < moduleCount - 1) && (col < moduleCount - 1)) {
+ var count = 0;
+ if (current) count++;
+ if (qrCode.modules[row + 1][col]) count++;
+ if (qrCode.modules[row][col + 1]) count++;
+ if (qrCode.modules[row + 1][col + 1]) count++;
+ if (count == 0 || count == 4) {
+ lostPoint += 3;
+ }
+ }
+ //level 1 璇勪环
+ if (head ^ current) {
+ sameCount++;
+ } else {
+ head = current;
+ if (sameCount >= 5) {
+ lostPoint += (3 + sameCount - 5);
+ }
+ sameCount = 1;
+ }
+ //level 4 璇勪环
+ if (current) {
+ darkCount++;
+ }
+ }
+ }
+ for (var col = 0; col < moduleCount; col++) {
+ var sameCount = 0;
+ var head = qrCode.modules[0][col];
+ for (var row = 0; row < moduleCount; row++) {
+ var current = qrCode.modules[row][col];
+ //level 3 璇勪环
+ if (row < moduleCount - 6) {
+ if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
+ if (row < moduleCount - 10) {
+ if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
+ lostPoint += 40;
+ }
+ } else if (row > 3) {
+ if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
+ lostPoint += 40;
+ }
+ }
+ }
+ }
+ //level 1 璇勪环
+ if (head ^ current) {
+ sameCount++;
+ } else {
+ head = current;
+ if (sameCount >= 5) {
+ lostPoint += (3 + sameCount - 5);
+ }
+ sameCount = 1;
+ }
+ }
+ }
+ // LEVEL4
+ var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
+ lostPoint += ratio * 10;
+ return lostPoint;
+ }
+
+ };
+ //---------------------------------------------------------------------
+ // QRMath浣跨敤鐨勬暟瀛﹀伐鍏�
+ //---------------------------------------------------------------------
+ var QRMath = {
+ /*
+ 灏唍杞寲涓篴^m
+ */
+ glog: function (n) {
+ if (n < 1) {
+ throw new Error("glog(" + n + ")");
+ }
+ return QRMath.LOG_TABLE[n];
+ },
+ /*
+ 灏哸^m杞寲涓簄
+ */
+ gexp: function (n) {
+ while (n < 0) {
+ n += 255;
+ }
+ while (n >= 256) {
+ n -= 255;
+ }
+ return QRMath.EXP_TABLE[n];
+ },
+ EXP_TABLE: new Array(256),
+ LOG_TABLE: new Array(256)
+
+ };
+ for (var i = 0; i < 8; i++) {
+ QRMath.EXP_TABLE[i] = 1 << i;
+ }
+ for (var i = 8; i < 256; i++) {
+ QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
+ }
+ for (var i = 0; i < 255; i++) {
+ QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
+ }
+ //---------------------------------------------------------------------
+ // QRPolynomial 澶氶」寮�
+ //---------------------------------------------------------------------
+ /**
+ * 澶氶」寮忕被
+ * @param {Array} num 绯绘暟
+ * @param {num} shift a^shift
+ */
+ function QRPolynomial(num, shift) {
+ if (num.length == undefined) {
+ throw new Error(num.length + "/" + shift);
+ }
+ var offset = 0;
+ while (offset < num.length && num[offset] == 0) {
+ offset++;
+ }
+ this.num = new Array(num.length - offset + shift);
+ for (var i = 0; i < num.length - offset; i++) {
+ this.num[i] = num[i + offset];
+ }
+ }
+ QRPolynomial.prototype = {
+ get: function (index) {
+ return this.num[index];
+ },
+ getLength: function () {
+ return this.num.length;
+ },
+ /**
+ * 澶氶」寮忎箻娉�
+ * @param {QRPolynomial} e 琚箻澶氶」寮�
+ * @return {[type]} [description]
+ */
+ multiply: function (e) {
+ var num = new Array(this.getLength() + e.getLength() - 1);
+ for (var i = 0; i < this.getLength(); i++) {
+ for (var j = 0; j < e.getLength(); j++) {
+ num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
+ }
+ }
+ return new QRPolynomial(num, 0);
+ },
+ /**
+ * 澶氶」寮忔ā杩愮畻
+ * @param {QRPolynomial} e 妯″椤瑰紡
+ * @return {}
+ */
+ mod: function (e) {
+ var tl = this.getLength(),
+ el = e.getLength();
+ if (tl - el < 0) {
+ return this;
+ }
+ var num = new Array(tl);
+ for (var i = 0; i < tl; i++) {
+ num[i] = this.get(i);
+ }
+ while (num.length >= el) {
+ var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
+
+ for (var i = 0; i < e.getLength(); i++) {
+ num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
+ }
+ while (num[0] == 0) {
+ num.shift();
+ }
+ }
+ return new QRPolynomial(num, 0);
+ }
+ };
+
+ //---------------------------------------------------------------------
+ // RS_BLOCK_TABLE
+ //---------------------------------------------------------------------
+ /*
+ 浜岀淮鐮佸悇涓増鏈俊鎭痆鍧楁暟, 姣忓潡涓殑鏁版嵁鍧楁暟, 姣忓潡涓殑淇℃伅鍧楁暟]
+ */
+ var RS_BLOCK_TABLE = [
+ // L
+ // M
+ // Q
+ // H
+ // 1
+ [1, 26, 19],
+ [1, 26, 16],
+ [1, 26, 13],
+ [1, 26, 9],
+
+ // 2
+ [1, 44, 34],
+ [1, 44, 28],
+ [1, 44, 22],
+ [1, 44, 16],
+
+ // 3
+ [1, 70, 55],
+ [1, 70, 44],
+ [2, 35, 17],
+ [2, 35, 13],
+
+ // 4
+ [1, 100, 80],
+ [2, 50, 32],
+ [2, 50, 24],
+ [4, 25, 9],
+
+ // 5
+ [1, 134, 108],
+ [2, 67, 43],
+ [2, 33, 15, 2, 34, 16],
+ [2, 33, 11, 2, 34, 12],
+
+ // 6
+ [2, 86, 68],
+ [4, 43, 27],
+ [4, 43, 19],
+ [4, 43, 15],
+
+ // 7
+ [2, 98, 78],
+ [4, 49, 31],
+ [2, 32, 14, 4, 33, 15],
+ [4, 39, 13, 1, 40, 14],
+
+ // 8
+ [2, 121, 97],
+ [2, 60, 38, 2, 61, 39],
+ [4, 40, 18, 2, 41, 19],
+ [4, 40, 14, 2, 41, 15],
+
+ // 9
+ [2, 146, 116],
+ [3, 58, 36, 2, 59, 37],
+ [4, 36, 16, 4, 37, 17],
+ [4, 36, 12, 4, 37, 13],
+
+ // 10
+ [2, 86, 68, 2, 87, 69],
+ [4, 69, 43, 1, 70, 44],
+ [6, 43, 19, 2, 44, 20],
+ [6, 43, 15, 2, 44, 16],
+
+ // 11
+ [4, 101, 81],
+ [1, 80, 50, 4, 81, 51],
+ [4, 50, 22, 4, 51, 23],
+ [3, 36, 12, 8, 37, 13],
+
+ // 12
+ [2, 116, 92, 2, 117, 93],
+ [6, 58, 36, 2, 59, 37],
+ [4, 46, 20, 6, 47, 21],
+ [7, 42, 14, 4, 43, 15],
+
+ // 13
+ [4, 133, 107],
+ [8, 59, 37, 1, 60, 38],
+ [8, 44, 20, 4, 45, 21],
+ [12, 33, 11, 4, 34, 12],
+
+ // 14
+ [3, 145, 115, 1, 146, 116],
+ [4, 64, 40, 5, 65, 41],
+ [11, 36, 16, 5, 37, 17],
+ [11, 36, 12, 5, 37, 13],
+
+ // 15
+ [5, 109, 87, 1, 110, 88],
+ [5, 65, 41, 5, 66, 42],
+ [5, 54, 24, 7, 55, 25],
+ [11, 36, 12],
+
+ // 16
+ [5, 122, 98, 1, 123, 99],
+ [7, 73, 45, 3, 74, 46],
+ [15, 43, 19, 2, 44, 20],
+ [3, 45, 15, 13, 46, 16],
+
+ // 17
+ [1, 135, 107, 5, 136, 108],
+ [10, 74, 46, 1, 75, 47],
+ [1, 50, 22, 15, 51, 23],
+ [2, 42, 14, 17, 43, 15],
+
+ // 18
+ [5, 150, 120, 1, 151, 121],
+ [9, 69, 43, 4, 70, 44],
+ [17, 50, 22, 1, 51, 23],
+ [2, 42, 14, 19, 43, 15],
+
+ // 19
+ [3, 141, 113, 4, 142, 114],
+ [3, 70, 44, 11, 71, 45],
+ [17, 47, 21, 4, 48, 22],
+ [9, 39, 13, 16, 40, 14],
+
+ // 20
+ [3, 135, 107, 5, 136, 108],
+ [3, 67, 41, 13, 68, 42],
+ [15, 54, 24, 5, 55, 25],
+ [15, 43, 15, 10, 44, 16],
+
+ // 21
+ [4, 144, 116, 4, 145, 117],
+ [17, 68, 42],
+ [17, 50, 22, 6, 51, 23],
+ [19, 46, 16, 6, 47, 17],
+
+ // 22
+ [2, 139, 111, 7, 140, 112],
+ [17, 74, 46],
+ [7, 54, 24, 16, 55, 25],
+ [34, 37, 13],
+
+ // 23
+ [4, 151, 121, 5, 152, 122],
+ [4, 75, 47, 14, 76, 48],
+ [11, 54, 24, 14, 55, 25],
+ [16, 45, 15, 14, 46, 16],
+
+ // 24
+ [6, 147, 117, 4, 148, 118],
+ [6, 73, 45, 14, 74, 46],
+ [11, 54, 24, 16, 55, 25],
+ [30, 46, 16, 2, 47, 17],
+
+ // 25
+ [8, 132, 106, 4, 133, 107],
+ [8, 75, 47, 13, 76, 48],
+ [7, 54, 24, 22, 55, 25],
+ [22, 45, 15, 13, 46, 16],
+
+ // 26
+ [10, 142, 114, 2, 143, 115],
+ [19, 74, 46, 4, 75, 47],
+ [28, 50, 22, 6, 51, 23],
+ [33, 46, 16, 4, 47, 17],
+
+ // 27
+ [8, 152, 122, 4, 153, 123],
+ [22, 73, 45, 3, 74, 46],
+ [8, 53, 23, 26, 54, 24],
+ [12, 45, 15, 28, 46, 16],
+
+ // 28
+ [3, 147, 117, 10, 148, 118],
+ [3, 73, 45, 23, 74, 46],
+ [4, 54, 24, 31, 55, 25],
+ [11, 45, 15, 31, 46, 16],
+
+ // 29
+ [7, 146, 116, 7, 147, 117],
+ [21, 73, 45, 7, 74, 46],
+ [1, 53, 23, 37, 54, 24],
+ [19, 45, 15, 26, 46, 16],
+
+ // 30
+ [5, 145, 115, 10, 146, 116],
+ [19, 75, 47, 10, 76, 48],
+ [15, 54, 24, 25, 55, 25],
+ [23, 45, 15, 25, 46, 16],
+
+ // 31
+ [13, 145, 115, 3, 146, 116],
+ [2, 74, 46, 29, 75, 47],
+ [42, 54, 24, 1, 55, 25],
+ [23, 45, 15, 28, 46, 16],
+
+ // 32
+ [17, 145, 115],
+ [10, 74, 46, 23, 75, 47],
+ [10, 54, 24, 35, 55, 25],
+ [19, 45, 15, 35, 46, 16],
+
+ // 33
+ [17, 145, 115, 1, 146, 116],
+ [14, 74, 46, 21, 75, 47],
+ [29, 54, 24, 19, 55, 25],
+ [11, 45, 15, 46, 46, 16],
+
+ // 34
+ [13, 145, 115, 6, 146, 116],
+ [14, 74, 46, 23, 75, 47],
+ [44, 54, 24, 7, 55, 25],
+ [59, 46, 16, 1, 47, 17],
+
+ // 35
+ [12, 151, 121, 7, 152, 122],
+ [12, 75, 47, 26, 76, 48],
+ [39, 54, 24, 14, 55, 25],
+ [22, 45, 15, 41, 46, 16],
+
+ // 36
+ [6, 151, 121, 14, 152, 122],
+ [6, 75, 47, 34, 76, 48],
+ [46, 54, 24, 10, 55, 25],
+ [2, 45, 15, 64, 46, 16],
+
+ // 37
+ [17, 152, 122, 4, 153, 123],
+ [29, 74, 46, 14, 75, 47],
+ [49, 54, 24, 10, 55, 25],
+ [24, 45, 15, 46, 46, 16],
+
+ // 38
+ [4, 152, 122, 18, 153, 123],
+ [13, 74, 46, 32, 75, 47],
+ [48, 54, 24, 14, 55, 25],
+ [42, 45, 15, 32, 46, 16],
+
+ // 39
+ [20, 147, 117, 4, 148, 118],
+ [40, 75, 47, 7, 76, 48],
+ [43, 54, 24, 22, 55, 25],
+ [10, 45, 15, 67, 46, 16],
+
+ // 40
+ [19, 148, 118, 6, 149, 119],
+ [18, 75, 47, 31, 76, 48],
+ [34, 54, 24, 34, 55, 25],
+ [20, 45, 15, 61, 46, 16]
+ ];
+
+ /**
+ * 鏍规嵁鏁版嵁鑾峰彇瀵瑰簲鐗堟湰
+ * @return {[type]} [description]
+ */
+ QRCodeAlg.prototype.getRightType = function () {
+ for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
+ var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
+ if (rsBlock == undefined) {
+ throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
+ }
+ var length = rsBlock.length / 3;
+ var totalDataCount = 0;
+ for (var i = 0; i < length; i++) {
+ var count = rsBlock[i * 3 + 0];
+ var dataCount = rsBlock[i * 3 + 2];
+ totalDataCount += dataCount * count;
+ }
+ var lengthBytes = typeNumber > 9 ? 2 : 1;
+ if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
+ this.typeNumber = typeNumber;
+ this.rsBlock = rsBlock;
+ this.totalDataCount = totalDataCount;
+ break;
+ }
+ }
+ };
+
+ //---------------------------------------------------------------------
+ // QRBitBuffer
+ //---------------------------------------------------------------------
+ function QRBitBuffer() {
+ this.buffer = new Array();
+ this.length = 0;
+ }
+ QRBitBuffer.prototype = {
+ get: function (index) {
+ var bufIndex = Math.floor(index / 8);
+ return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1);
+ },
+ put: function (num, length) {
+ for (var i = 0; i < length; i++) {
+ this.putBit(((num >>> (length - i - 1)) & 1));
+ }
+ },
+ putBit: function (bit) {
+ var bufIndex = Math.floor(this.length / 8);
+ if (this.buffer.length <= bufIndex) {
+ this.buffer.push(0);
+ }
+ if (bit) {
+ this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
+ }
+ this.length++;
+ }
+ };
+
+
+
+ // xzedit
+ let qrcodeAlgObjCache = [];
+ /**
+ * 浜岀淮鐮佹瀯閫犲嚱鏁帮紝涓昏鐢ㄤ簬缁樺埗
+ * @param {鍙傛暟鍒楄〃} opt 浼犻�掑弬鏁�
+ * @return {}
+ */
+ QRCode = function (opt) {
+ //璁剧疆榛樿鍙傛暟
+ this.options = {
+ text: '',
+ size: 256,
+ correctLevel: 3,
+ background: '#ffffff',
+ foreground: '#000000',
+ pdground: '#000000',
+ image: '',
+ imageSize: 30,
+ canvasId: opt.canvasId,
+ context: opt.context,
+ usingComponents: opt.usingComponents,
+ showLoading: opt.showLoading,
+ loadingText: opt.loadingText,
+ };
+ if (typeof opt === 'string') { // 鍙紪鐮丄SCII瀛楃涓�
+ opt = {
+ text: opt
+ };
+ }
+ if (opt) {
+ for (var i in opt) {
+ this.options[i] = opt[i];
+ }
+ }
+ //浣跨敤QRCodeAlg鍒涘缓浜岀淮鐮佺粨鏋�
+ var qrCodeAlg = null;
+ for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
+ if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
+ qrCodeAlg = qrcodeAlgObjCache[i].obj;
+ break;
+ }
+ }
+ if (i == l) {
+ qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
+ qrcodeAlgObjCache.push({
+ text: this.options.text,
+ correctLevel: this.options.correctLevel,
+ obj: qrCodeAlg
+ });
+ }
+ /**
+ * 璁$畻鐭╅樀鐐圭殑鍓嶆櫙鑹�
+ * @param {Obj} config
+ * @param {Number} config.row 鐐箈鍧愭爣
+ * @param {Number} config.col 鐐箉鍧愭爣
+ * @param {Number} config.count 鐭╅樀澶у皬
+ * @param {Number} config.options 缁勪欢鐨刼ptions
+ * @return {String}
+ */
+ let getForeGround = function (config) {
+ var options = config.options;
+ if (options.pdground && (
+ (config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5) ||
+ (config.row > (config.count - 6) && config.row < (config.count - 2) && config.col > 1 && config.col < 5) ||
+ (config.row > 1 && config.row < 5 && config.col > (config.count - 6) && config.col < (config.count - 2))
+ )) {
+ return options.pdground;
+ }
+ return options.foreground;
+ }
+ // 鍒涘缓canvas
+ let createCanvas = function (options) {
+ if (options.showLoading) {
+ uni.showLoading({
+ title: options.loadingText,
+ mask: true
+ });
+ }
+ var ctx = uni.createCanvasContext(options.canvasId, options.context);
+ var count = qrCodeAlg.getModuleCount();
+ var ratioSize = options.size;
+ var ratioImgSize = options.imageSize;
+ //璁$畻姣忎釜鐐圭殑闀垮
+ var tileW = (ratioSize / count).toPrecision(4);
+ var tileH = (ratioSize / count).toPrecision(4);
+ //缁樺埗
+ for (var row = 0; row < count; row++) {
+ for (var col = 0; col < count; col++) {
+ var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW));
+ var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW));
+ var foreground = getForeGround({
+ row: row,
+ col: col,
+ count: count,
+ options: options
+ });
+ ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
+ ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
+ }
+ }
+ if (options.image) {
+ var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+ var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));
+ drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true)
+ ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
+ // 鐢诲渾瑙掔煩褰�
+ function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
+ ctxi.setLineWidth(lineWidth);
+ ctxi.setFillStyle(options.background);
+ ctxi.setStrokeStyle(options.background);
+ ctxi.beginPath(); // draw top and top right corner
+ ctxi.moveTo(x + r, y);
+ ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
+ ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
+ ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
+ ctxi.arcTo(x, y, x + r, y, r);
+ ctxi.closePath();
+ if (fill) {
+ ctxi.fill();
+ }
+ if (stroke) {
+ ctxi.stroke();
+ }
+ }
+ }
+ setTimeout(() => {
+ ctx.draw(true, () => {
+ // 淇濆瓨鍒颁复鏃跺尯鍩�
+ setTimeout(() => {
+ uni.canvasToTempFilePath({
+ width: options.width,
+ height: options.height,
+ destWidth: options.width,
+ destHeight: options.height,
+ canvasId: options.canvasId,
+ quality: Number(1),
+ success: function (res) {
+ if (options.cbResult) {
+ options.cbResult(res.tempFilePath)
+ }
+ },
+ fail: function (res) {
+ if (options.cbResult) {
+ options.cbResult(res)
+ }
+ },
+ complete: function () {
+ if (options.showLoading){
+ uni.hideLoading();
+ }
+ },
+ }, options.context);
+ }, options.text.length + 100);
+ });
+ }, options.usingComponents ? 0 : 150);
+ }
+ createCanvas(this.options);
+ // 绌哄垽瀹�
+ let empty = function (v) {
+ let tp = typeof v,
+ rt = false;
+ if (tp == "number" && String(v) == "") {
+ rt = true
+ } else if (tp == "undefined") {
+ rt = true
+ } else if (tp == "object") {
+ if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
+ } else if (tp == "string") {
+ if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
+ } else if (tp == "function") {
+ rt = false
+ }
+ return rt
+ }
+ };
+ QRCode.prototype.clear = function (fn) {
+ var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context)
+ ctx.clearRect(0, 0, this.options.size, this.options.size)
+ ctx.draw(false, () => {
+ if (fn) {
+ fn()
+ }
+ })
+ };
+})()
+
+export default QRCode
\ No newline at end of file
diff --git a/h5/utils/utils.js b/h5/utils/utils.js
index 5c30af7..08378e8 100644
--- a/h5/utils/utils.js
+++ b/h5/utils/utils.js
@@ -64,4 +64,100 @@
const month = now.getMonth() + 1; // 鏈堜唤鏄粠0寮�濮嬬殑
const day = now.getDate();
return `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
-}
\ No newline at end of file
+}
+
+
+// meeting
+/**
+ * 鑾峰彇褰撳ぉ鏃ユ湡
+ **/
+export const getDay = () => {
+ let date = new Date();
+ var year = date.getFullYear();
+ var month = date.getMonth() + 1;
+ var day = date.getDate();
+ month = (month > 9) ? month : ("0" + month);
+ day = (day < 10) ? ("0" + day) : day;
+ let week = '鏄熸湡' + '鏃ヤ竴浜屼笁鍥涗簲鍏�'.charAt(new Date().getDay())
+ var today = year + "骞�" + month + "鏈�" + day + "鏃�" + " " + week;
+
+ return {
+ today,
+ date: year + "-" + month + "-" + day,
+ day
+ };
+}
+
+/**
+ * 鑾峰彇涓婁竴澶╂棩鏈�
+ **/
+export const getPreviousDay = (number, val) => {
+ let num = (24*60*60*1000) * number;
+ let date = ''
+ if (val) {
+ date = new Date(new Date(val).getTime() - num);
+ } else {
+ date = new Date(new Date().getTime() - num);
+ }
+ var year = date.getFullYear();
+ var month = date.getMonth() + 1;
+ var day = date.getDate();
+ month = (month > 9) ? month : ("0" + month);
+ day = (day < 10) ? ("0" + day) : day;
+ let week = '鏄熸湡' + '鏃ヤ竴浜屼笁鍥涗簲鍏�'.charAt(date.getDay())
+ var today = year + "骞�" + month + "鏈�" + day + "鏃�" + " " + week;
+
+ return {
+ today,
+ date: year + "-" + month + "-" + day
+ };
+}
+
+// 鏍煎紡鍖栨棩瀵硅薄
+export const getNowDate = () => {
+ var date = new Date();
+ var sign2 = ":";
+ var year = date.getFullYear() // 骞�
+ var month = date.getMonth() + 1; // 鏈�
+ var day = date.getDate(); // 鏃�
+ var hour = date.getHours(); // 鏃�
+ var minutes = date.getMinutes(); // 鍒�
+ var seconds = date.getSeconds() //绉�
+ var weekArr = ['鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�', '鏄熸湡澶�'];
+ var week = weekArr[date.getDay()];
+ // 缁欎竴浣嶆暟鐨勬暟鎹墠闈㈠姞 鈥�0鈥�
+ if (month >= 1 && month <= 9) {
+ month = "0" + month;
+ }
+ if (day >= 0 && day <= 9) {
+ day = "0" + day;
+ }
+ if (hour >= 0 && hour <= 9) {
+ hour = "0" + hour;
+ }
+ if (minutes >= 0 && minutes <= 9) {
+ minutes = "0" + minutes;
+ }
+ if (seconds >= 0 && seconds <= 9) {
+ seconds = "0" + seconds;
+ }
+ return year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
+}
+
+//蹇呴』涓哄瓧姣嶅姞鏁板瓧涓旈暱搴︿笉灏忎簬8浣�
+export const CheckPassWord = (password) => {
+ var str = password;
+ if (str == null || str.length <8) {
+ return false;
+ }
+ var reg1 = new RegExp(/^[0-9A-Za-z]+$/);
+ if (!reg1.test(str)) {
+ return false;
+ }
+ var reg = new RegExp(/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/);
+ if (reg.test(str)) {
+ return true;
+ } else {
+ return false;
+ }
+}
--
Gitblit v1.9.3