diff --git a/xz_mini/.gitignore b/xz_mini/.gitignore new file mode 100644 index 0000000..a60a8c6 --- /dev/null +++ b/xz_mini/.gitignore @@ -0,0 +1 @@ +/project.config.json diff --git a/xz_mini/app.js b/xz_mini/app.js new file mode 100644 index 0000000..2b053e6 --- /dev/null +++ b/xz_mini/app.js @@ -0,0 +1,73 @@ +//app.js +var restAjax = require('utils/restAjax.js'); +var dialog = require('utils/dialog.js'); +var utils = require('utils/util.js'); +// + 'https://www.xzszwhy.cn/usercenter' +App({ + loginUrl: restAjax.baseUrl, + usercenterUrl: restAjax.baseUrl, + newsUrl: restAjax.baseUrl, + newsContentUrl: restAjax.url, + libraryUrl: restAjax.baseUrl, + venueUrl: restAjax.baseUrl, + activityUrl: restAjax.baseUrl, + volunteerUrl: restAjax.baseUrl, + activityUrl: restAjax.baseUrl, + volunteerUrl: restAjax.baseUrl, + liveUrl: restAjax.url + 'live', + liveRecordUrl: restAjax.baseUrl, + socialUrl: restAjax.baseUrl, + areaCode: '540200000000', + areaName: '日喀则市', + areaId: '640675', + appId: 'wxa5c5246b283713de', + shopUrl: restAjax.url + "xzshop", + bigDataUrl: restAjax.url + "module", + restAjax: restAjax, + shopImgUrl: restAjax.url + "xzshop/route/file/download/true/", + imgUrl: restAjax.baseUrl + "/route/file/download/true/", + liveImgUrl: restAjax.url + "live/route/file/download/true/", + dialog: dialog, + utils: utils, + wssUrl: restAjax.wssUrl, + onLaunch: function () { + // 展示本地存储能力 + var logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + + // 登录 + wx.login({ + success: res => { + // 发送 res.code 到后台换取 openId, sessionKey, unionId + } + }) + // 获取用户信息 + wx.getSetting({ + success: res => { + if (res.authSetting['scope.userInfo']) { + // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 + wx.getUserInfo({ + success: res => { + // 可以将 res 发送给后台解码出 unionId + this.globalData.userInfo = res.userInfo + + // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 + // 所以此处加入 callback 以防止这种情况 + if (this.userInfoReadyCallback) { + this.userInfoReadyCallback(res) + } + } + }) + } + } + }) + }, + globalData: { + userInfo: null, + curLat: -1, + curLng: -1, + carList: [], + isPublic: false,//是否关注了公众号 + } +}) \ No newline at end of file diff --git a/xz_mini/app.json b/xz_mini/app.json new file mode 100644 index 0000000..102b679 --- /dev/null +++ b/xz_mini/app.json @@ -0,0 +1,121 @@ +{ + "pages": [ + "pages/index/index", + "pages/travel/travel", + "pages/resource/resource", + "pages/template/template", + "pages/train/train", + "pages/cultureMap/cultureMap", + "pages/order/order", + "pages/venue/venue", + "pages/center/center", + "pages/myFriendCircle/myFriendCircle", + "pages/friendCircle/friendCircle", + "pages/orderDetail/orderDetail", + "pages/broadcastList/broadcastList", + "pages/myVenueOrder/myVenueOrder", + "pages/broadcast/broadcast", + "pages/activityDialog/activityDialog", + "pages/teamDetail/teamDetail", + "pages/volunteerRegister/volunteerRegister", + "pages/volunteer/volunteer", + "pages/heritage/heritage", + "pages/broadcastDetail/broadcastDetail", + "pages/venueDetail/venueDetail", + "pages/book/book", + "pages/register/register", + "pages/login/login", + "pages/newVolunteerActivity/newVolunteerActivity", + "pages/newTeam/newTeam", + "pages/volunteerTeam/volunteerTeam", + "pages/cultureDetail/cultureDetail", + "pages/activitySign/activitySign", + "pages/activityDetail/activityDetail", + "pages/activity/activity", + "pages/newsDetail/newsDetail", + "pages/newsList/newsList", + "pages/myActivity/myActivity", + "pages/myVolunteerTeam/myVolunteerTeam", + "pages/myVolunteerActivity/myVolunteerActivity", + "pages/serviceActivityDetail/serviceActivityDetail", + "pages/shop/shopcategory", + "pages/commonQrCode/commonQrCode" + ], + "subPackages": [ + { + "root": "subpages/", + "pages": [ + "goodslist/goodslist", + "goodsdetail/goodsdetail", + "goodscar/goodscar", + "goodsaddress/goodsaddress", + "goodsorder/goodsorder", + "addshopaddress/addshopaddress", + "editshopaddress/editshopaddress", + "orderconfirm/orderconfirm", + "addresschoose/addresschoose", + "webcontentview/webcontent", + "search/commonSearch", + "liverecord/liverecord" + ] + } + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#9F1512", + "navigationBarTitleText": "日喀则市数字文化云", + "navigationBarTextStyle": "white" + }, + "tabBar": { + "color": "#BBBBBB", + "borderStyle": "black", + "selectedColor": "#000000", + "list": [ + { + "pagePath": "pages/index/index", + "iconPath": "images/index.png", + "text": "首页", + "selectedIconPath": "images/index-on.png" + }, + { + "pagePath": "pages/activity/activity", + "iconPath": "images/activity.png", + "text": "活动", + "selectedIconPath": "images/activity-on.png" + }, + { + "pagePath": "pages/venue/venue", + "iconPath": "images/venue.png", + "text": "场馆", + "selectedIconPath": "images/venue-on.png" + }, + { + "pagePath": "pages/shop/shopcategory", + "iconPath": "images/culture.png", + "text": "商城", + "selectedIconPath": "images/culture-on.png" + }, + { + "pagePath": "pages/center/center", + "iconPath": "images/center.png", + "text": "我的", + "selectedIconPath": "images/center-on.png" + } + ] + }, + "usingComponents": { + "page-loading": "/components/loading/pageloading", + "page-empty": "/components/empty/empty", + "loading-more": "/components/loadmore/loading-more" + }, + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于您当前所在位置" + } + }, + "requiredPrivateInfos": [ + "getLocation" + ], + "style": "v2", + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/xz_mini/app.wxss b/xz_mini/app.wxss new file mode 100644 index 0000000..e02b9d2 --- /dev/null +++ b/xz_mini/app.wxss @@ -0,0 +1,188 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} + +radio-group text { + font-size: 25rpx; +} + +radio .wx-radio-input { + border-radius: 50%; + width: 24rpx; + border: 2rpx solid #5e5e5f; + height: 24rpx; +} + +radio .wx-radio-input.wx-radio-input-checked { + border: none; + background: #07c160; +} + +radio .wx-radio-input.wx-radio-input-checked::before { + border-radius: 50%; + /* 圆角 */ + width: 28rpx; + /* 选中后对勾大小,不要超过背景的尺寸 */ + height: 28rpx; + /* 选中后对勾大小,不要超过背景的尺寸 */ + line-height: 28rpx; + text-align: center; + font-size: 20rpx; + /* 对勾大小 30rpx */ + color: #fff; + /* 对勾颜色 白色 */ + background: #07c160; + transform: translate(-50%, -50%) scale(1); +} + + + +checkbox-group text { + font-size: 25rpx; + +} + +checkbox .wx-checkbox-input { + width: 24rpx; + border: 2rpx solid #5e5e5f; + height: 24rpx; + margin-left: 5rpx; +} + +checkbox .wx-checkbox-input.wx-checkbox-input-checked { + border: none; + background: #07c160; +} + +checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { + /* 圆角 */ + width: 28rpx; + /* 选中后对勾大小,不要超过背景的尺寸 */ + height: 28rpx; + /* 选中后对勾大小,不要超过背景的尺寸 */ + line-height: 28rpx; + text-align: center; + font-size: 20rpx; + margin-left: 5rpx; + /* 对勾大小 30rpx */ + color: #fff; + /* 对勾颜色 白色 */ + background: #07c160; + transform: translate(-50%, -50%) scale(1); +} + + + +.text-clamp1 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + } + + .text-clamp2 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + + .text-clamp3 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + } + + .text-clamp4 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 4; + } + + .text-clamp5 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 5; + } + +.flex { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + + .flex-center { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + justify-content: center; + -webkit-align-items: center; + -webkit-justify-content: center; + } + + .flex-alignStart { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: flex-start; + -webkit-align-items: flex-start; + } + + .flex-alignCenter { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + -webkit-align-items: center; + } + + .flex-alignEnd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: flex-end; + -webkit-align-items: flex-end; + } + + .flex-between { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: space-between; + -webkit-justify-content: space-between; + } + + .flex-around { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: space-around; + -webkit-justify-content: space-around; + } + + .flex-middle { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: center; + -webkit-justify-content: center; + } + + .flex-end { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: flex-end; + -webkit-justify-content: flex-end; + } \ No newline at end of file diff --git a/xz_mini/components/empty/empty.js b/xz_mini/components/empty/empty.js new file mode 100644 index 0000000..9fe184b --- /dev/null +++ b/xz_mini/components/empty/empty.js @@ -0,0 +1,23 @@ +// components/empty/empty.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) diff --git a/xz_mini/components/empty/empty.json b/xz_mini/components/empty/empty.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/xz_mini/components/empty/empty.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/components/empty/empty.wxml b/xz_mini/components/empty/empty.wxml new file mode 100644 index 0000000..5c056ae --- /dev/null +++ b/xz_mini/components/empty/empty.wxml @@ -0,0 +1,5 @@ + + + + 暂无数据 + \ No newline at end of file diff --git a/xz_mini/components/empty/empty.wxss b/xz_mini/components/empty/empty.wxss new file mode 100644 index 0000000..d7792cf --- /dev/null +++ b/xz_mini/components/empty/empty.wxss @@ -0,0 +1,24 @@ +/* components/empty/empty.wxss */ +.data-empty { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + align-self: center; + + position: fixed; + top: 50%; + left: 50%; + transform: translateX(-50%)translateY(-50%); +} + +.data-empty image { + width: 180rpx; + height: 120rpx; +} + +.data-empty .hint { + margin-top: 30rpx; + font-size: 32rpx; +} \ No newline at end of file diff --git a/xz_mini/components/expandabletext/expandabletext.js b/xz_mini/components/expandabletext/expandabletext.js new file mode 100644 index 0000000..92fd564 --- /dev/null +++ b/xz_mini/components/expandabletext/expandabletext.js @@ -0,0 +1,80 @@ +// components/expandabletext/expandabletext.js +/** + * 长文本内容展开与收起 + * @param {String} content 长文本内容 + * @param {Number} maxline 最多展示行数[只允许 1-5 的正整数] + * @param {String} position 展开收起按钮位置[可选值为 left right] + * @param {Boolean} foldable 点击长文本是否展开收起 + */ + +Component({ + options: { + addGlobalClass: true + }, + /** + * 组件的属性列表 + */ + properties: { + content: { + type: String, + observer(val) { + console.log(val) + if (this.data.onReady) { + setTimeout(() => this.checkFold(), 10) + } + } + }, + maxline: { + type: Number, + value: 1, + observer(value) { + if (!(/^[1-5]$/).test(value)) { + throw new Error(`Maxline field value can only be digits (1-5), Error value: ${value}`) + } else if (this.data.onReady) { + setTimeout(() => this.checkFold(), 10) + } + } + }, + position: { + type: String, + value: "left" + }, + foldable: { + type: Boolean, + value: true + } + }, + + /** + * 组件的初始数据 + */ + data: { + onFold: false, + showFold: false, + onReady: false + }, + lifetimes: { + ready() { + this.checkFold() + this.data.onReady = true + } + }, + /** + * 组件的方法列表 + */ + methods: { + checkFold() { + const query = wx.createSelectorQuery().in(this); + query.selectAll(".showArea, .hideArea").boundingClientRect(res => { + this.setData({ + showFold: res[0].height < res[1].height + }) + }).exec() + }, + handleFold() { + this.setData({ + onFold: !this.data.onFold + }) + } + } +}) diff --git a/xz_mini/components/expandabletext/expandabletext.json b/xz_mini/components/expandabletext/expandabletext.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/xz_mini/components/expandabletext/expandabletext.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/components/expandabletext/expandabletext.wxml b/xz_mini/components/expandabletext/expandabletext.wxml new file mode 100644 index 0000000..177cac9 --- /dev/null +++ b/xz_mini/components/expandabletext/expandabletext.wxml @@ -0,0 +1,7 @@ + + {{content || "示例文本"}} + {{content || "示例文本"}} + + {{onFold ? "收起" : "展开"}} + + \ No newline at end of file diff --git a/xz_mini/components/expandabletext/expandabletext.wxss b/xz_mini/components/expandabletext/expandabletext.wxss new file mode 100644 index 0000000..30bd345 --- /dev/null +++ b/xz_mini/components/expandabletext/expandabletext.wxss @@ -0,0 +1,34 @@ +.content { + width: 690rpx; + padding: 0 30rpx; + border-top: 20rpx solid transparent; + border-bottom: 20rpx solid transparent; + margin-bottom: 20rpx; + } + + .contentInner { + width: 690rpx; + color: #ffffff; + font-size: 30rpx; + line-height: 1.35; + text-align: justify; + } + + .hideArea { + display: -webkit-box; + overflow: hidden; + position: fixed; + top: 100vh; + left: -100vw; + } + + .foldInner { + width: 690rpx; + padding-top: 10rpx; + } + + .foldInner .fold { + color: #eb0000; + font-size: 32rpx; + cursor: pointer; + } \ No newline at end of file diff --git a/xz_mini/components/loading/pageloading.js b/xz_mini/components/loading/pageloading.js new file mode 100644 index 0000000..7c20516 --- /dev/null +++ b/xz_mini/components/loading/pageloading.js @@ -0,0 +1,23 @@ +// components/loading/pageloading.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) diff --git a/xz_mini/components/loading/pageloading.json b/xz_mini/components/loading/pageloading.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/xz_mini/components/loading/pageloading.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/components/loading/pageloading.wxml b/xz_mini/components/loading/pageloading.wxml new file mode 100644 index 0000000..2115a2b --- /dev/null +++ b/xz_mini/components/loading/pageloading.wxml @@ -0,0 +1,5 @@ + + + + 加载中... + \ No newline at end of file diff --git a/xz_mini/components/loading/pageloading.wxss b/xz_mini/components/loading/pageloading.wxss new file mode 100644 index 0000000..f36fd23 --- /dev/null +++ b/xz_mini/components/loading/pageloading.wxss @@ -0,0 +1,24 @@ +/* components/loading/pageloading.wxss */ +.page-loading-box { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + /* background: rgba(255, 255, 255, 1); */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; +} + +.page-loading-box image { + width: 128rpx; + height: 128rpx; +} + +.page-loading-box .text { + margin-top: 20rpx; + font-size: 28rpx; +} \ No newline at end of file diff --git a/xz_mini/components/loadmore/loading-more.js b/xz_mini/components/loadmore/loading-more.js new file mode 100644 index 0000000..b2eec0f --- /dev/null +++ b/xz_mini/components/loadmore/loading-more.js @@ -0,0 +1,30 @@ +// components/loadmore/loading-more.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + isShowloading: true, + loadingTxt: "加载中..." + }, + + /** + * 组件的初始数据 + */ + data: { + + }, + + /** + * 组件的方法列表 + */ + methods: { + + }, + observers: { + 'isShowloading,loadingTxt': function (ss, sss) { + console.log(ss) + console.log(sss) + } + } +}) \ No newline at end of file diff --git a/xz_mini/components/loadmore/loading-more.json b/xz_mini/components/loadmore/loading-more.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/xz_mini/components/loadmore/loading-more.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/components/loadmore/loading-more.wxml b/xz_mini/components/loadmore/loading-more.wxml new file mode 100644 index 0000000..f67005c --- /dev/null +++ b/xz_mini/components/loadmore/loading-more.wxml @@ -0,0 +1,5 @@ + + + + {{loadingTxt}} + \ No newline at end of file diff --git a/xz_mini/components/loadmore/loading-more.wxss b/xz_mini/components/loadmore/loading-more.wxss new file mode 100644 index 0000000..b29e480 --- /dev/null +++ b/xz_mini/components/loadmore/loading-more.wxss @@ -0,0 +1,20 @@ +/* components/loadmore/loading-more.wxss */ + +.loading-box { + width: 100%; + height: 80rpx; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + font-size: 35rpx; +} + +.loading-box image { + width: 40rpx; + height: 40rpx; +} + +.loading-content { + margin-left: 20rpx; +} \ No newline at end of file diff --git a/xz_mini/images/activity-on.png b/xz_mini/images/activity-on.png new file mode 100755 index 0000000..21b4a86 Binary files /dev/null and b/xz_mini/images/activity-on.png differ diff --git a/xz_mini/images/activity.png b/xz_mini/images/activity.png new file mode 100755 index 0000000..67b7076 Binary files /dev/null and b/xz_mini/images/activity.png differ diff --git a/xz_mini/images/address.png b/xz_mini/images/address.png new file mode 100755 index 0000000..4cddf4d Binary files /dev/null and b/xz_mini/images/address.png differ diff --git a/xz_mini/images/app_logo.png b/xz_mini/images/app_logo.png new file mode 100644 index 0000000..eff4db2 Binary files /dev/null and b/xz_mini/images/app_logo.png differ diff --git a/xz_mini/images/avatar.png b/xz_mini/images/avatar.png new file mode 100755 index 0000000..3a27a6e Binary files /dev/null and b/xz_mini/images/avatar.png differ diff --git a/xz_mini/images/big-news.png b/xz_mini/images/big-news.png new file mode 100755 index 0000000..104edda Binary files /dev/null and b/xz_mini/images/big-news.png differ diff --git a/xz_mini/images/center-bg.png b/xz_mini/images/center-bg.png new file mode 100755 index 0000000..6b1a42a Binary files /dev/null and b/xz_mini/images/center-bg.png differ diff --git a/xz_mini/images/center-on.png b/xz_mini/images/center-on.png new file mode 100755 index 0000000..12b8eb5 Binary files /dev/null and b/xz_mini/images/center-on.png differ diff --git a/xz_mini/images/center.png b/xz_mini/images/center.png new file mode 100755 index 0000000..82bc34f Binary files /dev/null and b/xz_mini/images/center.png differ diff --git a/xz_mini/images/collect.png b/xz_mini/images/collect.png new file mode 100755 index 0000000..4e6fb4f Binary files /dev/null and b/xz_mini/images/collect.png differ diff --git a/xz_mini/images/collected.png b/xz_mini/images/collected.png new file mode 100755 index 0000000..e002b86 Binary files /dev/null and b/xz_mini/images/collected.png differ diff --git a/xz_mini/images/culture-on.png b/xz_mini/images/culture-on.png new file mode 100755 index 0000000..cd31b80 Binary files /dev/null and b/xz_mini/images/culture-on.png differ diff --git a/xz_mini/images/culture.png b/xz_mini/images/culture.png new file mode 100755 index 0000000..5b75524 Binary files /dev/null and b/xz_mini/images/culture.png differ diff --git a/xz_mini/images/delete-photo.png b/xz_mini/images/delete-photo.png new file mode 100755 index 0000000..7774c41 Binary files /dev/null and b/xz_mini/images/delete-photo.png differ diff --git a/xz_mini/images/delete.png b/xz_mini/images/delete.png new file mode 100755 index 0000000..768ea38 Binary files /dev/null and b/xz_mini/images/delete.png differ diff --git a/xz_mini/images/friend.png b/xz_mini/images/friend.png new file mode 100755 index 0000000..ea7d2ab Binary files /dev/null and b/xz_mini/images/friend.png differ diff --git a/xz_mini/images/good.png b/xz_mini/images/good.png new file mode 100755 index 0000000..e52c992 Binary files /dev/null and b/xz_mini/images/good.png differ diff --git a/xz_mini/images/ic_audio_bg.png b/xz_mini/images/ic_audio_bg.png new file mode 100755 index 0000000..56425d5 Binary files /dev/null and b/xz_mini/images/ic_audio_bg.png differ diff --git a/xz_mini/images/ic_empty_data.png b/xz_mini/images/ic_empty_data.png new file mode 100755 index 0000000..625841c Binary files /dev/null and b/xz_mini/images/ic_empty_data.png differ diff --git a/xz_mini/images/ic_goods_type_default.png b/xz_mini/images/ic_goods_type_default.png new file mode 100755 index 0000000..66ecf29 Binary files /dev/null and b/xz_mini/images/ic_goods_type_default.png differ diff --git a/xz_mini/images/ic_music_icon.png b/xz_mini/images/ic_music_icon.png new file mode 100644 index 0000000..484155d Binary files /dev/null and b/xz_mini/images/ic_music_icon.png differ diff --git a/xz_mini/images/ic_search_black.png b/xz_mini/images/ic_search_black.png new file mode 100644 index 0000000..db4f792 Binary files /dev/null and b/xz_mini/images/ic_search_black.png differ diff --git a/xz_mini/images/ic_search_gray.png b/xz_mini/images/ic_search_gray.png new file mode 100644 index 0000000..d3bd372 Binary files /dev/null and b/xz_mini/images/ic_search_gray.png differ diff --git a/xz_mini/images/ic_shop_car_icon.png b/xz_mini/images/ic_shop_car_icon.png new file mode 100755 index 0000000..69b6a8d Binary files /dev/null and b/xz_mini/images/ic_shop_car_icon.png differ diff --git a/xz_mini/images/index-on.png b/xz_mini/images/index-on.png new file mode 100755 index 0000000..e4a185d Binary files /dev/null and b/xz_mini/images/index-on.png differ diff --git a/xz_mini/images/index.png b/xz_mini/images/index.png new file mode 100755 index 0000000..a9bdc1f Binary files /dev/null and b/xz_mini/images/index.png differ diff --git a/xz_mini/images/loading-small.gif b/xz_mini/images/loading-small.gif new file mode 100644 index 0000000..5ea92d7 Binary files /dev/null and b/xz_mini/images/loading-small.gif differ diff --git a/xz_mini/images/loading.gif b/xz_mini/images/loading.gif new file mode 100644 index 0000000..8524d0f Binary files /dev/null and b/xz_mini/images/loading.gif differ diff --git a/xz_mini/images/login-bg.png b/xz_mini/images/login-bg.png new file mode 100755 index 0000000..b2a2441 Binary files /dev/null and b/xz_mini/images/login-bg.png differ diff --git a/xz_mini/images/logo.png b/xz_mini/images/logo.png new file mode 100755 index 0000000..d3b8222 Binary files /dev/null and b/xz_mini/images/logo.png differ diff --git a/xz_mini/images/marker_red.png b/xz_mini/images/marker_red.png new file mode 100755 index 0000000..c2c8e4d Binary files /dev/null and b/xz_mini/images/marker_red.png differ diff --git a/xz_mini/images/marker_yellow.png b/xz_mini/images/marker_yellow.png new file mode 100755 index 0000000..d432909 Binary files /dev/null and b/xz_mini/images/marker_yellow.png differ diff --git a/xz_mini/images/my-collect.png b/xz_mini/images/my-collect.png new file mode 100755 index 0000000..b367781 Binary files /dev/null and b/xz_mini/images/my-collect.png differ diff --git a/xz_mini/images/my-comment.png b/xz_mini/images/my-comment.png new file mode 100755 index 0000000..e537d31 Binary files /dev/null and b/xz_mini/images/my-comment.png differ diff --git a/xz_mini/images/my-sign.png b/xz_mini/images/my-sign.png new file mode 100755 index 0000000..5ecc809 Binary files /dev/null and b/xz_mini/images/my-sign.png differ diff --git a/xz_mini/images/new.png b/xz_mini/images/new.png new file mode 100644 index 0000000..540f1d7 Binary files /dev/null and b/xz_mini/images/new.png differ diff --git a/xz_mini/images/next.png b/xz_mini/images/next.png new file mode 100644 index 0000000..99dc194 Binary files /dev/null and b/xz_mini/images/next.png differ diff --git a/xz_mini/images/order.png b/xz_mini/images/order.png new file mode 100644 index 0000000..3298720 Binary files /dev/null and b/xz_mini/images/order.png differ diff --git a/xz_mini/images/people.png b/xz_mini/images/people.png new file mode 100644 index 0000000..0c4cdd1 Binary files /dev/null and b/xz_mini/images/people.png differ diff --git a/xz_mini/images/person.png b/xz_mini/images/person.png new file mode 100644 index 0000000..8b4bea7 Binary files /dev/null and b/xz_mini/images/person.png differ diff --git a/xz_mini/images/play.png b/xz_mini/images/play.png new file mode 100755 index 0000000..d758945 Binary files /dev/null and b/xz_mini/images/play.png differ diff --git a/xz_mini/images/play_next.png b/xz_mini/images/play_next.png new file mode 100755 index 0000000..b7fcecd Binary files /dev/null and b/xz_mini/images/play_next.png differ diff --git a/xz_mini/images/play_pause.png b/xz_mini/images/play_pause.png new file mode 100755 index 0000000..c556994 Binary files /dev/null and b/xz_mini/images/play_pause.png differ diff --git a/xz_mini/images/play_prev.png b/xz_mini/images/play_prev.png new file mode 100755 index 0000000..eebc540 Binary files /dev/null and b/xz_mini/images/play_prev.png differ diff --git a/xz_mini/images/play_resume.png b/xz_mini/images/play_resume.png new file mode 100755 index 0000000..68c2e85 Binary files /dev/null and b/xz_mini/images/play_resume.png differ diff --git a/xz_mini/images/prev.png b/xz_mini/images/prev.png new file mode 100755 index 0000000..1b2cd58 Binary files /dev/null and b/xz_mini/images/prev.png differ diff --git a/xz_mini/images/select-tab.png b/xz_mini/images/select-tab.png new file mode 100755 index 0000000..923566a Binary files /dev/null and b/xz_mini/images/select-tab.png differ diff --git a/xz_mini/images/selected-l.png b/xz_mini/images/selected-l.png new file mode 100755 index 0000000..f1b1f13 Binary files /dev/null and b/xz_mini/images/selected-l.png differ diff --git a/xz_mini/images/selected-r.png b/xz_mini/images/selected-r.png new file mode 100755 index 0000000..7e4f452 Binary files /dev/null and b/xz_mini/images/selected-r.png differ diff --git a/xz_mini/images/setting.png b/xz_mini/images/setting.png new file mode 100755 index 0000000..4572b03 Binary files /dev/null and b/xz_mini/images/setting.png differ diff --git a/xz_mini/images/share.png b/xz_mini/images/share.png new file mode 100755 index 0000000..cd01dea Binary files /dev/null and b/xz_mini/images/share.png differ diff --git a/xz_mini/images/tab1.png b/xz_mini/images/tab1.png new file mode 100644 index 0000000..ca72309 Binary files /dev/null and b/xz_mini/images/tab1.png differ diff --git a/xz_mini/images/tab2.png b/xz_mini/images/tab2.png new file mode 100644 index 0000000..4a1a40d Binary files /dev/null and b/xz_mini/images/tab2.png differ diff --git a/xz_mini/images/tab3.png b/xz_mini/images/tab3.png new file mode 100644 index 0000000..38ea9ba Binary files /dev/null and b/xz_mini/images/tab3.png differ diff --git a/xz_mini/images/tab4.png b/xz_mini/images/tab4.png new file mode 100644 index 0000000..cd01619 Binary files /dev/null and b/xz_mini/images/tab4.png differ diff --git a/xz_mini/images/tab5.png b/xz_mini/images/tab5.png new file mode 100644 index 0000000..3d8f906 Binary files /dev/null and b/xz_mini/images/tab5.png differ diff --git a/xz_mini/images/tab6.png b/xz_mini/images/tab6.png new file mode 100644 index 0000000..22c3870 Binary files /dev/null and b/xz_mini/images/tab6.png differ diff --git a/xz_mini/images/tab7.png b/xz_mini/images/tab7.png new file mode 100644 index 0000000..4d22afd Binary files /dev/null and b/xz_mini/images/tab7.png differ diff --git a/xz_mini/images/team.png b/xz_mini/images/team.png new file mode 100644 index 0000000..90c7332 Binary files /dev/null and b/xz_mini/images/team.png differ diff --git a/xz_mini/images/time.png b/xz_mini/images/time.png new file mode 100644 index 0000000..e56443a Binary files /dev/null and b/xz_mini/images/time.png differ diff --git a/xz_mini/images/venue-on.png b/xz_mini/images/venue-on.png new file mode 100644 index 0000000..b03315d Binary files /dev/null and b/xz_mini/images/venue-on.png differ diff --git a/xz_mini/images/venue.png b/xz_mini/images/venue.png new file mode 100644 index 0000000..125f968 Binary files /dev/null and b/xz_mini/images/venue.png differ diff --git a/xz_mini/images/venue1.png b/xz_mini/images/venue1.png new file mode 100644 index 0000000..f989b9a Binary files /dev/null and b/xz_mini/images/venue1.png differ diff --git a/xz_mini/images/venue2.png b/xz_mini/images/venue2.png new file mode 100644 index 0000000..1456e5a Binary files /dev/null and b/xz_mini/images/venue2.png differ diff --git a/xz_mini/images/venue3.png b/xz_mini/images/venue3.png new file mode 100644 index 0000000..3a3d9b8 Binary files /dev/null and b/xz_mini/images/venue3.png differ diff --git a/xz_mini/images/venueall.png b/xz_mini/images/venueall.png new file mode 100644 index 0000000..0c985ad Binary files /dev/null and b/xz_mini/images/venueall.png differ diff --git a/xz_mini/images/view.png b/xz_mini/images/view.png new file mode 100644 index 0000000..8584a8f Binary files /dev/null and b/xz_mini/images/view.png differ diff --git a/xz_mini/libs/bmap-wx.js b/xz_mini/libs/bmap-wx.js new file mode 100644 index 0000000..c6ca337 --- /dev/null +++ b/xz_mini/libs/bmap-wx.js @@ -0,0 +1,452 @@ +/** + * @file 微信小程序JSAPI + * @author 崔健 cuijian03@baidu.com 2017.01.10 + * @update 邓淑芳 623996689@qq.com 2019.07.03 + */ + +/** + * 百度地图微信小程序API类 + * + * @class + */ +class BMapWX { + + /** + * 百度地图微信小程序API类 + * + * @constructor + */ + constructor(param) { + this.ak = param["ak"]; + } + + /** + * 使用微信接口进行定位 + * + * @param {string} type 坐标类型 + * @param {Function} success 成功执行 + * @param {Function} fail 失败执行 + * @param {Function} complete 完成后执行 + */ + getWXLocation(type, success, fail, complete) { + type = type || 'gcj02', + success = success || function () { }; + fail = fail || function () { }; + complete = complete || function () { }; + wx.getLocation({ + type: type, + success: success, + fail: fail, + complete: complete + }); + } + + /** + * POI周边检索 + * + * @param {Object} param 检索配置 + * 参数对象结构可以参考 + * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi + */ + search(param) { + var that = this; + param = param || {}; + let searchparam = { + query: param["query"] || '生活服务$美食&酒店', + scope: param["scope"] || 1, + filter: param["filter"] || '', + coord_type: param["coord_type"] || 2, + page_size: param["page_size"] || 10, + page_num: param["page_num"] || 0, + output: param["output"] || 'json', + ak: that.ak, + sn: param["sn"] || '', + timestamp: param["timestamp"] || '', + radius: param["radius"] || 2000, + ret_coordtype: 'gcj02ll' + }; + let otherparam = { + iconPath: param["iconPath"], + iconTapPath: param["iconTapPath"], + width: param["width"], + height: param["height"], + alpha: param["alpha"] || 1, + success: param["success"] || function () { }, + fail: param["fail"] || function () { } + }; + let type = 'gcj02'; + let locationsuccess = function (result) { + searchparam["location"] = result["latitude"] + ',' + result["longitude"]; + wx.request({ + url: 'https://api.map.baidu.com/place/v2/search', + data: searchparam, + header: { + "content-type": "application/json" + }, + method: 'GET', + success(data) { + let res = data["data"]; + if (res["status"] === 0) { + let poiArr = res["results"]; + // outputRes 包含两个对象, + // originalData为百度接口返回的原始数据 + // wxMarkerData为小程序规范的marker格式 + let outputRes = {}; + outputRes["originalData"] = res; + outputRes["wxMarkerData"] = []; + for (let i = 0; i < poiArr.length; i++) { + outputRes["wxMarkerData"][i] = { + id: i, + latitude: poiArr[i]["location"]["lat"], + longitude: poiArr[i]["location"]["lng"], + title: poiArr[i]["name"], + iconPath: otherparam["iconPath"], + iconTapPath: otherparam["iconTapPath"], + address: poiArr[i]["address"], + telephone: poiArr[i]["telephone"], + alpha: otherparam["alpha"], + width: otherparam["width"], + height: otherparam["height"] + } + } + otherparam.success(outputRes); + } else { + otherparam.fail({ + errMsg: res["message"], + statusCode: res["status"] + }); + } + }, + fail(data) { + otherparam.fail(data); + } + }); + } + let locationfail = function (result) { + otherparam.fail(result); + }; + let locationcomplete = function (result) { + }; + if (!param["location"]) { + that.getWXLocation(type, locationsuccess, locationfail, locationcomplete); + } else { + let longitude = param.location.split(',')[1]; + let latitude = param.location.split(',')[0]; + let errMsg = 'input location'; + let res = { + errMsg: errMsg, + latitude: latitude, + longitude: longitude + }; + locationsuccess(res); + } + } + + /** + * sug模糊检索 + * + * @param {Object} param 检索配置 + * 参数对象结构可以参考 + * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api + */ + suggestion(param) { + var that = this; + param = param || {}; + let suggestionparam = { + query: param["query"] || '', + region: param["region"] || '全国', + city_limit: param["city_limit"] || false, + output: param["output"] || 'json', + ak: that.ak, + sn: param["sn"] || '', + timestamp: param["timestamp"] || '', + ret_coordtype: 'gcj02ll' + }; + let otherparam = { + success: param["success"] || function () { }, + fail: param["fail"] || function () { } + }; + wx.request({ + url: 'https://api.map.baidu.com/place/v2/suggestion', + data: suggestionparam, + header: { + "content-type": "application/json" + }, + method: 'GET', + success(data) { + let res = data["data"]; + if (res["status"] === 0) { + otherparam.success(res); + } else { + otherparam.fail({ + errMsg: res["message"], + statusCode: res["status"] + }); + } + }, + fail(data) { + otherparam.fail(data); + } + }); + } + + /** + * rgc检索(逆地理编码:经纬度->地点描述) + * + * @param {Object} param 检索配置 + * 参数对象结构可以参考 + * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad + * + */ + regeocoding (param) { + var that = this; + param = param || {}; + let regeocodingparam = { + coordtype: param["coordtype"] || 'gcj02ll', + ret_coordtype: 'gcj02ll', + radius: param["radius"] || 1000, + ak: that.ak, + sn: param["sn"] || '', + output: param["output"] || 'json', + callback: param["callback"] || function () { }, + extensions_poi: param["extensions_poi"] || 1, + extensions_road: param["extensions_road"] || false, + extensions_town: param["extensions_town"] || false, + language: param["language"] || 'zh-CN', + language_auto: param["language_auto"] || 0 + }; + let otherparam = { + iconPath: param["iconPath"], + iconTapPath: param["iconTapPath"], + width: param["width"], + height: param["height"], + alpha: param["alpha"] || 1, + success: param["success"] || function () { }, + fail: param["fail"] || function () { } + }; + let type = 'gcj02'; + let locationsuccess = function (result) { + regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"]; + wx.request({ + url: 'https://api.map.baidu.com/reverse_geocoding/v3', + data: regeocodingparam, + header: { + "content-type": "application/json" + }, + method: 'GET', + success(data) { + let res = data["data"]; + if (res["status"] === 0) { + let poiObj = res["result"]; + // outputRes 包含两个对象: + // originalData为百度接口返回的原始数据 + // wxMarkerData为小程序规范的marker格式 + let outputRes = {}; + outputRes["originalData"] = res; + outputRes["wxMarkerData"] = []; + outputRes["wxMarkerData"][0] = { + id: 0, + latitude: result["latitude"], + longitude: result["longitude"], + address: poiObj["formatted_address"], + iconPath: otherparam["iconPath"], + iconTapPath: otherparam["iconTapPath"], + desc: poiObj["sematic_description"], + business: poiObj["business"], + alpha: otherparam["alpha"], + width: otherparam["width"], + height: otherparam["height"] + } + otherparam.success(outputRes); + } else { + otherparam.fail({ + errMsg: res["message"], + statusCode: res["status"] + }); + } + }, + fail(data) { + otherparam.fail(data); + } + }); + }; + let locationfail = function (result) { + otherparam.fail(result); + } + let locationcomplete = function (result) { + }; + if (!param["location"]) { + that.getWXLocation(type, locationsuccess, locationfail, locationcomplete); + } else { + let longitude = param.location.split(',')[1]; + let latitude = param.location.split(',')[0]; + let errMsg = 'input location'; + let res = { + errMsg: errMsg, + latitude: latitude, + longitude: longitude + }; + locationsuccess(res); + } + } + + /** + * gc检索(地理编码:地点->经纬度) + * + * @param {Object} param 检索配置 + * 参数对象结构可以参考 + * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding + * + */ + geocoding(param) { + var that = this; + param = param || {}; + let geocodingparam = { + address: param["address"] || '', + city: param["city"] || '', + ret_coordtype: param["coordtype"] || 'gcj02ll', + ak: that.ak, + sn: param["sn"] || '', + output: param["output"] || 'json', + callback: param["callback"] || function () { } + }; + let otherparam = { + iconPath: param["iconPath"], + iconTapPath: param["iconTapPath"], + width: param["width"], + height: param["height"], + alpha: param["alpha"] || 1, + success: param["success"] || function () { }, + fail: param["fail"] || function () { } + }; + if (param["address"]) { + wx.request({ + url: 'https://api.map.baidu.com/geocoding/v3', + data: geocodingparam, + header: { + "content-type": "application/json" + }, + method: 'GET', + success(data) { + let res = data["data"]; + if (res["status"] === 0){ + let poiObj = res["result"]; + // outputRes 包含两个对象: + // originalData为百度接口返回的原始数据 + // wxMarkerData为小程序规范的marker格式 + let outputRes = res; + outputRes["originalData"] = res; + outputRes["wxMarkerData"] = []; + outputRes["wxMarkerData"][0] = { + id: 0, + latitude: poiObj["location"]["lat"], + longitude: poiObj["location"]["lng"], + iconPath: otherparam["iconPath"], + iconTapPath: otherparam["iconTapPath"], + alpha: otherparam["alpha"], + width: otherparam["width"], + height: otherparam["height"] + } + otherparam.success(outputRes); + } else { + otherparam.fail({ + errMsg: res["message"], + statusCode: res["status"] + }); + } + }, + fail(data) { + otherparam.fail(data); + } + }); + } else { + let errMsg = 'input address!'; + let res = { + errMsg: errMsg + }; + otherparam.fail(res); + } + } + + /** + * 天气检索 + * + * @param {Object} param 检索配置 + */ + weather(param) { + var that = this; + param = param || {}; + let weatherparam = { + coord_type: param["coord_type"] || 'gcj02', + output: param["output"] || 'json', + ak: that.ak, + sn: param["sn"] || '', + timestamp: param["timestamp"] || '' + }; + let otherparam = { + success: param["success"] || function () { }, + fail: param["fail"] || function () { } + }; + let type = 'gcj02'; + let locationsuccess = function (result) { + weatherparam["location"] = result["longitude"] + ',' + result["latitude"]; + wx.request({ + url: 'https://api.map.baidu.com/telematics/v3/weather', + data: weatherparam, + header: { + "content-type": "application/json" + }, + method: 'GET', + success(data) { + let res = data["data"]; + if (res["error"] === 0 && res["status"] === 'success') { + let weatherArr = res["results"]; + // outputRes 包含两个对象, + // originalData为百度接口返回的原始数据 + // wxMarkerData为小程序规范的marker格式 + let outputRes = {}; + outputRes["originalData"] = res; + outputRes["currentWeather"] = []; + outputRes["currentWeather"][0] = { + currentCity: weatherArr[0]["currentCity"], + pm25: weatherArr[0]["pm25"], + date: weatherArr[0]["weather_data"][0]["date"], + temperature: weatherArr[0]["weather_data"][0]["temperature"], + weatherDesc: weatherArr[0]["weather_data"][0]["weather"], + wind: weatherArr[0]["weather_data"][0]["wind"] + }; + otherparam.success(outputRes); + } else { + otherparam.fail({ + errMsg: res["message"], + statusCode: res["status"] + }); + } + }, + fail(data) { + otherparam.fail(data); + } + }); + } + let locationfail = function (result) { + otherparam.fail(result); + } + let locationcomplete = function (result) { + } + if (!param["location"]) { + that.getWXLocation(type, locationsuccess, locationfail, locationcomplete); + } else { + let longitude = param.location.split(',')[0]; + let latitude = param.location.split(',')[1]; + let errMsg = 'input location'; + let res = { + errMsg: errMsg, + latitude: latitude, + longitude: longitude + }; + locationsuccess(res); + } + } + } + + module.exports.BMapWX = BMapWX; \ No newline at end of file diff --git a/xz_mini/pages/activity/activity.js b/xz_mini/pages/activity/activity.js new file mode 100644 index 0000000..a5cf2fe --- /dev/null +++ b/xz_mini/pages/activity/activity.js @@ -0,0 +1,174 @@ +// pages/activity/activity.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + dataList: [], + areaList: [], + typeList: [], + pages: { + page: 1, + rows: 5, + activityType: '' + } + }, + //获取活动分类 + getActivityTypeList() { + var _self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dictionaryself/listdictionarybyparentidrelease/e36ad682-c6b4-44fe-a05c-889a5ff7c284', []), + null, null, + function (code, data) { + _self.setData({ + typeList: data, + 'pages.activityType': data[0].dataId + }) + _self.getActivityList() + }, + function (err) { + + } + ); + }, + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/dictionaryself/listdictionarybyparentidrelease/e36ad682-c6b4-44fe-a05c-889a5ff7c284', []), + self.data.pages, null, + function (code, data) { + if (code == '200') { + self.setData({ + areaList: data, + + }) + } + } + ) + }, + changeArea: function (e) { + app.dialog.loading('正在加载'); + console.log(e) + this.setData({ + 'pages.activityType': e.currentTarget.dataset.dataid + }) + this.getActivityList() + }, + loadAll: function () { + this.setData({ + 'pages.county': '' + }) + this.getActivityList() + }, + goDetail: function (e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '../activityDetail/activityDetail?id=' + id + }) + }, + getActivityList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activitylibrary/listpageactivitylibraryfornetrelease/{areaCode}', [app.areaCode]), + self.data.pages, null, + function (code, data) { + console.log(code + "===" + data) + if ('200' == code) { + for (var item of data.rows) { + if ('' != item.activityImage) { + item.activityImage = app.activityUrl + '/route/file/download/true/' + item.activityImage; + } + } + if (1 === self.data.pages.page) { + self.setData({ + dataList: data.rows, + }) + } else { + if (data.rows.length == 0) { + self.setData({ + [`pages.page`]: self.data.pages.page - 1 + }) + app.dialog.msg('暂无更多') + return false; + } + self.setData({ + dataList: data.rows.concat(self.data.dataList), + }) + } + } + }, + function () { + + }, + function () { + wx.hideNavigationBarLoading(); //完成停止加载图标 + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getActivityTypeList() + // this.getActivityList(); + // this.getAreaList() + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + // 在标题栏中显示加载图标 + wx.showNavigationBarLoading(); + var self = this; + self.setData({ + [`pages.page`]: 1, + dataList: [] + + }) + this.getActivityList(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/activity/activity.json b/xz_mini/pages/activity/activity.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/activity/activity.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/activity/activity.wxml b/xz_mini/pages/activity/activity.wxml new file mode 100644 index 0000000..2dfc13d --- /dev/null +++ b/xz_mini/pages/activity/activity.wxml @@ -0,0 +1,23 @@ + + + {{item.dataName}} + + + + + + + + + {{item.activityTitle}} + 报名中 + 报名人数已满 + 停止报名 + 进行中 + 直接进入 + 已结束 + + {{item.activityStartTime}}至{{item.activityEndTime}} + + + \ No newline at end of file diff --git a/xz_mini/pages/activity/activity.wxss b/xz_mini/pages/activity/activity.wxss new file mode 100644 index 0000000..57ac14b --- /dev/null +++ b/xz_mini/pages/activity/activity.wxss @@ -0,0 +1,105 @@ +.activity { + padding: 20rpx 30rpx 0; + margin-top: 80rpx; +} + +.activity-box { + margin-bottom: 20rpx; + box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; +} + +.activity-img { + height: 320rpx; + position: relative; +} + +.activity-img image { + width: 100%; + height: 100%; +} + +.corner { + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; +} + +.corner view { + padding: 0 10rpx; + background: rgba(0, 0, 0, 0.6); + line-height: 40rpx; + vertical-align: middle; + display: flex; + align-items: center; + border-radius: 5rpx; +} + +.view-count { + margin-right: 20rpx; +} + +.view-count image { + width: 40rpx; + height: 40rpx; +} + +.activity-info { + padding: 15rpx 20rpx; +} + +.title { + display: flex; + justify-content: space-between; +} + +.activity-title { + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 32rpx; + color: #242424; + line-height: 40rpx; +} + +.sign { + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; + font-size: 28rpx; +} + +.date { + margin-top: 10rpx; + font-size: 24rpx; + color: #242424; +} + +.area { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 80rpx; + white-space: nowrap; + overflow-x: auto; + box-shadow: 10rpx 10rpx 5rpx #f2f2f2; +} + +.area-box { + display: inline-block; + width: 25%; + line-height: 80rpx; + text-align: center; + font-size: 30rpx; +} + +.area-box.active { + color: #9F1512; +} \ No newline at end of file diff --git a/xz_mini/pages/activityDetail/activityDetail.js b/xz_mini/pages/activityDetail/activityDetail.js new file mode 100644 index 0000000..59d2493 --- /dev/null +++ b/xz_mini/pages/activityDetail/activityDetail.js @@ -0,0 +1,144 @@ +// pages/activityDetail/activityDetail.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + activityUrl: app.activityUrl, + dataMap: {}, + token: '' + }, + getToken: function () { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + goSign: function (e) { + var activityId = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '../activitySign/activitySign?id=' + activityId + }) + }, + cancel: function (e) { + var activityId = e.currentTarget.dataset.id; + app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId, []), + {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + wx.navigateTo({ + url: '../activityDetail/activityDetail?id=' + activityId + }) + } + }, function () { + + }, function () { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + var url; + var id = options.id; + if (!self.data.token) { + url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id; + self.setData({ + token: null + }) + } else { + url = '/app/activitylibrary/getactivitylibrarybyid/' + id + self.getToken() + } + app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + data.activityImageArray = data.activityImage.split(','); + self.setData({ + dataMap: data + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }) + this.saveBigdata(options.id); + }, + saveBigdata(id) { + var params = "小程序" + id + "活动"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/activityDetail/activityDetail.json b/xz_mini/pages/activityDetail/activityDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/activityDetail/activityDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/activityDetail/activityDetail.wxml b/xz_mini/pages/activityDetail/activityDetail.wxml new file mode 100644 index 0000000..0cd2c82 --- /dev/null +++ b/xz_mini/pages/activityDetail/activityDetail.wxml @@ -0,0 +1,53 @@ + + + + + + + + + {{dataMap.activityTitle}} + + + + 活动人数: + {{dataMap.activityUserNum }} + + + + 活动时间: + {{dataMap.activityStartTime}}至{{dataMap.activityEndTime}} + + + + 活动地址: + {{dataMap.activityAddress }} + + + + + 活动详情 + + + + 活动单位 + + + 主办单位:{{dataMap.activitySponsor}} + + + 承办单位:{{dataMap.activityOrganizer}} + + + 协办单位:{{dataMap.activityCoOrganizer}} + + + + + + + 报名 + + diff --git a/xz_mini/pages/activityDetail/activityDetail.wxss b/xz_mini/pages/activityDetail/activityDetail.wxss new file mode 100644 index 0000000..8808df0 --- /dev/null +++ b/xz_mini/pages/activityDetail/activityDetail.wxss @@ -0,0 +1,91 @@ +.activity-img, .activity-img image{ + width: 100%; + height: 480rpx; +} +swiper { + height: 100%; +} +.activity-detail{ + position: absolute; + left: 0; + right: 0; + top: 430rpx; + background: #fff; + border-radius:30rpx 30rpx 0px 0px; + overflow: hidden; + padding-bottom: 120rpx; +} +.activity-title, .activity-info{ + padding: 30rpx; + font-size: 32rpx; + color: #242424; + border-bottom: 5px solid #FBFBFB; +} +.activity-text{ + line-height: 35rpx; + font-size: 28rpx; + margin-bottom: 15rpx; +} +.activity-text:last-child{ + margin-bottom: 0; +} +.activity-info image{ + width: 35rpx; + height: 35rpx; + margin-right: 10rpx; + vertical-align: middle; + margin-top: -5rpx; +} +.activity-text text{ + color: #BBBBBB; +} +.activity-container{ + padding: 30rpx; +} +.part{ + margin-bottom: 30rpx; +} +.part:last-child{ + margin-bottom: 0; +} +.part-title{ + border-left: 3px solid #9F1512; + color: #242424; + padding-left: 10rpx; + font-size: 30rpx; + margin-bottom: 10rpx; +} +.part-content{ + font-size: 28rpx; + line-height: 40rpx; +} +.part-info{ + line-height: 50rpx; + color: #242424; + font-size: 28rpx; +} +.part-info text{ + color: #BBBBBB; +} +.sign-box{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1); + height: 120rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; + background: #fff; +} +.sign-btn{ + width: 100%; + height: 100%; + background: #9F1512; + border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; +} \ No newline at end of file diff --git a/xz_mini/pages/activityDialog/activityDialog.js b/xz_mini/pages/activityDialog/activityDialog.js new file mode 100644 index 0000000..7ed2669 --- /dev/null +++ b/xz_mini/pages/activityDialog/activityDialog.js @@ -0,0 +1,156 @@ +// pages/activityDialog/activityDialog.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + serviceId: '', + pages: { + page: 1, + rows: 5 + }, + dataList: {}, + status: '' + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getActivityHis: function() { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teamactivityhis/listpageteamactivityhis?serviceId=' + self.data.serviceId, []), + self.data.pages, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + var photos = []; + for(var item of data.rows) { + if('' != item.photo) { + item.photo = app.volunteerUrl + '/route/file/download/true/' + item.photo; + } + if('' != item.photos) { + var photoArr = item.photos.split(","); + for(var i=0; i { + this.getActivityHis() + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + // 在标题栏中显示加载图标 + wx.showNavigationBarLoading(); + var self = this; + self.setData({ + [`pages.page`] : self.data.pages.page + 1 + }) + console.log(self.data.pages) + this.getActivityHis(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/activityDialog/activityDialog.json b/xz_mini/pages/activityDialog/activityDialog.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/activityDialog/activityDialog.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/activityDialog/activityDialog.wxml b/xz_mini/pages/activityDialog/activityDialog.wxml new file mode 100644 index 0000000..48a8c04 --- /dev/null +++ b/xz_mini/pages/activityDialog/activityDialog.wxml @@ -0,0 +1,24 @@ + + + 暂无评论 + + + + + + + + + \ No newline at end of file diff --git a/xz_mini/pages/activityDialog/activityDialog.wxss b/xz_mini/pages/activityDialog/activityDialog.wxss new file mode 100644 index 0000000..b01a43d --- /dev/null +++ b/xz_mini/pages/activityDialog/activityDialog.wxss @@ -0,0 +1,42 @@ +.dialog{ + padding: 30rpx; +} +.dialog-box{ + margin-bottom: 15rpx; + display: flex; + justify-content: space-between; +} +.avatar{ + width: 15%; +} +.avatar image{ + width: 100%; + height: 90rpx; +} +.user-info{ + width: 83%; + border-bottom: 1px solid #DEDEDE; + padding-bottom: 10rpx; +} +.name{ + font-size: 34rpx; + color: #949494; + margin: 15rpx 0; +} +.content{ + font-size: 30rpx; + color: #000; + margin-bottom: 15rpx; +} +.public-time{ + display: flex; + justify-content: space-between; +} +.time{ + font-size: 28rpx; + color: #949494; +} +.delete, .delete image{ + width: 40rpx; + height: 40rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/activitySign/activitySign.js b/xz_mini/pages/activitySign/activitySign.js new file mode 100644 index 0000000..44bb418 --- /dev/null +++ b/xz_mini/pages/activitySign/activitySign.js @@ -0,0 +1,196 @@ +// pages/activitySign/activitySign.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + activityUrl: app.activityUrl, + token: '', + dataMap: {}, + phone: '', + code: '', + name: '', + idCard: '', + trueCode: '', + activityId: '', + restTime: 120, + timer: '', + gotCode: false + }, + getToken: function () { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getCode: function () { + var self = this; + if (!self.data.phone) { + app.dialog.msg('请输入手机号'); + return false; + } + app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/sms/verify-code/' + self.data.phone, []), {}, null, function (code, data) { + console.log(data) + if ('200' == code) { + self.setData({ + gotCode: true + }) + self.data.timer = setInterval(function () { + var cur = self.data.restTime - 1 + if (cur == 0) { + clearInterval(self.data.timer) + self.setData({ + restTime: 120, + gotCode: false + }) + } else { + self.setData({ + restTime: cur + }) + } + }, 1000) + } + }, function (code, data) { + app.dialog.msg(data.msg) + }, function () { + + }) + }, + commit: function () { + var self = this; + if (!self.data.phone) { + app.dialog.msg('请输入手机号'); + return false; + } + if (!self.data.name) { + app.dialog.msg('请输入姓名'); + return false; + } + if (!self.data.idCard) { + app.dialog.msg('请输入身份证号码'); + return false; + } + var activityUserApplyVO = { + activityId: self.data.activityId, + code: self.data.code, + userIdCard: self.data.idCard, + userName: self.data.name, + userPhone: self.data.phone + } + app.restAjax.post(app.restAjax.path(app.activityUrl + '/app/activityuserapply/saveactivityuserapply', []), + activityUserApplyVO, { + headers: { + token: self.data.token + } + }, + function (code, data) { + console.log(data) + if ('200' == code) { + app.dialog.msg('报名成功'); + setTimeout(function () { + wx.navigateBack({}) + }, 1000) + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + var url; + var id = options.id; + if (!self.data.token) { + url = '/app/activitylibrary/getactivitylibrarybyidrelease/' + id; + } else { + url = '/app/activitylibrary/getactivitylibrarybyid/' + id + } + self.setData({ + activityId: options.id + }) + app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + data.activityImageArray = data.activityImage.split(','); + self.setData({ + dataMap: data + }) + console.log(self.data.dataMap) + } + }, function () { + + }, function () { + + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/activitySign/activitySign.json b/xz_mini/pages/activitySign/activitySign.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/activitySign/activitySign.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/activitySign/activitySign.wxml b/xz_mini/pages/activitySign/activitySign.wxml new file mode 100644 index 0000000..9c4c4e8 --- /dev/null +++ b/xz_mini/pages/activitySign/activitySign.wxml @@ -0,0 +1,59 @@ + + + + + + + + + + {{dataMap.activityTitle}} + + + + 活动人数: + + {{dataMap.activityUserNum }} + + + + + 活动时间: + + {{dataMap.activityStartTime}}至{{dataMap.activityEndTime}} + + + + + 活动地址: + + {{dataMap.activityAddress }} + + + + + 填写信息 + + + 手机号: + + + + 验证码: + + 获取验证码 + {{restTime}} + + + 姓 名: + + + + 身份证: + + + + + + 立即报名 + \ No newline at end of file diff --git a/xz_mini/pages/activitySign/activitySign.wxss b/xz_mini/pages/activitySign/activitySign.wxss new file mode 100644 index 0000000..a237f80 --- /dev/null +++ b/xz_mini/pages/activitySign/activitySign.wxss @@ -0,0 +1,104 @@ +.activity{ + padding: 30rpx; + border-bottom: 5px solid #EFEFEF; + display: flex; +} +.activity-img, .activity-img image{ + width: 290rpx; + height: 200rpx; + border-radius: 10rpx; +} +.activity-info{ + width: 370rpx; + margin-left: 20rpx; +} +.activity-title{ + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + font-size: 30rpx; + color: #242424; +} +.activity-text{ + display: flex; + font-size: 26rpx; +} +.activity-text view{ + flex-shrink: 0; + width: 50%; + word-break: break-all; +} +.activity-text image{ + width: 35rpx; + height: 35rpx; + margin-right: 10rpx; + vertical-align: middle; + margin-top: -5rpx; +} +.activity-text text{ + color: #BBB; +} +.personal{ + padding: 30rpx 30rpx 0; + margin-bottom: 120rpx; +} +.title{ + padding-left: 10rpx; + border-left: 3px solid #9F1512; + font-size: 32rpx; + color: #242424; +} +.info-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; + font-size: 28rpx; + color: #242424; + line-height: 40rpx; + position: relative; +} +.info-box input{ + display: inline-block; + vertical-align: middle; + width: 300rpx; + height: 40rpx; + margin-top: -5rpx; +} +.get-code, .got-code{ + position: absolute; + top: 15rpx; + right: 0; + height: 40rpx; + background: rgba(159,21,18,.1); + padding: 5rpx 10rpx; + color: #9F1512; + font-size: 26rpx; +} +.got-code{ + width: 120rpx; + background: #eee; + color: #4a4d52; + border: 1px solid #eaeaea; + text-align: center; +} +.sign-box{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1); + height: 120rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; + background: #fff; +} +.sign-btn{ + width: 100%; + height: 100%; + background: #9F1512; + border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; +} \ No newline at end of file diff --git a/xz_mini/pages/book/book.js b/xz_mini/pages/book/book.js new file mode 100644 index 0000000..06707a0 --- /dev/null +++ b/xz_mini/pages/book/book.js @@ -0,0 +1,410 @@ +var app = getApp(); +//util.js 工具类 +var util = require('../../utils/util.js'); +// pages/book/book.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + timer: '', + gotCode: false, + checkOrder: false, + restTime:120, + venuesInfoId: '', + selectVenuesProject:'', + venuesProjectList: [], + projectDetail:{}, + bookingOrderDateList:[], + bookingOrderDate: '', + selectGround:'', + groundList:[], + itemTimeList:[], + mySelectItem:[], + totalPrice:'0', + phoneNumber:'', + smsCode:'' + }, + + //保存 + saveBookingInfo: function(){ + var self = this; + if(self.data.mySelectItem.length == 0){ + wx.showToast({ + title: '请先选择您的预订信息', + icon: 'none', + }) + return false; + } + if(!self.checkPhoneNumber()){ + return false; + } + if(self.data.smsCode == ''){ + wx.showToast({ + title: '请填写验证码', + icon: 'none', + }) + return false; + } + var param = { + smsCode : self.data.smsCode, + phoneNumber : self.data.phoneNumber, + venuesProjectId : self.data.selectVenuesProject, + bookingItemList : self.data.mySelectItem + } + wx.showLoading({ + title: '请稍等...', + mask: true + }) + app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[app.venueUrl]), param, {headers : {token:self.data.token}}, function(code,data){ + if(code == 200){ + wx.showToast({ + title: '预订成功', + }); + setTimeout( () =>{ + wx.navigateBack({ + delta: 1, + }) + },1500); + } + },function(code,data){ + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }); + }, + + /** + * 获取项目列 + */ + listVenuesProject: function(){ + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/listprojectinforelease/{venuesInfoId}', + [app.venueUrl,self.data.venuesInfoId]), {}, null, + function(code,data){ + self.setData({ + venuesProjectList: data + }); + if(self.data.venuesProjectList.length > 0){ + self.setData({ + selectVenuesProject: self.data.venuesProjectList[0].venuesProjectId + }); + self.getVenuesProjectDetail(); + self.getItemTimeList(); + }; + },function(code,data){ + app.dialog.msg(data.msg); + } + ); + }, + + //获取项目详情信息 + getVenuesProjectDetail: function(){ + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesproject/getvenuesprojectdetailrelease/{venuesProjectId}', + [app.venueUrl,self.data.selectVenuesProject]), {}, null, + function(code,data){ + self.setData({ + projectDetail:data.data + }); + // console.log(self.data.projectDetail); + },function(code,data){ + app.dialog.msg(data.msg); + } + ); + }, + + //获取预订时刻表 + getItemTimeList: function(){ + var self = this; + if(self.data.selectVenuesProject == ''){ + return false; + } + app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/listgrouninfoanditemrelease/{venuesProjectId}', + [app.venueUrl,self.data.selectVenuesProject]), null, {headers : {token:self.data.token}}, + function(code,data){ + if(data.data.length > 0 ){ + self.setData({ + groundList: data.data, + selectGround:data.data[0].groundInfoId, + itemTimeList:data.data[0].groundItemList + }); + } else { + self.setData({ + groundList: [], + selectGround:'', + itemTimeList:[] + }); + } + self.checkSelectType(); + // console.log(data.data); + },function(code,data){ + app.dialog.msg(data.msg); + } + ); + }, + + //用户点选时刻 + selectItemTime: function(options){ + var obj = options.currentTarget.dataset; + if(obj.data.checked == '0'){ + var item = { + bookingOrderDate: this.data.bookingOrderDate, + timeStr: obj.data.timeStr, + timeEnd: obj.data.timeEnd, + groundName: obj.data.groundName, + groundItemId: obj.data.groundItemId, + price: obj.data.price + } + var mySelectItem = this.data.mySelectItem; + mySelectItem.push(item) + this.setData({ + mySelectItem :mySelectItem + }) + } + if(obj.data.checked == '1'){ + var self = this; + var mySelectItem = self.data.mySelectItem; + for(var i = 0; i < mySelectItem.length; i++){ + if(mySelectItem[i]['groundItemId'] == obj.data.groundItemId && mySelectItem[i]['bookingOrderDate'] == self.data.bookingOrderDate){ + mySelectItem.splice(i,1); + self.setData({ + mySelectItem: mySelectItem + }) + break; + } + } + } + this.checkSelectType(); + this.checkPrice(); + }, + + //切换当前选择项目 + changeProject: function(options){ + var venuesProjectId = options.currentTarget.dataset.id; + if(this.data.selectVenuesProject == venuesProjectId){ + return false; + }; + this.setData({ + selectVenuesProject: venuesProjectId, + mySelectItem: [] + }); + this.getVenuesProjectDetail(); + this.getItemTimeList(); + this.getBookingDate() + this.setData({ + mySelectItem:[], + totalPrice : 0 + }); + }, + + //切换场地 + changeGround: function(options){ + var groundInfoId = options.currentTarget.dataset.id; + var index = options.currentTarget.dataset.index; + var groundList = this.data.groundList; + this.setData({ + selectGround: groundInfoId, + itemTimeList: groundList[index].groundItemList + }) + this.checkSelectType(); + }, + + //判断已选择的状态 + checkSelectType: function(){ + var self = this; + self.data.itemTimeList.forEach(element =>{ + element['checked'] = '0'; + self.data.mySelectItem.forEach(my =>{ + if(element['groundItemId'] == my['groundItemId'] && self.data.bookingOrderDate == my['bookingOrderDate']){ + element['checked'] = '1'; + } + }) + }); + // console.log(self.data.itemTimeList); + self.setData({ + itemTimeList: self.data.itemTimeList + }) + }, + + //预订日期 + getBookingDate: function(){ + var dateList = []; + var day = new Date(); + day.setTime(day.getTime() + 24*60*60*1000) + dateList.push(util.formatDate(day)); + day.setTime(day.getTime() + 24*60*60*1000) + dateList.push(util.formatDate(day)); + day.setTime(day.getTime() + 24*60*60*1000) + dateList.push(util.formatDate(day)); + this.setData({ + bookingOrderDate: dateList[0], + bookingOrderDateList: dateList + }) + }, + + //切换日期 + changeDate: function(options){ + this.setData({ + bookingOrderDate: options.currentTarget.dataset.date + }) + this.checkSelectType(); + }, + + //计算金额 + checkPrice: function(){ + var total = 0; + this.data.mySelectItem.forEach(element=>{ + total = total + Number(element['price']); + }) + this.setData({ + totalPrice: total + }) + }, + + checkPhoneNumber: function(){ + if(this.data.phoneNumber == ''){ + wx.showToast({ + title: '请填写手机号', + icon: 'none', + }) + return false; + } + if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.data.phoneNumber)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 1500 + }) + return false; + } + return true; + }, + + //获取验证码 + getSmsCoce: function (){ + var self = this; + if(!self.checkPhoneNumber()){ + return false; + } + wx.showLoading({ + title: '请稍等...', + mask: true + }) + app.restAjax.get(app.restAjax.path('{venueUrl}/app/sms/verify-code/' + self.data.phoneNumber, [app.venueUrl]), {}, null, + function (code, data) { + if (code == 200) { + self.setData({ + gotCode: true + }) + self.data.timer = setInterval(function () { + var cur = self.data.restTime - 1 + if (cur == 0) { + clearInterval(self.data.timer) + self.setData({ + restTime: 120, + gotCode: false + }) + } else { + self.setData({ + restTime: cur + }) + } + }, 1000) + wx.hideLoading(); + } + }, + function (code, data) { + wx.showToast({ + title: data.msg, + icon: 'none', + duration: 1500 + }) + }) + }, + + doCheckOrder: function () { + if(this.data.mySelectItem.length == 0){ + return false; + } + this.setData({ + checkOrder: true + }) + }, + + closeCheckOrder: function () { + this.setData({ + checkOrder: false + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data + }) + } + }) + this.setData({ + venuesInfoId: options.venuesInfoId + }); + this.listVenuesProject(); + this.getBookingDate(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/book/book.json b/xz_mini/pages/book/book.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/book/book.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/book/book.wxml b/xz_mini/pages/book/book.wxml new file mode 100644 index 0000000..38ac246 --- /dev/null +++ b/xz_mini/pages/book/book.wxml @@ -0,0 +1,77 @@ + + + + {{item.projectName}} + + + + + 简介: + {{projectDetail.projectDescription}} + + + + {{item}} + + + + + + + {{item.groundName}} + + + + + + + {{item.timeStr}}-{{item.timeEnd}} + {{item.price == '0' ? '免费' : item.price + '元'}} + + + + + + 手机号: + + + + + + 验证码: + + + 获取验证码 + {{restTime}} + + + + + + 订单金额:{{totalPrice == '0'? '-' : totalPrice + '元'}} + + + 预定 + + + + + + 订单信息 + + + + {{item.bookingOrderDate}} + {{item.timeStr}}-{{item.timeEnd}} + + + {{item.groundName}} + 免费 + {{item.price}}元 + + + + + \ No newline at end of file diff --git a/xz_mini/pages/book/book.wxss b/xz_mini/pages/book/book.wxss new file mode 100644 index 0000000..aa0b16d --- /dev/null +++ b/xz_mini/pages/book/book.wxss @@ -0,0 +1,237 @@ +.top-select{ + height:90rpx; + background:rgba(255,255,255,1); + box-shadow:0px 0px 16rpx 0px rgba(0,0,0,0.1); + border-radius:0px 0px 31rpx 31rpx; + padding: 0 30rpx; + display: flex; + margin-bottom: 10rpx; +} +.select-box{ + padding: 0 30rpx; + position: relative; + font-size: 32rpx; + display: flex; + align-items: center; + justify-content: center; +} +.select-box image{ + position: absolute; + top: 50%; + width: 20rpx; + height: 30rpx; + display: none; + transform: translate(0, -50%); +} +.select-box.active image{ + display: block; +} +.select-l{ + left: 0; +} +.select-r{ + right: 0; +} +.venue-info{ + padding: 0 30rpx; +} +.title{ + font-size: 30rpx; + color: #000; + margin-bottom: 10rpx; +} +.content{ + font-size: 28rpx; + color: #949494; + margin-bottom: 10rpx; +} +.date{ + border-top: 3px solid #DEDEDE; + border-bottom: 3px solid #DEDEDE; + padding: 0 30rpx; +} +.date-container, .ground-container{ + display: flex; + flex-wrap: nowrap; + overflow-x: auto; +} +.date-box, .ground-box{ + flex-shrink: 0; + padding: 15rpx 0; + margin-right: 15rpx; + font-size: 30rpx; + color: #949494; +} +.date-box.active{ + color: #9F1512; +} +.ground{ + margin: 20rpx 0; + padding: 0 30rpx 20rpx; + border-bottom: 3px solid #DEDEDE; +} +.ground-box{ + margin: 0; + padding: 0 25rpx; + position: relative; +} +.ground-box image{ + width: 20rpx; + height: 30rpx; + position: absolute; + top: 50%; + transform: translate(0, -50%); + display: none; +} +.left{ + left: 0 +} +.right{ + right: 0 +} +.ground-box.active{ + color: #9F1512; +} +.ground-box.active image{ + display: block; +} +.time{ + padding: 0 30rpx; + margin-bottom: 260rpx; +} +.time-box{ + display: inline-block; + width: 32%; + margin-right: 2%; + background: rgba(159,21,18,.5); + color: #fff; + font-size: 28rpx; + border-radius: 15rpx; + margin-bottom: 15rpx; + text-align: center; + padding: 15rpx; + box-sizing: border-box; +} +.time-box:nth-child(3n){ + margin-right: 0 +} +.time-box.selected{ + background: #9F1512; +} +.bottom{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + background: #fff; +} +.phone-code{ + margin-bottom: 20rpx; +} +.row{ + display: flex; + justify-content: space-between; +} +.row-title{ + width: 20%; + font-size: 28rpx; + color: #000; + line-height: 55rpx; + padding: 10rpx 0; +} +.row-input{ + width: 78%; + border-bottom: 1px solid #DEDEDE; + display: flex; + justify-content: space-between; + padding: 10rpx 0; +} +.row-input input{ + width: 100%; + height: 55rpx; +} +.row-input input.code-input{ + width: 70%; +} +.get-code{ + width: 28%; + font-size: 28rpx; + background: #9F1512; + color: #fff; + display: flex; + justify-content: center; + align-items: center; +} +.pay-book{ + display: flex; + justify-content: space-between; +} +.pay, .book{ + width: 70%; + height: 60rpx; + background: #9F1512; + color: #fff; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; +} +.book{ + width: 29%; +} +.order-info{ + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1000; + background: rgba(0,0,0,0.6); +} +.order-container{ + position: absolute; + bottom: 90rpx; + left: 30rpx; + right: 30rpx; + background: #fff; + border-radius: 10rpx; + padding: 20rpx; +} +.order-title{ + font-size: 30rpx; + text-align: center; + color: #9F1512; +} +.order{ + margin-top: 20rpx; + overflow-x: auto; + white-space: nowrap; +} +.order-box{ + border: 1px solid #9F1512; + border-radius: 10rpx; + text-align: center; + display: inline-block; + margin-right: 20rpx; + font-size: 28rpx; + width: 32%; +} +.top{ + background: #9F1512; + color: #fff; +} +.get-code, .got-code{ + font-size: 28rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + width: 28%; + line-height: 55rpx; + text-align: center; + border-radius: 10rpx; +} +.got-code{ + background: #fff; + color: #4a4d52; + border: 1px solid #eaeaea; +} \ No newline at end of file diff --git a/xz_mini/pages/broadcast/broadcast.js b/xz_mini/pages/broadcast/broadcast.js new file mode 100644 index 0000000..903814a --- /dev/null +++ b/xz_mini/pages/broadcast/broadcast.js @@ -0,0 +1,105 @@ +// pages/broadcast/broadcast.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + live: { + liveUrl: app.liveUrl, + liveList: [] + }, + currentPage: 1, + rows: 10 + }, + doGetLiveList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + var liveArray; + if(page <= 1) { + liveArray = data.rows; + } else { + liveArray = self.data.live.liveList; + liveArray = liveArray.concat(data.rows); + } + self.setData({ + currentPage: page, + 'live.liveList': liveArray + }) + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + goDetail: function (event) { + wx.navigateTo({ + url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + self.doGetLiveList(1); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.doGetLiveList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.doGetLiveList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/broadcast/broadcast.json b/xz_mini/pages/broadcast/broadcast.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/broadcast/broadcast.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/broadcast/broadcast.wxml b/xz_mini/pages/broadcast/broadcast.wxml new file mode 100644 index 0000000..681ac73 --- /dev/null +++ b/xz_mini/pages/broadcast/broadcast.wxml @@ -0,0 +1,15 @@ + + + + + 已结束 + 未开始 + 直播中 + 错误 + + + {{item.livePlanName}} + {{item.livePlanStart}}至{{item.livePlanEnd}} + + + \ No newline at end of file diff --git a/xz_mini/pages/broadcast/broadcast.wxss b/xz_mini/pages/broadcast/broadcast.wxss new file mode 100644 index 0000000..09db68d --- /dev/null +++ b/xz_mini/pages/broadcast/broadcast.wxss @@ -0,0 +1,41 @@ +.broadcast{ + padding: 30rpx; +} +.broadcast-box{ + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:10rpx; + overflow: hidden; + margin-bottom: 20rpx; +} +.broadcast-img, .broadcast-img image{ + width: 100%; + height: 310rpx; +} +.broadcast-img{ + position: relative; +} +.broadcast-info{ + padding: 20rpx; +} +.name{ + font-size: 32rpx; + color: #242424; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.time{ + color: #242424; + font-size: 28rpx; + margin-top: 10rpx; +} +.broadcast-status{ + position: absolute; + top: 15rpx; + right: 15rpx; + padding: 5rpx 10rpx; + background: #9F1512; + color: #fff; + font-size: 28rpx; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/broadcastDetail/broadcastDetail.js b/xz_mini/pages/broadcastDetail/broadcastDetail.js new file mode 100644 index 0000000..7333b17 --- /dev/null +++ b/xz_mini/pages/broadcastDetail/broadcastDetail.js @@ -0,0 +1,111 @@ +var app = getApp(); +function getRandomColor() { + const rgb = [] + for (let i = 0; i < 3; ++i) { + let color = Math.floor(Math.random() * 256).toString(16) + color = color.length === 1 ? '0' + color : color + rgb.push(color) + } + return '#' + rgb.join('') +} + +Page({ + data: { + liveUrl: app.liveUrl, + liveDetail: {}, + videoContext: null, + }, + + onShareAppMessage() { + return { + title: 'video', + path: 'page/component/pages/video/video' + } + }, + + onReady() { + // this.videoContext = wx.createVideoContext('myVideo') + + }, + getLivePlan(livePlanId) { + var self = this; + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/getliveplanbyidrelease/{livePlanId}', [self.data.liveUrl, livePlanId]), {}, null, function (code, data) { + self.setData({ + liveDetail: data + }); + self.videoContext = wx.createLivePlayerContext('liveVideo'); + self.videoContext.play(); + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + goLiveRecord(event) { + wx.navigateTo({ + url: '../broadcastList/broadcastList?livePlanId=' + event.currentTarget.dataset.livePlanId, + }) + }, + onLoad(option) { + this.getLivePlan(option.livePlanId); + this.saveBigdata(option.livePlanId) + }, + saveBigdata(id) { + var params = "小程序" + id + "直播"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + onHide() { + + }, + + inputValue: '', + + + bindInputBlur(e) { + this.inputValue = e.detail.value + }, + + bindButtonTap() { + const that = this + wx.chooseVideo({ + sourceType: ['album', 'camera'], + maxDuration: 60, + camera: ['front', 'back'], + success(res) { + that.setData({ + src: res.tempFilePath + }) + } + }) + }, + + bindVideoEnterPictureInPicture() { + console.log('进入小窗模式') + }, + + bindVideoLeavePictureInPicture() { + console.log('退出小窗模式') + }, + + bindPlayVideo() { + console.log('1') + this.videoContext.play() + }, + bindSendDanmu() { + this.videoContext.sendDanmu({ + text: this.inputValue, + color: getRandomColor() + }) + }, + + videoErrorCallback(e) { + console.log('视频错误信息:') + console.log(e.detail.errMsg) + } +}) \ No newline at end of file diff --git a/xz_mini/pages/broadcastDetail/broadcastDetail.json b/xz_mini/pages/broadcastDetail/broadcastDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/broadcastDetail/broadcastDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/broadcastDetail/broadcastDetail.wxml b/xz_mini/pages/broadcastDetail/broadcastDetail.wxml new file mode 100644 index 0000000..2542eb8 --- /dev/null +++ b/xz_mini/pages/broadcastDetail/broadcastDetail.wxml @@ -0,0 +1,24 @@ + + + + + + + +{{liveDetail.livePlanName}} + + + + 开始时间: + {{liveDetail.livePlanStart}} + + + + 结束时间: + {{liveDetail.livePlanEnd}} + + + + 介绍 + {{liveDetail.livePlanRecord}} + \ No newline at end of file diff --git a/xz_mini/pages/broadcastDetail/broadcastDetail.wxss b/xz_mini/pages/broadcastDetail/broadcastDetail.wxss new file mode 100644 index 0000000..ae4cf40 --- /dev/null +++ b/xz_mini/pages/broadcastDetail/broadcastDetail.wxss @@ -0,0 +1,71 @@ +.broadcast{ + width: 100%; + height: 400rpx; + background: #D8D8D8; +} +video{ + width: 100%; + height: 400rpx; +} +.broadcast-title{ + padding: 30rpx; + font-size: 34rpx; + color: #242424; + border-bottom: 5px solid #FBFBFB; +} +.time{ + margin-bottom: 10rpx; +} +.broadcast-time{ + padding: 30rpx 30rpx 20rpx; + border-bottom: 5px solid #FBFBFB; + font-size: 30rpx; + color: #242424; +} +.broadcast-time image{ + width: 40rpx; + height: 40rpx; + vertical-align: middle; +} +.broadcast-intro{ + padding: 30rpx; +} +.broadcast-intro-title{ + padding-left: 15rpx; + border-left: 5px solid #9F1512; + font-size: 32rpx; + color: #242424; +} +.intro-text{ + font-size: 30rpx; + color: #5F5F5F; + line-height: 40rpx; + margin-top: 15rpx; +} +.play-button-box { + width: 200rpx; + height: 200rpx; + position: fixed; + z-index: 100; + top: 100rpx; + left: 50%; + margin-left: -100rpx; + background-color: rgba(0, 0, 0, 0.5); + border: 1rpx dotted rgba(255, 255, 255, 0.8); + border-radius: 100rpx; +} +.play-button-box .play-button { + border-top-width: 60rpx; + border-bottom-width: 60rpx; + border-left-width: 100rpx; + border-style: solid; + border-top-color: transparent; + border-left-color: red; + border-bottom-color: transparent; + border-right-color: transparent; + width: 0; + height: 0; + position: absolute; + top: 40rpx; + left: 60rpx; +} diff --git a/xz_mini/pages/broadcastList/broadcastList.js b/xz_mini/pages/broadcastList/broadcastList.js new file mode 100644 index 0000000..75190f2 --- /dev/null +++ b/xz_mini/pages/broadcastList/broadcastList.js @@ -0,0 +1,112 @@ +// pages/broadcastList/broadcastList.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + liveRecordContentUrl: app.newsContentUrl, + liveUrl: app.liveUrl, + liveRecordUrl: app.liveRecordUrl, + livePlanId: null, + page: 1, + rows: 20, + liveRecordList: [], + videoPath: '' + }, + getLivePlanRecordList: function () { + var self = this + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liverecord/listpageliverecordrelease/' + self.data.livePlanId, [app.liveUrl]), { + page: self.data.page, + rows: self.data.rows + }, null, + function (code, data) { + if (data.rows.length > 0) { + self.setData({ + liveRecordList: data.rows + }) + } else { + wx.showToast({ + title: '暂无更多', + icon: "none", + duration: 1500 + }) + } + if (self.data.page == 1) { + self.setData({ + videoPath: data.rows[0].recordFilePath + }) + } + } + ) + }, + playVideo: function (e) { + this.setData({ + videoPath: e.currentTarget.dataset.url + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + livePlanId: options.livePlanId + }) + this.getLivePlanRecordList(); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.setData({ + page: this.data.page + 1 + }) + this.getLivePlanRecordList() + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.setData({ + page: this.data.page + 1 + }) + this.getLivePlanRecordList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/broadcastList/broadcastList.json b/xz_mini/pages/broadcastList/broadcastList.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/broadcastList/broadcastList.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/broadcastList/broadcastList.wxml b/xz_mini/pages/broadcastList/broadcastList.wxml new file mode 100644 index 0000000..6cc484a --- /dev/null +++ b/xz_mini/pages/broadcastList/broadcastList.wxml @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/xz_mini/pages/broadcastList/broadcastList.wxss b/xz_mini/pages/broadcastList/broadcastList.wxss new file mode 100644 index 0000000..eceebcd --- /dev/null +++ b/xz_mini/pages/broadcastList/broadcastList.wxss @@ -0,0 +1,25 @@ +.video{ + position: fixed; + top: 0; + left: 0; + right: 0; + width: 100%; + height: 475rpx; +} +.video video{ + width: 100%; + height: 100%; +} +.select-list{ + margin-top: 475rpx; + padding: 0 15rpx; +} +.select-video{ + border-bottom: 1px solid #DEDEDE; + line-height: 80rpx; + font-size: 32rpx; + color: #000; +} +.select-video.active{ + color: #9F1512; +} \ No newline at end of file diff --git a/xz_mini/pages/center/center.js b/xz_mini/pages/center/center.js new file mode 100644 index 0000000..a7b4005 --- /dev/null +++ b/xz_mini/pages/center/center.js @@ -0,0 +1,356 @@ +// pages/center/center.js +var app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + randomName: true, + showPhone: true, + gotCode: false, + restTime: 120, + timer: '', + userAvatar: '', + token: '', + userInfo: {}, + usercenterUrl: app.usercenterUrl, + sourcePath: '/route/file/download/true/', + phone: '', + code: '', + isLoading: false + }, + // 选择头像来源 + changeAvatar: function () { + var self = this + wx.showActionSheet({ + itemList: ['从相册中选择', '拍照'], + success: function (res) { + if (!res.cancel) { + if (res.tapIndex == 0) { + self.chooseAvatar('album') + } else { + self.chooseAvatar('camera') + } + } + } + }) + }, + // 选择图片 + chooseAvatar: function (type) { + var self = this + wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: [type], + success: function (res) { + var avatar = res.tempFilePaths[0]; + app.restAjax.file(app.restAjax.path('{usercenterUrl}/app/file/uploadimage', [app.usercenterUrl]), avatar, 'image', { + headers: { + token: self.data.token + } + }, function (code, data) { + var id = JSON.parse(data).data + self.uploadAvatar(id) + }, function (code, data) { + console.log(data) + }) + self.setData({ + userAvatar: avatar + }) + } + }) + }, + // 上传 + uploadAvatar: function (avatarId) { + var self = this + app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/update-avatar', [app.usercenterUrl]), { + avatar: avatarId + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.setStorageSync('token', data.data); + self.getUserInfo() + }, function (code, data) { + console.log(data) + }) + }, + // 获取token + getToken: function () { + var self = this + wx.getStorage({ + key: 'token', + success: function (res) { + self.setData({ + token: res.data + }) + self.getUserInfo() + }, + }) + }, + //收货地址 + toAddressManage() { + wx.navigateTo({ + url: '/subpages/goodsaddress/goodsaddress', + }) + }, + //我的订单 + toShopOrder() { + wx.navigateTo({ + url: '/subpages/goodsorder/goodsorder', + }) + }, + //购物车 + toShopCar() { + wx.navigateTo({ + url: '/subpages/goodscar/goodscar', + }) + }, + /** + * 跳转到我的活动 + */ + toMyJoinActivity() { + wx.navigateTo({ + url: '/pages/myActivity/myActivity', + }) + }, + /** + * 跳转到我的预订列表 + */ + toMyOrder: function () { + wx.navigateTo({ + url: '../order/order', + }) + }, + /** + * 跳转到我的志愿团队页面 + */ + toMyTeam: function () { + wx.navigateTo({ + url: '../myVolunteerTeam/myVolunteerTeam', + }) + }, + /** + * 跳转到我的志愿活动页面 + */ + toMyVolunteerActivity: function () { + wx.navigateTo({ + url: '../myVolunteerActivity/myVolunteerActivity', + }) + }, + /** + * 跳转到我发布的朋友圈页面 + */ + toMyFirend: function () { + wx.navigateTo({ + url: '../myFriendCircle/myFriendCircle', + }) + }, + /** + * 跳转到我预定的场馆页面 + */ + toMyOrder: function () { + wx.navigateTo({ + url: '../order/order', + }) + }, + // 获取输入的手机号 + phoneNum: function (res) { + this.setData({ + phone: res.detail.value + }) + }, + // 校验手机号 + testPhone: function () { + var self = this + if (self.data.phone) { + if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.data.phone)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 1500 + }) + } else { + self.getCode() + } + } else { + wx.showToast({ + title: '手机号不能为空', + icon: 'none', + duration: 1500 + }) + } + }, + // 提交绑定手机 + submitPhone: function () { + var self = this; + self.setData({ + isConfirm: true + }) + app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/user/updateminiappdefaultusername', [app.usercenterUrl]), { + phone: self.data.phone + }, { + headers: { + token: self.data.token + } + }, function (code, data) { + wx.setStorageSync('token', data.data); + wx.setStorageSync('isRandomUsername', 0) + clearInterval(self.data.timer) + self.setData({ + showPhone: false + }) + wx.showTabBar(); + self.getUserInfo() + }, function (code, data) { + app.dialog.msg(data.msg); + self.setData({ + isConfirm: false + }) + }) + }, + // // 验证码 + // inputCode: function (e) { + // this.setData({ + // code: e.detail.value + // }) + // }, + getPhoneNumber: function (e) { + var self = this + self.setData({ + isLoading: true + }) + console.log(e) + if (e.detail.errMsg == 'getPhoneNumber:ok') { + var info = { + encryptedData: e.detail.encryptedData, + iv: e.detail.iv + } + // app.dialog.loading('正在加载'); + app.restAjax.put(app.restAjax.path('{usercenterUrl}/app/miniapp/update-phone', [app.usercenterUrl]), info, { + headers: { + token: self.data.token + } + }, function (code, data) { + // wx.hideLoading(); + self.setData({ + isLoading: false + }) + wx.setStorageSync('token', data.data); + wx.setStorageSync('isRandomUsername', '0'); + self.setData({ + randomName: false, + token: data.data + }) + self.getUserInfo() + app.dialog.msg('绑定成功'); + },function(code,error){ + self.setData({ + isLoading: false + }) + app.dialog.msg(error.msg) + }) + } else { + self.setData({ + isLoading: false + }) + } + }, + // 判断用户是否为随机名称 + isRandomName: function () { + var self = this + wx.getStorage({ + key: 'isRandomUsername', + success: function (res) { + if (res.data == 1) { + self.setData({ + randomName: true + }) + } else { + self.setData({ + randomName: false + }) + } + } + }) + }, + // 获取用户信息 + getUserInfo: function () { + var self = this + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + self.setData({ + userInfo: data + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }) + }, + cancelPhone: function () { + this.setData({ + showPhone: false + }) + wx.showTabBar() + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.isRandomName(); + this.getToken(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/center/center.json b/xz_mini/pages/center/center.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/center/center.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/center/center.wxml b/xz_mini/pages/center/center.wxml new file mode 100644 index 0000000..3dc4711 --- /dev/null +++ b/xz_mini/pages/center/center.wxml @@ -0,0 +1,82 @@ + + + + + + + + + {{userInfo.name}} + + 绑定手机号后,账号信息即可与APP共享 + + + 常用功能 + + + + 我的预订 + + + + + 我的活动 + + + + + 我的志愿团队 + + + + 我的志愿活动 + + + + 购物车 + + + + 收货地址 + + + + 我的订单 + + + + + + + + + \ No newline at end of file diff --git a/xz_mini/pages/center/center.wxss b/xz_mini/pages/center/center.wxss new file mode 100644 index 0000000..87f9007 --- /dev/null +++ b/xz_mini/pages/center/center.wxss @@ -0,0 +1,167 @@ +.top-img, .top-img image{ + width: 100%; + height: 450rpx +} +.page-container{ + position: absolute; + top: 420rpx; + left: 0; + right: 0; + border-radius:31rpx 31rpx 0px 0px; + background: #fff; +} +.person{ + padding: 50rpx 30rpx 30rpx; + position: relative; + border-bottom: 3px solid #FBFBFB; +} +.user-avatar{ + width: 180rpx; + height: 180rpx; + border-radius: 50%; + overflow: hidden; + border: 2px solid #fff; + position: absolute; + left: 50%; + margin-left: -90rpx; + top: -150rpx; +} +.user-avatar image{ + width: 100%; + height: 100%; +} +.user-name{ + font-size: 32rpx; + text-align: center; + color: #242424; +} +.main{ + padding: 30rpx; +} +.main-title{ + border-left: 3px solid #9F1512; + padding-left: 10rpx; + font-size: 32rpx; + color: #242424; + margin-bottom: 20rpx; +} +.main-container{ + display: flex; + flex-wrap: wrap; +} +.main-box{ + width: 25%; + flex-shrink: 0; + text-align: center; + padding: 0 15rpx; + box-sizing: border-box; + margin-bottom: 15rpx; +} +.main-box image{ + width: 65rpx; + height: 65rpx; +} +.title{ + font-size: 30rpx; + color: #242424; +} +.set-phone{ + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .6); + z-index: 100; +} +.set-phone-box{ + width: 96%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: #fff; + border-radius: 10rpx; + padding: 30rpx; + box-sizing: border-box; +} +.tips{ + font-size: 28rpx; + color: #000; +} +.phone-input{ + margin: 25rpx 0; +} +.code-input{ + display: flex; + justify-content: space-between; + margin-bottom: 25rpx; +} +.code-input input{ + width: 70%; + height: 55rpx; + border: 1px solid #dedede; + border-radius: 10rpx; + padding: 0 10rpx; + box-sizing: border-box; + font-size: 28rpx; +} +.phone-input input{ + width: 100%; + height: 55rpx; + border: 1px solid #dedede; + border-radius: 10rpx; + padding: 0 10rpx; + box-sizing: border-box; + font-size: 28rpx; +} +.get-code, .got-code{ + font-size: 28rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + width: 28%; + line-height: 55rpx; + text-align: center; + border-radius: 10rpx; +} +.got-code{ + background: #fff; + color: #4a4d52; + border: 1px solid #eaeaea; +} +.set-phone-btn-box{ + display: flex; + justify-content: space-between; +} +.set-phone-btn{ + width: 49%; + height: 65rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} +.tips{ + font-size: 30rpx; + text-align: center; + margin-top: 15rpx; +} +.loading{ + position: fixed; + top: 0; + right: 0; + left: 0; + bottom: 0; + background: rgba(0, 0, 0, .2); +} +.loading image{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + width: 150rpx; + height: 150rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/commonQrCode/commonQrCode.js b/xz_mini/pages/commonQrCode/commonQrCode.js new file mode 100644 index 0000000..bebae40 --- /dev/null +++ b/xz_mini/pages/commonQrCode/commonQrCode.js @@ -0,0 +1,98 @@ +// subpages/commonQrCode.js +const app = getApp(); +var socket = null; +Page({ + + /** + * 页面的初始数据 + */ + data: { + title: '日喀则市公共数字文化云', + desc: '开展新闻资讯、场馆导航、场馆预定、活动预约、艺术普及、在线培训、电子图书、文化点单、直播活动等。', + hint: '扫描或长按识别上面二维码进行关注公众号', + imgSrc: '', + userId: '', + urls: app.wssUrl, + userName: '码', + hideloading: false, + }, + onLoad(options) { + console.log(options) + wx.setNavigationBarTitle({ + title: '公众号关注', + }); + wx.setNavigationBarColor({ + backgroundColor: '#ededed', + frontColor: '#000000', + }) + var userId = ""; + if (options && JSON.stringify(options) !== '{}') { + var keys = Object.keys(options) + var values = keys[0].split("="); + userId = values[1]; + this.setData({ + userId: userId + }) + } else { + userId = app.globalData.userInfo.userId; + this.setData({ + userId: userId + }) + this.startWebSocket(); + } + this.getCodeImg(userId); + }, + startWebSocket() { + var _self = this; + socket = wx.connectSocket({ + url: _self.data.urls + '/app/wxeventrelease/' + _self.data.userId, + success(res) { + console.log(res) + } + }); + socket.onMessage(function (e) { + console.log(e) + if (e.data) { + var data = JSON.parse(e.data); + _self.prePage(data.attention) + } + }); + }, + prePage(e) { + console.log(e) + app.globalData.isPublic = e + var pages = getCurrentPages(); + var prePage = pages[pages.length - 2] + prePage.setData({ + isPublic: e + }); + wx.navigateBack() + }, + onUnload() { + if (socket != null) { + socket.close({ + code: 1000 + }); + } + }, + getCodeImg(id) { + var _self = this; + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/wxopen/qrcoderelease/{userId}', [app.usercenterUrl, id]), {}, { + + }, function (code, data) { + _self.setData({ + imgSrc: data, + hideloading: true + }) + + }, function (code, data) { + _self.setData({ + hideloading: true + }) + app.dialog.msg(data.msg); + }) + }, + onShow() { + + }, +}) \ No newline at end of file diff --git a/xz_mini/pages/commonQrCode/commonQrCode.json b/xz_mini/pages/commonQrCode/commonQrCode.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/xz_mini/pages/commonQrCode/commonQrCode.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/commonQrCode/commonQrCode.wxml b/xz_mini/pages/commonQrCode/commonQrCode.wxml new file mode 100644 index 0000000..00f171b --- /dev/null +++ b/xz_mini/pages/commonQrCode/commonQrCode.wxml @@ -0,0 +1,15 @@ + + + + + + {{title}} + {{desc}} + + + + {{hint}} + + + + \ No newline at end of file diff --git a/xz_mini/pages/commonQrCode/commonQrCode.wxss b/xz_mini/pages/commonQrCode/commonQrCode.wxss new file mode 100644 index 0000000..eae47db --- /dev/null +++ b/xz_mini/pages/commonQrCode/commonQrCode.wxss @@ -0,0 +1,80 @@ +/* subpages/commonQrCode.wxss */ +page { + width: 100%; + height: 100%; + background-color: #ededed; +} + +.page { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + /* justify-content: center; */ +} + +.box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-top: 200rpx; + width: 80%; + background-color: white; + border-radius: 20rpx; + height: auto; + padding: 20rpx; + box-shadow: 3rpx 3rpx 30rpx #e7e7e7; +} + +.title-box { + width: 100%; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; +} + +.title-icon { + width: 120rpx; + height: 120rpx; +} + +.title-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 75%; + margin-left: 20rpx; +} + +.title-txt { + font-size: 35rpx; + color: black; + font-weight: bold; +} + +.title-des { + font-size: 20rpx; + color: #6b6b6b; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + margin-top: 10rpx; +} + +.img { + margin-top: 20rpx; + width: 500rpx; + height: 500rpx; +} + +.hint { + margin-top: 20rpx; + font-size: 24rpx; + color: #858585; + margin-bottom: 20rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/cultureDetail/cultureDetail.js b/xz_mini/pages/cultureDetail/cultureDetail.js new file mode 100644 index 0000000..93b3fca --- /dev/null +++ b/xz_mini/pages/cultureDetail/cultureDetail.js @@ -0,0 +1,137 @@ +// pages/cultureDetail/cultureDetail.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + libraryUrl: app.libraryUrl, + swiper: { + imgUrl: [], + indicatorDots: false, + autoplay: true, + current: 0 + }, + library: null, + libraryPersonList: [] + }, + prevImg: function () { + var swiper = this.data.swiper; + var current = swiper.current; + swiper.current = current > 0 ? current - 1 : swiper.imgUrl.length - 1; + this.setData({ + swiper: swiper, + }) + }, + nextImg: function () { + var swiper = this.data.swiper; + var current = swiper.current; + swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0; + this.setData({ + swiper: swiper, + }) + }, + doGetLibrary: function (libraryId) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function (code, data) { + var covers = data.libraryCover.split(','); + var imageArray = []; + for (var i = 0, item; item = covers[i++];) { + imageArray.push(app.restAjax.path('{libraryUrl}/route/file/download/true/{cover}', [self.data.libraryUrl, item])); + } + self.setData({ + library: data, + 'swiper.imgUrl': imageArray + }); + }, function (code, data) { + app.dialog.msg(data.msg); + }, function () { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + doGetLibraryPerson: function (libraryId) { + var self = this; + app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), { + intangibleLibraryId: libraryId + }, null, function (code, data) { + self.setData({ + libraryPersonList: data + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var libraryId = options.libraryId + this.doGetLibrary(libraryId); + this.doGetLibraryPerson(libraryId) + this.saveBigdata(libraryId); + }, + saveBigdata(id) { + var params = "小程序" + id + "非遗"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/cultureDetail/cultureDetail.json b/xz_mini/pages/cultureDetail/cultureDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/cultureDetail/cultureDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/cultureDetail/cultureDetail.wxml b/xz_mini/pages/cultureDetail/cultureDetail.wxml new file mode 100644 index 0000000..7d78b71 --- /dev/null +++ b/xz_mini/pages/cultureDetail/cultureDetail.wxml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + {{library.libraryTitle}} + + + + 项目编号: + {{library.libraryNumber}} + + + 数据来源: + {{library.librarySource}} + + + + + 公布时间: + {{library.libraryOpenDateValue}} + + + 非遗级别: + {{library.libraryLevel}}级 + + + + + 所属地区: + {{library.libraryArea}} + + + 类  型: + {{library.libraryTypeValue}} + + + + + 申报地区或单位: + {{library.libraryAddress}} + + + + + 保护单位: + {{library.libraryAuthor}} + + + + + 相关描述 + + + + + + 相关传承人 + + + + 编  号: + {{item.libraryPersonNumber}} + + + 姓  名: + {{item.libraryPersonName}} + + + + + 性  别: + {{item.libraryPersonSex == 1 ? '男' : '女'}} + + + 出生日期: + {{item.libraryPersonBirthday }} + + + + + 民  族: + {{item.libraryPersonNationDictionaryName}} + + + + + diff --git a/xz_mini/pages/cultureDetail/cultureDetail.wxss b/xz_mini/pages/cultureDetail/cultureDetail.wxss new file mode 100644 index 0000000..2a00192 --- /dev/null +++ b/xz_mini/pages/cultureDetail/cultureDetail.wxss @@ -0,0 +1,116 @@ +.culture-swiper, swiper, .swiper-img{ + width: 100%; + height: 500rpx; +} +.culture-swiper{ + position: fixed; +} +.prev{ + width: 60rpx; + height: 100rpx; + position: absolute; + top: 50%; + left: 0rpx; + transform: translate(0, -50%); + background-color: rgba(0, 0, 0, 0.5); + border-top-right-radius: 100rpx; + border-bottom-right-radius: 100rpx; + display: flex; + justify-content: center; + align-items: center; +} +.next image, .prev image{ + width: 30rpx; + height: 30rpx; +} +.next{ + width: 60rpx; + height: 100rpx; + position: absolute; + top: 50%; + right: 0rpx; + transform: translate(0, -50%); + background-color: rgba(0, 0, 0, 0.5); + border-top-left-radius: 100rpx; + border-bottom-left-radius: 100rpx; + display: flex; + justify-content: center; + align-items: center; +} +.culture{ + position: absolute; + top: 450rpx; + left: 0; + right: 0; + border-radius:31rpx 31rpx 0px 0px; + background: #fff; +} +.culture-title{ + padding: 30rpx; + border-bottom: 3px solid #FBFBFB; + font-size: 34rpx; + color: #242424; +} +.culture-info{ + padding: 20rpx 30rpx; + border-bottom: 3px solid #FBFBFB; +} +.row{ + display: flex; +} +.info{ + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 26rpx; + color: #242424; + padding-right: 10rpx; + line-height: 50rpx; +} +.info text{ + color: #BBBBBB; +} +.part{ + padding: 30rpx; + border-bottom: 3px solid #FBFBFB; +} +.part-title{ + font-size: 32rpx; + border-left: 3px solid #9F1512; + padding-left: 10rpx; + margin-bottom: 20rpx; +} +.part-content{ + font-size: 26rpx; + line-height: 40rpx; + color: #5F5F5F; +} +.sign-box{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1); + height: 120rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; + background: #fff; +} +.sign-btn{ + width: 100%; + height: 100%; + background: #9F1512; + border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; +} +.library-person { + border-bottom: 1px solid #FBFBFB; +} +.library-person:last-child { + border-bottom: none; +} \ No newline at end of file diff --git a/xz_mini/pages/cultureMap/cultureMap.js b/xz_mini/pages/cultureMap/cultureMap.js new file mode 100644 index 0000000..7fc1d2a --- /dev/null +++ b/xz_mini/pages/cultureMap/cultureMap.js @@ -0,0 +1,59 @@ +// 引用百度地图微信小程序JSAPI模块 +var bmap = require('../../libs/bmap-wx.js'); +var app = getApp(); +Page({ + data: { + markers: [], + latitude: '', + longitude: '', + placeData: {}, + venueUrl: app.venueUrl, + }, + makertap: function(e) { + var that = this; + var id = e.markerId; + }, + onLoad: function() { + var self = this; + // 新建百度地图对象 + var BMap = new bmap.BMapWX({ + ak: 'qLbLh9KupfB8Ir72bkKogyvYi246rkKS' + }); + var fail = function(data) { + app.dialog.msg(data.msg); + }; + var success = function(code,data) { + wx.getLocation({ + altitude: 'false', + type: 'wgs84', + success: function (res) { + self.setData({ + longitude: res.longitude, + latitude: res.latitude + }) + } + }) + var arr = [] + for (var i = 0; i < data.data.length; i++) { + var obj = { + latitude: data.data[i].latitude, + longitude: data.data[i].longitude, + iconPath: '../../images/marker_red.png', + callout:{ + content:data.data[i].venueName + "\r\n地址:" + data.data[i].venuePosition + "\r\n电话:" + data.data[i].venueTelephone, + bgColor:"#fff", + padding:"5px", + borderRadius:"2px", + borderWidth:"1px", + borderColor:"#07c160", + } + } + arr.push(obj) + } + self.setData({ + markers: arr + }); + } + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesmap/listrangevenuesinforelease', [self.data.venueUrl]),{},null,success,fail) + } +}) \ No newline at end of file diff --git a/xz_mini/pages/cultureMap/cultureMap.json b/xz_mini/pages/cultureMap/cultureMap.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/cultureMap/cultureMap.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/cultureMap/cultureMap.wxml b/xz_mini/pages/cultureMap/cultureMap.wxml new file mode 100644 index 0000000..df31520 --- /dev/null +++ b/xz_mini/pages/cultureMap/cultureMap.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/xz_mini/pages/cultureMap/cultureMap.wxss b/xz_mini/pages/cultureMap/cultureMap.wxss new file mode 100644 index 0000000..f52424a --- /dev/null +++ b/xz_mini/pages/cultureMap/cultureMap.wxss @@ -0,0 +1,12 @@ +.map_container{ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.map { + height: 100%; + width: 100%; +} \ No newline at end of file diff --git a/xz_mini/pages/friendCircle/friendCircle.js b/xz_mini/pages/friendCircle/friendCircle.js new file mode 100644 index 0000000..77a66c3 --- /dev/null +++ b/xz_mini/pages/friendCircle/friendCircle.js @@ -0,0 +1,121 @@ +// pages/friendCircle/friendCircle.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + usercenterUrl: app.usercenterUrl, + socialUrl: app.socialUrl, + momentsList: [], + currentPage: 1, + rows: 20 + }, + doGetMomentsList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{socialUrl}/app/moments/listpagemomentsofpublicrelease', [self.data.socialUrl]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + for(var i = 0, item; item = data.rows[i++];) { + if(item.type === 'photo') { + var photos = item.photos.split(','); + var photoArray = []; + for(var j = 0, jItem; jItem = photos[j++];) { + if(jItem.length != 0) { + photoArray.push(jItem); + } + } + item.photoArray = photoArray; + } + } + var momentsArray; + if(page <= 1) { + momentsArray = data.rows; + } else { + momentsArray = self.data.news.newsList; + momentsArray = momentsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + momentsList: momentsArray + }) + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + // newFriendCircle: function () { + // wx.navigateTo({ + // url: '../newFriendCircle/newFriendCircle', + // }) + // }, + toMyFriendCircle: function () { + wx.navigateTo({ + url: '../myFriendCircle/myFriendCircle', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.doGetMomentsList(1); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.doGetMomentsList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.doGetMomentsList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/friendCircle/friendCircle.json b/xz_mini/pages/friendCircle/friendCircle.json new file mode 100644 index 0000000..8275159 --- /dev/null +++ b/xz_mini/pages/friendCircle/friendCircle.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "onReachBottomDistance": 50 +} \ No newline at end of file diff --git a/xz_mini/pages/friendCircle/friendCircle.wxml b/xz_mini/pages/friendCircle/friendCircle.wxml new file mode 100644 index 0000000..cafaf5d --- /dev/null +++ b/xz_mini/pages/friendCircle/friendCircle.wxml @@ -0,0 +1,55 @@ + + + + + + + {{item.creatorName}} + {{item.content}} + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + \ No newline at end of file diff --git a/xz_mini/pages/friendCircle/friendCircle.wxss b/xz_mini/pages/friendCircle/friendCircle.wxss new file mode 100644 index 0000000..d41c2c7 --- /dev/null +++ b/xz_mini/pages/friendCircle/friendCircle.wxss @@ -0,0 +1,71 @@ +.friend-circle{ + padding: 15rpx 30rpx; + border-bottom: 1px solid #DEDEDE; +} +.friend-circle:last-child { + border-bottom: none; +} +.friend-circle-box{ + display: flex; + justify-content: space-between; + padding-bottom: 10rpx; +} + +.avatar{ + width: 8%; +} +.avatar image{ + width: 100%; + height: 50rpx; + border-radius: 50rpx; +} +.content{ + width: 90%; +} +.name{ + font-size: 30rpx; + color: #949494; +} +.text{ + font-size: 32rpx; + color: #000; + margin: 10rpx 0; +} +.date{ + font-size: 28rpx; + color: #949494; +} +.photo-one image{ + width: 100%; +} +.photo-more image{ + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 10rpx; +} +.photo-more image:nth-child(3n){ + margin-right: 0; +} +.video video{ + width: 100%; +} +.new-friend-circle{ + position: fixed; + right: 30rpx; + bottom: 30rpx; +} +.box{ + width: 100rpx; + height: 100rpx; + display: flex; + justify-content: center; + align-items: center; + background: #9F1512; + color: #fff; + font-size: 32rpx; + border-radius: 50%; +} +.new{ + margin-bottom: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/heritage/heritage.js b/xz_mini/pages/heritage/heritage.js new file mode 100644 index 0000000..79f2111 --- /dev/null +++ b/xz_mini/pages/heritage/heritage.js @@ -0,0 +1,121 @@ +// pages/heritage/heritage.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + libraryUrl: app.libraryUrl, + libraryList: [], + currentPage: 1, + rows: 20 + }, + goDetail: function (event) { + wx.navigateTo({ + url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId, + }) + }, + goLive: function() { + wx.navigateTo({ + url: '../broadcast/broadcast', + }) + }, + goFriendCircle: function() { + wx.navigateTo({ + url: '../friendCircle/friendCircle', + }) + }, + goCultureMap: function () { + wx.navigateTo({ + url: '../cultureMap/cultureMap', + }) + }, + doGetLibraryList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease/{areaCode}', [self.data.libraryUrl,app.areaCode]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + for(var i = 0, item; item = data.rows[i++];) { + item.libraryApplyTime = item.libraryApplyTime.substring(0, item.libraryApplyTime.length - 10); + item.libraryCoverArray = item.libraryCover.split(','); + } + var libraryArray; + if(page <= 1) { + libraryArray = data.rows; + } else { + libraryArray = self.data.libraryList; + libraryArray = libraryArray.concat(data.rows); + } + self.setData({ + currentPage: page, + libraryList: libraryArray + }) + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.doGetLibraryList(1); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.doGetLibraryList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.doGetLibraryList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/heritage/heritage.json b/xz_mini/pages/heritage/heritage.json new file mode 100644 index 0000000..8275159 --- /dev/null +++ b/xz_mini/pages/heritage/heritage.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "onReachBottomDistance": 50 +} \ No newline at end of file diff --git a/xz_mini/pages/heritage/heritage.wxml b/xz_mini/pages/heritage/heritage.wxml new file mode 100644 index 0000000..78eb64b --- /dev/null +++ b/xz_mini/pages/heritage/heritage.wxml @@ -0,0 +1,33 @@ + + + + 非物质文化遗产数据库 + + + + + + 文化地图 + + + + + + + + + + {{item.libraryTitle}} + + {{item.libraryApplyTime}} + + + \ No newline at end of file diff --git a/xz_mini/pages/heritage/heritage.wxss b/xz_mini/pages/heritage/heritage.wxss new file mode 100644 index 0000000..260d4f1 --- /dev/null +++ b/xz_mini/pages/heritage/heritage.wxss @@ -0,0 +1,87 @@ +.top-select{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + padding: 30rpx 30rpx 10rpx; + flex-wrap: nowrap; + overflow-x: auto; + background: #fff; + z-index: 100; +} +.select-box{ + flex-shrink: 0; + width: 25%; + padding: 0 10rpx; + box-sizing: border-box; + text-align: center; +} +.select-box image{ + width: 100rpx; + height: 100rpx; +} +.select-title{ + color: #242424; + font-size: 30rpx; + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} +.select-box.active .select-title{ + color: #9F1512; +} +.activity{ + padding: 20rpx 30rpx 0; + margin-top: 200rpx; +} +.activity-box{ + margin-bottom: 20rpx; + box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1); + border-radius: 10rpx; + overflow: hidden; +} +.activity-img{ + height: 320rpx; + position: relative; +} +.activity-img image{ + width: 100%; + height: 100%; +} +.corner{ + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; +} +.activity-info{ + padding: 10rpx; +} +.title{ + display: flex; + justify-content: space-between; +} +.activity-title{ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 32rpx; + color: #242424; + line-height: 40rpx; +} +.sign{ + background: rgba(159,21,18,.1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; +} +.date{ + margin-top: 10rpx; + font-size: 28rpx; + color: #242424; +} \ No newline at end of file diff --git a/xz_mini/pages/index/index.js b/xz_mini/pages/index/index.js new file mode 100644 index 0000000..9005b72 --- /dev/null +++ b/xz_mini/pages/index/index.js @@ -0,0 +1,410 @@ +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + randomName: true, + showPhone: true, + gotCode: false, + restTime: 120, + timer: '', + indicatorDots: true, + autoplay: true, + token: '', + news: { + newsUrl: app.newsUrl, + bannerList: [], + newsList: [] + }, + venue: { + venueUrl: app.venueUrl, + venueList: [] + }, + activity: { + activityUrl: app.activityUrl, + activityList: [] + }, + live: { + liveUrl: app.liveUrl, + liveList: [] + }, + usercenterUrl: app.usercenterUrl, + bigDataUrl: app.bigDataUrl, + isConfirm: false, + mainFuncList: [], + mainNewTab: [], + isHide: true + }, + doLogin: function () { + var self = this; + wx.login({ + success(res) { + if (res.code) { + app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default-multi', [app.loginUrl]), { + jsCode: res.code, + appKey: app.appId + }, null, function (code, data) { + console.log(data) + var tokenArray = data.data.split('_'); + var token = tokenArray[0]; + var isRandomUsername = tokenArray[1]; + self.setData({ + token: token + }) + wx.setStorageSync('token', token); + wx.setStorageSync('isRandomUsername', isRandomUsername) + //获取UserID + self.getUserInfo(); + }, function (code, data) { + app.dialog.msg(data.msg); + }); + } else { + console.log(res) + app.dialog.msg('登录失败!' + res.errMsg); + } + } + }) + }, + // getUserInfo(){ + // var _self= this; + // // app/wxopen/qrcoderelease/{userId} + // app.restAjax.get(app.restAjax.path('{newsUrl}/app/user/get-app-user'),[_self.data.news.newsUrl]), + // null, + // null, + // function(code,data){ + // console.log(data) + // }, + // function(code,error){ + // app.dialog.msg(error.msg); + // } + // }, + //获取首页功能 + getMainFunc() { + var _self = this; + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/list/areamenu/release/{areaCode}', [_self.data.news.newsUrl, app.areaCode]), + null, + null, + function (code, data) { + console.log(data) + _self.setData({ + mainFuncList: data + }) + }, + function (code, data) { + app.dialog.msg(data.msg); + }); + }, + //获取首页新闻动态 + getMainNewsTab() { + var _self = this; + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listsub/areaauth/release/{newsDirectoriesId}/{areaCode}', [_self.data.news.newsUrl, '0', app.areaCode]), + null, + null, + function (code, data) { + if (data && data.length > 0) { + _self.setData({ + mainNewTab: data + }) + data.forEach(el => { + _self.doGetNewsList(el.newsDirectoriesId); + }); + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }); + }, + //获取新闻 + doGetNewsList(id) { + var _self = this; + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [_self.data.news.newsUrl, app.areaCode]), { + newsDirectoriesId: "", + newsDirectoriesParentId: id, + page: 1, + rows: 5 + }, null, function (code, data) { + _self.data.mainNewTab.forEach(el => { + if (el.newsDirectoriesId == id) { + el.newsList = data.rows + } + }); + _self.setData({ + mainNewTab: _self.data.mainNewTab + }) + }, function (code, data) { + console.log(data) + app.dialog.msg(data.msg); + }); + }, + doGetBanner: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [self.data.news.newsUrl, app.areaCode]), { + newsDirectoriesId: 'eab0ca3c-d35d-4c02-9397-ace2bdd10fc1', + page: 1, + rows: 5 + }, null, function (code, data) { + self.setData({ + 'news.bannerList': data.rows + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + doGetVenueList: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease/{areaCode}', [self.data.venue.venueUrl, app.areaCode]), { + page: 1, + rows: 3, + latitude: app.globalData.curLat, + longitude: app.globalData.curLng, + orderKey: "", + }, null, function (code, data) { + for (var i = 0, item; item = data.rows[i++];) { + item.venuePanoramaArray = item.venuePanorama.split(','); + } + self.setData({ + 'venue.venueList': data.rows + }); + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + //加载活动图片错误 + loadImgErr(e) { + console.log(e) + var index = e.currentTarget.dataset.index + this.data.activity.activityList[index].activityImageArray.unshift("03c2ea0d-87ad-43db-bba0-ae6b4f827dba") + this.setData({ + activity: this.data.activity + }) + }, + //加载轮播图错误 + loadBannerErr(e) { + var index = e.currentTarget.dataset.index + this.data.news.bannerList[index].newsContentCoverList.unshift('03c2ea0d-87ad-43db-bba0-ae6b4f827dba') + this.setData({ + news: this.data.news + }) + }, + doGetActivityList: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{activityUrl}/app/activitylibrary/listpageactivitylibraryfornetrelease/{areaCode}', [self.data.activity.activityUrl, app.areaCode]), { + page: 1, + rows: 3 + }, null, function (code, data) { + console.log(data); + for (var i = 0, item; item = data.rows[i++];) { + item.activityImageArray = item.activityImage.split(','); + } + self.setData({ + 'activity.activityList': data.rows + }); + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + // doGetNewsList: function () { + // var self = this; + // app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), { + // newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167', + // page: 1, + // rows: 5 + // }, null, function (code, data) { + // self.setData({ + // 'news.newsList': data.rows + // }) + // }, function (code, data) { + // app.dialog.msg(data.msg); + // }); + // }, + doGetLiveList: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), { + page: 1, + rows: 4 + }, null, function (code, data) { + self.setData({ + 'live.liveList': data.rows + }) + }, function (code, data) { + app.dialog.msg(data.msg); + }); + }, + + goNewsDetail: function (event) { + wx.navigateTo({ + url: '../newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId + }) + }, + openNewsDetail(e) { + console.log(e.currentTarget.dataset.item) + //判断是跳转到列表 详情 webview + var item = e.currentTarget.dataset.item; + if (item.directoriesView == '0') { + //跳转webview + wx.navigateTo({ + url: '/subpages/webcontentview/webcontent?url=' + item.directoriesTarget2, + }) + } else if (item.directoriesView == '1') { + //跳转列表 + wx.navigateTo({ + url: '/pages/newsList/newsList?id=' + item.newsDirectoriesId, + }) + } else { + //跳转无二级页面 + wx.navigateTo({ + url: '/pages/newsList/newsList?id=' + item.newsDirectoriesId, + }) + } + }, + goNewsList: function (event) { + wx.navigateTo({ + url: '../newsList/newsList?type=' + event.currentTarget.dataset.type, + }) + }, + goVolunteer: function () { + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + }, + goBroadcast: function () { + wx.navigateTo({ + url: '../broadcast/broadcast', + }) + }, + goVenue: function () { + wx.switchTab({ + url: '../venue/venue', + }) + }, + goVenueDetail: function (event) { + wx.navigateTo({ + url: '../venueDetail/venueDetail?venuesInfoId=' + event.currentTarget.dataset.venuesInfoId, + }) + }, + goBroadcastDetail: function (event) { + wx.navigateTo({ + url: '../broadcastDetail/broadcastDetail?livePlanId=' + event.currentTarget.dataset.livePlanId, + }) + }, + goActivity: function () { + wx.switchTab({ + url: '../activity/activity', + }) + }, + goActivityDetail: function (event) { + wx.navigateTo({ + url: '../activityDetail/activityDetail?id=' + event.currentTarget.dataset.activityLibraryId + }) + }, + goHeritage: function () { + wx.navigateTo({ + url: '/pages/heritage/heritage', + }) + }, + goCultureDetail: function (event) { + wx.navigateTo({ + url: '../cultureDetail/cultureDetail?libraryId=' + event.currentTarget.dataset.libraryId, + }) + }, + // 获取用户信息 + getUserInfo: function () { + var self = this + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/user/get-app-user', [app.usercenterUrl]), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + console.log(data); + app.globalData.userInfo = data; + self.setData({ + userInfo: data + }); + self.doSaveLoginInfo(data.userId); + self.getIsPublic(); + }, function (code, data) { + app.dialog.msg(data.msg); + }) + }, + //是否关注公众号 + getIsPublic() { + var _self = this; + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/wxopen/attentionrelease/{userId}', [app.usercenterUrl, _self.data.userInfo.userId]), {}, { + }, function (code, data) { + app.globalData.isPublic = data + }, function (code, data) { + app.dialog.msg(data.msg) + }) + }, + doSaveLoginInfo(id) { + var params = "小程序USER" + id; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/contentcensusrelease/log', [app.bigDataUrl]), info, { + + }, function (code, data) { + + }, function (code, data) { + }) + }, + goTrain: function () { + wx.navigateTo({ + url: '../train/train', + }) + }, + goTravel: function () { + wx.navigateTo({ + url: '../travel/travel', + }) + }, + goResource: function () { + wx.navigateTo({ + url: '../resource/resource', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + wx.getLocation({ + type: 'gcj02', + success(res) { + // const latitude = res.latitude + // const longitude = res.longitude + // const speed = res.speed + // const accuracy = res.accuracy + app.globalData.curLng = res.longitude + app.globalData.curLat = res.latitude + } + }) + self.doLogin(); + self.doGetBanner(); + self.doGetLiveList(); + self.doGetVenueList(); + self.doGetActivityList(); + self.getMainFunc(); + self.getMainNewsTab(); + }, + onPageScroll(e) { + var _self = this; + if (e.scrollTop <= 96) { + //显示 + _self.setData({ + isHide: true + }) + } else { + //隐藏 + _self.setData({ + isHide: false + }) + } + }, + openSearch() { + wx.navigateTo({ + url: '/subpages/search/commonSearch', + }) + } +}) \ No newline at end of file diff --git a/xz_mini/pages/index/index.json b/xz_mini/pages/index/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/index/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/index/index.wxml b/xz_mini/pages/index/index.wxml new file mode 100644 index 0000000..c393f82 --- /dev/null +++ b/xz_mini/pages/index/index.wxml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + {{item.directoriesName}} + + + + + 志愿者服务 + + + + 精彩活动 + + + + 场馆导航 + + + + 非遗文化 + + + + 直播点播 + + + + + + + + + 精彩推荐 + + + + + + + 场馆导航 + {{item.venueName}} + + + + 精彩活动 + {{item.activityTitle}} + + + + + + + + + + + + {{it.directoriesName}} + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + + + + + 直播专区 + + + + + + + {{item.livePlanName}} + 直播中 + 已结束 + 未开始 + 直播中 + 错误 + + + + + + \ No newline at end of file diff --git a/xz_mini/pages/index/index.wxss b/xz_mini/pages/index/index.wxss new file mode 100644 index 0000000..768c5e8 --- /dev/null +++ b/xz_mini/pages/index/index.wxss @@ -0,0 +1,393 @@ +.swiper-box, +.swiper-img, +swiper { + width: 100%; + height: 330rpx; +} + +.search-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: fixed; + bottom: 30rpx; + right: 50rpx; + width: 70rpx; + height: 70rpx; + background: linear-gradient(to right bottom, #9f15129e, #9f1512 70px); + border-radius: 50%; + padding: 10rpx; + +} + +.search-box image { + width: 48rpx; + height: 48rpx; +} + +.search-box text { + font-size: 25rpx; + color: #9f1512; +} + +.tab { + padding: 30rpx; + display: flex; + flex-wrap: nowrap; +} + +.tab-arrow { + font-size: 28rpx; + background: #242424; + text-align: center; + justify-content: center; + align-items: center; + position: absolute; + right: 0rpx; + padding: 20rpx; +} + +.tab-box { + flex-shrink: 0; + text-align: center; + width: 25%; +} + +.tab-box image { + width: 65rpx; + height: 65rpx; +} + +.tab-title { + font-size: 28rpx; +} + +.recommend { + padding: 0rpx 30rpx 30rpx 30rpx; +} + +.recommend-container { + width: 100%; + display: flex; +} + +.line { + width: 100%; + height: 1rpx; + background: #f2f2f2; +} + +.line-thick { + width: 100%; + height: 10rpx; + background: #f2f2f2; +} + +.recommend-box { + flex-shrink: 0; + width: 220rpx; + height: 130rpx; + border-radius: 10rpx; + overflow: hidden; + position: relative; + margin-right: 30rpx; +} + +.recommend-name { + position: absolute; + bottom: 0; + left: 0; + font-size: 20rpx; + background: #00000088; + color: white; + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.recommend-box image { + width: 100%; + height: 100%; +} + +.recommend-status { + position: absolute; + right: 0; + top: 0; + background: #9F1512; + border-radius: 10rpx; + color: white; + font-size: 20rpx; + padding: 0rpx 10rpx; + width: fit-content; +} + +.public-title { + text-align: center; + padding: 10rpx 0rpx; +} + +.title-text { + display: inline-block; + font-size: 32rpx; + color: #9F1512; + padding: 0 20rpx 0; + position: relative; + margin-bottom: 15rpx; +} + +.title-text image { + position: absolute; + top: 0; + width: 15rpx; + height: 100%; +} + +.selected-l { + left: 0; +} + +.selected-r { + right: 0; +} + +.news { + padding: 30rpx; + border-bottom: 5px solid #FBFBFB; +} + +.news-box { + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} + +.news-title { + color: #242424; + font-size: 30rpx; + font-weight: bold; +} + +.news-info { + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} + +.news-info text { + margin-right: 20rpx; +} + +.news-big-pic, +.news-small-pic { + margin-top: 10rpx; +} + +.news-big-pic image { + width: 100%; + height: 380rpx; +} + +.news-small-pic image { + width: 30%; + height: 150rpx; + margin-right: 20rpx; +} + +.transverse-news { + flex-direction: row; + justify-content: space-between; +} + +.news-row-img { + width: 30%; + height: 150rpx; +} + +.news-row-img image { + width: 100%; + height: 100%; +} + +.news-row-info { + width: 68%; +} + +.broadcast { + margin-top: 15rpx; + padding: 0 30rpx; +} + +.broadcast-container { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.broadcast-box { + flex-shrink: 0; + width: 49%; + border-radius: 10rpx; + overflow: hidden; + height: 185rpx; + margin-bottom: 15rpx; + position: relative; +} + +.broadcast-box image { + width: 100%; + height: 100%; +} + +.broadcast-text { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: 5rpx 10rpx; + font-size: 26rpx; + background: rgba(0, 0, 0, 0.6); + color: #fff; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.broadcast-status { + position: absolute; + top: 10rpx; + right: 10rpx; + padding: 5rpx; + background: #9F1512; + color: #fff; + font-size: 26rpx; + border-radius: 10rpx; +} + +.set-phone { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, .6); + z-index: 100; +} + +.set-phone-box { + width: 96%; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: #fff; + border-radius: 10rpx; + padding: 30rpx; + box-sizing: border-box; +} + +.tips { + font-size: 28rpx; + color: #000; +} + +.phone-input { + margin: 25rpx 0; +} + +.code-input { + display: flex; + justify-content: space-between; + margin-bottom: 25rpx; +} + +.code-input input { + width: 70%; + height: 55rpx; + border: 1px solid #dedede; + border-radius: 10rpx; + padding: 0 10rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.phone-input input { + width: 100%; + height: 55rpx; + border: 1px solid #dedede; + border-radius: 10rpx; + padding: 0 10rpx; + box-sizing: border-box; + font-size: 28rpx; +} + +.get-code, +.got-code { + font-size: 28rpx; + background: rgba(159, 21, 18, .1); + color: #9F1512; + width: 28%; + line-height: 55rpx; + text-align: center; + border-radius: 10rpx; +} + +.got-code { + background: #fff; + color: #4a4d52; + border: 1px solid #eaeaea; +} + +.set-phone-btn-box { + display: flex; + justify-content: space-between; +} + +.set-phone-btn { + width: 100%; + height: 65rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} + +.voice-box { + padding-right: 30px; + position: relative; +} + +.voice-box iamge { + position: absolute; + top: 0; + right: 0; + width: 25rpx; + height: 25rpx; +} + +.news-big-pic { + position: relative; +} + +.news-big-pic image.play-btn { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80rpx; + height: 80rpx; +} + + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/login/login.js b/xz_mini/pages/login/login.js new file mode 100644 index 0000000..6d0e5fe --- /dev/null +++ b/xz_mini/pages/login/login.js @@ -0,0 +1,66 @@ +// pages/login/login.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/login/login.json b/xz_mini/pages/login/login.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/login/login.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/login/login.wxml b/xz_mini/pages/login/login.wxml new file mode 100644 index 0000000..37ce7e4 --- /dev/null +++ b/xz_mini/pages/login/login.wxml @@ -0,0 +1,25 @@ + + + + + + + + +版权所有 \ No newline at end of file diff --git a/xz_mini/pages/login/login.wxss b/xz_mini/pages/login/login.wxss new file mode 100644 index 0000000..2ed4a3e --- /dev/null +++ b/xz_mini/pages/login/login.wxss @@ -0,0 +1,84 @@ +.login-top{ + width: 100%; + height: 610rpx; + position: relative; + text-align: center; +} +.login-bg{ + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} +.logo{ + width: 295rpx; + height: 265rpx; + margin-top: 75rpx; +} +.login{ + position: absolute; + top: 410rpx; + left: 0; + right: 0; + padding: 0 30rpx; +} +.login-info{ + padding: 45rpx 30rpx; + background: #fff; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:10rpx; +} +.row{ + display: flex; + justify-content: space-between; + border-radius:6rpx; + border:2rpx solid rgba(237,237,237,1); + align-items: center; + height: 100rpx; +} +.row-title{ + width: 30%; + text-align: center; + color: #9F1512; + font-size: 28rpx; +} +.row-text{ + width: 69%; +} +.row-text input{ + width: 100%; + height: 100%; +} +.password{ + margin-top: 25rpx; +} +.login-btn-box{ + margin-top: 45rpx; +} +.login-btn, .register-btn{ + display: flex; + justify-content: center; + align-items: center; + height: 90rpx; + background:#9F1512; + border-radius: 10rpx; + font-size: 32rpx; + color: #fff; +} +.register-btn{ + margin-top: 20rpx; + background: #fff; + color: #9F1512; +} +.copyright{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 20rpx 0; + font-size: 28rpx; + color: #949494; + text-align: center; +} \ No newline at end of file diff --git a/xz_mini/pages/myActivity/myActivity.js b/xz_mini/pages/myActivity/myActivity.js new file mode 100644 index 0000000..f337319 --- /dev/null +++ b/xz_mini/pages/myActivity/myActivity.js @@ -0,0 +1,147 @@ +// pages/volunteer/volunteer.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + dataMap: [], + type: '1' + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + myjoinActivity: function() { + var self = this; + app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/myjoinactivity', []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + console.log(data) + self.setData({ + dataMap: data.rows + }) + } + }, function() { + + }, function() { + + }) + }, + /** + * + * @param {查看活动详情} e + */ + activityDetail: function(e) { + var id = e.currentTarget.dataset.activityid; + wx.navigateTo({ + url: '../activityDetail/activityDetail?id=' + id + }) + }, + /** + * + * @param {取消报名} e + */ + cancelApply: function(e) { + var applyId = e.currentTarget.dataset.applyid; + var activityId = e.currentTarget.dataset.activityid; + wx.showModal({ + title: '提示', + content: '确定要退出吗?', + success: function (sm) { + if (sm.confirm) { + app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId + '/' + applyId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + self.onLoad() + } + }, function() { + + }, function() { + + }) + } else if (sm.cancel) { + + } + } + }) + var self = this; + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getToken().then(result => { + this.myjoinActivity(); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/myActivity/myActivity.json b/xz_mini/pages/myActivity/myActivity.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/myActivity/myActivity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/myActivity/myActivity.wxml b/xz_mini/pages/myActivity/myActivity.wxml new file mode 100644 index 0000000..c72d8b7 --- /dev/null +++ b/xz_mini/pages/myActivity/myActivity.wxml @@ -0,0 +1,15 @@ + + + + {{item.activityTitle}} + + 活动地址:{{item.activityAddress}} + 时间:{{item.startTime}}-{{item.endTime}} + 报名人:{{item.userName}} + 身份证号:{{item.userIdCard}} + 活动详情 + 取消报名 + + \ No newline at end of file diff --git a/xz_mini/pages/myActivity/myActivity.wxss b/xz_mini/pages/myActivity/myActivity.wxss new file mode 100644 index 0000000..33621f7 --- /dev/null +++ b/xz_mini/pages/myActivity/myActivity.wxss @@ -0,0 +1,105 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + padding: 0 30rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} +.cancel-btn{ + width: 150rpx; + height: 55rpx; + text-align: center; + font-size: 28rpx; + background: #9F1512; + border-radius: 10rpx; + line-height: 55rpx; + color: #fff; + margin-top: 10rpx; + display: inline-block; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/myFriendCircle/myFriendCircle.js b/xz_mini/pages/myFriendCircle/myFriendCircle.js new file mode 100644 index 0000000..bba010c --- /dev/null +++ b/xz_mini/pages/myFriendCircle/myFriendCircle.js @@ -0,0 +1,116 @@ +// pages/friendCircle/friendCircle.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + usercenterUrl: app.usercenterUrl, + socialUrl: app.socialUrl, + momentsList: [], + currentPage: 1, + rows: 20 + }, + doGetMomentsList: function(page) { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{socialUrl}/app/moments/listpagemomentsofpublicrelease', [self.data.socialUrl]), { + page: page, + rows: self.data.rows + }, null, function(code, data) { + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + for(var i = 0, item; item = data.rows[i++];) { + if(item.type === 'photo') { + var photos = item.photos.split(','); + var photoArray = []; + for(var j = 0, jItem; jItem = photos[j++];) { + if(jItem.length != 0) { + photoArray.push(jItem); + } + } + item.photoArray = photoArray; + } + } + var momentsArray; + if(page <= 1) { + momentsArray = data.rows; + } else { + momentsArray = self.data.news.newsList; + momentsArray = momentsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + momentsList: momentsArray + }) + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + newFriendCircle: function () { + wx.navigateTo({ + url: '../newFriendCircle/newFriendCircle', + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.doGetMomentsList(1); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.doGetMomentsList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.doGetMomentsList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/myFriendCircle/myFriendCircle.json b/xz_mini/pages/myFriendCircle/myFriendCircle.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/myFriendCircle/myFriendCircle.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/myFriendCircle/myFriendCircle.wxml b/xz_mini/pages/myFriendCircle/myFriendCircle.wxml new file mode 100644 index 0000000..59e2b16 --- /dev/null +++ b/xz_mini/pages/myFriendCircle/myFriendCircle.wxml @@ -0,0 +1,54 @@ + + + + + + + {{item.creatorName}} + {{item.content}} + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + + + + {{item.creatorName}} + {{item.content}} + + + + {{item.gmtCreate}} + + + + + 发布 + \ No newline at end of file diff --git a/xz_mini/pages/myFriendCircle/myFriendCircle.wxss b/xz_mini/pages/myFriendCircle/myFriendCircle.wxss new file mode 100644 index 0000000..5b9cd19 --- /dev/null +++ b/xz_mini/pages/myFriendCircle/myFriendCircle.wxss @@ -0,0 +1,68 @@ +.friend-circle{ + padding: 15rpx 30rpx; + border-bottom: 1px solid #DEDEDE; +} +.friend-circle:last-child { + border-bottom: none; +} +.friend-circle-box{ + display: flex; + justify-content: space-between; + padding-bottom: 10rpx; +} + +.avatar{ + width: 8%; +} +.avatar image{ + width: 100%; + height: 50rpx; + border-radius: 50rpx; +} +.content{ + width: 90%; +} +.name{ + font-size: 30rpx; + color: #949494; +} +.text{ + font-size: 32rpx; + color: #000; + margin: 10rpx 0; +} +.date{ + font-size: 28rpx; + color: #949494; +} +.photo-one image{ + width: 100%; +} +.photo-more image{ + width: 32%; + height: 150rpx; + margin-right: 2%; + margin-bottom: 10rpx; +} +.photo-more image:nth-child(3n){ + margin-right: 0; +} +.video video{ + width: 100%; +} +.new-friend-circle{ + position: fixed; + right: 30rpx; + bottom: 30rpx; +} +.box{ + width: 100rpx; + height: 100rpx; + display: flex; + justify-content: center; + align-items: center; + background: #9F1512; + color: #fff; + font-size: 32rpx; + border-radius: 50%; +} \ No newline at end of file diff --git a/xz_mini/pages/myVenueOrder/myVenueOrder.js b/xz_mini/pages/myVenueOrder/myVenueOrder.js new file mode 100644 index 0000000..c263f75 --- /dev/null +++ b/xz_mini/pages/myVenueOrder/myVenueOrder.js @@ -0,0 +1,66 @@ +// pages/myVenueOrder/myVenueOrder.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/myVenueOrder/myVenueOrder.json b/xz_mini/pages/myVenueOrder/myVenueOrder.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/myVenueOrder/myVenueOrder.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/myVenueOrder/myVenueOrder.wxml b/xz_mini/pages/myVenueOrder/myVenueOrder.wxml new file mode 100644 index 0000000..542582a --- /dev/null +++ b/xz_mini/pages/myVenueOrder/myVenueOrder.wxml @@ -0,0 +1,44 @@ + + + + + + + + 场馆 + 篮球 + + 订单编号:12456789 + 下单时间:2020-01-01 10:00:00 + ¥15元 + + + + + + + + + 场馆 + 篮球 + + 订单编号:12456789 + 下单时间:2020-01-01 10:00:00 + ¥15元 + + + + + + + + + 场馆 + 篮球 + + 订单编号:12456789 + 下单时间:2020-01-01 10:00:00 + ¥15元 + + + \ No newline at end of file diff --git a/xz_mini/pages/myVenueOrder/myVenueOrder.wxss b/xz_mini/pages/myVenueOrder/myVenueOrder.wxss new file mode 100644 index 0000000..214e7f4 --- /dev/null +++ b/xz_mini/pages/myVenueOrder/myVenueOrder.wxss @@ -0,0 +1,51 @@ +.venue{ + padding: 10rpx 30rpx; +} +.order-box{ + border-radius: 10rpx; + padding: 10rpx; + box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1); + display: flex; + justify-content: space-between; + margin-bottom: 20rpx; +} +.venue-img{ + width: 35%; + height: 180rpx; +} +.venue-img image{ + width: 100%; + height: 100%; + border-radius: 10rpx; +} +.order-info{ + width: 62%; +} +.venue-title{ + font-size: 32rpx; + display: flex; + justify-content: space-between; +} +.title{ + width: 70%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.project{ + font-size: 28rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + padding: 0 5rpx; + border-radius: 10rpx; +} +.number-time{ + font-size: 26rpx; + color: #949494; + margin-top: 10rpx; +} +.price{ + font-size: 30rpx; + color: #9F1512; + margin-top: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.js b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.js new file mode 100644 index 0000000..81cde1c --- /dev/null +++ b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.js @@ -0,0 +1,138 @@ +// pages/volunteer/volunteer.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + dataMap: {}, + type: '1', + teamId: '' + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + newTeam: function () { + wx.navigateTo({ + url: '../newTeam/newTeam', + }) + }, + goDetail: function (e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '../serviceActivityDetail/serviceActivityDetail?id=' + id + }) + }, + newActivity: function () { + wx.navigateTo({ + url: '../newVolunteerActivity/newVolunteerActivity', + }) + }, + changeTab: function(e) { + var self = this; + self.setData({ + type: e.currentTarget.dataset.type + }) + if(self.data.type === '1') { + // 我发起的活动 + self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice'); + }else { + // 我参加的活动 + self.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagemyjoinservice'); + } + }, + myActivity: function(url) { + var self = this; + app.restAjax.get(app.restAjax.path(url, []), + self.data.pages, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + for(var item of data.rows) { + if('' != item.photo) { + var photoArr = item.photo.split(","); + item.photo = app.volunteerUrl + '/route/file/download/true/' + photoArr[0]; + } + } + self.setData({ + dataMap: data.rows + }) + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getToken().then(result => { + this.myActivity(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservice'); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.json b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxml b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxml new file mode 100644 index 0000000..e2c9f54 --- /dev/null +++ b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxml @@ -0,0 +1,30 @@ + + + + 我发起 + + + + + 我参加 + + + + + + + + + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + + + + + + 发起新活动 + \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxss b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxss new file mode 100644 index 0000000..b777244 --- /dev/null +++ b/xz_mini/pages/myVolunteerActivity/myVolunteerActivity.wxss @@ -0,0 +1,137 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + margin-top: 90rpx; + padding: 0 30rpx; + margin-bottom: 110rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} +.volunteer-activity{ + margin-top: 90rpx; + padding: 0 30rpx; + margin-bottom: 105rpx; +} +.activity{ + padding: 20rpx 30rpx 0; +} +.activity-box{ + margin-bottom: 20rpx; + box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1); + border-radius: 10rpx; + overflow: hidden; +} +.activity-img{ + height: 320rpx; + position: relative; +} +.activity-img image{ + width: 100%; + height: 100%; +} +.activity-info{ + padding: 15rpx 20rpx; +} +.title{ + display: flex; + justify-content: space-between; +} +.activity-title{ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 30rpx; + color: #242424; + line-height: 40rpx; +} +.date{ + margin-top: 10rpx; + font-size: 22rpx; + color: #242424; +} \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.js b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.js new file mode 100644 index 0000000..6b77acc --- /dev/null +++ b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.js @@ -0,0 +1,158 @@ +// pages/volunteer/volunteer.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + otherTeamMap: {}, + type: '1', + teamId: '', + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + toTeamDetail: function(e) { + var teamId = e.currentTarget.dataset.teamid; + wx.navigateTo({ + url: '../teamDetail/teamDetail?teamId=' + teamId, + }) + }, + newTeam: function () { + wx.navigateTo({ + url: '../newTeam/newTeam', + }) + }, + otherTeam: function(url) { + var self = this; + app.restAjax.get(app.restAjax.path(url, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + self.setData({ + otherTeamMap: data.rows + }) + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + + }) + }, + /** + * 申请/退出加入团队 + */ + joinOrOutTeam: function(e) { + var self = this; + self.setData({ + teamId: e.currentTarget.dataset.teamid + }) + var teamMemberVO; + var url; + var methodType; + var title; + if('1' == self.data.type) { + url = app.volunteerUrl + '/app/teammember/saveteammember' + teamMemberVO = { + teamId: e.currentTarget.dataset.teamid + } + methodType = app.restAjax.post + title = '申请成功!' + }else { + url = app.volunteerUrl + '/app/teammember/quitTeam/' + self.data.teamId + methodType = app.restAjax.get + title = '退出成功!' + } + + methodType(app.restAjax.path(url, []), + teamMemberVO, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + app.dialog.msg(title); + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getToken().then(result => { + this.otherTeam(app.volunteerUrl + '/app/team/myteamm'); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.json b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxml b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxml new file mode 100644 index 0000000..536dfcc --- /dev/null +++ b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxml @@ -0,0 +1,15 @@ + + + + {{item.teamName}} + 申请加入 + 退出 + 待审核 + 退出 + 审核驳回 + 已退出 + + 团队口号:{{item.teamWatchword}} + 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} + + \ No newline at end of file diff --git a/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxss b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxss new file mode 100644 index 0000000..29df066 --- /dev/null +++ b/xz_mini/pages/myVolunteerTeam/myVolunteerTeam.wxss @@ -0,0 +1,92 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + padding: 0 30rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/newTeam/newTeam.js b/xz_mini/pages/newTeam/newTeam.js new file mode 100644 index 0000000..4b12457 --- /dev/null +++ b/xz_mini/pages/newTeam/newTeam.js @@ -0,0 +1,375 @@ +// pages/newTeam/newTeam.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + isAgree: false, // 是否同意志愿者注册协议 + index: 0, + array: ['区域1','区域2','区域3','区域4'], + photo: '', // 用于页面显示的photo链接 + uploadPhoto: '', // 用于传到后台的photoId + teamName: '', + count:'', + teamWatchword: '', + content: '', + + tempObj: {}, // 用于临时存储字典表返回的数据 + tempArray: [], // 用于临时存储字典表返回的数据 + + teamCityIndex: 0, + teamCityResult: '请选择服务区域', + teamCity: {}, // 服务区域-市 + teamCityArray: [], // 服务区域-市 + + teamCountyIndex: 0, + teamCountyResult: '请选择旗县区', + teamCounty: {}, // 服务区域-旗县区 + teamCountyArray: [], // 服务区域-旗县区 + + teamAreaIndex: 0, + teamAreaResult: '请选择乡镇村', + teamArea: {}, // 服务区域-乡镇村 + teamAreaArray: [], // 服务区域-乡镇村 + + countyShowStatus: true, + areaShowStatus: true + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + bindPickerChange: function (e) { + this.setData({ + index: e.detail.value + }) + }, + /** + * 上传活动照片 + */ + uploadPhoto: function () { + var self = this + wx.chooseImage({ + success (res) { + const tempFilePaths = res.tempFilePaths + console.log(tempFilePaths) + app.restAjax.file(app.restAjax.path(app.volunteerUrl + '/app/file/uploadimage', []), tempFilePaths[0], + 'image', { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + var data = data.substr(9, data.length); + data = data.substr(0, data.length - 2); + self.setData({ + photo: app.volunteerUrl + '/route/file/download/true/' + data, + uploadPhoto: data + }) + } + }, function(code, data) { + app.dialog.msg(data.msg) + }, function() { + + }) + } + }) + }, + cityChange: function(e) { + var self = this; + self.setData({ + teamCityIndex: e.detail.value, + areaShowStatus: true, + teamArea: {}, + teamAreaArray: [] + }) + + this.getDataFromArea(self.data.teamCity[self.data.teamCityIndex].areaId, 2).then(result => { + if(self.data.tempObj.length > 0) { + self.setData({ + teamCounty: self.data.tempObj, + teamCountyArray: self.data.tempArray, + countyShowStatus: false, + tempObj: {}, + tempArray: [] + }) + }else { + self.setData({ + teamCounty: {}, + teamCountyArray: [], + countyShowStatus: true, + tempObj: {}, + tempArray: [] + }) + } + }); + }, + countyChange: function(e) { + var self = this; + self.setData({ + teamCountyIndex: e.detail.value + }) + + this.getDataFromArea(self.data.teamCounty[self.data.teamCountyIndex].areaId, 2).then(result => { + if(self.data.tempObj.length > 0) { + self.setData({ + teamArea: self.data.tempObj, + teamAreaArray: self.data.tempArray, + areaShowStatus: false, + tempObj: {}, + tempArray: [] + }) + }else { + self.setData({ + teamArea: {}, + teamAreaArray: [], + areaShowStatus: true, + tempObj: {}, + tempArray: [] + }) + } + }) + }, + areaChange: function(e) { + var self = this; + self.setData({ + teamAreaIndex: e.detail.value + }) + }, + userAgree: function(e) { + var type = e.currentTarget.dataset.type; + wx.navigateTo({ + url: '../userAgree/userAgree?type=' + type, + }) + }, + changeAgree: function (e) { + if(e.detail.value == ''){ + this.setData({ + isAgree: false + }) + }else{ + this.setData({ + isAgree: true + }) + } + }, + submitRegister: function () { + var self = this; + if(!self.data.isAgree) { + wx.showToast({ + title: '请阅读并同意《团队注册服务协议》', + icon: 'none', + duration: 1500 + }) + return false; + } + var teamVO = { + photo: self.data.uploadPhoto, + teamName: self.data.teamName, + count:self.data.count, + teamWatchword: self.data.teamWatchword, + content: self.data.content, + agree: self.data.isAgree, + teamCity: self.data.teamCity[self.data.teamCityIndex] != '' + && self.data.teamCity[self.data.teamCityIndex] != null + && self.data.teamCity[self.data.teamCityIndex] != 'undefined' ? + self.data.teamCity[self.data.teamCityIndex].dictionaryId : + '', + teamCounty: self.data.teamCounty[self.data.teamCountyIndex] != '' + && self.data.teamCounty[self.data.teamCountyIndex] != null + && self.data.teamCounty[self.data.teamCountyIndex] != 'undefined' ? + self.data.teamCounty[self.data.teamCountyIndex].dictionaryId : + '', + teamArea: self.data.teamArea[self.data.teamAreaIndex] != '' + && self.data.teamArea[self.data.teamAreaIndex] != null + && self.data.teamArea[self.data.teamAreaIndex] != 'undefined' ? + self.data.teamArea[self.data.teamAreaIndex].dictionaryId : + '', + }; + app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/team/saveteam', []), + teamVO, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + app.dialog.msg('注册成功') + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, function(code, data) { + app.dialog.msg(data.msg) + }, function() { + + }) + }, + /** + *从字典表拉取数据 + */ + getDataFromDict: function(dictId, type) { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/datadictionary/listdictionarybyparentid/' + dictId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + var array = []; + for(var item of data) { + delete item.dictionaryParentId; + delete item.dictionaryParentName; + delete item.dictionarySummary; + delete item.dictionaryCode; + delete item.dictionarySort; + delete item.subDictionary; + delete item.parent; + + array.push(item.dictionaryName); + } + self.setData({ + tempArray: array + }) + } + self.setData({ + tempObj: data + }) + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, + /** + *从区域表拉取数据 + */ + getDataFromArea: function(dictId, type) { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listbyparentidrelease/' + dictId, []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + console.log(data) + if('200' == code) { + if(data || type === 2) { + var array = []; + for(var item of data) { + delete item.areaParentId; + delete item.areaParentName; + delete item.areaCode; + delete item.areaCityCode; + delete item.areaMergerName; + delete item.areaShortName; + delete item.areaZipCode; + delete item.areaLevel; + delete item.areaLng; + delete item.areaLat; + delete item.areaPinyin; + delete item.areaFirst; + delete item.subArea; + delete item.parent; + + array.push(item.areaName); + } + self.setData({ + tempArray: array + }) + } + self.setData({ + tempObj: data + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + console.log(self.data.token) + this.getDataFromArea('640675', 2).then(result => { + self.setData({ + teamCity: self.data.tempObj, + teamCityArray: self.data.tempArray, + tempObj: {}, + tempArray: [] + }) + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/newTeam/newTeam.json b/xz_mini/pages/newTeam/newTeam.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/newTeam/newTeam.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/newTeam/newTeam.wxml b/xz_mini/pages/newTeam/newTeam.wxml new file mode 100644 index 0000000..9c0f06d --- /dev/null +++ b/xz_mini/pages/newTeam/newTeam.wxml @@ -0,0 +1,77 @@ + + + 团队头像: + + + + + 点击上传 + + + + 团队名称: + + + + + + 人数限制: + + + + + + 团队口号: + + + + + + 市: + + + + {{teamCityArray[teamCityIndex]}} + + + + + + + + 团队介绍: + + + + + + + + + + + + + 立即注册 + + \ No newline at end of file diff --git a/xz_mini/pages/newTeam/newTeam.wxss b/xz_mini/pages/newTeam/newTeam.wxss new file mode 100644 index 0000000..ceb514f --- /dev/null +++ b/xz_mini/pages/newTeam/newTeam.wxss @@ -0,0 +1,88 @@ +.new-team{ + padding: 0 30rpx; +} +.row{ + display: flex; + justify-content: space-between; + height: 90rpx; +} +.row-title{ + line-height: 90rpx; + color: #242424; + font-size: 32rpx; + width: 24%; + display: flex; + align-items: center; +} +.row-text{ + width: 75%; + display: flex; + align-items: center; + border-bottom: 1px solid #EBEBEB; +} +.row-text input{ + width: 100%; + height: 100%; +} +picker{ + width: 100%; + height: 100%; + line-height: 90rpx; +} +laebl{ + margin-right: 30rpx; +} +.intro, .intro textarea{ + height: 230rpx; +} +.intro textarea{ + padding: 26rpx 0; + box-sizing: border-box; + font-size: 32rpx; +} +.create{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 0 30rpx 30rpx; + background: #fff; +} +.agree{ + display: flex; + align-items: center; + font-size: 30rpx; + padding-top: 5rpx; +} +.agree-checkbox{ + transform: scale(0.8,0.8); +} +.create-btn{ + background: #9F1512; + height: 80rpx; + border-radius: 10rpx; + color: #fff; + font-size: 32rpx; + display: flex; + justify-content: center; + align-items: center; + margin-top: 15rpx; +} +label{ + margin-right: 30rpx; +} +.info-text{ + width: 77%; + font-size: 26rpx; + height: 55rpx; +} +.avatar{ + height: 150rpx; +} +.avatar image{ + width: 150rpx; + height: 150rpx; +} +.avatar-row{ + height: 150rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.js b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.js new file mode 100644 index 0000000..6d9b129 --- /dev/null +++ b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.js @@ -0,0 +1,254 @@ +// pages/newVolunteerActivity/newVolunteerActivity.js +var app = getApp(); +var util = require('../../utils/util.js'); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + startDate: '', + endDate: '', + serviceName: '', // 名称 + serviceContent: '', // 活动内容 + address: '', // 活动地址 + serviceReward: '', // 服务奖补 + linkMan: '', // 联系人 + linkTel: '', // 联系人联系方式 + count: '', // 志愿者数量 + introduce: '', // 活动介绍 + voluntaryType: 1, // 类型 + tempFilePaths: '', // 宣传图片 + photo: '', // 用于页面显示的宣传图片链接 + uploadPhoto: '', // 用于传到后台的宣传图片Id + serviceRequirement: '', // 服务要求 + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + startDateChange: function(e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + startDate: e.detail.value + }) + }, + endDateChange: function(e) { + var self = this; + console.log('picker发送选择改变,携带值为', e.detail.value) + if(self.data.startDate > e.detail.value) { + wx.showToast({ + title: '结束时间不能早于开始时间', + icon: 'none', + duration: 1500 + }) + return false; + } + this.setData({ + endDate: e.detail.value + }) + }, + dateDafault: function() { + // 设置日期选择框为当前日期 + var self = this; + var TIME = util.formatDate(new Date()); + self.setData({ + startDate: TIME, + endDate: TIME + }) + }, + /** + * 选择志愿者或者团队类型 + */ + changeType: function(e) { + if(e.detail.value == 1){ + this.setData({ + voluntaryType : 1 + }) + }else{ + this.setData({ + voluntaryType : 2 + }) + } + }, + /** + * 上传活动照片 + */ + uploadPhoto: function () { + var self = this + wx.chooseImage({ + success (res) { + const tempFilePaths = res.tempFilePaths + app.restAjax.file(app.restAjax.path(app.volunteerUrl + '/app/file/uploadimage', []), tempFilePaths[0], + 'image', { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + var data = data.substr(9, data.length); + data = data.substr(0, data.length - 2); + self.setData({ + photo: app.volunteerUrl + '/route/file/download/true/' + data, + uploadPhoto: data + }) + } + }, function(code, data) { + app.dialog.msg(data.msg) + }, function() { + + }) + } + }) + }, + submitRegister: function () { + var self = this; + if(!self.data.serviceName) { + wx.showToast({ + title: '活动名称不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + if(!self.data.serviceContent) { + wx.showToast({ + title: '活动内容不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + if(!self.data.address) { + wx.showToast({ + title: '活动地址不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + if(!self.data.linkMan) { + wx.showToast({ + title: '活动联系人不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + if(!self.data.address) { + wx.showToast({ + title: '联系方式不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + if(!self.data.count) { + wx.showToast({ + title: '数量不能为空', + icon: 'none', + duration: 1500 + }) + return false; + } + var volunteerServiceVO = { + serviceName: self.data.serviceName, + serviceContent: self.data.serviceContent, + address: self.data.address, + serviceReward: self.data.serviceReward, + linkMan: self.data.linkMan, + linkTel: self.data.linkTel, + voluntaryType: self.data.voluntaryType, + count: self.data.count, + introduce: self.data.introduce, + startTime: self.data.startDate, + endTime: self.data.endDate, + photo: self.data.uploadPhoto, + serviceRequirement: self.data.serviceRequirement + }; + app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/savevolunteerservice', []), + volunteerServiceVO, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + app.dialog.msg('活动发布成功!'); + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.dateDafault(); + this.getToken(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.json b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxml b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxml new file mode 100644 index 0000000..1ee51e8 --- /dev/null +++ b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxml @@ -0,0 +1,102 @@ + + + 活动名称: + + + + + + 活动内容: + + + + + + 活动地址: + + + + + + 服务奖补: + + + + + + 服务要求: + + + + + + 联系人: + + + + + + 联系方式: + + + + + + 类型: + + + + + + + + 数量: + + + + + + 活动简介: + + + + + + 开始时间: + + + + {{startDate}} + + + + + + 结束时间: + + + + {{endDate}} + + + + + + 宣传图片: + + + + + 点击上传 + + + + + + + 立即发起 + + \ No newline at end of file diff --git a/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxss b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxss new file mode 100644 index 0000000..33eab65 --- /dev/null +++ b/xz_mini/pages/newVolunteerActivity/newVolunteerActivity.wxss @@ -0,0 +1,75 @@ +.new-team{ + padding: 0 30rpx; + margin-bottom: 140rpx; +} +.row{ + display: flex; + justify-content: space-between; + height: 90rpx; +} +.row-title{ + line-height: 90rpx; + color: #242424; + font-size: 32rpx; + width: 24%; +} +.row-text{ + width: 75%; + display: flex; + align-items: center; + border-bottom: 1px solid #EBEBEB; +} +.row-text input{ + width: 100%; + height: 100%; +} +picker{ + width: 100%; + height: 100%; + line-height: 90rpx; +} +.intro, .intro textarea{ + height: 230rpx; +} +.intro textarea{ + padding: 26rpx 0; + box-sizing: border-box; + font-size: 32rpx; +} +.create{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + background: #fff; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); +} +.create-btn{ + background: #9F1512; + height: 80rpx; + border-radius: 10rpx; + color: #fff; + font-size: 32rpx; + display: flex; + justify-content: center; + align-items: center; +} +.img-row{ + height: auto; +} +.img-row .row-text{ + padding-top: 20rpx; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.row-img{ + width: 240rpx; + height: 130rpx; + margin-right: 20rpx; + margin-bottom: 20rpx; +} +.row-img:nth-child(even){ + margin-right: 0; +} \ No newline at end of file diff --git a/xz_mini/pages/newsDetail/newsDetail.js b/xz_mini/pages/newsDetail/newsDetail.js new file mode 100644 index 0000000..042ec44 --- /dev/null +++ b/xz_mini/pages/newsDetail/newsDetail.js @@ -0,0 +1,287 @@ +// pages/newsDetail/newsDetail.js +var app = getApp(); +var audioContentx = null; +Page({ + + /** + * 页面的初始数据 + */ + data: { + newsId: '', + newsBean: null, + imgUrl: app.imgUrl, + pageHeight: 500, + currentVideoUrl: '', + currentDesc: '', + currentVideoIndex: 0, + sliderValue: 0, + currentTime: 0, + duration: 0, + currentAudioIndex: 0, + currentAudioDesc: '', + canPlay: false, + isPlaying: false, + totalValue: 0, + isPublicCode: false, + isPublic: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + newsId: options.id, + pageHeight: wx.getSystemInfoSync().windowHeight, + isPublic: app.globalData.isPublic + }) + + this.saveBigdata(options.id); + }, + onShow() { + if (this.data.isPublic) { + this.setData({ + isPublicCode: false + }) + } + this.setData({ + newsBean: null + }) + this.getNewsDetail(); + }, + saveBigdata(id) { + var params = "小程序" + id + "新闻"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + getNewsDetail() { + var _self = this; + // app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/getnewscontentbyidrelease/{id}', [app.newsUrl, _self.data.newsId]), null, null, + function (code, data) { + _self.setData({ + newsBean: data + }) + //视频 + if (_self.data.newsBean.newsContentType == '4') { + _self.setData({ + currentVideoUrl: _self.data.imgUrl + _self.data.newsBean.fileList[0].contentFileFileId, + currentDesc: _self.data.newsBean.fileList[0].contentFileText + }) + } + //音频 + if (_self.data.newsBean.newsContentType == '3') { + _self.setData({ + currentAudioUrl: _self.data.imgUrl + _self.data.newsBean.fileList[0].contentFileFileId, + currentAudioDesc: _self.data.newsBean.fileList[0].contentFileText, + }) + _self.initAudio() + } + + //判断是否需要关注公众号 + if (data.newsViewAuth && data.newsViewAuth.indexOf('2') !==-1) { + //需要关注 + //判断是否已经关注 + console.log('需要关注') + if (!_self.data.isPublic) { + _self.setData({ + isPublicCode: true + }) + } + } else { + console.log('无需关注') + //无需关注 + _self.setData({ + isPublicCode: false + }) + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.stopPullDownRefresh(); + // wx.hideLoading(); + }); + }, + + setVideoUrl(e) { + var _self = this; + var item = e.currentTarget.dataset.item + var index = e.currentTarget.dataset.index + this.setData({ + currentVideoUrl: _self.data.imgUrl + item.contentFileFileId, + currentDesc: item.contentFileText, + currentVideoIndex: index + }) + }, + //初始化音频播放器 + initAudio() { + var _self = this; + audioContentx = wx.createInnerAudioContext(); + + audioContentx.src = _self.data.currentAudioUrl; + // 准备好歌曲流,可以播放 + audioContentx.onCanplay(() => { + _self.setData({ + canPlay: true, + duration: audioContentx.duration * 1000 + }) + console.log(audioContentx.duration) + + }) + audioContentx.onTimeUpdate(function () { + const currentTime = audioContentx.currentTime * 1000 + _self.setData({ + duration: audioContentx.duration * 1000, + currentTime: currentTime, + sliderValue: audioContentx.currentTime, + totalValue: audioContentx.duration + }) + + }); + audioContentx.onStop(() => { + _self.setData({ + isPlaying: false, + sliderValue: 0, + }) + }); + audioContentx.onEnded(() => { + _self.setData({ + isPlaying: false, + sliderValue: 0, + }) + }); + audioContentx.onPlay(() => { + _self.setData({ + isPlaying: true, + }) + }); + audioContentx.onError((res) => { + console.log(res.errMsg) + console.log(res.errCode) + }) + + }, + move() { + + }, + + goAttention() { + wx.navigateTo({ + url: '/pages/commonQrCode/commonQrCode', + }) + }, + playAudio() { + if (audioContentx && audioContentx.paused) { + audioContentx.stop(); + audioContentx.play(); + this.setData({ + isPlaying: true + }) + } else { + audioContentx.pause(); + this.setData({ + isPlaying: false + }) + } + }, + //下一个音频 + nextAudio() { + var _self = this; + var index = _self.data.currentAudioIndex + 1 + if (index >= _self.data.newsBean.fileList.length) { + index = _self.data.newsBean.fileList.length - 1 + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } else { + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } + }, + setAudioUrl(e) { + var _self = this; + var item = e.currentTarget.dataset.item + var index = e.currentTarget.dataset.index + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId; + audioContentx.play() + this.setData({ + currentAudioIndex: index, + sliderValue: 0 + }) + } + }, + //上一个音频 + preAudio() { + var _self = this; + var index = _self.data.currentAudioIndex - 1 + if (index <= 0) { + index = 0 + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } else { + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } + }, + //slider进度调整 + handleSliderChange(event) { + this.setData({ + currentTime: event.detail.value * 1000 + }) + audioContentx.pause() + audioContentx.seek(event.detail.value) + audioContentx.play() + }, + onUnload() { + if (audioContentx) { + audioContentx.stop(); + audioContentx.destroy(); + } + } +}) \ No newline at end of file diff --git a/xz_mini/pages/newsDetail/newsDetail.json b/xz_mini/pages/newsDetail/newsDetail.json new file mode 100644 index 0000000..0cbeeb7 --- /dev/null +++ b/xz_mini/pages/newsDetail/newsDetail.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "custom-content": "/components/expandabletext/expandabletext" + }, + "pageOrientation": "auto" +} \ No newline at end of file diff --git a/xz_mini/pages/newsDetail/newsDetail.wxml b/xz_mini/pages/newsDetail/newsDetail.wxml new file mode 100644 index 0000000..5cc0780 --- /dev/null +++ b/xz_mini/pages/newsDetail/newsDetail.wxml @@ -0,0 +1,89 @@ + + + + 关注公众号即可阅读 + 去关注 + + + + + + {{newsBean.newsContentTitle}} + + 新闻来源:{{newsBean.newsContentResource}} + 发布时间:{{newsBean.newsContentPublishTime}} + + + + + + + + + + + + + + + + + + + + + + + + + + + {{format.formatDuration(currentTime)}} + + {{format.formatDuration(duration)}} + + + + + + + 目录 + + + {{index+1}} + + + + + | + 详情 + + {{currentAudioDesc}} + + + + + + 目录 + + + {{index+1}} + + + + + | + 详情 + + {{currentDesc}} + + + + + + + + + + + \ No newline at end of file diff --git a/xz_mini/pages/newsDetail/newsDetail.wxss b/xz_mini/pages/newsDetail/newsDetail.wxss new file mode 100644 index 0000000..6138bac --- /dev/null +++ b/xz_mini/pages/newsDetail/newsDetail.wxss @@ -0,0 +1,238 @@ +page { + width: 100%; + height: 100%; +} + +.news-title { + padding: 20rpx 30rpx; + font-size: 34rpx; + font-weight: bold; + color: #242424; + text-align: center; +} + +.news-attr-box { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.news-attr { + font-size: 24rpx; + color: #949494; +} + +.news-attr:nth-of-type(n+2) { + margin-left: 20rpx; +} + +.news-content { + padding: 20rpx 20rpx; + font-size: 34rpx; + color: #242424; +} + +.img-box { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + background: black; +} + +.swiper-item { + width: 100%; + height: 100%; + position: absolute; + transform: translate(0%, 0px) translateZ(0px); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.item-txt { + position: absolute; + color: white; + font-size: 24rpx; + bottom: 0rpx; +} + +.video-box { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + background: #242424; +} + +.video-box video { + width: 100%; +} + +.video-category { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + padding-bottom: 30rpx; + margin: 20rpx; + flex-wrap: wrap; +} + +.category-title { + font-size: 34rpx; + color: white; + align-self: center; + margin-top: 20rpx; +} + +.category-item { + font-size: 30rpx; + color: white; + border: 1rpx solid #949494; + padding: 20rpx; + margin: 5rpx; +} + +.category-item-sel { + border: 1rpx solid #f30000; + color: #f30000; + background: #97979741; +} + +.desc-box { + color: #f30000; + margin-top: 40rpx; + padding-left: 20rpx; +} + + +.desc { + font-size: 28rpx; + color: #242424; + padding: 30rpx 40rpx; +} + +.audio-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + background: black; + color: white; +} + +.audio-img { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 400rpx; +} + +.img-bg { + width: 100%; + height: 400rpx; +} + +.img-loading { + width: 200rpx; + height: 200rpx; + position: absolute; + top: calc(50%-50rpx); + left: calc(50%-50rpx); +} + +.progress { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 100%; +} + +.slider { + margin: 10rpx; + width: 50%; +} + +.option { + display: flex; + flex: 1; + justify-content: space-between; + align-items: center; + padding-bottom: 20rpx; + width: 70%; + align-self: center; + margin-top: 20rpx; +} + +.btn-mode, +.btn-music { + width: 70rpx; + height: 70rpx; +} + +.btn-prev, +.btn-next { + width: 70rpx; + height: 70rpx; +} + +.btn-pause { + width: 140rpx; + height: 140rpx; +} + +.current { + font-size: 28rpx; + margin-right: 30rpx; +} + +.duration { + font-size: 28rpx; + margin-left: 30rpx; +} + +.btn { + width: 64rpx; + height: 64rpx; +} + +.page-mask { + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.6); + position: fixed; + top: 0; + left: 0; + z-index: 99999999; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + backdrop-filter: blur(10rpx); +} + +.mask-btn { + background-color: #4CAF50; + border: none; + color: white; + padding: 10rpx 80rpx; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 26rpx; + margin-top: 30rpx; + border-radius: 10rpx; +} + +.mask-hint { + font-size: 40rpx; + color: #ffffff; + font-weight: bold; + text-align: center; +} \ No newline at end of file diff --git a/xz_mini/pages/newsList/newsList.js b/xz_mini/pages/newsList/newsList.js new file mode 100644 index 0000000..74f1e29 --- /dev/null +++ b/xz_mini/pages/newsList/newsList.js @@ -0,0 +1,146 @@ +// pages/newsList/newsList.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + news: { + newsUrl: app.newsUrl, + newsDictionaries: [], + newsList: [], + }, + dirId: '', //tab Id + currentNewsDictionariesId: '', + currentPage: 1, + rows: 10, + areaId: app.areaCode, + defaultAreaId: app.areaCode + }, + //获取下级子目录 + doGetNewsDictionariesList: function () { + var self = this; + app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listsub/areaauth/release/{newsDirectoriesId}/{areaCode}', [self.data.news.newsUrl, self.data.dirId, app.areaCode]), + null, + null, + function (code, data) { + self.setData({ + 'news.newsDictionaries': data, + currentNewsDictionariesId: self.data.dirId + }) + self.doGetNewsList(1); + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { }); + }, + doClickDictionaries: function (event) { + var self = this; + console.log(event.currentTarget.dataset.newsDirectoriesId) + self.setData({ + currentNewsDictionariesId: event.currentTarget.dataset.newsDirectoriesId + }); + self.doGetNewsList(1); + }, + //获取新闻 + doGetNewsList: function (page, lv) { + var self = this; + app.dialog.loading('正在加载'); + var info = { + page: page, + rows: self.data.rows + } + if (self.data.currentNewsDictionariesId == self.data.dirId) { + info.newsDirectoriesParentId = self.data.dirId; + } else { + info.newsDirectoriesId = self.data.currentNewsDictionariesId; + } + var tempAreaCode = app.areaCode; + if (lv) { + tempAreaCode = self.data.areaId; + } + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [self.data.news.newsUrl, tempAreaCode]), info, null, function (code, data) { + var newsArray; + if (page <= 1) { + newsArray = data.rows; + } else { + newsArray = self.data.news.newsList; + newsArray = newsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + 'news.newsList': newsArray + }) + if (data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + }, function (code, data) { + app.dialog.msg(data.msg); + }, function () { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }); + }, + goNewsDetail: function (event) { + wx.navigateTo({ + url: '../newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId + }) + }, + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listbyparentidrelease/' + app.areaId, []), + self.data.pages, null, + function (code, data) { + if (code == '200') { + self.setData({ + areaList: data + }) + } + } + ) + }, + changeArea: function (e) { + app.dialog.loading('正在加载'); + var lv = parseInt(e.currentTarget.dataset.level) + 1 + this.setData({ + areaId: e.currentTarget.dataset.area + }) + this.doGetNewsList(1, lv) + }, + //加载全部类型 + doClearCurrentNewsDictionariesId: function () { + var self = this; + self.setData({ + currentNewsDictionariesId: self.data.dirId + }); + self.doGetNewsList(1); + }, + //加载全部地区 + loadAll: function () { + this.setData({ + areaId: app.areaCode + }) + this.doGetNewsList(1) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + self.setData({ + dirId: options.id + }) + self.doGetNewsDictionariesList(); + self.getAreaList(); + }, + onReachBottom() { + this.setData({ + currentPage: this.data.currentPage + 1 + }) + this.doGetNewsList(this.data.currentPage) + } + +}) \ No newline at end of file diff --git a/xz_mini/pages/newsList/newsList.json b/xz_mini/pages/newsList/newsList.json new file mode 100644 index 0000000..8275159 --- /dev/null +++ b/xz_mini/pages/newsList/newsList.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "onReachBottomDistance": 50 +} \ No newline at end of file diff --git a/xz_mini/pages/newsList/newsList.wxml b/xz_mini/pages/newsList/newsList.wxml new file mode 100644 index 0000000..827f68c --- /dev/null +++ b/xz_mini/pages/newsList/newsList.wxml @@ -0,0 +1,101 @@ + + + + + 全部 + + + + + {{item.directoriesName}} + + + + + + + 全部 + + + + + {{item.areaName}} + + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + \ No newline at end of file diff --git a/xz_mini/pages/newsList/newsList.wxss b/xz_mini/pages/newsList/newsList.wxss new file mode 100644 index 0000000..2658c29 --- /dev/null +++ b/xz_mini/pages/newsList/newsList.wxss @@ -0,0 +1,232 @@ +.top-tab { + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + overflow-x: hidden; + z-index: 100; + box-shadow: 10rpx 10rpx 15rpx #f0f0f0; +} + +.type { + display: flex; + overflow-x: auto; + /* 隐藏滚动条 */ + scrollbar-width: none; + /* firefox */ + -ms-overflow-style: none; + /* IE 10+ */ + margin-left: 20rpx; +} + +.tab-box { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 25%; + min-width: fit-content; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; +} + +.tab-box.active { + color: #9F1512; +} + +.tab-box image { + width: 20rpx; + height: 40rpx; + /* position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; */ +} + +.tab-box .txt { + padding: 0rpx 10rpx; + width: 100%; + text-align: center; +} + +.tab-box.active image { + display: block; +} + +.tab-box image.selected-l { + left: 20rpx; +} + +.tab-box image.selected-r { + right: 20rpx; +} + +.area { + display: flex; + /* z-index: 100; + overflow-x: auto; + white-space: nowrap; + position: fixed; + top: 90rpx; + left: 0; + right: 0; + border-bottom: 1px solid #DDD; + background: #fff; */ +} + +.area-box { + /* display: flex; + width: fit-content; + flex-direction: row; + height: 90rpx; */ + /* line-height: 90rpx; + text-align: center; */ + /* align-items: center; + justify-content: center; + padding: 0 20px; + box-sizing: border-box; + position: relative; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 30rpx; */ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 30%; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; +} + +.area-box.active { + color: #9F1512; +} + +.area-box image { + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} + +.area-box.active image { + display: block; +} + +.area-box image.selected-l { + left: 20rpx; +} + +.area-box image.selected-r { + right: 20rpx; +} + +.news { + padding: 30rpx; + border-bottom: 5px solid #FBFBFB; + margin-top: 180rpx; +} + +.news-box { + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} + +.news-title { + color: #242424; + font-size: 30rpx; + font-weight: bold; +} + +.news-info { + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} + +.news-info text { + margin-right: 20rpx; +} + +.voice-box { + padding-right: 30px; + position: relative; +} + +.voice-box iamge { + position: absolute; + top: 0; + right: 0; + width: 25rpx; + height: 25rpx; +} + +.news-big-pic, +.news-small-pic { + margin-top: 10rpx; +} + +.news-big-pic { + position: relative; +} + +.news-big-pic image { + width: 100%; + height: 380rpx; +} + +.news-big-pic image.play-btn { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80rpx; + height: 80rpx; +} + +.news-small-pic image { + width: 30%; + height: 150rpx; + margin-right: 20rpx; +} + +.transverse-news { + flex-direction: row; + justify-content: space-between; +} + +.news-row-img { + width: 30%; + height: 150rpx; +} + +.news-row-img image { + width: 100%; + height: 100%; +} + +.news-row-info { + width: 68%; +} + + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/order/order.js b/xz_mini/pages/order/order.js new file mode 100644 index 0000000..86ba5be --- /dev/null +++ b/xz_mini/pages/order/order.js @@ -0,0 +1,114 @@ +var app = getApp(); +// pages/order/order.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + venueUrl : app.venueUrl, + imgRoute : '/route/file/download/true/', + token: '', + orderList:[], + page: 1, + rows: 10, + total: 0 + }, + + //查询订单列表 + listOrderList: function() { + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/listpagemyticket', [app.venueUrl]), + {page: self.data.page,rows: self.data.rows}, {headers:{token : self.data.token}}, + function (code, data) { + console.log(data); + data.rows.forEach(element => { + element.venuePanorama = element.venuePanorama.split(',')[0] + }); + self.setData({ + orderList: data.rows, + page: data.page, + total: data.total + }); + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + }, + + //订单详情页 + toOrderDetail: function(options){ + var groundBookingId = options.currentTarget.dataset.id; + if(!groundBookingId){ + return false; + } + wx.navigateTo({ + url: '../orderDetail/orderDetail?groundBookingId=' + groundBookingId, + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data + }) + this.listOrderList(); + } + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/order/order.json b/xz_mini/pages/order/order.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/order/order.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/order/order.wxml b/xz_mini/pages/order/order.wxml new file mode 100644 index 0000000..242b03b --- /dev/null +++ b/xz_mini/pages/order/order.wxml @@ -0,0 +1,25 @@ + + + + + + + + {{item.venuesName}} + {{item.projectName}} + + 订单编号:{{item.serial}} + 下单时间:{{item.gmtCreate}} + + 免费 + ¥{{item.price}}元 + + + 已取消 + + + 已过期 + + + + \ No newline at end of file diff --git a/xz_mini/pages/order/order.wxss b/xz_mini/pages/order/order.wxss new file mode 100644 index 0000000..2b9f1f5 --- /dev/null +++ b/xz_mini/pages/order/order.wxss @@ -0,0 +1,58 @@ +.order{ + padding: 30rpx; +} +.order-box{ + border: 1px solid #DEDEDE; + border-radius: 10rpx; + overflow: hidden; + display: flex; + justify-content: space-between; + height: 200rpx; + margin-bottom: 20rpx; +} +.order-img{ + width: 35%; +} +.order-img image{ + width: 100%; + height: 200rpx; +} +.order-info{ + width: 63%; +} +.venue-project{ + font-size: 32rpx; + display: flex; + justify-content: space-between; + padding: 10rpx; +} +.venue{ + width: 65%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.project{ + background:rgba(159,21,18,.1); + color: #9F1512; + padding: 0 10rpx; + display: flex; + align-items: center; + font-size: 20rpx; +} +.order-text{ + font-size: 30rpx; + color: #BBBBBB; + margin-bottom: 10rpx; +} +.price{ + font-size: 32rpx; + color:#9F1512; +} +.status{ + display: inline-block; + padding: 0 10rpx; + background: #DEDEDE; + color: #FFF; + font-size: 30rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/orderDetail/orderDetail.js b/xz_mini/pages/orderDetail/orderDetail.js new file mode 100644 index 0000000..ed18594 --- /dev/null +++ b/xz_mini/pages/orderDetail/orderDetail.js @@ -0,0 +1,171 @@ +var app = getApp(); +// pages/orderDetail/orderDetail.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + venueUrl : app.venueUrl, + imgRoute : '/route/file/download/true/', + token:'', + groundBookingId: '', + serial: '', + venuesName: '', + projectName: '', + venuePanorama: '', + gmtCreate: '', + price: '', + itemList:[], + cancelType: false, + }, + + //查询订单详情 + getDetail: function(){ + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/getmyticketdetail/{groundBookingId}', [app.venueUrl,self.data.groundBookingId]), + {}, {headers:{token : self.data.token}}, + function (code, data) { + self.setData({ + serial: data.data.serial, + venuesName: data.data.venuesName, + projectName: data.data.projectName, + venuePanorama: data.data.venuePanorama.split(',')[0], + gmtCreate: data.data.gmtCreate.substring(0,19), + itemList: data.data.itemDTOList, + cancelType: false + }) + var totalPrice = 0; + self.data.itemList.forEach(element => { + if(element.orderType != '1'){ + totalPrice += Number(element.price); + } + if(element.orderType == '0'){ + self.setData({ + cancelType: true + }) + } + }); + self.setData({ + price: totalPrice + }) + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + }, + + //取消预订场次 + cancelItem: function(options){ + var self = this; + var bookingItemId = options.currentTarget.dataset.id; + var unCancelNum = 0; + self.data.itemList.forEach(element => { + if(element.orderType == '0'){ + unCancelNum++; + } + }); + //取消一个 + if(unCancelNum > 1){ + app.dialog.loading('请稍等'); + app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticketitem/{groundBookingId}/{bookingItemId}', + [app.venueUrl,self.data.groundBookingId,bookingItemId]), {}, {headers:{token : self.data.token}}, + function (code, data) { + self.getDetail(); + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + } + //取消全部 + if(unCancelNum <= 1){ + self.cancelAll(); + } + }, + + //全部取消 + cancelAll: function(){ + var self = this; + app.dialog.loading('请稍等'); + app.restAjax.delete(app.restAjax.path('{venueUrl}/app/booking/removemyticket/{groundBookingId}', + [app.venueUrl,self.data.groundBookingId]), {}, {headers:{token : self.data.token}}, + function (code, data) { + wx.navigateBack() + }, + function (code, data) { + app.dialog.msg(data.msg); + },function(){ + wx.hideLoading(); + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.getStorage({ + key: 'token', + success: (result) => { + this.setData({ + token : result.data, + groundBookingId: options.groundBookingId + }) + this.getDetail(); + } + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/orderDetail/orderDetail.json b/xz_mini/pages/orderDetail/orderDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/orderDetail/orderDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/orderDetail/orderDetail.wxml b/xz_mini/pages/orderDetail/orderDetail.wxml new file mode 100644 index 0000000..0839f96 --- /dev/null +++ b/xz_mini/pages/orderDetail/orderDetail.wxml @@ -0,0 +1,40 @@ + + + + + + {{venuesName}} + + 订单编号:{{serial}} + + + 下单时间:{{gmtCreate}} + + + 价  格: - + + + 价  格: {{price}}元 + + + + + {{projectName}}-预定详情 + + + + {{item.bookingOrderDate}} + {{item.timeStr}}-{{item.timeEnd}} + + + {{item.groundName}} + 免费 + {{item.price}}元 + 取消预定 + 已取消 + 已过期 + + + + +全部取消 \ No newline at end of file diff --git a/xz_mini/pages/orderDetail/orderDetail.wxss b/xz_mini/pages/orderDetail/orderDetail.wxss new file mode 100644 index 0000000..0b908da --- /dev/null +++ b/xz_mini/pages/orderDetail/orderDetail.wxss @@ -0,0 +1,92 @@ +.venue{ + padding: 15rpx 30rpx; + display: flex; + justify-content: space-between; + border-bottom: 3px solid #DEDEDE; +} +.venue-img{ + width: 35%; + height: 180rpx; +} +.venue-img image{ + width: 100%; + height: 100%; +} +.venue-info{ + width: 63%; +} +.venue-title{ + font-size: 32rpx; + color: #000; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.time-number{ + font-size: 26rpx; + margin-top: 10rpx; +} +.time-number text{ + color: #949494; +} +.book{ + margin-top: 20rpx; + padding: 0 30rpx; + margin-bottom: 85rpx; +} +.book-title{ + font-size: 32rpx; + padding-left: 25rpx; + border-left: 5px solid #9F1512; +} +.order{ + margin-top: 20rpx; +} +.order-box{ + display: inline-block; + width: 32%; + margin-right: 1%; + border: 1px solid #9F1512; + border-radius: 10rpx; + text-align: center; + margin-bottom: 10rpx; +} +.order-box:nth-child(3n){ + margin-right: 0; +} +.top{ + background: #9F1512; + color: #fff; + font-size: 28rpx; +} +.bottom{ + font-size: 28rpx; +} +.cancel{ + width: 70%; + margin: 0 auto 10rpx; + background: #9F1512; + color: #fff; + padding: 5rpx 0; + border-radius: 10rpx; +} +.cancel-all{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + background: #9F1512; + color: #fff; + font-size: 32rpx; +} +.time-out{ + width: 70%; + margin: 0 auto 10rpx; + background: rgba(159,21,18,.1); + color: #BBBBBB; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/register/register.js b/xz_mini/pages/register/register.js new file mode 100644 index 0000000..1513315 --- /dev/null +++ b/xz_mini/pages/register/register.js @@ -0,0 +1,66 @@ +// pages/register/register.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/register/register.json b/xz_mini/pages/register/register.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/register/register.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/register/register.wxml b/xz_mini/pages/register/register.wxml new file mode 100644 index 0000000..b8a1e9b --- /dev/null +++ b/xz_mini/pages/register/register.wxml @@ -0,0 +1,56 @@ + + + 登录账号: + + + + + + 是否公开: + + + + + + + + + 手机号: + + + + + + 验证码: + + + 获取验证码 + + + + 姓 名: + + + + + + 身份证: + + + + + + + + + + + 立即注册 + + \ No newline at end of file diff --git a/xz_mini/pages/register/register.wxss b/xz_mini/pages/register/register.wxss new file mode 100644 index 0000000..eb0d118 --- /dev/null +++ b/xz_mini/pages/register/register.wxss @@ -0,0 +1,83 @@ +.new-team{ + padding: 0 30rpx; +} +.row{ + display: flex; + justify-content: space-between; + height: 90rpx; +} +.row-title{ + line-height: 90rpx; + color: #242424; + font-size: 32rpx; + width: 24%; +} +.row-text{ + width: 75%; + display: flex; + align-items: center; + border-bottom: 1px solid #EBEBEB; +} +label{ + margin-right: 30rpx; +} +.row-text input{ + width: 100%; + height: 100%; +} +.row-text input.yzm{ + width: 70%; + padding-right: 10rpx; + box-sizing: border-box; +} +.get-yzm{ + display: inline-block; + width: 30%; + height: 40rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 26rpx; + text-align: center; + line-height: 40rpx; +} +picker{ + width: 100%; + height: 100%; + line-height: 90rpx; +} +.intro, .intro textarea{ + height: 230rpx; +} +.intro textarea{ + padding: 26rpx 0; + box-sizing: border-box; + font-size: 32rpx; +} +.create{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 0 30rpx 30rpx; + background: #fff; +} +.agree{ + display: flex; + align-items: center; + font-size: 30rpx; + padding-top: 5rpx; +} +.agree-checkbox{ + transform: scale(0.8,0.8); +} +.create-btn{ + background: #9F1512; + height: 80rpx; + border-radius: 10rpx; + color: #fff; + font-size: 32rpx; + display: flex; + justify-content: center; + align-items: center; + margin-top: 15rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/resource/resource.js b/xz_mini/pages/resource/resource.js new file mode 100644 index 0000000..558a866 --- /dev/null +++ b/xz_mini/pages/resource/resource.js @@ -0,0 +1,143 @@ +// pages/resource/resource.js +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + newsUrl: app.newsUrl, + directoriesParentId: '98c74389-2088-499b-a046-8611bdc57ea4', + typeList: [], + currentPage: 1, + rows: 10, + currentNewsDictionariesId: '', + trainList: [] + }, + getType: function () { + var self = this + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listnewsdirectoriesrelease', [app.newsUrl]), { + directoriesParentId: self.data.directoriesParentId + }, null, function (code, data) { + self.setData({ + typeList: data + }) + self.getList(1) + }) + }, + changeType: function (e) { + this.setData({ + currentNewsDictionariesId: e.currentTarget.dataset.newsDirectoriesId + }) + this.getList(1) + }, + getList: function (page) { + var self = this + app.dialog.loading('正在加载'); + var info = { + newsDirectoriesParentId: self.data.directoriesParentId, + newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '', + page: page, + rows: self.data.rows + } + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) { + var newsArray; + for (var i = 0; i < data.rows.length; i++) { + data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId + } + if(page <= 1) { + newsArray = data.rows; + } else { + newsArray = self.data.trainList; + newsArray = newsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + trainList: newsArray + }) + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + goNewsDetail: function (e) { + var url = e.currentTarget.dataset.templateRecordUrl + var link = e.currentTarget.dataset.contentLink + if (link) { + wx.navigateTo({ + url: '../template/template?link=' + encodeURIComponent(link), + }) + } else { + wx.navigateTo({ + url: '../template/template?url=' + encodeURIComponent(url), + }) + } + }, + doClearCurrentNewsDictionariesId: function () { + this.setData({ + currentNewsDictionariesId: '' + }) + this.getList(1) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getType() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + this.getList(1); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList(this.data.currentPage + 1); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/resource/resource.json b/xz_mini/pages/resource/resource.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/resource/resource.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/resource/resource.wxml b/xz_mini/pages/resource/resource.wxml new file mode 100644 index 0000000..dee09d3 --- /dev/null +++ b/xz_mini/pages/resource/resource.wxml @@ -0,0 +1,25 @@ + + + + + 全部 + + + + + {{item.directoriesName}} + + + + + + + {{item.newsContentTitle}} + + + + + {{item.newsContentPublishTime}} + + + \ No newline at end of file diff --git a/xz_mini/pages/resource/resource.wxss b/xz_mini/pages/resource/resource.wxss new file mode 100644 index 0000000..7912152 --- /dev/null +++ b/xz_mini/pages/resource/resource.wxss @@ -0,0 +1,141 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + overflow-x: auto; +} +.type{ + display: flex; +} +.tab-box{ + display: inline-flex; + justify-content: center; + align-items: center; + width: 30%; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; + padding: 0 10rpx; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 10rpx; +} +.tab-box image.selected-r{ + right: 10rpx; +} +.area{ + overflow-x: auto; + white-space: nowrap; + position: fixed; + top: 90rpx; + left: 0; + right: 0; + border-bottom: 1px solid #DDD; + background: #fff; +} +.area-box{ + display: inline-flex; + width: 30%; + height: 90rpx; + /* line-height: 90rpx; + text-align: center; */ + align-items: center; + justify-content: center; + padding: 0 20px; + box-sizing: border-box; + position: relative; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 30rpx; +} +.area-box.active{ + color: #9F1512; +} +.area-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.area-box.active image{ + display: block; +} +.area-box image.selected-l{ + left: 20rpx; +} +.area-box image.selected-r{ + right: 20rpx; +} +.news{ + padding: 0 30rpx; + border-bottom: 5px solid #FBFBFB; + margin-top: 90rpx; +} +.news-box{ + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} +.news-box:first-child{ + padding-top: 0; +} +.news-title{ + color: #242424; + font-size: 30rpx; + font-weight: bold; +} +.news-info{ + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} +.news-info text{ + margin-right: 20rpx; +} +.news-big-pic, .news-small-pic{ + margin-top: 10rpx; +} +.news-big-pic image{ + width: 100%; +} +.news-small-pic image{ + width: 100%; + height: 400rpx; +} +.transverse-news{ + flex-direction: row; + justify-content: space-between; +} +.news-row-img{ + width: 30%; + height: 150rpx; +} +.news-row-img image{ + width: 100%; + height: 100%; +} +.news-row-info{ + width: 68%; +} \ No newline at end of file diff --git a/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.js b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.js new file mode 100644 index 0000000..d1b0c79 --- /dev/null +++ b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.js @@ -0,0 +1,313 @@ +// pages/activityDetail/activityDetail.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + dataMap: {}, + token: '', + serviceId: '', + type: '', + + teamIndex: 0, + teamResult: '请选择服务区域', + team: {}, // 服务区域-市 + teamArray: [], // 服务区域-市 + }, + getToken: function () { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getDetail: function (id) { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/getvolunteerservicebyid/' + id, []), + {}, { + headers: { + 'token': self.data.token + } + }, function (code, data) { + if ('200' == code) { + var ph = data.photo + if (data.photo.endsWith(",")) { + ph = data.photo.substr(0, data.photo.length - 1); + } + data.photo = app.volunteerUrl + '/route/file/download/true/' + ph; + self.setData({ + dataMap: data + }) + } + }, function () { + + }, function () { + + }) + }, + /** + * 志愿者团队报名 + */ + enroll: function (e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type + }) + }, + /** + * + * @param {志愿者报名} e + */ + volunteerEnroll: function (e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type + }) + + // 提交报名请求 + var serviceMemberVO = { + serviceId: self.data.serviceId, + voluntaryType: self.data.type + } + self.sendEnrollRequest(serviceMemberVO); + + }, + /** + * + * @param {团队报名} e + */ + teamChange: function (e) { + var self = this; + + self.setData({ + teamIndex: e.detail.value + }) + + // 提交报名请求 + var serviceMemberVO = { + serviceId: self.data.serviceId, + teamId: self.data.team[self.data.teamIndex].teamId, + voluntaryType: self.data.type + } + self.sendEnrollRequest(serviceMemberVO); + }, + /** + * + * @param {团队取消报名} e + */ + teamCancelChange: function (e) { + var self = this; + + self.setData({ + teamIndex: e.detail.value + }) + + self.sendCancelEnrollRequest(); + }, + /** + * + * @param {志愿者取消报名} e + */ + volunteerCancelEnroll: function (e) { + var self = this; + self.setData({ + serviceId: e.target.dataset.serviceid, + type: e.target.dataset.type, + teamArray: [] + }) + self.sendCancelEnrollRequest(); + }, + /** + * + * @param {发送报名请求} serviceMemberVO + */ + sendEnrollRequest: function (serviceMemberVO) { + var self = this; + app.restAjax.post(app.restAjax.path(app.volunteerUrl + '/app/servicemember/saveservicemember', []), + serviceMemberVO, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + app.dialog.msg('注册成功!'); + wx.redirectTo({ + url: '../volunteer/volunteer', + }) + } + }, function () { + + }, function () { + + }) + }, + /** + * 发送取消报名请求 + */ + sendCancelEnrollRequest() { + var self = this; + var url; + if (self.data.teamArray.length > 0) { + url = app.volunteerUrl + '/app/servicemember/cancelapply/' + self.data.type + '/' + self.data.serviceId + '/' + self.data.team[self.data.teamIndex].teamId; + } else { + url = app.volunteerUrl + '/app/servicemember/cancelapply/' + self.data.type + '/' + self.data.serviceId + '/null'; + } + + app.restAjax.get(app.restAjax.path(url, []), {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + app.dialog.msg('取消报名成功!'); + wx.redirectTo({ + url: '../volunteer/volunteer', + }) + } + }, function () { + + }, function () { + + }) + }, + /** + * 获取我的团队 + */ + getMyTeam: function () { + var self = this; + console.log(self.data.token) + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/myteamm', []), + {}, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + var array = []; + for (var item of data.rows) { + delete item.teamArea; + delete item.teamAreaDictionaryName; + delete item.teamWatchword; + delete item.teamOwner; + delete item.memberId; + delete item.memberName; + delete item.gmtCreate; + delete item.photo; + delete item.count; + delete item.status; + delete item.content; + delete item.isTeamOwner; + delete item.checkStatus; + delete item.teamCounty; + delete item.teamCity; + delete item.teamCityDictionaryName; + delete item.teamCountyDictionaryName; + delete item.teamCity; + + array.push(item.teamName); + } + self.setData({ + teamArray: array, + team: data.rows + }) + } + }, function (code, data) { + app.dialog.msg(data.msg); + }, function () { + + }) + }, + toActivityHis: function (e) { + var self = this; + const status = e.currentTarget.dataset.status; + wx.navigateTo({ + url: '../activityDialog/activityDialog?serviceId=' + self.data.serviceId + '&status=' + status, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var id = options.id; + var self = this; + self.setData({ + serviceId: id + }) + this.getToken().then(result => { + this.getDetail(id); + this.getMyTeam(); + }) + this.saveBigdata(id); + }, + saveBigdata(id) { + var params = "小程序" + id + "志愿"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.json b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxml b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxml new file mode 100644 index 0000000..5b40e73 --- /dev/null +++ b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxml @@ -0,0 +1,44 @@ + + + + + {{dataMap.serviceName}} + + + + 活动人数: + {{dataMap.count }} + + + + 活动时间: + {{dataMap.startTime}}至{{dataMap.endTime}} + + + + 活动地址: + {{dataMap.address }} + + + + + + 活动详情 + 评论列表 + + + + + + + + 报名 + + 报名 + + + + 取消报名 + + 取消报名 + \ No newline at end of file diff --git a/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxss b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxss new file mode 100644 index 0000000..cb9f554 --- /dev/null +++ b/xz_mini/pages/serviceActivityDetail/serviceActivityDetail.wxss @@ -0,0 +1,97 @@ +.activity-img, .activity-img image{ + width: 100%; + height: 480rpx; +} +.activity-detail{ + position: absolute; + left: 0; + right: 0; + top: 430rpx; + background: #fff; + border-radius:30rpx 30rpx 0px 0px; + overflow: hidden; + padding-bottom: 120rpx; +} +.activity-title, .activity-info{ + padding: 30rpx; + font-size: 32rpx; + color: #242424; + border-bottom: 5px solid #FBFBFB; +} +.activity-text{ + line-height: 35rpx; + font-size: 28rpx; + margin-bottom: 15rpx; +} +.activity-text:last-child{ + margin-bottom: 0; +} +.activity-info image{ + width: 35rpx; + height: 35rpx; + margin-right: 10rpx; + vertical-align: middle; + margin-top: -5rpx; +} +.activity-text text{ + color: #BBBBBB; +} +.activity-container{ + padding: 30rpx; +} +.part{ + margin-bottom: 30rpx; +} +.part:last-child{ + margin-bottom: 0; +} +.part-title{ + border-left: 3px solid #9F1512; + color: #242424; + padding-left: 10rpx; + font-size: 30rpx; + margin-bottom: 10rpx; + display: flex; + justify-content: space-between; +} +.comment-btn{ + padding: 0 10rpx; + background: #9F1512; + color: #fff; + font-size: 28rpx; + border-radius: 10rpx; +} +.part-content{ + font-size: 28rpx; + line-height: 40rpx; +} +.part-info{ + line-height: 50rpx; + color: #242424; + font-size: 28rpx; +} +.part-info text{ + color: #BBBBBB; +} +.sign-box{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1); + height: 120rpx; + padding: 20rpx 30rpx; + box-sizing: border-box; + background: #fff; +} +.sign-btn{ + width: 100%; + height: 80rpx; + background: #9F1512; + border-radius: 10rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; +} \ No newline at end of file diff --git a/xz_mini/pages/shop/shopcategory.js b/xz_mini/pages/shop/shopcategory.js new file mode 100644 index 0000000..215ff2f --- /dev/null +++ b/xz_mini/pages/shop/shopcategory.js @@ -0,0 +1,62 @@ +// pages/shop/shopcat.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + categoryOneList: [], + categorySeconList: [], + currentIndex: 0, + isHidePageLoading: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getCategroyList(); + }, + getCategroyList() { + var _self = this + app.restAjax.get(app.restAjax.path('{shopUrl}/app/category/listztreerelease', [app.shopUrl]), null, null, function (code, data) { + if (data.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + console.log(data) + _self.setData({ + categoryOneList: data, + categorySeconList: data[0].subList, + isHidePageLoading: true + }) + }, function (code, data) { + app.dialog.msg(data.msg); + _self.setData({ + isHidePageLoading: true + }) + }, function () { + wx.hideLoading(); + }) + }, + chooseOne(event) { + var index = event.currentTarget.dataset.index + var _self = this; + this.setData({ + currentIndex: index, + categorySeconList: _self.data.categoryOneList[index].subList + }) + }, + goList(e) { + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '/subpages/goodslist/goodslist?id=' + id, + }) + }, + showCar() { + wx.navigateTo({ + url: '/subpages/goodscar/goodscar', + }) + } +}) \ No newline at end of file diff --git a/xz_mini/pages/shop/shopcategory.json b/xz_mini/pages/shop/shopcategory.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/shop/shopcategory.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/shop/shopcategory.wxml b/xz_mini/pages/shop/shopcategory.wxml new file mode 100644 index 0000000..d3749f8 --- /dev/null +++ b/xz_mini/pages/shop/shopcategory.wxml @@ -0,0 +1,31 @@ + + + + + {{item.name}} + + + + + + {{item.name}} + > + + + + + {{it.name}} + + + + + 暂无数据 + + + + + + 购物车 + + + \ No newline at end of file diff --git a/xz_mini/pages/shop/shopcategory.wxss b/xz_mini/pages/shop/shopcategory.wxss new file mode 100644 index 0000000..8979b5c --- /dev/null +++ b/xz_mini/pages/shop/shopcategory.wxss @@ -0,0 +1,148 @@ +/* pages/shop/shopcat.wxss */ +page { + height: 100%; + background: #f6f6f6; +} + +.container-box { + display: flex; + flex-direction: row; + width: 100%; + height: 100%; +} + +.container-box .left { + display: flex; + flex-direction: column; + width: 35%; + height: 100%; + margin-top: 10rpx; + position: fixed; + top: 0; + left: 0; +} + +.category-item-default { + display: flex; + flex-direction: row; + padding: 20rpx 0rpx 20rpx 2rpx; + width: 100%; +} + + + +.category-item-active { + display: flex; + flex-direction: row; + padding: 20rpx 0rpx 20rpx 2rpx; + background: white; + width: 100%; +} + +.category-one-name { + margin-left: 20rpx; + padding: 10rpx 0rpx; + flex: 1; +} + + + + +.line { + background: #e70101; + width: 10rpx; + height: 60rpx; + align-self: center; +} + +.container-box .right { + display: flex; + flex-direction: column; + width: 65%; + position: absolute; + left: 35%; +} + +.category-card { + margin: 10rpx 10rpx 10rpx 0rpx; + border-radius: 20rpx; + min-height: 300rpx; + background-color: white; + box-shadow: 5rpx 5rpx 5rpx 5rpx rgba(0, 0, 0, 0, 1); + padding: 10rpx; +} + +.category-two-name { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 20rpx 5rpx; +} + +.category-thrid-box { + display: flex; + flex-direction: row; + margin-top: 20rpx; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; +} + +.category-thrid-item { + width: 30%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 30rpx; + margin: 10rpx 0rpx; + text-align: center; +} + +.category-thrid-item image { + width: 82rpx; + height: 82rpx; + margin-bottom: 15rpx; +} + +.category-empty { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + align-self: center; + font-size: 30rpx; +} + +.category-empty image { + width: 96rpx; + height: 66rpx; +} + +.car-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: fixed; + bottom: 30rpx; + right: 50rpx; + width: 100rpx; + height: 100rpx; + background: linear-gradient(to right bottom, rgb(243, 209, 55), rgb(245, 170, 9) 70px); + border-radius: 50%; + padding: 10rpx; + +} + +.car-box image { + width: 48rpx; + height: 48rpx; +} + +.car-box text { + font-size: 25rpx; + color: #9f1512; +} \ No newline at end of file diff --git a/xz_mini/pages/teamDetail/teamDetail.js b/xz_mini/pages/teamDetail/teamDetail.js new file mode 100644 index 0000000..eaaf2ce --- /dev/null +++ b/xz_mini/pages/teamDetail/teamDetail.js @@ -0,0 +1,168 @@ +// pages/teamDetail/teamDetail.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + teamId: '', + dataMap: [], + memberData: {}, + checkData: {} + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getDetail(teamId) { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/team/getteambyid/' + teamId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + console.log(data) + if('200' == code) { + self.setData({ + dataMap: data + }) + } + }, function() { + + }, function() { + + }) + }, + getMember(teamId) { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teammember/listteammember?teamId=' + teamId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + var teamMember = []; + var checkMember = []; + for(var item of data) { + if('1' == item.status) { + teamMember.push(item); + }else { + checkMember.push(item); + } + } + self.setData({ + memberData: teamMember, + checkData: checkMember + }) + } + }, function() { + + }, function() { + + }) + }, + agree(e) { + var self = this; + console.log(e) + var id = e.currentTarget.dataset.teammemberid; + var type = e.currentTarget.dataset.type; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/teammember/checkmember/'+id+'/' + type + '?teamId=' + self.data.teamId, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + if('1' == type) { + app.dialog.msg('审核通过!'); + }else { + app.dialog.msg('审核驳回!'); + } + wx.navigateTo({ + url: '../myVolunteerTeam/myVolunteerTeam', + }) + } + }, function() { + + }, function() { + + }) + + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + self.setData({ + teamId: options.teamId + }) + this.getToken().then(result => { + this.getDetail(options.teamId); + this.getMember(options.teamId); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/teamDetail/teamDetail.json b/xz_mini/pages/teamDetail/teamDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/teamDetail/teamDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/teamDetail/teamDetail.wxml b/xz_mini/pages/teamDetail/teamDetail.wxml new file mode 100644 index 0000000..5b09e1a --- /dev/null +++ b/xz_mini/pages/teamDetail/teamDetail.wxml @@ -0,0 +1,57 @@ + + + + 团队名称: + {{dataMap.teamName}} + + + 团队人数: + {{dataMap.count}} + + + 所属区域: + {{dataMap.teamCityDictionaryName}} {{dataMap.teamCountyDictionaryName}} {{dataMap.teamAreaDictionaryName}} + + + 团队口号: + {{dataMap.teamWatchword}} + + + 团队介绍: + {{dataMap.content}} + + + + 团队成员 + + + + + + {{item.memberName}} + 队长 + 成员 + + 加入时间:{{item.inputTime}} + + + + + 申请人员 + + + + + + + {{item.memberName}} + + 通过 + 拒绝 + + + 加入时间:{{item.inputTime}} + + + + \ No newline at end of file diff --git a/xz_mini/pages/teamDetail/teamDetail.wxss b/xz_mini/pages/teamDetail/teamDetail.wxss new file mode 100644 index 0000000..0443cd1 --- /dev/null +++ b/xz_mini/pages/teamDetail/teamDetail.wxss @@ -0,0 +1,83 @@ +.team{ + padding: 30rpx; +} +.team-info{ + margin-bottom: 20rpx; +} +.row{ + display: flex; + justify-content: space-between; +} +.title{ + width: 23%; + font-size: 28rpx; + line-height: 65rpx; +} +.content{ + width: 75%; + line-height: 65rpx; + font-size: 28rpx; + border-bottom: 1px solid #DEDEDE; +} +.intro{ + min-height: 200rpx; +} +.team-member{ + margin-top: 20rpx; +} +.member-title{ + font-size: 30rpx; + color: #000; + padding-left: 25rpx; + border-left: 10rpx solid #9F1512; + margin-bottom: 20rpx; +} +.member-box{ + display: flex; + justify-content: space-between; + padding: 10rpx 0; + border-bottom: 1px solid #DEDEDE; +} +.member-avatar{ + width: 15%; +} +.member-avatar image{ + width: 100%; + height: 90rpx; +} +.member-info{ + width: 83%; +} +.name{ + font-size: 30rpx; + margin: 20rpx 0; +} +.post{ + display: inline-block; + background: rgba(159,21,18,.1); + color: #9F1512; + padding: 0 10rpx; + margin-left: 15rpx; +} +.join-time{ + font-size: 28rpx; + color: #949494; +} +.apply-member, .btn{ + display: flex; + justify-content: space-between; +} +.agree, .refuse{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; +} +.refuse{ + margin-left: 15rpx; +} +.name-box{ + width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/xz_mini/pages/template/template.js b/xz_mini/pages/template/template.js new file mode 100644 index 0000000..3dfda78 --- /dev/null +++ b/xz_mini/pages/template/template.js @@ -0,0 +1,99 @@ +// pages/template/template.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + url: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if (options.link) { + options.link = decodeURIComponent(options.link) + app.dialog.loading('正在加载'); + var type = options.link.split('.') + if (type[type.length-1] == 'pdf') { + wx.download({ + url: options.link, + success: function (res) { + const filePath = res.tempFilePath + wx.openDocument({ + filePath: filePath, + fileType: 'pdf', + success: function (res) { + wx.stopPullDownRefresh(); + wx.hideLoading(); + } + }) + }, + fail: function (error) { + console.log(error) + } + }) + } else { + this.setData({ + url: options.link + }) + } + } else { + options.url = decodeURIComponent(options.url) + this.setData({ + url: 'https://www.wgink.ink/' + options.url + }) + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/template/template.json b/xz_mini/pages/template/template.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/template/template.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/template/template.wxml b/xz_mini/pages/template/template.wxml new file mode 100644 index 0000000..4839609 --- /dev/null +++ b/xz_mini/pages/template/template.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/xz_mini/pages/template/template.wxss b/xz_mini/pages/template/template.wxss new file mode 100644 index 0000000..71de55a --- /dev/null +++ b/xz_mini/pages/template/template.wxss @@ -0,0 +1 @@ +/* pages/template/template.wxss */ \ No newline at end of file diff --git a/xz_mini/pages/train/train.js b/xz_mini/pages/train/train.js new file mode 100644 index 0000000..35469a2 --- /dev/null +++ b/xz_mini/pages/train/train.js @@ -0,0 +1,144 @@ +// pages/train/train.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + newsUrl: app.newsUrl, + typeList: [], + currentNewsDictionariesId: '', + currentPage: 1, + rows: 10, + directoriesParentId: 'd9d8c7ea-32e0-43ed-ad17-7c99a3c389b9', + trainList: [] + }, + getType: function () { + var self = this + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listnewsdirectoriesrelease', [app.newsUrl]), { + directoriesParentId: self.data.directoriesParentId + }, null, function (code, data) { + self.setData({ + typeList: data + }) + self.getList(1) + }) + }, + changeType: function (e) { + this.setData({ + currentNewsDictionariesId: e.currentTarget.dataset.newsDirectoriesId + }) + this.getList(1) + }, + doClearCurrentNewsDictionariesId: function() { + var self = this; + self.setData({ + currentNewsDictionariesId: '' + }); + this.getList(1) + }, + getList: function (page) { + var self = this + app.dialog.loading('正在加载'); + var info = { + newsDirectoriesParentId: self.data.directoriesParentId, + newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '', + page: page, + rows: self.data.rows + } + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) { + var newsArray; + for (var i = 0; i < data.rows.length; i++) { + data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId + } + if(page <= 1) { + newsArray = data.rows; + } else { + newsArray = self.data.news.newsList; + newsArray = newsArray.concat(data.rows); + } + self.setData({ + currentPage: page, + trainList: newsArray + }) + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + goNewsDetail: function (e) { + var url = e.currentTarget.dataset.templateRecordUrl + var link = e.currentTarget.dataset.contentLink + if (link) { + wx.navigateTo({ + url: '../template/template?link=' + encodeURIComponent(link), + }) + } else { + wx.navigateTo({ + url: '../template/template?url=' + encodeURIComponent(url), + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getType() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/train/train.json b/xz_mini/pages/train/train.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/train/train.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/train/train.wxml b/xz_mini/pages/train/train.wxml new file mode 100644 index 0000000..dee09d3 --- /dev/null +++ b/xz_mini/pages/train/train.wxml @@ -0,0 +1,25 @@ + + + + + 全部 + + + + + {{item.directoriesName}} + + + + + + + {{item.newsContentTitle}} + + + + + {{item.newsContentPublishTime}} + + + \ No newline at end of file diff --git a/xz_mini/pages/train/train.wxss b/xz_mini/pages/train/train.wxss new file mode 100644 index 0000000..7912152 --- /dev/null +++ b/xz_mini/pages/train/train.wxss @@ -0,0 +1,141 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + overflow-x: auto; +} +.type{ + display: flex; +} +.tab-box{ + display: inline-flex; + justify-content: center; + align-items: center; + width: 30%; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; + padding: 0 10rpx; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 10rpx; +} +.tab-box image.selected-r{ + right: 10rpx; +} +.area{ + overflow-x: auto; + white-space: nowrap; + position: fixed; + top: 90rpx; + left: 0; + right: 0; + border-bottom: 1px solid #DDD; + background: #fff; +} +.area-box{ + display: inline-flex; + width: 30%; + height: 90rpx; + /* line-height: 90rpx; + text-align: center; */ + align-items: center; + justify-content: center; + padding: 0 20px; + box-sizing: border-box; + position: relative; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 30rpx; +} +.area-box.active{ + color: #9F1512; +} +.area-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.area-box.active image{ + display: block; +} +.area-box image.selected-l{ + left: 20rpx; +} +.area-box image.selected-r{ + right: 20rpx; +} +.news{ + padding: 0 30rpx; + border-bottom: 5px solid #FBFBFB; + margin-top: 90rpx; +} +.news-box{ + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} +.news-box:first-child{ + padding-top: 0; +} +.news-title{ + color: #242424; + font-size: 30rpx; + font-weight: bold; +} +.news-info{ + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} +.news-info text{ + margin-right: 20rpx; +} +.news-big-pic, .news-small-pic{ + margin-top: 10rpx; +} +.news-big-pic image{ + width: 100%; +} +.news-small-pic image{ + width: 100%; + height: 400rpx; +} +.transverse-news{ + flex-direction: row; + justify-content: space-between; +} +.news-row-img{ + width: 30%; + height: 150rpx; +} +.news-row-img image{ + width: 100%; + height: 100%; +} +.news-row-info{ + width: 68%; +} \ No newline at end of file diff --git a/xz_mini/pages/travel/travel.js b/xz_mini/pages/travel/travel.js new file mode 100644 index 0000000..8fd44e7 --- /dev/null +++ b/xz_mini/pages/travel/travel.js @@ -0,0 +1,118 @@ +// pages/travel/travel.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + newsUrl: app.newsUrl, + newsDirectoriesId: '51ae7beb-f277-47a4-937a-088e6d47656d', + currentPage: 1, + rows: 10, + travelList: [] + }, + getTravel: function (page) { + var self = this + app.dialog.loading('正在加载'); + var info = { + page: page, + rows: self.data.rows, + newsDirectoriesId: self.data.newsDirectoriesId + } + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [app.newsUrl,app.areaCode]), info, null, function (code, data) { + var newsArray; + for (var i = 0; i < data.rows.length; i++) { + data.rows[i].newsContentCoverList = data.rows[i].newsContentCoverList[0].contentCoverId + } + if(page <= 1) { + newsArray = data.rows; + } else { + newsArray = self.data.travelList; + newsArray = newsArray.concat(data.rows); + } + console.log(newsArray) + self.setData({ + currentPage: page, + travelList: newsArray + }) + if(data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + goNewsDetail: function (e) { + var url = e.currentTarget.dataset.templateRecordUrl + var link = e.currentTarget.dataset.contentLink + if (link) { + wx.navigateTo({ + url: '../template/template?link=' + encodeURIComponent(link), + }) + } else { + wx.navigateTo({ + url: '../template/template?url=' + encodeURIComponent(url), + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getTravel(1) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/travel/travel.json b/xz_mini/pages/travel/travel.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/travel/travel.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/travel/travel.wxml b/xz_mini/pages/travel/travel.wxml new file mode 100644 index 0000000..4d8a873 --- /dev/null +++ b/xz_mini/pages/travel/travel.wxml @@ -0,0 +1,8 @@ + + + {{item.newsContentTitle}} + + + + + \ No newline at end of file diff --git a/xz_mini/pages/travel/travel.wxss b/xz_mini/pages/travel/travel.wxss new file mode 100644 index 0000000..2670b7d --- /dev/null +++ b/xz_mini/pages/travel/travel.wxss @@ -0,0 +1,52 @@ +.news{ + padding: 0 30rpx; + border-bottom: 5px solid #FBFBFB; + margin-top: 10rpx; +} +.news-box{ + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} +.news-box:first-child{ + padding-top: 0; +} +.news-title{ + color: #242424; + font-size: 30rpx; + font-weight: bold; +} +.news-info{ + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} +.news-info text{ + margin-right: 20rpx; +} +.news-big-pic, .news-small-pic{ + margin-top: 10rpx; +} +.news-big-pic image{ + width: 100%; +} +.news-small-pic image{ + width: 100%; + height: 400rpx; +} +.transverse-news{ + flex-direction: row; + justify-content: space-between; +} +.news-row-img{ + width: 30%; + height: 150rpx; +} +.news-row-img image{ + width: 100%; + height: 100%; +} +.news-row-info{ + width: 68%; +} \ No newline at end of file diff --git a/xz_mini/pages/userAgree/userAgree.js b/xz_mini/pages/userAgree/userAgree.js new file mode 100644 index 0000000..c8b2d4b --- /dev/null +++ b/xz_mini/pages/userAgree/userAgree.js @@ -0,0 +1,104 @@ +// pages/userAgree/userAgree.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + agreeContent: '', + token: '' + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getUserAgree: function(type) { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/agreecontent/getagreecontentbyid/' + type, []), + {}, { + headers: { + token: self.data.token + } + }, function(code, data) { + if('200' == code) { + self.setData({ + agreeContent: data.content + }) + } + }, function(code, data) { + app.dialog.msg(data.msg) + }, function() { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var type = options.type; + var self = this; + this.getToken().then(result => { + this.getUserAgree(type); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/userAgree/userAgree.json b/xz_mini/pages/userAgree/userAgree.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/userAgree/userAgree.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/userAgree/userAgree.wxml b/xz_mini/pages/userAgree/userAgree.wxml new file mode 100644 index 0000000..f32a380 --- /dev/null +++ b/xz_mini/pages/userAgree/userAgree.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/xz_mini/pages/userAgree/userAgree.wxss b/xz_mini/pages/userAgree/userAgree.wxss new file mode 100644 index 0000000..b534855 --- /dev/null +++ b/xz_mini/pages/userAgree/userAgree.wxss @@ -0,0 +1 @@ +/* pages/userAgree/userAgree.wxss */ \ No newline at end of file diff --git a/xz_mini/pages/venue/venue.js b/xz_mini/pages/venue/venue.js new file mode 100644 index 0000000..6e08a30 --- /dev/null +++ b/xz_mini/pages/venue/venue.js @@ -0,0 +1,230 @@ +var app = getApp(); +// pages/venue/venue.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + venueUrl: app.venueUrl, + imgRoute: '/route/file/download/true/', + venueTypeParentId: 'df8b758c-f6d8-465a-9aa8-c451fde47076', + page: '1', + rows: '10', + venueTypeList: [], + venuesList: [], + orderKey: '', + venueType: '', + latitude: '', + longitude: '', + selectingArea: false, // 显示隐藏选择区域 + areaList: [], + venueArea: '', + areaName: '' + }, + + //获取定位 + getLocation: function () { + var self = this; + wx.getLocation({ + type: 'gcj02', + success: function (res) { + self.setData({ + latitude: res.latitude, + longitude: res.longitude + }) + }, + complete: function () { + self.listPageVenuesInfo(); + } + }) + }, + + //获取场馆分类 + listVenueType: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuedictionary/listvenuedictionarybyparentidrelease/{venueTypeParentId}', + [app.venueUrl, self.data.venueTypeParentId]), {}, null, + function (code, data) { + self.setData({ + venueTypeList: data.data + }); + }, + function (code, data) { + app.dialog.msg(data.msg); + } + ); + }, + + //获取场馆列表 + listPageVenuesInfo: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/listpagevenuesinforelease/{areaCode}', [app.venueUrl, app.areaCode]), { + page: self.data.page, + rows: self.data.rows, + orderKey: self.data.orderKey, + venueType: self.data.venueType, + latitude: self.data.latitude, + longitude: self.data.longitude, + selfLocation: 'TX', + venueArea: self.data.venueArea + }, null, + function (code, data) { + data.rows.forEach(element => { + element.venuePanorama = element.venuePanorama.split(',')[0]; + if (element.apart >= 1000) { + element.apart = (element.apart / 1000).toFixed(2) + 'km'; + } else { + element.apart += 'm'; + } + }); + self.setData({ + venuesList: data.rows, + page: data.page + }); + if (data.rows.length == 0) { + app.dialog.msg('暂无数据'); + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideNavigationBarLoading(); + wx.stopPullDownRefresh(); + wx.hideLoading(); + } + ); + }, + + //切换场馆类型 + changeVenueType: function (options) { + var id = options.currentTarget.dataset.id; + if (id == this.data.venueType) { + id = '' + } + this.setData({ + venueType: id + }) + this.listPageVenuesInfo(); + }, + + //切换场馆排序 + changeVenuesOrderBy: function (options) { + var beCheck = options.currentTarget.dataset.becheck; + this.setData({ + orderKey: beCheck + }) + this.listPageVenuesInfo(); + }, + + //去详情页 + goDetail: function (options) { + var venuesInfoId = options.currentTarget.dataset.id; + wx.navigateTo({ + url: '../venueDetail/venueDetail?venuesInfoId=' + venuesInfoId, + }) + }, + + //选择区域 + selectArea: function () { + this.setData({ + selectingArea: true + }) + }, + + // 获取地区列表 + getAreaList: function () { + var self = this; + app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listbyparentidrelease/640675', []), + self.data.pages, null, + function (code, data) { + if (code == '200') { + self.setData({ + areaList: data + }) + } + }) + }, + // 切换地区 + changeArea: function (e) { + app.dialog.loading('正在加载'); + this.setData({ + venueArea: e.currentTarget.dataset.area, + selectingArea: false, + areaName: e.currentTarget.dataset.areaname + }) + this.listPageVenuesInfo() + }, + + // 全部地区 + loadAll: function () { + this.setData({ + venueArea: '', + selectingArea: false + }) + this.listPageVenuesInfo() + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.listVenueType(); + this.getLocation(); + this.getAreaList(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + wx.showNavigationBarLoading(); + this.setData({ + venueType: '', + orderKey: '', + }) + this.onLoad(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/venue/venue.json b/xz_mini/pages/venue/venue.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/venue/venue.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/venue/venue.wxml b/xz_mini/pages/venue/venue.wxml new file mode 100644 index 0000000..57dd59d --- /dev/null +++ b/xz_mini/pages/venue/venue.wxml @@ -0,0 +1,49 @@ + + + + + 全部 + + + + {{item.dictionaryName}} + + + + + 默认排序 + + + 离我最近 + + + 最新发布 + + + 选择区域 + + + {{areaName}} + + + + + + + + + + + {{item.venueName}} + 距离:{{item.apart == '0' ? '未知' : item.apart}} + + 营业时间:{{item.businessHours}} + + + + + + 全部 + {{item.areaName}} + + \ No newline at end of file diff --git a/xz_mini/pages/venue/venue.wxss b/xz_mini/pages/venue/venue.wxss new file mode 100644 index 0000000..09ff6b5 --- /dev/null +++ b/xz_mini/pages/venue/venue.wxss @@ -0,0 +1,125 @@ +.fixed-top{ + position: fixed; + top: 0; + left: 0; + right: 0; + padding: 0 30rpx 10rpx; + background: #fff; +} +.fixed-tab{ + padding: 30rpx 0; + display: flex; + overflow-x: auto; +} +.tab-box{ + flex-shrink: 0; + width: 120rpx; + text-align: center; + margin-right: 40rpx; +} +.tab-box image{ + width: 80rpx; + height: 80rpx; +} +.tab-title{ + font-size: 30rpx; + color: #242424; +} +.tab-box.active .tab-title{ + color: #9F1512; +} +.select-tab{ + display: flex; + margin-bottom: 10rpx; +} +.select-box{ + flex: 1; + text-align: center; + font-size: 32rpx; + color: #242424; +} +.select-box.active{ + color: #9F1512; + font-weight: bold; +} +.venue{ + height: 400rpx; + margin-top: 250rpx; + padding: 0 30rpx; + +} +.venue-box{ + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:10rpx; + overflow: hidden; + margin-bottom: 15rpx; +} +.venue-img, .venue-img image{ + width: 100%; + height: 315rpx; +} +.venue-info{ + padding: 15rpx 20rpx; +} +.name-distance{ + display: flex; + justify-content: space-between; + height: 35rpx; + line-height: 35rpx; +} +.name{ + font-size: 32rpx; + width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.distance{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + border-radius: 10rpx; + font-size: 28rpx; +} +.time{ + font-size: 28rpx; + color: #242424; + margin-top: 10rpx; +} +.select-area{ + position: fixed; + top: 0; + bottom: 0; + right: 0; + left: 0; + background: rgba(0,0,0,0.6); +} +.area-container{ + background: #fff; + padding: 15rpx 15rpx 0; + font-size: 0; +} +.area-box{ + display: inline-block; + width: 32%; + height: 60rpx; + line-height: 60rpx; + margin-bottom: 15rpx; + margin-right: 2%; + text-align: center; + font-size: 30rpx; + border: 1px solid #DDD; + border-radius: 10rpx; + box-sizing: border-box; + padding: 0 10rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.area-box.active{ + border: #9F1512 1px solid; + color: #9F1512; +} +.area-box:nth-child(3n){ + margin-right: 0; +} \ No newline at end of file diff --git a/xz_mini/pages/venueDetail/venueDetail.js b/xz_mini/pages/venueDetail/venueDetail.js new file mode 100644 index 0000000..513d6f4 --- /dev/null +++ b/xz_mini/pages/venueDetail/venueDetail.js @@ -0,0 +1,137 @@ +var app = getApp(); +// pages/venueDetail/venueDetail.js +Page({ + /** + * 页面的初始数据 + */ + data: { + venueUrl: app.venueUrl, + imgRoute: '/route/file/download/true/', + indicatorDots: true, + autoplay: true, + venuesInfoId: '', + venuesDetail: {}, + venuesProjectList: [], + swiperImg: [], + venueCharge: '', + hasProject: '' + }, + + //场馆详情接口 + getVenuesDetail: function () { + var self = this; + app.restAjax.get(app.restAjax.path('{venueUrl}/app/venuesinfo/getvenuesinfobyidrelease/{venuesInfoId}', [app.venueUrl, self.data.venuesInfoId]), + { + resultLocation: 'TX' + }, null, function (code, data) { + var src = 'img src="' + app.venueUrl + '/' + if (data.venueDescription.indexOf('src="') != -1) { + data.venueDescription = data.venueDescription.replace(/src="/g, src) + } + var swiperImg = data.venuePanorama.split(','); + if (swiperImg.length <= 1) { + self.setData({ + indicatorDots: false, + autoplay: false + }) + }; + self.setData({ + venuesDetail: data, + swiperImg: swiperImg, + venueCharge: data.venueCharge, + hasProject: data.hasProject + }); + }, function (code, data) { + app.dialog.msg(data.msg); + } + ); + }, + + //场馆地图导航 + showMap: function (options) { + var dataObj = options.currentTarget.dataset + wx.openLocation({//​使用微信内置地图查看位置。 + latitude: Number(dataObj.latitude),//要去的纬度-地址 + longitude: Number(dataObj.longitude),//要去的经度-地址 + name: dataObj.venuename, + address: dataObj.venueposition + }); + }, + + goBooking: function () { + wx.navigateTo({ + url: '../book/book?venuesInfoId=' + this.data.venuesInfoId, + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + venuesInfoId: options.venuesInfoId + }); + this.getVenuesDetail(); + this.saveBigdata(options.venuesInfoId); + }, + saveBigdata(id) { + var params = "小程序" + id + "场馆"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/venueDetail/venueDetail.json b/xz_mini/pages/venueDetail/venueDetail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/xz_mini/pages/venueDetail/venueDetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/pages/venueDetail/venueDetail.wxml b/xz_mini/pages/venueDetail/venueDetail.wxml new file mode 100644 index 0000000..104dfa8 --- /dev/null +++ b/xz_mini/pages/venueDetail/venueDetail.wxml @@ -0,0 +1,49 @@ + + + + + + + + + {{venuesDetail.venueName}} + + 地址:{{venuesDetail.venuePosition}} + + + 联系方式:{{venuesDetail.venueTelephone}} + + + 交通方式:{{venuesDetail.venueRoute}} + + + 营业时间:{{venuesDetail.businessHours}} + + + 温馨提示:{{venuesDetail.bookingTips}} + + + + + 场馆服务: + {{venuesDetail.venueService}} + + {{venuesDetail.venueOtherService}} + + + + 场馆简介: + + + + + 直接到场 + + + 场次预订 + + + 门票预订 + \ No newline at end of file diff --git a/xz_mini/pages/venueDetail/venueDetail.wxss b/xz_mini/pages/venueDetail/venueDetail.wxss new file mode 100644 index 0000000..a2d97e4 --- /dev/null +++ b/xz_mini/pages/venueDetail/venueDetail.wxss @@ -0,0 +1,117 @@ +.swiper-box, swiper, .swiper-item image{ + width: 100%; + height: 350rpx; +} +.venue{ + margin-top: 10rpx; + padding: 0 20rpx; +} +.venue-name{ + font-size: 34rpx; + color: #000; + margin-bottom: 10rpx; + font-weight: bold; +} +.venue-info{ + font-size: 28rpx; + color: #242424; + border-bottom: 1px solid #ddd; + padding: 15rpx 0; +} +.venue-info image{ + width: 28rpx; + height: 28rpx; + vertical-align: middle; +} +.selecet-tab{ + display: flex; + overflow-x: auto; + flex-wrap: nowrap; + padding: 0 20rpx; +} +.tab-btn{ + flex-shrink: 0; + display: inline-flex; + justify-content: center; + align-items: center; + height: 60rpx; + color: #BBBBBB; + font-size: 30rpx; + margin-left: 60rpx; +} +.tab-btn.active{ + color: #9F1512; + border-bottom: 1px solid #9F1512; +} +.tab-btn:first-child{ + margin-left: 20rpx; +} +.tab-info{ + padding: 0 20rpx; + margin-top: 10rpx; +} +.tab-content{ + border-bottom: 1px solid #ddd; + padding-bottom: 10rpx; +} +.info-title{ + font-size: 30rpx; + color: #000; + font-weight: bold; +} +.info-content{ + font-size: 28rpx; + color: #BBBBBB; + padding-left: 20rpx; + margin: 10rpx 0; +} +.venue-other{ + margin: 10rpx 0 20rpx; + padding: 0 20rpx; +} +.other-title{ + font-size: 32rpx; + color: #000; + font-weight: bold; +} +.other-content{ + font-size: 28rpx; + color: #BBBBBB; + padding-left: 20rpx; + margin: 10rpx 0; +} +.other-container{ + padding-bottom: 10rpx; + border-bottom: 1px solid #ddd; +} +.venue-intro{ + padding: 0 20rpx 20rpx; + margin-bottom: 110rpx; +} +.intro-title{ + font-size: 30rpx; + color: #000; + font-weight: bold; +} +.intro-content{ + font-size: 28rpx; + color: #000; +} +.book-btn{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + background: #fff; +} +.btn{ + height: 80rpx; + background: #9F1512; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + font-size: 30rpx; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/volunteer/volunteer.js b/xz_mini/pages/volunteer/volunteer.js new file mode 100644 index 0000000..5c18b7c --- /dev/null +++ b/xz_mini/pages/volunteer/volunteer.js @@ -0,0 +1,140 @@ +// pages/volunteer/volunteer.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + indicatorDots: true, + autoplay: true, + serviceMap: [], + pages: { + page: 1, + rows: 5 + } + }, + goDetail: function (e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '../serviceActivityDetail/serviceActivityDetail?id=' + id + }) + }, + goTeam: function () { + wx.navigateTo({ + url: '../volunteerTeam/volunteerTeam', + }) + }, + goRegister: function () { + wx.navigateTo({ + url: '../volunteerRegister/volunteerRegister', + }) + }, + newActivity: function () { + wx.navigateTo({ + url: '../newVolunteerActivity/newVolunteerActivity', + }) + }, + /** + * 获取志愿者活动列表 + */ + activityList: function() { + var self = this; + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteerservice/listpagevolunteerservicerelease/{areaCode}', [app.areaCode]), + self.data.pages, null, function(code, data) { + if('200' == code) { + // 将活动照片,拼接为可访问地址 + for(var item of data.rows) { + if('' != item.photo) { + var photoArr = item.photo.split(","); + item.photo = app.volunteerUrl + '/route/file/download/true/' + photoArr[0]; + } + } + if(1 === self.data.pages.page) { + self.setData({ + serviceMap: data.rows + }) + }else { + if(data.rows.length == 0) { + self.setData({ + [`pages.page`] : self.data.pages.page - 1 + }) + app.dialog.msg('暂无更多') + return false; + } + + self.setData({ + serviceMap: data.rows.concat(self.data.serviceMap), + }) + } + + } + }, function() { + + }, function() { + wx.hideNavigationBarLoading(); //完成停止加载图标 + wx.stopPullDownRefresh(); + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.activityList(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + // 在标题栏中显示加载图标 + wx.showNavigationBarLoading(); + var self = this; + self.setData({ + [`pages.page`] : 1 + }) + this.activityList(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/volunteer/volunteer.json b/xz_mini/pages/volunteer/volunteer.json new file mode 100644 index 0000000..09e623a --- /dev/null +++ b/xz_mini/pages/volunteer/volunteer.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/pages/volunteer/volunteer.wxml b/xz_mini/pages/volunteer/volunteer.wxml new file mode 100644 index 0000000..170dc9c --- /dev/null +++ b/xz_mini/pages/volunteer/volunteer.wxml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + 志愿者注册 + 实名注册 + + + + + + + + 志愿者服务组织 + 志愿者团队 + + + + + + + + + + + 志愿活动 + + + + + + + + 报名中 + 已报名 + 停止报名 + 进行中 + 已结束 + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + + + + + + 发起新活动 + \ No newline at end of file diff --git a/xz_mini/pages/volunteer/volunteer.wxss b/xz_mini/pages/volunteer/volunteer.wxss new file mode 100644 index 0000000..3dcb433 --- /dev/null +++ b/xz_mini/pages/volunteer/volunteer.wxss @@ -0,0 +1,136 @@ +.swiper-box, .swiper-img, swiper{ + width: 100%; + height: 330rpx; +} +.link{ + padding: 15rpx 30rpx; + display: flex; + justify-content: space-between; +} +.link-box{ + width: 49%; + background:linear-gradient(315deg,rgba(205,47,41,1) 0%,rgba(159,21,18,1) 100%); + border-radius: 10rpx; + height: 145rpx; + padding: 30rpx 15rpx 0 30rpx; + box-sizing: border-box; + color: #fff; + justify-content: space-between; + display: flex; +} +.big{ + font-size: 28rpx; +} +.small{ + font-size: 24rpx; +} +.img image{ + width: 60rpx; + height: 60rpx; +} +.public-title{ + text-align: center; +} +.title-text{ + display: inline-block; + font-size: 28rpx; + color: #9F1512; + padding: 0 15rpx 0; + position: relative; + margin-bottom: 15rpx; +} +.title-text image{ + position: absolute; + top: 0; + width: 10rpx; + height: 100%; +} +.selected-l{ + left: 0; +} +.selected-r{ + right: 0; +} +.activity{ + padding: 20rpx 30rpx 90rpx; +} +.activity-box{ + margin-bottom: 20rpx; + box-shadow:0px 0px 17rpx 0px rgba(0,0,0,0.1); + border-radius: 10rpx; + overflow: hidden; +} +.activity-img{ + height: 320rpx; + position: relative; +} +.activity-img image{ + width: 100%; + height: 100%; +} +.corner{ + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; + width: 115rpx; + height: 45rpx; + display: flex; + justify-content: center; + align-items: center; + background:rgba(159,21,18,.6); + border-radius: 10rpx; + font-size: 26rpx; +} +.activity-info{ + padding: 15rpx 20rpx; +} +.title{ + display: flex; + justify-content: space-between; +} +.activity-title{ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 30rpx; + color: #242424; + line-height: 40rpx; +} +.sign{ + background: rgba(159,21,18,.1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; +} +.date{ + margin-top: 10rpx; + font-size: 22rpx; + color: #242424; +} +.new-activity{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + background: #fff; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); +} +.new-activity-btn{ + background: #9F1512; + display: flex; + width: 100%; + height: 70rpx; + justify-content: center; + align-items: center; + border-radius: 10rpx; + font-size: 28rpx; + color: #fff; +} +.volunteer-activity{ + margin-bottom: 105rpx; +} \ No newline at end of file diff --git a/xz_mini/pages/volunteerRegister/volunteerRegister.js b/xz_mini/pages/volunteerRegister/volunteerRegister.js new file mode 100644 index 0000000..3a761eb --- /dev/null +++ b/xz_mini/pages/volunteerRegister/volunteerRegister.js @@ -0,0 +1,468 @@ +// pages/volunteerRegister/volunteerRegister.js +var app = getApp(); +Page({ + /** + * 页面的初始数据 + */ + data: { + token: '', + volunteerMsg: [], + isAgree: false, // 是否同意志愿者注册协议 + openExperience: 0, + tempObj: {}, // 用于临时存储字典表返回的数据 + tempArray: [], // 用于临时存储字典表返回的数据 + serviceType: {}, // 服务意向 + serviceTypeValue: '', // 用户选择的服务意向ID + serviceIndustry: {}, // 服务领域或行业 + serviceIndustryValue: '', // 用户选择的服务领域或行业ID + + teamCityIndex: 0, + teamCityResult: '请选择服务区域', + teamCity: {}, // 服务区域-市 + teamCityArray: [], // 服务区域-市 + + teamCountyIndex: 0, + teamCountyResult: '请选择旗县区', + teamCounty: {}, // 服务区域-旗县区 + teamCountyArray: [], // 服务区域-旗县区 + + teamAreaIndex: 0, + teamAreaResult: '请选择乡镇村', + teamArea: {}, // 服务区域-乡镇村 + teamAreaArray: [], // 服务区域-乡镇村 + + countyShowStatus: true, + areaShowStatus: true, + + occupationIndex: 0, + occupationResult: '请选择职业', + occupation: {}, // 职业 + occupationArray: [], // 职业 + + work: '', // 工作单位及职务 + hobby: '', // 特长爱好 + cv: '', // 个人简历 + remark: '' // 备注 + }, + getToken: function() { + var self = this; + return new Promise(resolve =>{ + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + cityChange: function(e) { + var self = this; + self.setData({ + teamCityIndex: e.detail.value, + areaShowStatus: true, + teamArea: {}, + teamAreaArray: [] + }) + + this.getDataFromArea(self.data.teamCity[self.data.teamCityIndex].areaId, 2).then(result => { + if(self.data.tempObj.length > 0) { + self.setData({ + teamCounty: self.data.tempObj, + teamCountyArray: self.data.tempArray, + countyShowStatus: false, + tempObj: {}, + tempArray: [] + }) + }else { + self.setData({ + teamCounty: {}, + teamCountyArray: [], + countyShowStatus: true, + tempObj: {}, + tempArray: [] + }) + } + }); + }, + countyChange: function(e) { + var self = this; + self.setData({ + teamCountyIndex: e.detail.value + }) + + this.getDataFromArea(self.data.teamCounty[self.data.teamCountyIndex].areaId, 2).then(result => { + if(self.data.tempObj.length > 0) { + self.setData({ + teamArea: self.data.tempObj, + teamAreaArray: self.data.tempArray, + areaShowStatus: false, + tempObj: {}, + tempArray: [] + }) + }else { + self.setData({ + teamArea: {}, + teamAreaArray: [], + areaShowStatus: true, + tempObj: {}, + tempArray: [] + }) + } + }) + }, + areaChange: function(e) { + var self = this; + self.setData({ + teamAreaIndex: e.detail.value + }) + }, + changeOpen: function(e) { + if(e.detail.value == ''){ + this.setData({ + openExperience: 0 + }) + }else{ + this.setData({ + openExperience: 1 + }) + } + }, + changeAgree: function (e) { + console.log(e) + if(e.detail.value == ''){ + this.setData({ + isAgree: false + }) + }else{ + this.setData({ + isAgree: true + }) + } + }, + userAgree: function(e) { + var type = e.currentTarget.dataset.type; + wx.navigateTo({ + url: '../userAgree/userAgree?type=' + type, + }) + }, + /** + * 服务类别选择 + * @param {}} e + */ + serviceTypeChange: function(e) { + console.log(e) + var self = this; + var selData = e.detail.value; + if(selData) { + var dataValueStr = ''; + for(var item of selData) { + dataValueStr +=item + ","; + } + if (dataValueStr.length > 0) { + dataValueStr = dataValueStr.substr(0,dataValueStr.length - 1); + } + self.setData({ + serviceTypeValue: dataValueStr + }) + } + }, + /** + * 服务领域或行业选择 + * @param {}} e + */ + serviceIndustryChange: function(e) { + var self = this; + var selData = e.detail.value; + if(selData) { + var dataValueStr = ''; + for(var item of selData) { + dataValueStr +=item + ","; + } + if (dataValueStr.length > 0) { + dataValueStr = dataValueStr.substr(0,dataValueStr.length - 1); + } + self.setData({ + serviceIndustryValue: dataValueStr + }) + } + }, + submitRegister: function () { + var self = this; + if(!self.data.isAgree) { + wx.showToast({ + title: '请阅读并同意《志愿者注册服务协议》', + icon: 'none', + duration: 1500 + }) + return false; + } + var volunteerVO = { + serviceCity: self.data.teamCity[self.data.teamCityIndex] != '' + && self.data.teamCity[self.data.teamCityIndex] != null + && self.data.teamCity[self.data.teamCityIndex] != 'undefined' ? + self.data.teamCity[self.data.teamCityIndex].dictionaryId : + '', + serviceCounty: self.data.teamCounty[self.data.teamCountyIndex] != '' + && self.data.teamCounty[self.data.teamCountyIndex] != null + && self.data.teamCounty[self.data.teamCountyIndex] != 'undefined' ? + self.data.teamCounty[self.data.teamCountyIndex].dictionaryId : + '', + serviceArea: self.data.teamArea[self.data.teamAreaIndex] != '' + && self.data.teamArea[self.data.teamAreaIndex] != null + && self.data.teamArea[self.data.teamAreaIndex] != 'undefined' ? + self.data.teamArea[self.data.teamAreaIndex].dictionaryId : + '', + occupation: self.data.occupation[self.data.occupationIndex] != '' + && self.data.occupation[self.data.occupationIndex] != null + && self.data.occupation[self.data.occupationIndex] != 'undefined' ? + self.data.occupation[self.data.occupationIndex].dictionaryId : + '', + serviceType: self.data.serviceTypeValue, + serviceIndustry: self.data.serviceIndustryValue, + agree: self.data.isAgree, + openExperience : self.data.openExperience, + work: self.data.work, + hobby: self.data.hobby, + cv: self.data.cv, + remark: self.data.remark + }; + var url; + var requ; + if(!self.data.volunteerMsg) { + url = '/app/volunteer/savevolunteer'; + requ = app.restAjax.post; + }else { + url = '/app/volunteer/updatevolunteer/' + self.data.volunteerMsg.volunteerId; + requ = app.restAjax.put; + } + requ(app.restAjax.path(app.volunteerUrl + url, []), + volunteerVO, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + app.dialog.msg('注册成功!'); + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, function(code, data) { + app.dialog.msg(data.msg); + }, function() { + + }) + }, + /** + *从字典表拉取数据 + */ + getDataFromDict: function(dictId, type) { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/data/listbyparentid/' + dictId, []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + if(data || type === 2) { + var array = []; + for(var item of data) { + delete item.dataParentId; + delete item.dataParentName; + delete item.dataSummary; + delete item.dataCode; + delete item.dataSort; + delete item.subDictionary; + delete item.parent; + + array.push(item.dataName); + } + self.setData({ + tempArray: array + }) + } + self.setData({ + tempObj: data + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, + /** + *从区域表拉取数据 + */ + getDataFromArea: function(dictId, type) { + var self = this; + return new Promise(resolve => { + // listbyparentidrelease + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/area/listbyparentidrelease/' + dictId, []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + if(data || type === 2) { + var array = []; + for(var item of data) { + delete item.areaParentId; + delete item.areaParentName; + delete item.areaCode; + delete item.areaCityCode; + delete item.areaMergerName; + delete item.areaShortName; + delete item.areaZipCode; + delete item.areaLevel; + delete item.areaLng; + delete item.areaLat; + delete item.areaPinyin; + delete item.areaFirst; + delete item.subArea; + delete item.parent; + + array.push(item.areaName); + } + self.setData({ + tempArray: array + }) + } + self.setData({ + tempObj: data + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, + getVolunteerMsg() { + var self = this; + return new Promise(resolve => { + app.restAjax.get(app.restAjax.path(app.volunteerUrl + '/app/volunteer/getvolunteerbyuserid', []), + {}, { + headers: { + 'token': self.data.token + } + }, function(code, data) { + if('200' == code) { + console.log(data) + self.setData({ + volunteerMsg: data, + work: data.work, + hobby: data.hobby, + cv: data.cv, + remark: data.remark, + }) + } + return resolve(); + }, function() { + + }, function() { + + }) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + var self = this; + this.getToken().then(result => { + this.getVolunteerMsg().then(result => { + this.getDataFromDict('a223b308-014a-4e89-93fa-035a564e7fda', 1).then(result => { + self.setData({ + serviceType: self.data.tempObj, + tempObj: {} + }) + }).then(result => { + this.getDataFromDict('7b213c37-8575-4db3-bda1-86c4e38589f7', 1).then(result => { + self.setData({ + serviceIndustry: self.data.tempObj, + tempObj: {} + }) + }) + }).then(result => { + this.getDataFromArea('640675', 2).then(result => { + self.setData({ + teamCity: self.data.tempObj, + teamCityArray: self.data.tempArray, + tempObj: {}, + tempArray: [] + }) + }) + }).then(result => { + this.getDataFromDict('3a2a6615-a4fe-465b-b56d-a2b7ae409b9d', 2).then(result => { + self.setData({ + occupation: self.data.tempObj, + occupationArray: self.data.tempArray, + tempObj: {}, + tempArray: [] + }) + }) + }) + }) + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/volunteerRegister/volunteerRegister.json b/xz_mini/pages/volunteerRegister/volunteerRegister.json new file mode 100644 index 0000000..64da9ee --- /dev/null +++ b/xz_mini/pages/volunteerRegister/volunteerRegister.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": false +} \ No newline at end of file diff --git a/xz_mini/pages/volunteerRegister/volunteerRegister.wxml b/xz_mini/pages/volunteerRegister/volunteerRegister.wxml new file mode 100644 index 0000000..13f876c --- /dev/null +++ b/xz_mini/pages/volunteerRegister/volunteerRegister.wxml @@ -0,0 +1,135 @@ + + + 您已经是志愿者,可修改以下信息! + + + 公开经历: + + + + + + + + + + + 旗县区: + + + + + {{teamCityArray[teamCityIndex]}} + + + + + + + + + + + + 服务意向: + + + + + {{item.dataName}} + + + + + + + + 服务领域或行业: + + + + + {{item.dataName}} + + + + + + + + 职业: + + + + + {{occupationArray[occupationIndex]}} + + + + + + + + 工作单位及职务: + + + + + + + 特长爱好: + + + + + + + 个人简历: + + + + + + 备注: + + + + + + + + + + + + + 立即注册 + 立即修改 + \ No newline at end of file diff --git a/xz_mini/pages/volunteerRegister/volunteerRegister.wxss b/xz_mini/pages/volunteerRegister/volunteerRegister.wxss new file mode 100644 index 0000000..1c4c9d6 --- /dev/null +++ b/xz_mini/pages/volunteerRegister/volunteerRegister.wxss @@ -0,0 +1,110 @@ +page { + background: #ffffff; +} + +.register { + padding: 0rpx 0rpx 250rpx 0rpx; +} + +.hint { + background: white; + color: red; + padding: 20rpx; +} + +.thick-line { + align-self: center; + background: #f2f2f2; + height: 5rpx; +} + +.thin-line { + margin: 0rpx 30rpx; + align-self: center; + background: #f2f2f2; + height: 1rpx; +} + +.row { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 20rpx; +} + +.column { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 20rpx; +} + +.info-name { + font-size: 26rpx; + color: #000; + line-height: 55rpx; + width: 30%; +} + +.info-text { + font-size: 26rpx; + height: 55rpx; +} + +.info-text input { + width: 100%; + height: 55rpx; + padding: 0 10rpx; + box-sizing: border-box; + text-align: right; +} + +.info-text textarea { + height: 150rpx; + padding: 10rpx; + box-sizing: border-box; + border: 1px solid #DDD; +} + +picker, +.picker { + height: 55rpx; + line-height: 55rpx; +} + +text { + color: red; +} + +.section { + padding: 0 10rpx; + height: 55rpx; +} + +.submit { + width: 100%; + margin: 20rpx auto 0; + display: flex; + justify-content: center; + align-items: center; + height: 80rpx; + color: #fff; + border-radius: 10rpx; + background: #9F1512; +} + +checkbox:nth-of-type(n+2) { + margin-left: 10rpx; +} + +.bottom { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 0 30rpx 20rpx; + background: #fff; + z-index: 10; +} \ No newline at end of file diff --git a/xz_mini/pages/volunteerTeam/volunteerTeam.js b/xz_mini/pages/volunteerTeam/volunteerTeam.js new file mode 100644 index 0000000..2526ea3 --- /dev/null +++ b/xz_mini/pages/volunteerTeam/volunteerTeam.js @@ -0,0 +1,206 @@ +// pages/volunteer/volunteer.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + otherTeamMap: [], + type: '1', + teamId: '', + page: { + page: 1, + rows: 10 + }, + totalSize: 0, + + }, + getToken: function () { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + newTeam: function () { + wx.navigateTo({ + url: '../newTeam/newTeam', + }) + }, + changeTab: function (e) { + var self = this; + self.data.page.page = 1; + self.setData({ + page: self.data.page, + otherTeamMap: [], + totalSize: 0, + type: e.currentTarget.dataset.type + }) + if (self.data.type === '1') { + self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true'); + } else { + self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true'); + } + }, + otherTeam: function (url) { + var self = this; + app.restAjax.get(app.restAjax.path(url, []), self.data.page, { + headers: { + token: self.data.token + } + }, function (code, data) { + if ('200' == code) { + self.setData({ + totalSize: data.total + }) + if (data.rows && data.rows.length > 0) { + self.setData({ + otherTeamMap: self.data.otherTeamMap.concat(data.rows) + }) + } else { + app.dialog.msg('暂无更多数据了') + } + } + }, function (code, data) { + app.dialog.msg(data.msg); + }, function () { + wx.stopPullDownRefresh() + }) + }, + /** + * 申请/退出加入团队 + */ + joinOrOutTeam: function (e) { + var self = this; + self.setData({ + teamId: e.currentTarget.dataset.teamid + }) + var teamMemberVO; + var url; + var methodType; + var title; + if ('1' == self.data.type) { + url = app.volunteerUrl + '/app/teammember/saveteammember' + teamMemberVO = { + teamId: e.currentTarget.dataset.teamid + } + methodType = app.restAjax.post + title = '申请成功!' + } else { + url = app.volunteerUrl + '/app/teammember/quitTeam/' + self.data.teamId + methodType = app.restAjax.get + title = '退出成功!' + } + + methodType(app.restAjax.path(url, []), + teamMemberVO, { + headers: { + token: self.data.token + } + }, + function (code, data) { + if ('200' == code) { + app.dialog.msg(title); + wx.navigateTo({ + url: '../volunteer/volunteer', + }) + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.getToken().then(result => { + this.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true'); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + var self = this; + self.data.page.page = 1; + self.setData({ + page: self.data.page, + otherTeamMap: [], + totalSize: 0, + }) + if (self.data.type === '1') { + self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true'); + } else { + self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true'); + } + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var self = this; + if (self.data.otherTeamMap.length < self.data.totalSize) { + self.data.page.page = self.data.page.page + 1 + self.setData({ + page: self.data.page + }) + if (self.data.type === '1') { + self.otherTeam(app.volunteerUrl + '/app/team/otherteamm?otherTeam=true'); + } else { + self.otherTeam(app.volunteerUrl + '/app/team/myjointeam?myTeam=true'); + } + } else { + app.dialog.msg('暂无更多数据了') + } + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/xz_mini/pages/volunteerTeam/volunteerTeam.json b/xz_mini/pages/volunteerTeam/volunteerTeam.json new file mode 100644 index 0000000..7360326 --- /dev/null +++ b/xz_mini/pages/volunteerTeam/volunteerTeam.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/pages/volunteerTeam/volunteerTeam.wxml b/xz_mini/pages/volunteerTeam/volunteerTeam.wxml new file mode 100644 index 0000000..f840dc5 --- /dev/null +++ b/xz_mini/pages/volunteerTeam/volunteerTeam.wxml @@ -0,0 +1,30 @@ + + + + 未参加 + + + + + 已参加 + + + + + + + {{item.teamName}} + 申请加入 + 退出 + 待审核 + 退出 + 审核驳回 + 已退出 + + 团队口号:{{item.teamWatchword}} + 所属区域:{{item.teamCityDictionaryName}} {{item.teamCountyDictionaryName}} {{item.teamAreaDictionaryName}} + + + + 创建新团队 + \ No newline at end of file diff --git a/xz_mini/pages/volunteerTeam/volunteerTeam.wxss b/xz_mini/pages/volunteerTeam/volunteerTeam.wxss new file mode 100644 index 0000000..2674c63 --- /dev/null +++ b/xz_mini/pages/volunteerTeam/volunteerTeam.wxss @@ -0,0 +1,93 @@ +.top-tab{ + position: fixed; + top: 0; + left: 0; + right: 0; + display: flex; + box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1); + border-radius:0 0 31rpx 31rpx; + background: #fff; +} +.tab-box{ + display: flex; + justify-content: center; + align-items: center; + flex: 1; + position: relative; + height: 90rpx; + font-size: 30rpx; + color: #242424; +} +.tab-box.active{ + color: #9F1512; +} +.tab-box image{ + position: absolute; + width: 15rpx; + height: 40rpx; + top: 50%; + margin-top: -20rpx; + display: none; +} +.tab-box.active image{ + display: block; +} +.tab-box image.selected-l{ + left: 100rpx; +} +.tab-box image.selected-r{ + right: 100rpx; +} +.team{ + margin-top: 90rpx; + padding: 0rpx 30rpx 110rpx 30rpx; +} +.team-box{ + padding: 20rpx 0; + border-bottom: 1px solid #EBEBEB; +} +.name-join{ + display: flex; + justify-content: space-between; + height: 40rpx; + line-height: 40rpx; + font-size: 32rpx; + color: #242424; +} +.name{ + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.join{ + padding: 0 10rpx; + background: rgba(159,21,18,.1); + color: #9F1512; + font-size: 28rpx; + border-radius: 10rpx; +} +.slogan, .area{ + color: #949494; + font-size: 26rpx; + margin-top: 10rpx; +} +.new-team{ + position: fixed; + background: #fff; + bottom: 0; + left: 0; + right: 0; + padding: 15rpx 30rpx; + border-top: 1px solid #EBEBEB; +} +.new-team-btn{ + height: 80rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 30rpx; + color: #fff; + background: #9F1512; + border-radius: 10rpx; +} \ No newline at end of file diff --git a/xz_mini/project.private.config.json b/xz_mini/project.private.config.json new file mode 100644 index 0000000..6b3482f --- /dev/null +++ b/xz_mini/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "libVersion": "2.30.0", + "setting": { + "urlCheck": false + } +} \ No newline at end of file diff --git a/xz_mini/sitemap.json b/xz_mini/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/xz_mini/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/xz_mini/subpages/addresschoose/addresschoose.js b/xz_mini/subpages/addresschoose/addresschoose.js new file mode 100644 index 0000000..ec4a666 --- /dev/null +++ b/xz_mini/subpages/addresschoose/addresschoose.js @@ -0,0 +1,147 @@ +// subpages/goodsaddress/goodsaddress.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + list: [], + hidePageLoading: false, + defaultAddress: {} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + _self.getToken().then(result => { + _self.getList(); + }) + }, + getToken() { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + //获取列表 + getList() { + var _self = this + var header = { + headers: { + token: _self.data.token + } + }; + + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopaddress/list', [app.shopUrl]), null, header, function (code, data) { + console.log(data); + _self.setData({ + list: data, + hidePageLoading: true + }) + }, function (code, data) { + app.dialog.msg(data.msg); + _self.setData({ + hidePageLoading: true + }) + }, function () { + wx.hideLoading(); + _self.setData({ + hideLoading: true + }) + }) + }, + doRefresh() { + this.setData({ + list: [] + }) + this.getList(); + }, + doEdit(e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/subpages/editshopaddress/editshopaddress?id=' + id, + }) + }, + doDel(e) { + var id = e.currentTarget.dataset.id; + var item = e.currentTarget.dataset.item; + var _self = this; + if (1 == item.shopAddressDefault) { + wx.showToast({ + icon: 'none', + title: '请先设置默认地址', + }) + return; + } + wx.showModal({ + title: '警告', + content: '确定要删除该收货地址吗?', + complete: (res) => { + if (res.confirm) { + app.dialog.loading("删除中...") + app.restAjax.delete(app.restAjax.path('{shopUrl}/app/shopaddress/remove/{ids}', [app.shopUrl, id]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (code == 200) { + app.dialog.msg("删除成功") + _self.getList() + } + }, function (code, data) { + app.dialog.msg(data.msg) + }); + } + } + }) + }, + doSetDefault(e) { + var _self = this; + app.dialog.loading('设置中') + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + var item = e.currentTarget.dataset.item + app.restAjax.put(app.restAjax.path('{shopUrl}/app/shopaddress/updatedefault/{shopAddressId}', [app.shopUrl, id]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading(); + if (code == 200) { + app.dialog.msg('设置成功') + } + _self.setData({ + list: [], + defaultAddress: item + }) + _self.getList(); + }, function (code, data) { + console.log(data) + wx.hideLoading(); + app.dialog.msg(data.msg) + }) + + }, + addAddress() { + var _self= this; + var pages = getCurrentPages(); + var prePage = pages[pages.length - 2] + prePage.setData({ + addressBean: _self.data.defaultAddress + }) + wx.navigateBack() + }, +}) \ No newline at end of file diff --git a/xz_mini/subpages/addresschoose/addresschoose.json b/xz_mini/subpages/addresschoose/addresschoose.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/xz_mini/subpages/addresschoose/addresschoose.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/subpages/addresschoose/addresschoose.wxml b/xz_mini/subpages/addresschoose/addresschoose.wxml new file mode 100644 index 0000000..d7a9499 --- /dev/null +++ b/xz_mini/subpages/addresschoose/addresschoose.wxml @@ -0,0 +1,20 @@ + + + + + + + {{item.areaName}} + {{item.shopAddressContent}} + {{item.shopAddressName}} {{item.shopAddressPhone}} + + + + + + 确认 + + \ No newline at end of file diff --git a/xz_mini/subpages/addresschoose/addresschoose.wxss b/xz_mini/subpages/addresschoose/addresschoose.wxss new file mode 100644 index 0000000..b024cc7 --- /dev/null +++ b/xz_mini/subpages/addresschoose/addresschoose.wxss @@ -0,0 +1,106 @@ +/* subpages/goodsaddress/goodsaddress.wxss */ +.empty-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%)translateY(-50%); +} + +.empty-box image { + width: 140rpx; + height: 100rpx; +} + +.empty-box text { + margin-top: 20rpx; + font-size: 32rpx; +} + +.content-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 95%; + padding: 20rpx; + border-radius: 10rpx; + box-shadow: 5rpx 5rpx 20rpx #f2f2f2; + margin: 20rpx 20rpx 100rpx 0rpx; +} + +.address-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + padding: 10rpx; + border-bottom: 1rpx solid #f2f2f2; + width: 100%; +} + + +.address-item .check { + width: 48rpx; + height: 48rpx; + +} + +.address-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 100%; + max-width: 100%; + margin-left: 20rpx; +} + +.address-area { + font-size: 32rpx; +} + +.address-name { + font-size: 40rpx; + margin: 10rpx 0rpx; +} + +.address-phone { + font-size: 32rpx; +} + +.address-control-box { + display: flex; + width: 80rpx; + flex-direction: column; + justify-content: space-around; + align-items: center; +} + +.edit-icon { + width: 48rpx; + height: 48rpx; +} + +.del-icon { + width: 48rpx; + height: 48rpx; + margin-top: 20rpx; +} + +.bottom-btn { + height: 80rpx; + background: #9f1512; + border-radius: 10rpx; + text-align: center; + color: white; + position: fixed; + bottom: 0rpx; + left: 0rpx; + line-height: 80rpx; + margin: 0rpx 20rpx 10rpx 20rpx; + width: 95%; +} \ No newline at end of file diff --git a/xz_mini/subpages/addshopaddress/addshopaddress.js b/xz_mini/subpages/addshopaddress/addshopaddress.js new file mode 100644 index 0000000..64101f2 --- /dev/null +++ b/xz_mini/subpages/addshopaddress/addshopaddress.js @@ -0,0 +1,244 @@ +// subpages/addshopaddress/addshopaddress.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + area1: '', + area2: '', + area3: '', + area4: '', + detailContent: '', + name: '', + phone: '', + zipCode: '', + + tempProvIndex: -1, + tempProvArray: [], + + cityIndex: -1, + cityArray: [], + + countyIndex: -1, + countyArray: [], + + villageIndex: -1, + villageArray: [] + + }, + + /** + * 生命周期函数--监听页面加载 + */ + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + _self.getToken().then(result => { + + }) + _self.getAreaList(0, 1); + }, + getToken() { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + inputZip(e) { + this.setData({ + zipCode: e.detail.value + }) + }, + inputName(e) { + this.setData({ + name: e.detail.value + }) + }, + inputPhone(e) { + this.setData({ + phone: e.detail.value + }) + }, + inputDetail(e) { + this.setData({ + detailContent: e.detail.value + }) + }, + //获取 + getAreaList(areaId, type) { + var _self = this; + app.dialog.loading("加载中..."); + app.restAjax.get(app.restAjax.path('{shopUrl}/app/area/listbyparentidrelease/{areaParentId}', + [app.loginUrl, areaId]), + null, null, + function (code, data) { + switch (type) { + case 1: //省份 + _self.setData({ + tempProvIndex: -1, + tempProvArray: data + }) + break; + case 2: + _self.setData({ + cityArray: data + }) + break; + case 3: + _self.setData({ + countyArray: data + }) + break; + case 4: + _self.setData({ + villageArray: data + }) + break; + default: + break; + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideLoading(); + }) + }, + //省份选择 + provChange(e) { + var index = e.detail.value + this.setData({ + tempProvIndex: index, + cityIndex: -1, + cityArray: [], + countyIndex: -1, + countyArray: [], + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.tempProvArray[this.data.tempProvIndex].areaId, 2); + }, + //市选择 + cityChange(e) { + var index = e.detail.value + this.setData({ + cityIndex: index, + countyIndex: -1, + countyArray: [], + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.cityArray[this.data.cityIndex].areaId, 3); + }, + //区县选择 + countyChange(e) { + var index = e.detail.value + this.setData({ + countyIndex: index, + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.countyArray[this.data.countyIndex].areaId, 4); + }, + //乡镇选择 + villageChange(e) { + var index = e.detail.value + this.setData({ + villageIndex: index + }) + }, + doSave() { + if (this.checkParams()) { + app.dialog.loading("保存中...") + var _self = this; + var areaName = _self.data.tempProvArray[_self.data.tempProvIndex].areaName + ' ' + _self.data.cityArray[_self.data.cityIndex].areaName + ' ' + _self.data.countyArray[_self.data.countyIndex].areaName + ' ' + _self.data.villageArray[_self.data.villageIndex].areaName + var info = { + areaCode: _self.data.villageArray[_self.data.villageIndex].areaCode, + areaId: _self.data.villageArray[_self.data.villageIndex].areaId, + areaName: areaName, + shopAddressContent: _self.data.detailContent, + shopAddressName: _self.data.name, + shopAddressPhone: _self.data.phone, + shopAddressZipcode: _self.data.zipCode + }; + app.restAjax.post(app.restAjax.path('{url}/app/shopaddress/save', [app.shopUrl]), info, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + console.log(code) + if (code == 200) { + app.dialog.msg("添加成功") + var pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; + prevPage.doRefresh() + wx.navigateBack() + } + }, function (code, data) { + wx.hideLoading() + app.dialog.msg(data.msg); + }); + } + }, + checkParams() { + if (this.data.tempProvIndex == -1) { + wx.showToast({ + title: '请选择省份', + }) + return false; + } + if (this.data.cityIndex == -1) { + wx.showToast({ + title: '请选择市', + }) + return false; + } + if (this.data.countyIndex == -1) { + wx.showToast({ + title: '请选择区县', + }) + return false; + } + if (this.data.villageIndex == -1) { + wx.showToast({ + title: '请选择乡镇街道', + }) + return false; + } + if (this.data.detailContent == '') { + wx.showToast({ + title: '请输入详细地址', + }) + return false; + } + if (this.data.name == '') { + wx.showToast({ + title: '请输入姓名', + }) + return false; + } + if (this.data.phone == '') { + wx.showToast({ + title: '请输入联系方式', + }) + return false; + } + return true; + + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/addshopaddress/addshopaddress.json b/xz_mini/subpages/addshopaddress/addshopaddress.json new file mode 100644 index 0000000..7f6ca08 --- /dev/null +++ b/xz_mini/subpages/addshopaddress/addshopaddress.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "新增收货地址" +} \ No newline at end of file diff --git a/xz_mini/subpages/addshopaddress/addshopaddress.wxml b/xz_mini/subpages/addshopaddress/addshopaddress.wxml new file mode 100644 index 0000000..7c2ed92 --- /dev/null +++ b/xz_mini/subpages/addshopaddress/addshopaddress.wxml @@ -0,0 +1,72 @@ + + + + + 省份 + + + + {{tempProvIndex==-1 ? '请选择省份':tempProvArray[tempProvIndex].areaName}} + + + + + + + + + + + {{cityIndex==-1? '请选择市':cityArray[cityIndex].areaName}} + + + + + + + 区、县 + + + + {{countyIndex==-1? '请选择区县':countyArray[countyIndex].areaName}} + + + + + + + 乡镇街道 + + + + {{villageIndex==-1?'请选择乡镇街道':villageArray[villageIndex].areaName}} + + + + + + + 详细地址 + + + + + + 姓名 + + + + + + 联系方式 + + + + + + 邮政编码 + + + + +保存 \ No newline at end of file diff --git a/xz_mini/subpages/addshopaddress/addshopaddress.wxss b/xz_mini/subpages/addshopaddress/addshopaddress.wxss new file mode 100644 index 0000000..27e72fb --- /dev/null +++ b/xz_mini/subpages/addshopaddress/addshopaddress.wxss @@ -0,0 +1,58 @@ +/* subpages/addshopaddress/addshopaddress.wxss */ +.address-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 20rpx; +} + +.address-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + width: 100%; + font-size: 32rpx; +} + +.address-item:nth-of-type(n+2) { + margin-top: 20rpx; +} + + + +.area-title { + width: 25%; +} + +.line { + background: #9f1512; + width: 5rpx; + height: 35rpx; +} + +.area-content { + flex: 2; + margin-left: 20rpx; +} + +.arrow-icon { + width: 32rpx; + height: 32rpx; +} + + +.bottom-btn { + height: 80rpx; + background: #9f1512; + border-radius: 10rpx; + text-align: center; + color: white; + position: fixed; + bottom: 0rpx; + left: 0rpx; + line-height: 80rpx; + margin: 0rpx 20rpx 10rpx 20rpx; + width: 95%; +} \ No newline at end of file diff --git a/xz_mini/subpages/editshopaddress/editshopaddress.js b/xz_mini/subpages/editshopaddress/editshopaddress.js new file mode 100644 index 0000000..a4198b7 --- /dev/null +++ b/xz_mini/subpages/editshopaddress/editshopaddress.js @@ -0,0 +1,285 @@ +// subpages/addshopaddress/addshopaddress.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + id: '', + token: '', + area1: '', + area2: '', + area3: '', + area4: '', + detailContent: '', + name: '', + phone: '', + zipCode: '', + + tempProvIndex: -1, + tempProvArray: [], + + cityIndex: -1, + cityArray: [], + + countyIndex: -1, + countyArray: [], + + villageIndex: -1, + villageArray: [], + detailBean: {} + + }, + + /** + * 生命周期函数--监听页面加载 + */ + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + var id = options.id + _self.setData({ + id: id + }) + _self.getToken().then(result => { + _self.getAddressDetail(); + }) + _self.getAreaList(0, 1); + }, + getToken() { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + getAddressDetail() { + var _self = this; + app.dialog.loading("加载中..."); + app.restAjax.get(app.restAjax.path('{baseUrl}/app/shopaddress/get/{shopAddressId}', [app.shopUrl, _self.data.id]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (data) { + _self.setData({ + detailBean: data, + detailContent: data.shopAddressContent, + name: data.shopAddressName, + phone: data.shopAddressPhone, + zipCode: data.shopAddressZipcode + }) + } + }, function (code, data) { + wx.hideLoading() + }) + }, + inputZip(e) { + this.setData({ + zipCode: e.detail.value + }) + }, + inputName(e) { + this.setData({ + name: e.detail.value + }) + }, + inputPhone(e) { + this.setData({ + phone: e.detail.value + }) + }, + inputDetail(e) { + this.setData({ + detailContent: e.detail.value + }) + }, + //获取 + getAreaList(areaId, type) { + var _self = this; + app.dialog.loading("加载中..."); + app.restAjax.get(app.restAjax.path('{shopUrl}/app/area/listbyparentidrelease/{areaParentId}', + [app.loginUrl, areaId]), + null, null, + function (code, data) { + switch (type) { + case 1: //省份 + _self.setData({ + tempProvIndex: -1, + tempProvArray: data + }) + break; + case 2: + _self.setData({ + cityArray: data + }) + break; + case 3: + _self.setData({ + countyArray: data + }) + break; + case 4: + _self.setData({ + villageArray: data + }) + break; + default: + break; + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideLoading(); + }) + }, + //省份选择 + provChange(e) { + var index = e.detail.value + this.setData({ + tempProvIndex: index, + cityIndex: -1, + cityArray: [], + countyIndex: -1, + countyArray: [], + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.tempProvArray[this.data.tempProvIndex].areaId, 2); + }, + //市选择 + cityChange(e) { + var index = e.detail.value + this.setData({ + cityIndex: index, + countyIndex: -1, + countyArray: [], + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.cityArray[this.data.cityIndex].areaId, 3); + }, + //区县选择 + countyChange(e) { + var index = e.detail.value + this.setData({ + countyIndex: index, + villageIndex: -1, + villageArray: [] + }) + this.getAreaList(this.data.countyArray[this.data.countyIndex].areaId, 4); + }, + //乡镇选择 + villageChange(e) { + var index = e.detail.value + this.setData({ + villageIndex: index + }) + }, + doSave() { + if (this.checkParams()) { + app.dialog.loading("修改中...") + var _self = this; + var areaName = ''; + var areaId = ''; + var areaCode = ''; + if (_self.data.tempProvIndex == -1) { + areaName = _self.data.detailBean.areaName; + areaId = _self.data.detailBean.areaId; + areaCode = _self.data.detailBean.areaCode; + } else { + areaName = _self.data.tempProvArray[_self.data.tempProvIndex].areaName + ' ' + _self.data.cityArray[_self.data.cityIndex].areaName + ' ' + _self.data.countyArray[_self.data.countyIndex].areaName + ' ' + _self.data.villageArray[_self.data.villageIndex].areaName; + areaCode = _self.data.villageArray[_self.data.villageIndex].areaCode; + areaId = _self.data.villageArray[_self.data.villageIndex].areaId; + } + var info = { + areaCode: areaCode, + areaId: areaId, + areaName: areaName, + shopAddressContent: _self.data.detailContent, + shopAddressName: _self.data.name, + shopAddressPhone: _self.data.phone, + shopAddressZipcode: _self.data.zipCode + }; + app.restAjax.put(app.restAjax.path('{url}/app/shopaddress/update/{shopAddressId}', [app.shopUrl, _self.data.id]), info, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + console.log(code) + if (code == 200) { + app.dialog.msg("修改成功") + var pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; + prevPage.doRefresh() + wx.navigateBack() + } + }, function (code, data) { + wx.hideLoading() + app.dialog.msg(data.msg); + }); + } + }, + checkParams() { + if (this.data.tempProvIndex != -1) { + if (this.data.tempProvIndex == -1) { + wx.showToast({ + title: '请选择省份', + }) + return false; + } + if (this.data.cityIndex == -1) { + wx.showToast({ + title: '请选择市', + }) + return false; + } + if (this.data.countyIndex == -1) { + wx.showToast({ + title: '请选择区县', + }) + return false; + } + if (this.data.villageIndex == -1) { + wx.showToast({ + title: '请选择乡镇街道', + }) + return false; + } + } + if (this.data.detailContent == '') { + wx.showToast({ + title: '请输入详细地址', + }) + return false; + } + if (this.data.name == '') { + wx.showToast({ + title: '请输入姓名', + }) + return false; + } + if (this.data.phone == '') { + wx.showToast({ + title: '请输入联系方式', + }) + return false; + } + return true; + + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/editshopaddress/editshopaddress.json b/xz_mini/subpages/editshopaddress/editshopaddress.json new file mode 100644 index 0000000..8340eab --- /dev/null +++ b/xz_mini/subpages/editshopaddress/editshopaddress.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "收货地址修改" +} \ No newline at end of file diff --git a/xz_mini/subpages/editshopaddress/editshopaddress.wxml b/xz_mini/subpages/editshopaddress/editshopaddress.wxml new file mode 100644 index 0000000..ac1a5cb --- /dev/null +++ b/xz_mini/subpages/editshopaddress/editshopaddress.wxml @@ -0,0 +1,74 @@ + + + + {{detailBean.areaName}} + + + 省份 + + + + {{tempProvIndex==-1 ? '请选择省份':tempProvArray[tempProvIndex].areaName}} + + + + + + + + + + + {{cityIndex==-1? '请选择市':cityArray[cityIndex].areaName}} + + + + + + + 区、县 + + + + {{countyIndex==-1? '请选择区县':countyArray[countyIndex].areaName}} + + + + + + + 乡镇街道 + + + + {{villageIndex==-1?'请选择乡镇街道':villageArray[villageIndex].areaName}} + + + + + + + 详细地址 + + + + + + 姓名 + + + + + + 联系方式 + + + + + + 邮政编码 + + + + +保存 \ No newline at end of file diff --git a/xz_mini/subpages/editshopaddress/editshopaddress.wxss b/xz_mini/subpages/editshopaddress/editshopaddress.wxss new file mode 100644 index 0000000..20832cc --- /dev/null +++ b/xz_mini/subpages/editshopaddress/editshopaddress.wxss @@ -0,0 +1,64 @@ +/* subpages/addshopaddress/addshopaddress.wxss */ +.address-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 20rpx; +} + +.address-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + width: 100%; + font-size: 32rpx; +} + +.address-item:nth-of-type(n+2) { + margin-top: 20rpx; +} + + + +.area-title { + width: 25%; +} + +.line { + background: #9f1512; + width: 5rpx; + height: 35rpx; +} + +.area-content { + flex: 2; + margin-left: 20rpx; +} + +.arrow-icon { + width: 32rpx; + height: 32rpx; +} + + +.bottom-btn { + height: 80rpx; + background: #9f1512; + border-radius: 10rpx; + text-align: center; + color: white; + position: fixed; + bottom: 0rpx; + left: 0rpx; + line-height: 80rpx; + margin: 0rpx 20rpx 10rpx 20rpx; + width: 95%; +} + +.current-address { + font-size: 36rpx; + padding: 20rpx 0rpx; + font-weight: bold; +} \ No newline at end of file diff --git a/xz_mini/subpages/goodsaddress/goodsaddress.js b/xz_mini/subpages/goodsaddress/goodsaddress.js new file mode 100644 index 0000000..ed39b83 --- /dev/null +++ b/xz_mini/subpages/goodsaddress/goodsaddress.js @@ -0,0 +1,140 @@ +// subpages/goodsaddress/goodsaddress.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + list: [], + hidePageLoading: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + _self.getToken().then(result => { + _self.getList(); + }) + }, + getToken() { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + //获取列表 + getList() { + var _self = this + var header = { + headers: { + token: _self.data.token + } + }; + + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopaddress/list', [app.shopUrl]), null, header, function (code, data) { + console.log(data); + _self.setData({ + list: data, + hidePageLoading: true + }) + }, function (code, data) { + app.dialog.msg(data.msg); + _self.setData({ + hidePageLoading: true + }) + }, function () { + wx.hideLoading(); + _self.setData({ + hideLoading: true + }) + }) + }, + doRefresh() { + this.setData({ + list: [] + }) + this.getList(); + }, + doEdit(e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/subpages/editshopaddress/editshopaddress?id=' + id, + }) + }, + doDel(e) { + var id = e.currentTarget.dataset.id; + var item = e.currentTarget.dataset.item; + var _self = this; + if (1 == item.shopAddressDefault) { + wx.showToast({ + icon: 'none', + title: '请先设置默认地址', + }) + return; + } + wx.showModal({ + title: '警告', + content: '确定要删除该收货地址吗?', + complete: (res) => { + if (res.confirm) { + app.dialog.loading("删除中...") + app.restAjax.delete(app.restAjax.path('{shopUrl}/app/shopaddress/remove/{ids}', [app.shopUrl, id]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (code == 200) { + app.dialog.msg("删除成功") + _self.getList() + } + }, function (code, data) { + app.dialog.msg(data.msg) + }); + } + } + }) + }, + doSetDefault(e) { + var _self = this; + app.dialog.loading('设置中') + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + app.restAjax.put(app.restAjax.path('{shopUrl}/app/shopaddress/updatedefault/{shopAddressId}', [app.shopUrl, id]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading(); + if (code == 200) { + app.dialog.msg('设置成功') + } + _self.setData({ + list: [] + }) + _self.getList(); + }, function (code, data) { + console.log(data) + wx.hideLoading(); + app.dialog.msg(data.msg) + }) + + }, + addAddress() { + wx.navigateTo({ + url: '/subpages/addshopaddress/addshopaddress' + }) + }, +}) \ No newline at end of file diff --git a/xz_mini/subpages/goodsaddress/goodsaddress.json b/xz_mini/subpages/goodsaddress/goodsaddress.json new file mode 100644 index 0000000..99a8774 --- /dev/null +++ b/xz_mini/subpages/goodsaddress/goodsaddress.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "收货地址" +} \ No newline at end of file diff --git a/xz_mini/subpages/goodsaddress/goodsaddress.wxml b/xz_mini/subpages/goodsaddress/goodsaddress.wxml new file mode 100644 index 0000000..c93948c --- /dev/null +++ b/xz_mini/subpages/goodsaddress/goodsaddress.wxml @@ -0,0 +1,23 @@ + + + + + + + {{item.areaName}} + {{item.shopAddressContent}} + {{item.shopAddressName}} {{item.shopAddressPhone}} + + + + + + + + + + 暂无数据 + + 新增收货地址 + + \ No newline at end of file diff --git a/xz_mini/subpages/goodsaddress/goodsaddress.wxss b/xz_mini/subpages/goodsaddress/goodsaddress.wxss new file mode 100644 index 0000000..e35a71b --- /dev/null +++ b/xz_mini/subpages/goodsaddress/goodsaddress.wxss @@ -0,0 +1,108 @@ +/* subpages/goodsaddress/goodsaddress.wxss */ +.empty-box { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + background: white; +} + +.empty-box image { + width: 140rpx; + height: 100rpx; +} + +.empty-box text { + margin-top: 20rpx; + font-size: 32rpx; +} + +.content-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 95%; + padding: 20rpx; + border-radius: 10rpx; + box-shadow: 5rpx 5rpx 20rpx #f2f2f2; + margin: 20rpx 20rpx 100rpx 0rpx; +} + +.address-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + padding: 10rpx; + border-bottom: 1rpx solid #f2f2f2; + width: 100%; +} + + +.address-item .check { + width: 48rpx; + height: 48rpx; + +} + +.address-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 100%; + max-width: 100%; + margin-left: 20rpx; +} + +.address-area { + font-size: 32rpx; +} + +.address-name { + font-size: 40rpx; + margin: 10rpx 0rpx; +} + +.address-phone { + font-size: 32rpx; +} + +.address-control-box { + display: flex; + width: 80rpx; + flex-direction: column; + justify-content: space-around; + align-items: center; +} + +.edit-icon { + width: 48rpx; + height: 48rpx; +} + +.del-icon { + width: 48rpx; + height: 48rpx; + margin-top: 20rpx; +} + +.bottom-btn { + height: 80rpx; + background: #9f1512; + border-radius: 10rpx; + text-align: center; + color: white; + position: fixed; + bottom: 0rpx; + left: 0rpx; + line-height: 80rpx; + margin: 0rpx 20rpx 10rpx 20rpx; + width: 95%; +} \ No newline at end of file diff --git a/xz_mini/subpages/goodscar/goodscar.js b/xz_mini/subpages/goodscar/goodscar.js new file mode 100644 index 0000000..30ff57b --- /dev/null +++ b/xz_mini/subpages/goodscar/goodscar.js @@ -0,0 +1,137 @@ +// subpages/goodscar/goodscar.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + carList: [], + isHidePageloading: false, + imgUrl: app.shopImgUrl, + totalPrice: 0.0 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + try { + var value = wx.getStorageSync('carlist'); + console.log(value) + if (value) { + _self.setData({ + carList: value, + isHidePageloading: true + }) + _self.countPrice() + } else { + _self.setData({ + isHidePageloading: true + }) + } + } catch (e) { + + } + }, + onShow() { + var _self = this; + try { + var value = wx.getStorageSync('carlist'); + console.log(value) + if (value) { + _self.setData({ + carList: value, + isHidePageloading: true + }) + _self.countPrice() + } else { + _self.setData({ + isHidePageloading: true + }) + } + } catch (e) { + + } + }, + delGoods(e) { + var _self = this; + wx.showModal({ + title: '提示', + content: '确定要删除该商品吗?', + complete: (res) => { + if (res.confirm) { + var index = e.currentTarget.dataset.index + console.log(index) + _self.data.carList.splice(index, 1) + _self.setData({ + carList: _self.data.carList + }) + wx.setStorageSync('carlist', _self.data.carList); + _self.countPrice(); + } + } + }) + }, + delCount(e) { + var _self = this; + var index = e.currentTarget.dataset.index + if (this.data.carList[index].carAmount == 1) { + return; + } + this.data.carList[index].carAmount -= 1; + this.setData({ + carList: this.data.carList + }) + wx.setStorageSync('carlist', _self.data.carList); + _self.countPrice(); + }, + addCount(e) { + var _self = this; + var index = e.currentTarget.dataset.index + this.data.carList[index].carAmount += 1; + this.setData({ + carList: this.data.carList + }) + wx.setStorageSync('carlist', _self.data.carList); + _self.countPrice(); + }, + selSelect(e) { + var _self = this; + var index = e.currentTarget.dataset.index; + _self.data.carList[index].isCheck = !_self.data.carList[index].isCheck; + _self.setData({ + carList: _self.data.carList + }) + wx.setStorageSync('carlist', _self.data.carList); + _self.countPrice(); + }, + countPrice() { + var _self = this; + var tempCount = 0; + for (let i = 0; i < _self.data.carList.length; i++) { + const item = _self.data.carList[i]; + if (item.isCheck) { + tempCount = item.goodsPrice * item.carAmount + tempCount; + } + } + _self.setData({ + totalPrice: tempCount + }) + }, + toConfirmOrder() { + var _self = this; + if (_self.data.totalPrice > 0) { + wx.navigateTo({ + url: '/subpages/orderconfirm/orderconfirm', + }) + } else { + wx.showToast({ + icon: 'none', + title: '请选择要购买的商品', + }) + } + + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/goodscar/goodscar.json b/xz_mini/subpages/goodscar/goodscar.json new file mode 100644 index 0000000..b67c440 --- /dev/null +++ b/xz_mini/subpages/goodscar/goodscar.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "购物车" +} \ No newline at end of file diff --git a/xz_mini/subpages/goodscar/goodscar.wxml b/xz_mini/subpages/goodscar/goodscar.wxml new file mode 100644 index 0000000..47c80e0 --- /dev/null +++ b/xz_mini/subpages/goodscar/goodscar.wxml @@ -0,0 +1,44 @@ + + + + + + + + + + + ¥{{item.goodsPrice}} + {{item.goodsStandarName}} + + + 销量{{item.goodsSalesVolume}} + {{item.goodsNotFreight ==1 ? '不包邮':'包邮'}} + + + + + {{item.carAmount}} + + + + + + + + + + + + + ¥ + {{totalPrice}} + + 去结算 + + + + + + + \ No newline at end of file diff --git a/xz_mini/subpages/goodscar/goodscar.wxss b/xz_mini/subpages/goodscar/goodscar.wxss new file mode 100644 index 0000000..00e751d --- /dev/null +++ b/xz_mini/subpages/goodscar/goodscar.wxss @@ -0,0 +1,240 @@ +/* subpages/goodscar/goodscar.wxss */ + +.category-empty { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + text-align: center; + align-self: center; + + position: fixed; + top: 50%; + left: 50%; + transform: translateX(-50%)translateY(-50%); +} + +.category-empty image { + width: 180rpx; + height: 120rpx; +} + +.category-empty .hint { + margin-top: 30rpx; + font-size: 32rpx; +} + +.goods-item { + display: flex; + flex-direction: row; + padding: 10rpx; + margin-top: 10rpx; +} + +.check { + width: 48rpx; + height: 48rpx; + min-width: 48rpx; + min-height: 48rpx; + max-height: 48rpx; + max-width: 48rpx; +} + +.goods { + display: flex; + flex-direction: row; + justify-content: flex-start; + margin-left: 20rpx; +} + +.goods-img { + width: 180rpx; + height: 160rpx; +} + + +.goods-content { + margin: 0rpx 10rpx; + flex: 1; +} + +.goods-name { + font-size: 32rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.goods-unit-price { + font-size: 40rpx; + color: #9f1512; + margin-top: 10rpx; +} + +.goods-standard { + margin-top: 10rpx; + font-size: 32rpx; + border: 1rpx solid #9f1512; + border-radius: 3rpx; + color: #9f1512; + width: fit-content; + max-width: fit-content; + padding: 0rpx 10rpx; +} + +.goods-type-box { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; + margin-top: 20rpx; +} + +.goods-type-box image { + width: 48rpx; + height: 48rpx; +} + +.goods-type { + color: #9f1512; + font-size: 25rpx; + border: 1rpx solid #9f1512; + padding: 0rpx 10rpx; + text-align: center; +} + +.goods-type:last-child { + margin-left: 20rpx; +} + +.type-box { + display: flex; + flex-direction: row; + width: 50%; + justify-content: flex-start; + align-items: center; +} + +.add-del-box { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.add-del-box .txt { + font-size: 35rpx; + padding: 0rpx 15rpx; +} + +.control-box { + width: 50%; + display: flex; + flex-direction: row; + justify-content: space-around; +} + + + +.bottom-box { + display: flex; + flex-direction: column; + background: white; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + +} + +.goods-price { + color: #9f1512; + font-size: 40rpx; +} + +.bottom-content { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin: 25rpx; +} + +.bottom-price { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: baseline; + color: #e70606; + text-align: center; + font-weight: bold; +} + +.price-icon { + font-size: 30rpx; +} + +.price-content { + font-size: 55rpx; +} + + +.icon-btn { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.car-icon { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 30rpx; +} + +.car-icon image { + width: 48rpx; + height: 48rpx; + align-items: center; + align-self: center; + margin-left: 25rpx; + margin-top: 10rpx; +} + +.car { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.car-num { + position: relative; + right: 10rpx; + top: -10rpx; + background: #e70606; + color: white; + width: 48rpx; + height: 48rpx; + border-radius: 50%; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 25rpx; +} + +.car-add { + background: linear-gradient(to right bottom, rgb(245, 74, 74), rgb(221, 5, 5) 70px); + color: white; + padding: 15rpx; + border-radius: 10rpx; + margin-left: 20rpx; + font-size: 32rpx; +} + diff --git a/xz_mini/subpages/goodsdetail/goodsdetail.js b/xz_mini/subpages/goodsdetail/goodsdetail.js new file mode 100644 index 0000000..ca58ec6 --- /dev/null +++ b/xz_mini/subpages/goodsdetail/goodsdetail.js @@ -0,0 +1,181 @@ +// subpages/goodsdetail/goodsdetail.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + goodsId: "", + isHidePageloading: false, + detailBean: {}, + currentStandard: {}, + standardList: [], + curStandardIndex: 0, + imgUrl: app.shopImgUrl, + carList: [], + carNum: 0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + goodsId: options.id + }) + this.getGoodsDetail(); + + }, + onShow() { + try { + var value = wx.getStorageSync('carlist'); + if (value) { + this.setData({ + carList: value + }) + this.parseCarList(); + } + } catch (error) { + + } + }, + parseCarList() { + var _self = this; + var count = 0; + for (let i = 0; i < _self.data.carList.length; i++) { + const item = _self.data.carList[i]; + count = item.carAmount + count; + } + console.log(count) + if (count > 0) { + _self.setData({ + carNum: count + }) + } + }, + //获取商品详情 + getGoodsDetail() { + var _self = this + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoods/getrelease/{goodsId}', + [app.shopUrl, _self.data.goodsId]), + null, + null, + function (code, data) { + if (data) { + if (data.goodsPhotos.length > 0) { + var photos = data.goodsPhotos.split(','); + data.photoList = photos; + } else { + data.photoList = [] + } + data.goodsPrice = 0; + data.goodsStandarName = ""; + data.goodsStandarId = ""; + data.isCheck = false; + data.carAmount = 0; + _self.setData({ + detailBean: data, + }) + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + _self.getGoodsStandardList(); + }) + }, + // carAmount; + // goodsPrice; + // goodsStandarId; + // goodsStandarName; + // isCheck; + //获取商品附加信息 + getGoodsStandardList() { + var _self = this + _self.data.detailBean.goodsPrice = 0; + _self.data.detailBean.goodsStandarName = ""; + _self.data.detailBean.goodsStandarId = ""; + _self.data.detailBean.isCheck = false; + _self.data.detailBean.carAmount = 0; + + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoodsitem/listrelease/{goodsId}', + [app.shopUrl, _self.data.goodsId]), + null, + null, + function (code, data) { + if (data && data.length > 0) { + _self.data.detailBean.goodsPrice = data[0].goodsItemUnitPrice; + _self.data.detailBean.goodsStandarName = data[0].goodsItemName; + _self.data.detailBean.goodsStandarId = data[0].goodsItemId; + _self.setData({ + standardList: data, + currentStandard: data[0], + isHidePageloading: true, + detailBean: _self.data.detailBean + }) + } else { + _self.setData({ + isHidePageloading: true + }) + } + }, + function (code, data) { + app.dialog.msg(data.msg); + _self.setData({ + isHidePageloading: true + }) + }, + function () { + _self.setData({ + isHidePageloading: true + }) + }) + }, + doSelStandard(e) { + var item = e.currentTarget.dataset.item; + var index = e.currentTarget.dataset.index; + this.data.detailBean.goodsPrice = item.goodsItemUnitPrice; + this.data.detailBean.goodsStandarName = item.goodsItemName; + this.data.detailBean.goodsStandarId = item.goodsItemId; + this.setData({ + currentStandard: item, + curStandardIndex: index, + detailBean: this.data.detailBean + }) + }, + // 添加购物车 + addToCar() { + //判断购物车中是否存在该商品 + var _self = this; + var pos = -1; + for (let i = 0; i < _self.data.carList.length; i++) { + var item = _self.data.carList[i]; + if (_self.data.detailBean.goodsId == item.goodsId && _self.data.detailBean.goodsStandarId == item.goodsStandarId) { + pos = i; + break; + } + } + if (pos != -1) { + _self.data.carList[pos].carAmount = _self.data.carList[pos].carAmount + 1; + } else { + _self.data.detailBean.carAmount = 1; + _self.data.carList.push(_self.data.detailBean); + } + _self.setData({ + carList: _self.data.carList + }) + _self.parseCarList(); + wx.setStorageSync('carlist', _self.data.carList) + }, + openCar() { + if (this.data.carNum > 0) { + wx.navigateTo({ + url: '/subpages/goodscar/goodscar', + }) + } else { + app.dialog.msg('购物车无数据') + } + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/goodsdetail/goodsdetail.json b/xz_mini/subpages/goodsdetail/goodsdetail.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/xz_mini/subpages/goodsdetail/goodsdetail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/subpages/goodsdetail/goodsdetail.wxml b/xz_mini/subpages/goodsdetail/goodsdetail.wxml new file mode 100644 index 0000000..b41c699 --- /dev/null +++ b/xz_mini/subpages/goodsdetail/goodsdetail.wxml @@ -0,0 +1,83 @@ + + + + + + + + + 库存:{{currentStandard.goodsItemTotal}} + 销量:{{detailBean.goodsSalesVolume}} + 评分:{{detailBean.userEvaluate}} + {{detailBean.goodsNotFreight==1? '包邮':'不包邮'}} + + + {{detailBean.goodsName}} + + + {{detailBean.shopName}} + + + + + + + 规格 + + + + + + {{item.goodsItemName}} + + + + + + + + + 详情 + + + + + + {{it.parameterName}} + {{it.shopGoodsParameterContent}} + + + + + + + + + + + + + + + + ¥ + {{currentStandard.goodsItemUnitPrice}} + + + + + + {{carNum>99? '99+':carNum}} + + 购物车 + + 加入购物车 + + + \ No newline at end of file diff --git a/xz_mini/subpages/goodsdetail/goodsdetail.wxss b/xz_mini/subpages/goodsdetail/goodsdetail.wxss new file mode 100644 index 0000000..7771aa2 --- /dev/null +++ b/xz_mini/subpages/goodsdetail/goodsdetail.wxss @@ -0,0 +1,296 @@ +/* subpages/goodsdetail/goodsdetail.wxss */ +page { + background: #f2f2f2; +} + +.container-box { + width: 100%; + height: auto; + display: flex; + flex-direction: column; + margin-bottom: 150rpx; +} + +.banner { + height: 500rpx; +} + +.banner image { + width: 100%; + height: 500rpx; +} + + +.goods-type { + display: flex; + flex-direction: row; + margin-top: 10rpx; + +} + +.name-box { + padding: 30rpx; + display: flex; + flex-direction: column; + box-shadow: 10rpx 5rpx 10rpx #dfdfdf; + background: white; + margin: 20rpx; + border-radius: 10rpx; +} + +.type-box { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-content: center; +} + +.type-item { + background: #f2f2f2; + color: #e70606; + padding: 10rpx; + font-size: 28rpx; +} + +.type-item:nth-of-type(n+2) { + margin-left: 20rpx; +} + +.goods-name { + font-size: 32rpx; + color: black; + margin-top: 20rpx; +} + +.shop-name { + margin-top: 20rpx; + font-size: 28rpx; + color: gray; +} + +.standard-box { + padding: 30rpx; + display: flex; + flex-direction: column; + box-shadow: 10rpx 5rpx 10rpx #dfdfdf; + background: white; + margin: 20rpx; + border-radius: 10rpx; +} + +.title-item { + display: flex; + flex-direction: row; + align-items: center; +} + +.line { + height: 30rpx; + width: 10rpx; + background: #e70606; +} + +.title-name { + margin-left: 30rpx; +} + +.standard-content { + display: flex; + flex-direction: row; +} + +.standard-item { + display: flex; + flex-direction: row; + border: 1rpx solid #dfdfdf; + border-radius: 3rpx; + margin: 10rpx; + text-align: center; + justify-content: center; + align-items: center; + padding: 0rpx 0rpx 0rpx 5rpx; +} + +.name { + text-align: center; + margin: 0rpx 20rpx; + font-size: 28rpx; +} + +.standard-item image { + width: 48rpx; + height: 48rpx; +} + +.standard-item-sel { + display: flex; + flex-direction: row; + border: 1rpx solid #e70606; + border-radius: 3rpx; + margin: 10rpx; + text-align: center; + justify-content: center; + align-items: center; + padding: 0rpx 0rpx 0rpx 5rpx; +} + +.standard-item-sel image { + width: 48rpx; + height: 48rpx; +} + +.desc-box { + display: flex; + flex-direction: column; + margin: 20rpx; + box-shadow: 10rpx 5rpx 10rpx #dfdfdf; + background: white; + padding: 30rpx; +} + +.desc-video { + margin-top: 20rpx; + width: 100%; +} + +.desc-img { + margin-top: 20rpx; +} + +.desc-txt { + margin-top: 20rpx; +} + +.bottom-box { + display: flex; + flex-direction: column; + background: white; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + +} + +.bottom-content { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin: 25rpx; +} + +.bottom-price { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: baseline; + color: #e70606; + text-align: center; + font-weight: bold; +} + +.price-icon { + font-size: 30rpx; +} + +.price-content { + font-size: 55rpx; +} + + +.icon-btn { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.car-icon { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 30rpx; +} + +.car-icon image { + width: 48rpx; + height: 48rpx; + align-items: center; + align-self: center; + margin-left: 25rpx; + margin-top: 10rpx; +} + +.car { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.car-num { + position: relative; + right: 10rpx; + top: -10rpx; + background: #e70606; + color: white; + width: 48rpx; + height: 48rpx; + border-radius: 50%; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 25rpx; +} + +.car-add { + background: linear-gradient(to right bottom, rgb(245, 74, 74), rgb(221, 5, 5) 70px); + color: white; + padding: 15rpx; + border-radius: 10rpx; + margin-left: 20rpx; + font-size: 32rpx; +} + +.params-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin-top: 20rpx; +} + +.params-item { + display: flex; + flex-direction: row; + width: 100%; +} + +.params-item:first-child { + border: 1rpx solid #6e6e6e; +} + +.params-item:nth-of-type(n+2) { + border-bottom: 1rpx solid #6e6e6e; + border-left: 1rpx solid #6e6e6e; + border-right: 1rpx solid #6e6e6e; +} + +.params-title { + width: 40%; + border-right: 1rpx solid #6e6e6e; + padding: 5rpx; + text-align: center; + font-size: 32rpx; +} + +.params-content { + width: 60%; + text-align: center; + font-size: 32rpx; + padding: 5rpx; +} \ No newline at end of file diff --git a/xz_mini/subpages/goodslist/goodslist.js b/xz_mini/subpages/goodslist/goodslist.js new file mode 100644 index 0000000..7cbd5a4 --- /dev/null +++ b/xz_mini/subpages/goodslist/goodslist.js @@ -0,0 +1,89 @@ +// pages/goodslist/goodslist.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + id: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + id: options.id, + page: 1, + rows: 10, + keywords: "", + goodsList: [], + imgUrl: app.shopImgUrl, + hidePageLoading: false + }) + this.getGoodsList(); + }, + inputKeywords(event) { + this.setData({ + keywords: event.detail.value + }) + }, + doSearch() { + wx.startPullDownRefresh() + }, + getGoodsList() { + var _self = this + var info = { + 'page': _self.data.page, + 'rows': _self.data.rows, + 'categoryId': _self.data.id, + 'keywords': _self.data.keywords + }; + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopgoods/solrrelease', [app.shopUrl]), info, null, function (code, data) { + _self.setData({ + hidePageLoading: true + }) + if (data.rows.length == 0) { + app.dialog.msg('暂无数据'); + return; + } + _self.setData({ + goodsList: _self.data.goodsList.concat(data.rows), + hidePageLoading: true + }) + console.log(_self.data.goodsList) + wx.stopPullDownRefresh() + }, function (code, data) { + app.dialog.msg(data.msg); + wx.stopPullDownRefresh() + _self.setData({ + hidePageLoading: true + }) + }, function () { + wx.hideLoading(); + wx.stopPullDownRefresh() + }) + }, + //下拉刷新 + onPullDownRefresh() { + this.setData({ + page: 1, + goodsList: [] + }) + this.getGoodsList() + }, + //加载更多 + onReachBottom() { + var _self = this; + _self.setData({ + page: _self.data.page += 1 + }) + _self.getGoodsList() + }, + goDetail(e) { + wx.navigateTo({ + url: '/subpages/goodsdetail/goodsdetail?id=' + e.currentTarget.dataset.id, + }) + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/goodslist/goodslist.json b/xz_mini/subpages/goodslist/goodslist.json new file mode 100644 index 0000000..2f12723 --- /dev/null +++ b/xz_mini/subpages/goodslist/goodslist.json @@ -0,0 +1,8 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "商品", + "enablePullDownRefresh": true, + "backgroundColor": "#efefef", + "backgroundTextStyle": "dark", + "onReachBottomDistance": 150 +} \ No newline at end of file diff --git a/xz_mini/subpages/goodslist/goodslist.wxml b/xz_mini/subpages/goodslist/goodslist.wxml new file mode 100644 index 0000000..0a2c56f --- /dev/null +++ b/xz_mini/subpages/goodslist/goodslist.wxml @@ -0,0 +1,26 @@ + + + + + 搜索 + + + + + + + ¥ {{item.goodsPrice}} + + 销量:{{item.goodsSalesVolume}} + 评分:{{item.goodStar}} + {{item.goodsNotFreight ==1 ? '不包邮':'包邮'}} + + + {{item.shopName}} + + + + + + + \ No newline at end of file diff --git a/xz_mini/subpages/goodslist/goodslist.wxss b/xz_mini/subpages/goodslist/goodslist.wxss new file mode 100644 index 0000000..4323fd5 --- /dev/null +++ b/xz_mini/subpages/goodslist/goodslist.wxss @@ -0,0 +1,96 @@ +/* pages/goodslist/goodslist.wxss */ +.search-box { + position: fixed; + top: 0; + left: 0; + width: 100%; + padding: 20rpx 15rpx; + display: flex; + flex-direction: row; + background: #ffffff; +} + +.search-box input { + padding: 10rpx; + background: #f2f2f2; + border-radius: 20rpx; + width: 80%; + font-size: 28rpx; +} + +.search-box .btn { + padding: 10rpx; + color: black; +} + +.container-box { + margin-top: 110rpx; +} + +.goods-item { + display: flex; + flex-direction: row; + margin: 20rpx; +} + +.goods-content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + padding: 0rpx 10rpx; +} + +.goods-name { + font-size: 28rpx; + color: #000000; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.goods-price { + font-size: 40rpx; + color: #e70606; + margin-top: 20rpx; +} + +.goods-type { + display: flex; + flex-direction: row; + margin-top: 10rpx; + +} + +.type-item { + background: #f2f2f2; + color: #e70606; + padding: 10rpx; + font-size: 20rpx; +} + +.type-item:nth-of-type(n+2) { + margin-left: 20rpx; +} + +.shop-name { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + font-size: 28rpx; + color: #5a5a5a; + margin-top: 20rpx; +} + +.shop-name .shop-icon { + width: 30rpx; + height: 30rpx; +} + +.goods-item image { + width: 240rpx; + height: 200rpx; +} \ No newline at end of file diff --git a/xz_mini/subpages/goodsorder/goodsorder.js b/xz_mini/subpages/goodsorder/goodsorder.js new file mode 100644 index 0000000..56b0588 --- /dev/null +++ b/xz_mini/subpages/goodsorder/goodsorder.js @@ -0,0 +1,294 @@ +// subpages/goodsorder/goodsorder.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + tabList: [{ + name: "全部", + type: "all" + }, { + name: "代付款", + type: "0" + }, { + name: "待收货", + type: "2" + }, { + name: "已完成", + type: "4" + }, { + name: "已取消", + type: "" + }, ], + dataList: [], + currentIndex: 0, + pages: { + page: 1, + rows: 3, + isCancel: '', + orderStatus: '' + }, + token: '', + isHideLoading: false, + imgUrl: app.shopImgUrl, + cancelList: [], + currentCancel: {}, + isShowCancel: false, + cancelRemark: "", + totalSize: 0, + isShowLoading: true, + loading: "加载中" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + _self.getToken().then(res => { + _self.getGoodsList(); + }); + }, + changeTab(e) { + var _self = this; + var type = e.currentTarget.dataset.type + var isCancel = type == '' ? '1' : '0'; + if (isCancel == '1') { + type = ''; + } + if ('all' == type) { + type = ''; + isCancel = ''; + } + var tempPage = { + page: 1, + isCancel: isCancel, + orderStatus: type + } + _self.setData({ + currentIndex: e.currentTarget.dataset.index, + pages: tempPage, + dataList: [] + }) + _self.getGoodsList(); + }, + getGoodsList() { + var _self = this; + _self.setData({ + isHideLoading: !(1 == _self.data.pages.page) + }) + app.restAjax.get(app.restAjax.path(app.shopUrl + '/app/order/listpage', []), + _self.data.pages, { + headers: { + token: _self.data.token + } + }, + function (code, data) { + _self.setData({ + isHideLoading: true + }) + if ('200' == code) { + if (1 === _self.data.pages.page) { + _self.setData({ + dataList: data.rows, + totalSize: data.total + }) + } else { + _self.setData({ + dataList: _self.data.dataList.concat(data.rows) + }) + console.log(_self.data.dataList.length) + if (_self.data.dataList.length >= _self.data.totalSize) { + _self.setData({ + isShowLoading: false, + loading: "没有更多数据了" + }) + } + + } + } + }, + function () { + _self.setData({ + isHideLoading: true + }) + }, + function () { + _self.setData({ + isHideLoading: true + }) + wx.hideNavigationBarLoading(); //完成停止加载图标 + wx.stopPullDownRefresh(); + wx.hideLoading(); + }) + }, + getToken: function () { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + // 支付 + toPayOrder(e) { + var item = e.currentTarget.dataset.item; + wx.showToast({ + icon: "none", + title: '暂时无法支付', + }) + }, + //取消订单 + toCancelOrder(e) { + var _self = this; + var item = e.currentTarget.dataset.item; //当前订单 + app.dialog.loading("加载中..."); + app.restAjax.get(app.restAjax.path('{shopUrl}/app/data/listbyparentid/{id}', + [app.shopUrl, "bf2d6bb5-4562-4ace-827e-378e41571576"]), {}, { + headers: { + token: _self.data.token + } + }, + function (code, data) { + wx.hideLoading() + if (data && data.length > 0) { + for (let i = 0; i < data.length; i++) { + if (i == 0) { + data[i].check = true; + } else { + data[i].check = false; + } + } + _self.setData({ + cancelList: data, + currentCancel: data[0], + isShowCancel: true, + curOrder: item + }) + } else { + app.dialog.msg("暂时无法取消订单") + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideLoading(); + }) + }, + //删除订单 + toDelOrder(e) { + var _self = this; + var item = e.currentTarget.dataset.item; + wx.showModal({ + title: '提示', + content: '确定要删除该订单吗?删除后将无法找回.', + complete: (res) => { + if (res.confirm) { + app.restAjax.delete(app.restAjax.path('{shopUrl}/app/order/delete/{orderId}', + [app.shopUrl, item.orderId]), {}, { + headers: { + token: _self.data.token + } + }, + function (code, data) { + if (code == '200') { + app.dialog.msg('删除成功') + } + wx.startPullDownRefresh() + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideLoading(); + }) + } + } + }) + }, + inputRemark(e) { + console.log(e) + this.setData({ + cancelRemark: e.detail.value + }) + }, + //选择取消 + chooseCancel(e) { + var item = e.currentTarget.dataset.item; + var index = e.currentTarget.dataset.index; + item.check = true; + var _self = this; + _self.data.cancelList.forEach((item, i) => { + if (i == index) { + item.check = true; + } else { + item.check = false; + } + }); + _self.setData({ + currentCancel: item, + cancelList: _self.data.cancelList + }) + }, + cancelDialog() { + this.setData({ + isShowCancel: false + }) + }, + confirmCancel() { + var _self = this; + _self.setData({ + isShowCancel: false + }) + var cancelBean = { + cancelData: _self.data.currentCancel.dataId, + cancelRemark: _self.data.cancelRemark, + }; + app.dialog.loading("取消中..."); + app.restAjax.put(app.restAjax.path('{shopUrl}/app/order/updatebuyersclose/{orderId}', + [app.shopUrl, _self.data.curOrder.orderId]), cancelBean, { + headers: { + token: _self.data.token + } + }, + function (code, data) { + if (code == '200') { + wx.startPullDownRefresh() + app.dialog.msg('取消成功') + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.hideLoading(); + }) + }, + onPullDownRefresh: function () { + // 在标题栏中显示加载图标 + var _self = this; + _self.setData({ + [`pages.page`]: 1, + dataList: [] + }) + _self.getGoodsList() + }, + onReachBottom() { + var _self = this; + if (_self.data.totalSize > _self.data.dataList.length) { + _self.setData({ + [`pages.page`]: _self.data.pages.page + 1, + }) + _self.getGoodsList(); + } + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/goodsorder/goodsorder.json b/xz_mini/subpages/goodsorder/goodsorder.json new file mode 100644 index 0000000..7ef5329 --- /dev/null +++ b/xz_mini/subpages/goodsorder/goodsorder.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark" +} \ No newline at end of file diff --git a/xz_mini/subpages/goodsorder/goodsorder.wxml b/xz_mini/subpages/goodsorder/goodsorder.wxml new file mode 100644 index 0000000..1c48677 --- /dev/null +++ b/xz_mini/subpages/goodsorder/goodsorder.wxml @@ -0,0 +1,62 @@ + + + {{item.name}} + + + + + + + + {{item.shopName}} + {{item.orderStatusMsg}} + + + + + + ¥{{it.goodsItemPrice}} + {{it.goodsItemName}} + + 数量:{{it.goodsItemCount}} + + + + + 下单时间:{{item.orderFinalTime}} + 总计:¥{{item.amountFinalMoney}} + + + 去付款 + 取消订单 + 删除订单 + + + + + + + + + + + + + + + + 取消 + 确定 + + + 备注 + + + + + + {{item.dataName}} + + + + \ No newline at end of file diff --git a/xz_mini/subpages/goodsorder/goodsorder.wxss b/xz_mini/subpages/goodsorder/goodsorder.wxss new file mode 100644 index 0000000..25fd38a --- /dev/null +++ b/xz_mini/subpages/goodsorder/goodsorder.wxss @@ -0,0 +1,358 @@ +.activity { + padding: 20rpx 30rpx 0; + margin-top: 80rpx; +} + +.activity-box { + margin-bottom: 20rpx; + box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; + padding: 10rpx; +} + +.activity-img { + height: 320rpx; + position: relative; +} + +.activity-img image { + width: 100%; + height: 100%; +} + +.corner { + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; +} + +.corner view { + padding: 0 10rpx; + background: rgba(0, 0, 0, 0.6); + line-height: 40rpx; + vertical-align: middle; + display: flex; + align-items: center; + border-radius: 5rpx; +} + +.view-count { + margin-right: 20rpx; +} + +.view-count image { + width: 40rpx; + height: 40rpx; +} + +.activity-info { + padding: 15rpx 20rpx; +} + +.title { + display: flex; + justify-content: space-between; +} + +.activity-title { + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 32rpx; + color: #242424; + line-height: 40rpx; +} + +.sign { + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; + font-size: 28rpx; +} + +.date { + margin-top: 10rpx; + font-size: 24rpx; + color: #242424; +} + +.area { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 80rpx; + white-space: nowrap; + overflow-x: auto; + background: white; + box-shadow: 5rpx 5rpx 10rpx #f2f2f2; + z-index: 5; + +} + +.area-box { + display: inline-block; + width: 25%; + line-height: 80rpx; + text-align: center; + font-size: 32rpx; +} + +.area-box.active { + color: #9F1512; + font-weight: bold; +} + +.shop-status { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 5rpx; +} + +.shop-name { + font-size: 32rpx; + font-weight: bold; + color: black; +} + +.order-status { + background: #f3f3f3; + border-radius: 5rpx; + padding: 0rpx 10rpx; + font-size: 28rpx; + color: #9f1512; +} + +.order-time-box { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-top: 10rpx; +} + +.order-time { + font-size: 30rpx; + color: black; +} + +.order-price { + font-size: 32rpx; + color: #9f1512; +} + +.order-control-box { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: center; + margin-top: 10rpx; +} + +.order-btn { + font-size: 28rpx; + color: white; + padding: 5rpx 10rpx; + border-radius: 5rpx; + background: linear-gradient(to right bottom, rgb(240, 78, 78), #9f1512 70rpx); +} + +.order-btn:nth-of-type(n+2) { + margin-left: 10rpx; +} + + +.goods { + display: flex; + flex-direction: row; + justify-content: flex-start; + margin-left: 20rpx; + margin-top: 10rpx; +} + +.goods-img { + width: 180rpx; + height: 160rpx; +} + + +.goods-content { + margin: 0rpx 10rpx; + flex: 1; +} + +.goods-name { + font-size: 32rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.goods-unit-price { + font-size: 40rpx; + color: #9f1512; + margin-top: 10rpx; +} + +.goods-standard { + margin-top: 10rpx; + font-size: 25rpx; + border: 1rpx solid #9f1512; + border-radius: 3rpx; + color: #9f1512; + width: fit-content; + max-width: fit-content; + padding: 0rpx 10rpx; +} + +.goods-type-box { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin-top: 20rpx; +} + +.goods-type-box image { + width: 48rpx; + height: 48rpx; +} + +.goods-type { + color: #9f1512; + font-size: 25rpx; + background: #ecebeb; + padding: 0rpx 10rpx; + text-align: center; +} + + + +.type-box { + display: flex; + flex-direction: row; + width: 50%; + justify-content: flex-start; + align-items: center; +} + +.add-del-box { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.add-del-box .txt { + font-size: 35rpx; + padding: 0rpx 15rpx; +} + +.control-box { + width: 50%; + display: flex; + flex-direction: row; + justify-content: space-around; +} + +.cancel-box { + height: 50%; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + background: white; + width: 100%; + border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; + position: absolute; + bottom: 0; +} + +.cancel-control { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + width: 90%; + margin-top: 15rpx; +} + +.cancel-btn { + font-size: 35rpx; + color: black; + padding: 15rpx; +} + +.cancel-btn:last-child { + color: #9F1512; +} + +.cancel-remark { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + margin-top: 15rpx; + width: 87%; +} + +.cancel-title { + font-size: 32rpx; + color: black; +} + +.cancel-content { + font-size: 28rpx; + border-radius: 10rpx; + background: #f3f3f3; + height: 100rpx; + margin-top: 20rpx; + padding: 10rpx; + width: 95%; +} + +.cancel-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + padding: 10rpx; + margin-left: 20rpx; +} + +.cancel-item:first-child { + margin-top: 20rpx; +} + +.cancel-item image { + width: 30rpx; + height: 30rpx; +} + +.cancel-item .content { + font-size: 32rpx; + margin-left: 15rpx; + color: black; +} + +.shade-box { + background: #25252587; + width: 100%; + height: 100%; + z-index: 999999; + position: fixed; + top: 0; + left: 0; + +} \ No newline at end of file diff --git a/xz_mini/subpages/images/ic_add_circle_icon.png b/xz_mini/subpages/images/ic_add_circle_icon.png new file mode 100644 index 0000000..09f0577 Binary files /dev/null and b/xz_mini/subpages/images/ic_add_circle_icon.png differ diff --git a/xz_mini/subpages/images/ic_arrow_cir.png b/xz_mini/subpages/images/ic_arrow_cir.png new file mode 100755 index 0000000..e710ce5 Binary files /dev/null and b/xz_mini/subpages/images/ic_arrow_cir.png differ diff --git a/xz_mini/subpages/images/ic_cb_checked.png b/xz_mini/subpages/images/ic_cb_checked.png new file mode 100644 index 0000000..fec766e Binary files /dev/null and b/xz_mini/subpages/images/ic_cb_checked.png differ diff --git a/xz_mini/subpages/images/ic_cb_unchecked.png b/xz_mini/subpages/images/ic_cb_unchecked.png new file mode 100644 index 0000000..dd6618d Binary files /dev/null and b/xz_mini/subpages/images/ic_cb_unchecked.png differ diff --git a/xz_mini/subpages/images/ic_del_circle_icon.png b/xz_mini/subpages/images/ic_del_circle_icon.png new file mode 100644 index 0000000..477058a Binary files /dev/null and b/xz_mini/subpages/images/ic_del_circle_icon.png differ diff --git a/xz_mini/subpages/images/ic_divid_line_bottom.png b/xz_mini/subpages/images/ic_divid_line_bottom.png new file mode 100644 index 0000000..bc02cf1 Binary files /dev/null and b/xz_mini/subpages/images/ic_divid_line_bottom.png differ diff --git a/xz_mini/subpages/images/ic_edit_icon.png b/xz_mini/subpages/images/ic_edit_icon.png new file mode 100644 index 0000000..d691718 Binary files /dev/null and b/xz_mini/subpages/images/ic_edit_icon.png differ diff --git a/xz_mini/subpages/images/ic_goods_type_default.png b/xz_mini/subpages/images/ic_goods_type_default.png new file mode 100644 index 0000000..306f9e9 Binary files /dev/null and b/xz_mini/subpages/images/ic_goods_type_default.png differ diff --git a/xz_mini/subpages/images/ic_shop_car_icon.png b/xz_mini/subpages/images/ic_shop_car_icon.png new file mode 100644 index 0000000..b681f01 Binary files /dev/null and b/xz_mini/subpages/images/ic_shop_car_icon.png differ diff --git a/xz_mini/subpages/liverecord/liverecord.js b/xz_mini/subpages/liverecord/liverecord.js new file mode 100644 index 0000000..6905591 --- /dev/null +++ b/xz_mini/subpages/liverecord/liverecord.js @@ -0,0 +1,85 @@ +// subpages/liverecord/liverecord.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + planId: '', + liveUrl: app.liveUrl, + liveImgUrl: app.liveImgUrl, + liveList: [], + page: 1, + rows: 5, + hasMore: true, + isLoading: true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + planId: options.id + }) + this.getList(); + this.saveBigdata(options.id) + }, + saveBigdata(id) { + var params = "小程序" + id + "直播"; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), info, null, + function (code, data) { + + }, function (code, err) { + + }) + }, + getList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liverecord/listpageliverecordrelease/' + _self.data.planId, []), + { + page: _self.data.page, + rows: _self.data.rows + }, null, + function (code, data) { + _self.data.liveList = _self.data.liveList.concat(data.rows) + _self.setData({ + liveList: _self.data.liveList, + isLoading: false, + hasMore: _self.data.liveList.length < data.total + }) + wx.stopPullDownRefresh() + }, + function (code, err) { + app.dialog.msg('网络错误') + wx.stopPullDownRefresh() + _self.setData({ + isLoading: false + }) + }, + ) + }, + onReachBottom() { + var _self = this; + if (_self.data.hasMore) { + _self.setData({ + page: _self.data.page + 1 + }) + _self.getList() + } else { + app.dialog.msg('暂无更多数据了') + } + }, + onPullDownRefresh() { + this.setData({ + liveList: [], + page: 1, + hasMore: true + }) + this.getList() + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/liverecord/liverecord.json b/xz_mini/subpages/liverecord/liverecord.json new file mode 100644 index 0000000..7ad8a36 --- /dev/null +++ b/xz_mini/subpages/liverecord/liverecord.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/xz_mini/subpages/liverecord/liverecord.wxml b/xz_mini/subpages/liverecord/liverecord.wxml new file mode 100644 index 0000000..290f301 --- /dev/null +++ b/xz_mini/subpages/liverecord/liverecord.wxml @@ -0,0 +1,7 @@ + + + + + {{item.recordFileRecord}} + + \ No newline at end of file diff --git a/xz_mini/subpages/liverecord/liverecord.wxss b/xz_mini/subpages/liverecord/liverecord.wxss new file mode 100644 index 0000000..56a8c2b --- /dev/null +++ b/xz_mini/subpages/liverecord/liverecord.wxss @@ -0,0 +1,30 @@ +/* subpages/liverecord/liverecord.wxss */ +.video-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 95%; + padding: 20rpx 0rpx; +} + +.video-box video { + width: 100%; + height: 400rpx; + border-radius: 10rpx; + +} + +.txt { + color: #242424; + font-size: 28rpx; + margin-top: 10rpx; +} + +.page { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/xz_mini/subpages/orderconfirm/orderconfirm.js b/xz_mini/subpages/orderconfirm/orderconfirm.js new file mode 100644 index 0000000..1b5d34c --- /dev/null +++ b/xz_mini/subpages/orderconfirm/orderconfirm.js @@ -0,0 +1,154 @@ +// subpages/orderconfirm/orderconfirm.js +var app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + token: '', + imgUrl: app.shopImgUrl, + addressBean: {}, + hidePageLoading: false, + goodsList: [], + imgUrl: app.shopImgUrl, + remark: '', + totalPrice: 0, + carList: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + var _self = this; + _self.getToken().then(result => { + _self.getDefaultAddress(); + _self.getGoodsCar(); + }) + }, + getToken() { + var self = this; + return new Promise(resolve => { + wx.getStorage({ + key: 'token', + success(res) { + self.setData({ + token: res.data + }) + return resolve(); + } + }) + }) + }, + //获取默认地址 + getDefaultAddress() { + var _self = this; + app.restAjax.get(app.restAjax.path('{shopUrl}/app/shopaddress/getdefault', [app.shopUrl]), null, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (code == 200) { + _self.setData({ + addressBean: data, + hidePageLoading: true + }) + } + }, function (code, data) { + app.dialog.msg(data.msg) + _self.setData({ + hidePageLoading: true + }) + }); + }, + getGoodsCar() { + var _self = this; + var tempPrice = 0; + try { + var carList = wx.getStorageSync('carlist'); + console.log(carList) + if (carList) { + for (let i = 0; i < carList.length; i++) { + const item = carList[i]; + if (item.isCheck) { + _self.data.goodsList.push(item); + tempPrice = item.carAmount * item.goodsPrice + tempPrice; + } + } + _self.setData({ + carList: carList, + goodsList: _self.data.goodsList, + totalPrice: tempPrice + }) + } + } catch (error) { + + } + }, + inputRemark(e) { + var value = e.detail.value + this.setData({ + remark: value + }) + }, + doSelAddress() { + //选择地址 + wx.navigateTo({ + url: '/subpages/addresschoose/addresschoose', + }) + }, + checkParams() { + + }, + doConfirmOrder() { + var _self = this; + var tempList = []; + for (let i = 0; i < _self.data.goodsList.length; i++) { + const item = _self.data.goodsList[i]; + var tempItem = { + count: item.carAmount, + goodsId: item.goodsId, + goodsItemId: item.goodsStandarId, + }; + tempList.push(tempItem); + } + var saveBean = { + goodsItemList: tempList, + shopAddressId: _self.data.addressBean.shopAddressId, + words: _self.data.remark + }; + app.dialog.loading("下单中...") + app.restAjax.post(app.restAjax.path('{shopUrl}/app/order/savebycart', [app.shopUrl]), saveBean, { + headers: { + token: _self.data.token + } + }, function (code, data) { + wx.hideLoading() + if (code == 200) { + wx.showToast({ + title: '下单成功', + success() { + //删除购物车中的数据 + for (let i = _self.data.carList.length - 1; i >= 0; i--) { + const element = _self.data.carList[i]; + if (element.isCheck) { + _self.data.carList.splice(i, 1); + } + } + _self.setData({ + carList: _self.data.carList + }) + wx.setStorageSync('carlist', _self.data.carList) + setTimeout(function () { + wx.navigateBack() + }, 1000); + } + }) + } + }, function (code, data) { + app.dialog.msg(data.msg) + }); + } +}) \ No newline at end of file diff --git a/xz_mini/subpages/orderconfirm/orderconfirm.json b/xz_mini/subpages/orderconfirm/orderconfirm.json new file mode 100644 index 0000000..b41059d --- /dev/null +++ b/xz_mini/subpages/orderconfirm/orderconfirm.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "订单确认" +} \ No newline at end of file diff --git a/xz_mini/subpages/orderconfirm/orderconfirm.wxml b/xz_mini/subpages/orderconfirm/orderconfirm.wxml new file mode 100644 index 0000000..b7800ff --- /dev/null +++ b/xz_mini/subpages/orderconfirm/orderconfirm.wxml @@ -0,0 +1,51 @@ + + + + + 收货地址 + {{addressBean.areaName}} + + {{addressBean.shopAddressContent}} + + + + {{addressBean.shopAddressName}} {{addressBean.shopAddressPhone}} + + + + + + 确认商品 + + + + + + ¥{{item.goodsPrice}} + {{item.goodsStandarName}} + + + 销量{{item.goodsSalesVolume}} + {{item.goodsNotFreight ==1 ? '不包邮':'包邮'}} + + 数量:{{item.carAmount}} + + + + + + 留言 + + + + + + + ¥ + {{totalPrice}} + + 提交订单 + + + + \ No newline at end of file diff --git a/xz_mini/subpages/orderconfirm/orderconfirm.wxss b/xz_mini/subpages/orderconfirm/orderconfirm.wxss new file mode 100644 index 0000000..166a1c0 --- /dev/null +++ b/xz_mini/subpages/orderconfirm/orderconfirm.wxss @@ -0,0 +1,310 @@ +/* subpages/orderconfirm/orderconfirm.wxss */ +page { + background: #f2f2f2; +} + +.container-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + padding-bottom: 120rpx; +} + +.address-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + box-shadow: 10rpx 10rpx 20rpx #f2f2f2; + border-radius: 15rpx; + padding: 20rpx; + margin: 10rpx; + background: white; +} + +.address-area-name { + font-size: 32rpx; + margin-top: 20rpx; +} + +.address-area-content { + display: flex; + margin-top: 20rpx; + flex-direction: row; + justify-content: space-between; + align-items: center; + font-size: 40rpx; + width: 100%; +} + +.address-area-content .icon { + width: 48rpx; + height: 48rpx; +} + +.address-phone { + font-size: 32rpx; + margin-top: 20rpx; +} + +.line-img { + width: 100%; + height: 5rpx; + margin-top: 10rpx; +} + +.address-title { + font-size: 38rpx; + font-weight: bold; +} + +.goods-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + box-shadow: 10rpx 10rpx 20rpx #f2f2f2; + border-radius: 15rpx; + padding: 20rpx; + margin: 10rpx; + background: white; +} + +.goods-title { + font-size: 38rpx; + font-weight: bold; +} + + + +.goods { + display: flex; + flex-direction: row; + justify-content: flex-start; + margin-left: 20rpx; +} + +.goods-img { + width: 180rpx; + height: 160rpx; +} + +.goods-item { + display: flex; + flex-direction: row; + justify-content: flex-start; + margin-top: 15rpx; +} + +.goods-content { + margin: 0rpx 10rpx; + flex: 1; +} + +.goods-price { + color: #9f1512; + font-size: 40rpx; +} + +.goods-count { + color: #9f1512; + font-size: 40rpx; +} + +.goods-name { + font-size: 32rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.goods-unit-price { + font-size: 40rpx; + color: #9f1512; + margin-top: 10rpx; +} + +.goods-standard { + margin-top: 10rpx; + font-size: 32rpx; + border: 1rpx solid #9f1512; + border-radius: 3rpx; + color: #9f1512; + width: fit-content; + max-width: fit-content; + padding: 0rpx 10rpx; +} + +.goods-type-box { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin-top: 20rpx; +} + +.goods-type-box image { + width: 48rpx; + height: 48rpx; +} + +.goods-type { + color: #9f1512; + font-size: 25rpx; + border: 1rpx solid #9f1512; + padding: 0rpx 10rpx; + text-align: center; +} + +.goods-type:last-child { + margin-left: 20rpx; +} + +.type-box { + display: flex; + flex-direction: row; + width: 50%; + justify-content: flex-start; + align-items: center; +} + +.add-del-box { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.add-del-box .txt { + font-size: 35rpx; + padding: 0rpx 15rpx; +} + +.control-box { + width: 50%; + display: flex; + flex-direction: row; + justify-content: space-around; +} + + +.remark-box { + display: flex; + flex-direction: column; + width: 100%; + font-size: 32rpx; +} + +.remark-input { + height: 180rpx; + background: #f2f2f2; + border-radius: 20rpx; + margin-top: 20rpx; + padding-top: 10rpx; +} + + + +.bottom-box { + display: flex; + flex-direction: column; + background: white; + position: fixed; + bottom: 0; + left: 0; + width: 100%; + +} + +.goods-price { + color: #9f1512; + font-size: 40rpx; +} + +.bottom-content { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + margin: 15rpx 25rpx 15rpx 25rpx; +} + +.bottom-price { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: baseline; + color: #e70606; + text-align: center; + font-weight: bold; +} + +.price-icon { + font-size: 30rpx; +} + +.price-content { + font-size: 55rpx; +} + + +.icon-btn { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.car-icon { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 30rpx; +} + +.car-icon image { + width: 48rpx; + height: 48rpx; + align-items: center; + align-self: center; + margin-left: 25rpx; + margin-top: 10rpx; +} + +.car { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; +} + +.car-num { + position: relative; + right: 10rpx; + top: -10rpx; + background: #e70606; + color: white; + width: 48rpx; + height: 48rpx; + border-radius: 50%; + text-align: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-size: 25rpx; +} + +.car-add { + background: linear-gradient(to right bottom, rgb(245, 74, 74), rgb(221, 5, 5) 70px); + color: white; + padding: 15rpx; + border-radius: 10rpx; + margin-left: 20rpx; + font-size: 32rpx; +} \ No newline at end of file diff --git a/xz_mini/subpages/search/commonSearch.js b/xz_mini/subpages/search/commonSearch.js new file mode 100644 index 0000000..cf1e7df --- /dev/null +++ b/xz_mini/subpages/search/commonSearch.js @@ -0,0 +1,470 @@ +// subpages/search/commonSearch.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + // (网页|安卓|小程序)[a-zA-Z0-9-]{36}(新闻|活动|非遗|场馆|直播|志愿) 我后台正则是这样的 + tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + currentIndex: 0, + keywords: '', + newsList: [],//新闻 + activityList: [],//活动 + legacyList: [],//非遗 + placeList: [],//场馆 + liveList: [],//直播 + volumerList: [],//志愿者活动 + isLoading: false,//是否正在加载 + isInit: true,//初始化搜索 + imgUrl: app.imgUrl, + url: app.newsUrl, + liveUrl: app.liveUrl, + liveImgUrl: app.liveImgUrl, + page: 1, + rows: 10, + hasMore: true, + latitude: '', + longitude: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getLocation(); + }, + changeTab(e) { + var _self = this; + var index = e.currentTarget.dataset.index; + this.setData({ + currentIndex: index, + hasMore: true + }) + //刷新 + if (_self.data.keywords != '') { + _self.setData({ + isLoading: true, + page: 1, + isInit: false + }) + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + switch (_self.data.currentIndex) { + case 0: + _self.setData({ + newsList: [], + }) + _self.getNewsList() + _self.doSaveKeyword('新闻') + break; + case 1: + _self.setData({ + activityList: [], + }) + _self.getActivityList() + _self.doSaveKeyword('活动') + break; + case 2: + _self.setData({ + legacyList: [] + }) + _self.getLegacyList() + _self.doSaveKeyword('非遗') + break; + case 3: + _self.setData({ + placeList: [] + }) + _self.getPlaceList() + _self.doSaveKeyword('场馆') + break; + case 4: + _self.setData({ + liveList: [] + }) + _self.getLiveList() + _self.doSaveKeyword('直播') + break; + case 5: + _self.setData({ + volumerList: [] + }) + _self.getVolumerList() + _self.doSaveKeyword('志愿') + break; + } + } + }, + //新闻详情 + goNewsDetail: function (event) { + wx.navigateTo({ + url: '/pages/newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId + }) + }, + //活动详情 + goDetail: function (e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/activityDetail/activityDetail?id=' + id + }) + }, + //非遗详情 + legacyDetail(e) { + wx.navigateTo({ + url: '/pages/cultureDetail/cultureDetail?libraryId=' + e.currentTarget.dataset.libraryId, + }) + }, + //场馆详情 + placeDetail: function (options) { + var venuesInfoId = options.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/venueDetail/venueDetail?venuesInfoId=' + venuesInfoId, + }) + }, + volumerDetail(e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/serviceActivityDetail/serviceActivityDetail?id=' + id + }) + }, + //直播点播详情 + detailLive(event) { + //判断是直播还是录播 + var item = event.currentTarget.dataset.id; + if ('0' == item.liveStatus) { + //直播回放 + wx.navigateTo({ + url: '/subpages/liverecord/liverecord?id=' + item.livePlanId, + }) + } else if ('2' == item.liveStatus) { + //直播中 + wx.navigateTo({ + url: '/pages/broadcastDetail/broadcastDetail?livePlanId=' + event.currentTarget.dataset.id.livePlanId, + }) + } else { + //未开始 + } + }, + //输入监听 + inputKeywords(e) { + this.setData({ + keywords: e.detail.value + }) + if (e.detail.value == '') { + this.setData({ + isInit: true + }) + } + }, + //搜索 + doSearch() { + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + var _self = this; + if (_self.data.keywords == '') { + wx.showToast({ + icon: 'error', + title: '请输入关键词', + }) + } else { + _self.setData({ + isLoading: true, + page: 1, + isInit: false, + hasMore: true + }) + switch (_self.data.currentIndex) { + case 0: + _self.setData({ + newsList: [], + }) + _self.getNewsList() + _self.doSaveKeyword('新闻') + break; + case 1: + _self.setData({ + activityList: [], + }) + _self.getActivityList() + _self.doSaveKeyword('活动') + break; + case 2: + _self.setData({ + legacyList: [] + }) + _self.getLegacyList() + _self.doSaveKeyword('非遗') + break; + case 3: + _self.setData({ + placeList: [] + }) + _self.getPlaceList() + _self.doSaveKeyword('场馆') + break; + case 4: + _self.setData({ + liveList: [] + }) + _self.getLiveList() + _self.doSaveKeyword('直播') + break; + case 5: + _self.setData({ + volumerList: [] + }) + _self.getVolumerList() + _self.doSaveKeyword('志愿') + break; + } + } + }, + //获取新闻 + getNewsList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/newscontent/listpagenewscontentrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.data.newsList = _self.data.newsList.concat(data.rows) + _self.setData({ + newsList: _self.data.newsList, + isLoading: false, + hasMore: _self.data.newsList.length < data.total + }) + }, + function (code, err) { + //加载失败 + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取活动 + getActivityList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/activitylibrary/listpageactivitylibraryfornetrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + for (var item of data.rows) { + if ('' != item.activityImage) { + item.activityImage = _self.data.imgUrl + item.activityImage; + } + } + _self.data.activityList = _self.data.activityList.concat(data.rows) + _self.setData({ + activityList: _self.data.activityList, + isLoading: false, + hasMore: _self.data.activityList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取非遗 + getLegacyList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/intangiblelibrary/listpageintangiblelibraryrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + for (var i = 0, item; item = data.rows[i++];) { + item.libraryApplyTime = item.libraryApplyTime.substring(0, item.libraryApplyTime.length - 10); + item.libraryCoverArray = item.libraryCover.split(','); + } + _self.data.legacyList = _self.data.legacyList.concat(data.rows) + _self.setData({ + legacyList: _self.data.legacyList, + isLoading: false, + hasMore: _self.data.legacyList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取场馆 + getPlaceList() { + var _self = this; + + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/venuesinfo/listpagevenuesinforelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords, + latitude: _self.data.latitude, + longitude: _self.data.longitude + }, null, + function (code, data) { + data.rows.forEach(element => { + element.venuePanorama = element.venuePanorama.split(',')[0]; + if (element.apart >= 1000) { + element.apart = (element.apart / 1000).toFixed(2) + 'km'; + } else { + element.apart += 'm'; + } + }); + _self.data.placeList = _self.data.placeList.concat(data.rows) + _self.setData({ + placeList: _self.data.placeList, + isLoading: false, + hasMore: _self.data.placeList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取直播 + getLiveList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liveplan/listpageliveplanrelease/', []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.data.liveList = _self.data.liveList.concat(data.rows) + _self.setData({ + liveList: _self.data.liveList, + isLoading: false, + hasMore: _self.data.liveList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取志愿者活动 + getVolumerList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/volunteerservice/listpagevolunteerservicerelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.setData({ + isLoading: false, + hasMore: false + }) + for (var item of data.rows) { + if ('' != item.photo) { + var photoArr = item.photo.split(","); + item.photo = app.imgUrl + photoArr[0]; + } + } + _self.data.volumerList = _self.data.volumerList.concat(data.rows) + _self.setData({ + volumerList: _self.data.volumerList, + isLoading: false, + hasMore: _self.data.volumerList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取定位 + getLocation: function () { + var self = this; + wx.getLocation({ + type: 'gcj02', + success: function (res) { + self.setData({ + latitude: res.latitude, + longitude: res.longitude + }) + }, + complete: function () { + } + }) + }, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + var _self = this; + if (_self.data.hasMore) { + if (!_self.data.isInit) { + _self.setData({ + page: _self.data.page + 1, + isInit: false + }) + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + switch (_self.data.currentIndex) { + case 0: + _self.getNewsList() + break; + case 1: + _self.getActivityList() + break; + case 2: + _self.getLegacyList() + break; + case 3: + _self.getPlaceList() + break; + case 4: + _self.getLiveList() + break; + case 5: + _self.getVolumerList() + break; + } + } + } else { + app.dialog.msg('暂无更多数据了') + } + }, + doSaveKeyword(type) { + var _self = this; + var params = "小程序" + _self.data.keywords + type + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), + { + requestUrl: params + }, null, + function (code, data) { + + }, + function (code, err) { + }, + ) + } + +}) \ No newline at end of file diff --git a/xz_mini/subpages/search/commonSearch.json b/xz_mini/subpages/search/commonSearch.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/xz_mini/subpages/search/commonSearch.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/subpages/search/commonSearch.wxml b/xz_mini/subpages/search/commonSearch.wxml new file mode 100644 index 0000000..a4f7cbe --- /dev/null +++ b/xz_mini/subpages/search/commonSearch.wxml @@ -0,0 +1,222 @@ + + + + + + + + + {{item}} + + + + + + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + + 暂无数据 + + + + + + + + + + + + {{item.activityTitle}} + 报名中 + 报名人数已满 + 停止报名 + 进行中 + 直接进入 + 已结束 + + {{item.activityStartTime}}至{{item.activityEndTime}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.libraryTitle}} + + {{item.libraryApplyTime}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.venueName}} + 距离:{{item.apart == '0' ? '未知' : item.apart}} + + 营业时间:{{item.businessHours}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.livePlanName}} + 未开始 + 直播回放 + 直播中 + + {{item.livePlanStart}}至{{item.livePlanEnd}} + + + + + + 暂无数据 + + + + + + + + + 报名中 + 已报名 + 停止报名 + 进行中 + 已结束 + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + + + + + + 暂无数据 + + + + + + 加载中... + + + + 请输入关键词 + \ No newline at end of file diff --git a/xz_mini/subpages/search/commonSearch.wxss b/xz_mini/subpages/search/commonSearch.wxss new file mode 100644 index 0000000..90d8fa5 --- /dev/null +++ b/xz_mini/subpages/search/commonSearch.wxss @@ -0,0 +1,404 @@ +.top-tab { + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + overflow-x: hidden; + z-index: 100; +} + +.search-box { + background: #f2f2f2; + border-radius: 30rpx; + padding: 5rpx; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin: 20rpx 30rpx; +} + +.search-box image { + width: 32rpx; + height: 32rpx; + margin-left: 20rpx; +} + +.search-box input { + font-size: 28rpx; + color: #242424; + margin-left: 20rpx; + width: 100%; +} + +.type { + display: flex; + /* overflow-x: auto; */ + /* 隐藏滚动条 */ + /* scrollbar-width: none; */ + /* firefox */ + /* -ms-overflow-style: none; */ + /* IE 10+ */ + margin-left: 20rpx; +} + +.tab-box { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + width: 13%; + min-width: fit-content; + position: relative; + height: 60rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; +} + +.sel-line { + background-color: #9F1512; + width: 50%; + height: 5rpx; + border-radius: 3rpx; +} + +.tab-box.active { + color: #9F1512; +} + +.tab-box image { + width: 20rpx; + height: 40rpx; +} + +.tab-box .txt { + padding: 0rpx 10rpx; + width: 100%; + text-align: center; +} + +.tab-box .txt-active { + color: #9F1512; +} + +.tab-box.active image { + display: block; +} + +.tab-box image.selected-l { + left: 20rpx; +} + +.tab-box image.selected-r { + right: 20rpx; +} + +.search-init { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: #ffffff; +} + +.loading-page { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: white; +} + +.loading-page image { + width: 80rpx; + height: 80rpx; +} + +.search-init image { + width: 80rpx; + height: 80rpx; +} + +.loading-page text { + font-size: 28rpx; + margin-top: 20rpx; + color: #949494; +} + +.search-init text { + font-size: 28rpx; + margin-top: 20rpx; + color: #949494; +} + +/* =================================新闻======================================= */ + +.news { + padding: 30rpx; + border-bottom: 5px solid #FBFBFB; +} + +.news-box { + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} + +.news-title { + color: #242424; + font-size: 30rpx; + font-weight: bold; +} + +.news-info { + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} + +.news-info text { + margin-right: 20rpx; +} + +.voice-box { + padding-right: 30px; + position: relative; +} + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; +} + +.news-big-pic, +.news-small-pic { + margin-top: 10rpx; +} + +.news-big-pic { + position: relative; +} + +.news-big-pic image { + width: 100%; + height: 380rpx; +} + +.news-big-pic image.play-btn { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80rpx; + height: 80rpx; +} + +.news-small-pic image { + width: 30%; + height: 150rpx; + margin-right: 20rpx; +} + +.transverse-news { + flex-direction: row; + justify-content: space-between; +} + +.news-row-img { + width: 30%; + height: 150rpx; +} + +.news-row-img image { + width: 100%; + height: 100%; +} + +.news-row-info { + width: 68%; +} + +/* end */ + +/* 活动 */ +.activity { + padding: 20rpx 30rpx 0; +} + +.activity-box { + margin-bottom: 20rpx; + box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; +} + +.activity-img { + height: 320rpx; + position: relative; +} + +.activity-img image { + width: 100%; + height: 100%; +} + +.corner { + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; +} + +.corner view { + padding: 0 10rpx; + background: rgba(0, 0, 0, 0.6); + line-height: 40rpx; + vertical-align: middle; + display: flex; + align-items: center; + border-radius: 5rpx; +} + +.view-count { + margin-right: 20rpx; +} + +.view-count image { + width: 40rpx; + height: 40rpx; +} + +.activity-info { + padding: 15rpx 20rpx; +} + +.title { + display: flex; + justify-content: space-between; +} + +.activity-title { + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 32rpx; + color: #242424; + line-height: 40rpx; +} + +.sign { + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; + font-size: 28rpx; +} + +.date { + margin-top: 10rpx; + font-size: 24rpx; + color: #242424; +} + + +/* end */ + +/* ====================场馆==================== */ + +.venue { + height: 400rpx; + padding: 0 30rpx; +} + +.venue-box { + box-shadow: 0 0 17rpx 0 rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; + margin-bottom: 15rpx; +} + +.venue-img, +.venue-img image { + width: 100%; + height: 315rpx; +} + +.venue-info { + padding: 15rpx 20rpx; +} + +.name-distance { + display: flex; + justify-content: space-between; + height: 35rpx; + line-height: 35rpx; +} + +.name { + font-size: 32rpx; + width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.distance { + padding: 0 10rpx; + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + font-size: 28rpx; +} + +.time { + font-size: 28rpx; + color: #242424; + margin-top: 10rpx; +} + +/* =end= */ + +.empty-box { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: white; +} + +.empty-box image { + width: 128rpx; + height: 96rpx; +} + +.empty-box text { + font-size: 28rpx; + margin-top: 20rpx; + color: gray; +} \ No newline at end of file diff --git a/xz_mini/subpages/webcontentview/webcontent.js b/xz_mini/subpages/webcontentview/webcontent.js new file mode 100644 index 0000000..c0704dc --- /dev/null +++ b/xz_mini/subpages/webcontentview/webcontent.js @@ -0,0 +1,19 @@ +// subpages/webcontentview/webcontent.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + webUrl: "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + webUrl: options.url + }) + }, +}) \ No newline at end of file diff --git a/xz_mini/subpages/webcontentview/webcontent.json b/xz_mini/subpages/webcontentview/webcontent.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/xz_mini/subpages/webcontentview/webcontent.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/xz_mini/subpages/webcontentview/webcontent.wxml b/xz_mini/subpages/webcontentview/webcontent.wxml new file mode 100644 index 0000000..7bb428d --- /dev/null +++ b/xz_mini/subpages/webcontentview/webcontent.wxml @@ -0,0 +1,2 @@ + + diff --git a/xz_mini/subpages/webcontentview/webcontent.wxss b/xz_mini/subpages/webcontentview/webcontent.wxss new file mode 100644 index 0000000..9c1fc6e --- /dev/null +++ b/xz_mini/subpages/webcontentview/webcontent.wxss @@ -0,0 +1 @@ +/* subpages/webcontentview/webcontent.wxss */ \ No newline at end of file diff --git a/xz_mini/utils/dialog.js b/xz_mini/utils/dialog.js new file mode 100644 index 0000000..ef95156 --- /dev/null +++ b/xz_mini/utils/dialog.js @@ -0,0 +1,15 @@ +function msg(text) { + wx.showToast({ + title: text, + icon: 'none', + duration: 1000 + }) +} +function loading(msg) { + wx.showLoading({ + title: msg, + mask: true + }) +} +module.exports.msg = msg; +module.exports.loading = loading; \ No newline at end of file diff --git a/xz_mini/utils/restAjax.js b/xz_mini/utils/restAjax.js new file mode 100644 index 0000000..b882982 --- /dev/null +++ b/xz_mini/utils/restAjax.js @@ -0,0 +1,235 @@ +var methods = { + POST_METHOD: 'POST', + DELETE_METHOD: 'DELETE', + PUT_METHOD: 'PUT', + GET_METHOD: 'GET' +}; + +/** + * 新增 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function postJson(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.POST_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 删除 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function deleteForm(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.DELETE_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 修改 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function putJson(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.PUT_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 查询 + * @param url + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function getForm(url, dataObj, args, successCallback, errorCallback, completeCallback) { + doAjax(url, methods.GET_METHOD, dataObj, args, successCallback, errorCallback, completeCallback); +} + +/** + * 执行上传 + * @param url + * @param method + * @param dataObj + * @param args + * @param successCallback + * @param errorCallback + * @param completeCallback + */ +function doAjax(url, method, dataObj, args, successCallback, errorCallback, completeCallback) { + var headers = {}; + if (args != null && typeof (args.headers) != 'undefined' && args.headers != null) { + headers = args.headers; + } + wx.request({ + url: url, + method: method, + data: dataObj, + header: headers, + dataType: 'json', + success: function (response) { + if (response.statusCode == 200) { + successCallback(response.statusCode, response.data, args); + } else { + if (errorCallback && typeof (errorCallback) == 'function') { + errorCallback(response.statusCode, response.data); + } + } + }, + fail: function (response) { + console.log(response); + }, + complete: function () { + if (completeCallback && typeof (completeCallback) == 'function') { + completeCallback(); + } + } + }) +} + +/** + * 检测是路径参数有重复值 + * @param pathArgArray + * @returns {boolean} + */ +function pathArgsHasSameValue(pathArgArray) { + var tempArgIndex = 0; + var tempArgs = pathArgArray[tempArgIndex]; + for (var i = (tempArgIndex + 1), item; item = pathArgArray[i]; i++) { + if (tempArgs == item) { + throw new Error('参数' + item + '有重复值!!!'); + } + if (i == pathArgArray.length - 1) { + tempArgs = pathArgArray[++tempArgIndex]; + i = tempArgIndex; + continue; + } + } +} + +/** + * 获取页面间传递的参数 + * @param url + */ +function getParamsArg(url) { + var params = url.split('?')[1]; + var paramsObj = {}; + if (typeof (params) == 'undefined' || params == null) { + return paramsObj; + } + var paramsKVs = params.split('&'); + for (var i = 0, item = null; item = paramsKVs[i++];) { + var kvs = item.split('='); + if (kvs.length == 1) { + paramsObj[kvs[0]] = null; + } + if (kvs.length == 2) { + paramsObj[kvs[0]] = decodeURI(kvs[1]); + } + } + return paramsObj; +} + +/** + * 构建路径 + * @param basePath 请求路径,{参数}, + * @param pathArgs 替换的路径参数,不能重复 + * @returns {*} + */ +function buildPath(basePath, pathArgs) { + var path = basePath; + if (!basePath || !(typeof (basePath) == 'string')) { + throw new Error('basePath必须为字符串!!!'); + } + if (!pathArgs || !Array.isArray(pathArgs)) { + throw new Error('pathArgs必须为数组!!!'); + } + var pathArgArray = basePath.match(/\{\w+\}/g); + if (!pathArgArray) { + return path; + } + pathArgsHasSameValue(pathArgArray); + for (var i = 0, item; item = pathArgArray[i]; i++) { + path = path.replace(item, pathArgs[i]); + } + return path; +} + +/** + * 通过form对象上传文件 + * @param url + * @param formData + * @param args + * @param successCallback + * @param errorCallback + * @param beforeCallback + * @param completeCallback + */ +function postFile(url, path, name, args, successCallback, errorCallback, completeCallback) { + var headers = {}; + if (args != null && typeof (args.headers) != 'undefined' && args.headers != null) { + headers = args.headers; + } + wx.uploadFile({ + filePath: path, + name: name, + url: url, + header: headers, + success: function (response) { + if (response.statusCode == 200) { + successCallback(response.statusCode, response.data, args); + } else { + if (errorCallback && typeof (errorCallback) == 'function') { + errorCallback(response.statusCode, response.data); + } + } + }, + fail: function (response) { + console.log(response); + }, + complete: function () { + if (completeCallback && typeof (completeCallback) == 'function') { + completeCallback(); + } + } + }) +}; + +/** + * xss 转义 + * @param html + * @returns {string} + */ +function escape(html) { + return String(html || '').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&') + .replace(//g, '>') + .replace(/'/g, ''').replace(/"/g, '"'); +} + +module.exports.post = postJson; +module.exports.delete = deleteForm; +module.exports.put = putJson; +module.exports.get = getForm; +module.exports.params = getParamsArg; +module.exports.path = buildPath; +module.exports.escape = escape; +module.exports.file = postFile; +// module.exports.baseUrl='http://v3.xzszwhy.cn/xzszwhy'; +// module.exports.url="http://v3.xzszwhy.cn/"; +module.exports.baseUrl = 'https://www.xzszwhy.cn/xzszwhy'; +module.exports.url = "https://www.xzszwhy.cn/"; +module.exports.wssUrl="wss://www.xzszwhy.cn/xzszwhy"; + +// module.exports.baseUrl = 'http://192.168.0.120:8081/xzszwhy'; +// module.exports.url = "http://192.168.0.120:8081/"; \ No newline at end of file diff --git a/xz_mini/utils/util.js b/xz_mini/utils/util.js new file mode 100644 index 0000000..9ff37b1 --- /dev/null +++ b/xz_mini/utils/util.js @@ -0,0 +1,43 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') +} + +/** + * + * @param {*} date + */ +const formatDate = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + + return [year, month, day].map(formatNumber).join('-') +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : '0' + n +} + +function indexOf(str, val) { + if (str.indexOf(val) != -1) { + return true; + } else { + return false; + } +} +function formatDuration(){ + +} +module.exports = { + formatTime: formatTime, + formatDate: formatDate, + indexOf: indexOf +} \ No newline at end of file diff --git a/xz_mini/utils/utils.wxs b/xz_mini/utils/utils.wxs new file mode 100644 index 0000000..197cf9b --- /dev/null +++ b/xz_mini/utils/utils.wxs @@ -0,0 +1,42 @@ +function indexOf(str, val) { + if (str.indexOf(val) != -1) { + return true; + } else { + return false; + } +} + +function formatCount(count){ + var counter = parseInt(count) + if(counter > 100000000){ + return (counter / 100000000).toFixed(1) + '亿' + }else if(counter > 10000){ + return (counter / 10000).toFixed(1) + '万' + }else{ + return counter + } + } + + // 12->12 5->05 + function padLeftZero(str){ + str = str + '' + return ("00" + str).slice(str.length) + } + + function formatDuration(duration, isMilliseconds) { + isMilliseconds = isMilliseconds === undefined + if (isMilliseconds) { + duration = duration / 1000 + } + + var minute = Math.floor(duration / 60) + var second = Math.floor(duration) % 60 + + return padLeftZero(minute) + ":" + padLeftZero(second) + } + +module.exports = { + indexOf: indexOf, + formatCount:formatCount, + formatDuration:formatDuration +} \ No newline at end of file diff --git a/xz_mini/webview/flv/css/reset.css b/xz_mini/webview/flv/css/reset.css new file mode 100644 index 0000000..210501e --- /dev/null +++ b/xz_mini/webview/flv/css/reset.css @@ -0,0 +1 @@ +@charset "utf-8";a,body,dd,div,dl,dt,em,form,h1,h2,h3,h4,h5,h6,img,input,li,ol,option,p,select,span,strong,table,td,textarea,th,ul,var{margin:0;padding:0}body,html{font:400 100% "微软雅黑",Arail,Tabhoma;text-align:left;color:#535353;-webkit-font-smoothing:antialiased;line-height:normal}ol,ul{list-style:none}img{border:0;vertical-align:top}input,select,textarea{outline:0}textarea{resize:none}table{border-collapse:collapse;border-spacing:0}em,strong,th,var{font-weight:400;font-style:normal}a{text-decoration:none;color:#555}a,input{-webkit-tap-highlight-color:transparent}[v-cloak]{display: none} \ No newline at end of file diff --git a/xz_mini/webview/flv/css/style.css b/xz_mini/webview/flv/css/style.css new file mode 100644 index 0000000..91c4715 --- /dev/null +++ b/xz_mini/webview/flv/css/style.css @@ -0,0 +1,27 @@ +.video{ + width: 100%; + height: 4.75rem; + position: fixed; + top: 0; + left: 0; + right: 0; +} +.video video{ + width: 100%; + height: 100%; + background: #000; +} +.video-list{ + margin-top: 4.75rem; +} +.video-list ul li{ + padding: 0 .2rem; + line-height: 1rem; + border-bottom: 1px solid #DEDEDE; + font-size: .32rem; + color: #000; + cursor: pointer; +} +[v-cloak] { + display: none; +} \ No newline at end of file diff --git a/xz_mini/webview/flv/index.html b/xz_mini/webview/flv/index.html new file mode 100644 index 0000000..4f4fedf --- /dev/null +++ b/xz_mini/webview/flv/index.html @@ -0,0 +1,135 @@ + + + + + + 直播历史 + + + + + +
+
+ +
+
+
    +
  • {{index+1}}.{{liveRecord.recordFileName}}
  • +
+
+
+ + + + + + + diff --git a/xz_mini/webview/flv/js/flv.min.js b/xz_mini/webview/flv/js/flv.min.js new file mode 100644 index 0000000..cc07cf1 --- /dev/null +++ b/xz_mini/webview/flv/js/flv.min.js @@ -0,0 +1,7 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.flvjs=e()}}(function(){var e;return function e(t,n,i){function r(a,o){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var d=n[a]={exports:{}};t[a][0].call(d.exports,function(e){var n=t[a][1][e];return r(n||e)},d,d.exports,e,t,n,i)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},i.prototype.removeListener=function(e,t){var n,i,s,o;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(o=s;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],3:[function(e,t,n){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function s(e){if(h===setTimeout)return setTimeout(e,0);if((h===i||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function o(){p&&_&&(p=!1,_.length?m=_.concat(m):v=-1,m.length&&u())}function u(){if(!p){var e=s(o);p=!0;for(var t=m.length;t;){for(_=m,m=[];++v1)for(var n=1;n=e[r]&&t0&&e[0].originalDts=t[r].dts&&et[i].lastSample.originalDts&&e=t[i].lastSample.originalDts&&(i===t.length-1||i0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}()},{}],9:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0&&(i+=";codecs="+n.codec);var r=!1;if(l.default.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[n.type]=n,i!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])l.default.v(this.TAG,"Notice: "+n.type+" mimeType changed, origin: "+this._mimeTypes[n.type]+", target: "+i);else{r=!0;try{var s=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(i);s.addEventListener("error",this.e.onSourceBufferError),s.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return l.default.e(this.TAG,e.message),void this._emitter.emit(c.default.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=i}t||this._pendingSegments[n.type].push(n),r||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),h.default.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(e){l.default.e(this.TAG,e.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var r=0;r=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var i=n.buffered,r=!1,s=0;s=this._config.autoCleanupMaxBackwardDuration){r=!0;var u=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:u})}}else o0&&(isNaN(t)||n>t)&&(l.default.v(this.TAG,"Update MediaSource duration from "+t+" to "+n),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var i=n.shift();t.remove(i.start,i.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var n=e[t].shift();if(n.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,r=n.timestampOffset/1e3,s=Math.abs(i-r);s>.1&&(l.default.v(this.TAG,"Update MPEG audio timestampOffset from "+i+" to "+r),this._sourceBuffers[t].timestampOffset=r),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(c.default.BUFFER_FULL),this._isBufferFull=!0):(l.default.e(this.TAG,e.message),this._emitter.emit(c.default.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(l.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(c.default.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){l.default.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){l.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(c.default.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){l.default.e(this.TAG,"SourceBuffer Error: "+e)}}]),e}();n.default=p},{"../utils/browser.js":39,"../utils/exception.js":40,"../utils/logger.js":41,"./media-segment-info.js":8,"./mse-events.js":10,events:2}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};n.default=i},{}],11:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((i=m.default.probe(e)).match){this._demuxer=new m.default(i,this._config),this._remuxer||(this._remuxer=new v.default(this._config));var s=this._mediaDataSource;void 0==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),"boolean"==typeof s.hasAudio&&(this._demuxer.overridedHasAudio=s.hasAudio),"boolean"==typeof s.hasVideo&&(this._demuxer.overridedHasVideo=s.hasVideo),this._demuxer.timestampBase=s.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else i=null,l.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){n._internalAbort()}),this._emitter.emit(k.default.DEMUX_ERROR,y.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,c.default.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,c.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then(function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)})}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e,n=t+1;n0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(k.default.RECOMMEND_SEEKPOINT,i)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(k.default.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(k.default.STATISTICS_INFO,e)}}]),e}());n.default=L},{"../demux/demux-errors.js":16,"../demux/flv-demuxer.js":18,"../io/io-controller.js":23,"../io/loader.js":24,"../remux/mp4-remuxer.js":38,"../utils/browser.js":39,"../utils/logger.js":41,"./media-info.js":7,"./transmuxing-events.js":13,events:2}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};n.default=i},{}],14:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("../utils/logger.js"),s=(i(r),e("../utils/logging-control.js")),a=i(s),o=e("../utils/polyfill.js"),u=i(o),l=e("./transmuxing-controller.js"),d=i(l),h=e("./transmuxing-events.js"),f=i(h),c=function(e){function t(t,n){var i={msg:f.default.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function n(t,n){var i={msg:f.default.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function i(){var t={msg:f.default.LOADING_COMPLETE};e.postMessage(t)}function r(){var t={msg:f.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function s(t){var n={msg:f.default.MEDIA_INFO,data:t};e.postMessage(n)}function o(t){var n={msg:f.default.STATISTICS_INFO,data:t};e.postMessage(n)}function l(t,n){e.postMessage({msg:f.default.IO_ERROR,data:{type:t,info:n}})}function h(t,n){e.postMessage({msg:f.default.DEMUX_ERROR,data:{type:t,info:n}})}function c(t){e.postMessage({msg:f.default.RECOMMEND_SEEKPOINT,data:t})}function _(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}var m=null,p=_.bind(this);u.default.install(),e.addEventListener("message",function(u){switch(u.data.cmd){case"init":m=new d.default(u.data.param[0],u.data.param[1]),m.on(f.default.IO_ERROR,l.bind(this)),m.on(f.default.DEMUX_ERROR,h.bind(this)),m.on(f.default.INIT_SEGMENT,t.bind(this)),m.on(f.default.MEDIA_SEGMENT,n.bind(this)),m.on(f.default.LOADING_COMPLETE,i.bind(this)),m.on(f.default.RECOVERED_EARLY_EOF,r.bind(this)),m.on(f.default.MEDIA_INFO,s.bind(this)),m.on(f.default.STATISTICS_INFO,o.bind(this)),m.on(f.default.RECOMMEND_SEEKPOINT,c.bind(this));break;case"destroy":m&&(m.destroy(),m=null),e.postMessage({msg:"destroyed"});break;case"start":m.start();break;case"stop":m.stop();break;case"seek":m.seek(u.data.param);break;case"pause":m.pause();break;case"resume":m.resume();break;case"logging_config":var _=u.data.param;a.default.applyConfig(_),!0===_.enableCallback?a.default.addLogListener(p):a.default.removeLogListener(p)}})};n.default=c},{"../utils/logger.js":41,"../utils/logging-control.js":42,"../utils/polyfill.js":43,"./transmuxing-controller.js":12,"./transmuxing-events.js":13}],15:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?(0,l.default)(new Uint8Array(e,t+2,r)):"",{data:s,size:2+r}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new d.IllegalStateException("Data not enough when parse LongString");var i=new DataView(e,t,n),r=i.getUint32(0,!h),s=void 0;return s=r>0?(0,l.default)(new Uint8Array(e,t+4,r)):"",{data:s,size:4+r}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new d.IllegalStateException("Data size invalid when parse Date");var i=new DataView(e,t,n),r=i.getFloat64(0,!h);return r+=60*i.getInt16(8,!h)*1e3,{data:new Date(r),size:10}}},{key:"parseValue",value:function(t,n,i){if(i<1)throw new d.IllegalStateException("Data not enough when parse Value");var r=new DataView(t,n,i),s=1,a=r.getUint8(0),u=void 0,l=!1;try{switch(a){case 0:u=r.getFloat64(1,!h),s+=8;break;case 1:u=!!r.getUint8(1),s+=1;break;case 2:var f=e.parseString(t,n+1,i-1);u=f.data,s+=f.size;break;case 3:u={};var c=0;for(9==(16777215&r.getUint32(i-4,!h))&&(c=3);s32)throw new s.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,n=n<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}();n.default=a},{"../utils/exception.js":40}],18:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n13))return 0;i=e.probe(t).dataOffset}if(this._firstParse){this._firstParse=!1,n+i!==this._dataOffset&&l.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");0!==new DataView(t,i).getUint32(0,!r)&&l.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}for(;it.byteLength)break;var a=s.getUint8(0),o=16777215&s.getUint32(0,!r);if(i+11+o+4>t.byteLength)break;if(8===a||9===a||18===a){var u=s.getUint8(4),d=s.getUint8(5),h=s.getUint8(6),f=s.getUint8(7),c=h|d<<8|u<<16|f<<24;0!==(16777215&s.getUint32(7,!r))&&l.default.w(this.TAG,"Meet tag which has StreamID != 0!");var _=i+11;switch(a){case 8:this._parseAudioData(t,_,o,c);break;case 9:this._parseVideoData(t,_,o,c,n+i);break;case 18:this._parseScriptData(t,_,o)}var m=s.getUint32(11+o,!r);m!==11+o&&l.default.w(this.TAG,"Invalid PrevTagSize "+m),i+=11+o+4}else l.default.w(this.TAG,"Unsupported tag type "+a+", skipped"),i+=11+o+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}},{key:"_parseScriptData",value:function(e,t,n){var i=h.default.parseScriptData(e,t,n);if(i.hasOwnProperty("onMetaData")){if(null==i.onMetaData||"object"!==a(i.onMetaData))return void l.default.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&l.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=i;var r=this._metadata.onMetaData;if("boolean"==typeof r.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=r.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof r.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=r.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof r.audiodatarate&&(this._mediaInfo.audioDataRate=r.audiodatarate),"number"==typeof r.videodatarate&&(this._mediaInfo.videoDataRate=r.videodatarate),"number"==typeof r.width&&(this._mediaInfo.width=r.width),"number"==typeof r.height&&(this._mediaInfo.height=r.height),"number"==typeof r.duration){if(!this._durationOverrided){var s=Math.floor(r.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if("number"==typeof r.framerate){var o=Math.floor(1e3*r.framerate);if(o>0){var u=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=u}}if("object"===a(r.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var d=r.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(d),r.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=r,l.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],i=1;i>>4;if(2!==a&&10!==a)return void this._onError(m.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+a);var o=0,u=(12&s)>>>2;if(!(u>=0&&u<=4))return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+u);o=this._flvSoundRateTable[u];var d=1&s,h=this._audioMetadata,f=this._audioTrack;if(h||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),h=this._audioMetadata={},h.type="audio",h.id=f.id,h.timescale=this._timescale,h.duration=this._duration,h.audioSampleRate=o,h.channelCount=0===d?1:2),10===a){var c=this._parseAACAudioData(e,t+1,n-1);if(void 0==c)return;if(0===c.packetType){h.config&&l.default.w(this.TAG,"Found another AudioSpecificConfig!");var _=c.data;h.audioSampleRate=_.samplingRate,h.channelCount=_.channelCount,h.codec=_.codec,h.originalCodec=_.originalCodec,h.config=_.config,h.refSampleDuration=1024/h.audioSampleRate*h.timescale,l.default.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",h);var p=this._mediaInfo;p.audioCodec=h.originalCodec,p.audioSampleRate=h.audioSampleRate,p.audioChannelCount=h.channelCount,p.hasVideo?null!=p.videoCodec&&(p.mimeType='video/x-flv; codecs="'+p.videoCodec+","+p.audioCodec+'"'):p.mimeType='video/x-flv; codecs="'+p.audioCodec+'"',p.isComplete()&&this._onMediaInfo(p)}else if(1===c.packetType){var v=this._timestampBase+i,g={unit:c.data,dts:v,pts:v};f.samples.push(g),f.length+=c.data.length}else l.default.e(this.TAG,"Flv: Unsupported AAC data type "+c.packetType)}else if(2===a){if(!h.codec){var y=this._parseMP3AudioData(e,t+1,n-1,!0);if(void 0==y)return;h.audioSampleRate=y.samplingRate,h.channelCount=y.channelCount,h.codec=y.codec,h.originalCodec=y.originalCodec,h.refSampleDuration=1152/h.audioSampleRate*h.timescale,l.default.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",h);var E=this._mediaInfo;E.audioCodec=h.codec,E.audioSampleRate=h.audioSampleRate,E.audioChannelCount=h.channelCount,E.audioDataRate=y.bitRate,E.hasVideo?null!=E.videoCodec&&(E.mimeType='video/x-flv; codecs="'+E.videoCodec+","+E.audioCodec+'"'):E.mimeType='video/x-flv; codecs="'+E.audioCodec+'"',E.isComplete()&&this._onMediaInfo(E)}var b=this._parseMP3AudioData(e,t+1,n-1,!1);if(void 0==b)return;var S=this._timestampBase+i,k={unit:b,dts:S,pts:S};f.samples.push(k),f.length+=b.length}}}},{ +key:"_parseAACAudioData",value:function(e,t,n){if(n<=1)return void l.default.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!");var i={},r=new Uint8Array(e,t,n);return i.packetType=r[0],0===r[0]?i.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):i.data=r.subarray(1),i}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var i=new Uint8Array(e,t,n),r=null,s=0,a=0,o=0,u=null;if(s=a=i[0]>>>3,(o=(7&i[0])<<1|i[1]>>>7)<0||o>=this._mpegSamplingRates.length)return void this._onError(m.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");var l=this._mpegSamplingRates[o],d=(120&i[1])>>>3;if(d<0||d>=8)return void this._onError(m.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===s&&(u=(7&i[1])<<1|i[2]>>>7,i[2]);var h=self.navigator.userAgent.toLowerCase();return-1!==h.indexOf("firefox")?o>=6?(s=5,r=new Array(4),u=o-3):(s=2,r=new Array(2),u=o):-1!==h.indexOf("android")?(s=2,r=new Array(2),u=o):(s=5,u=o,r=new Array(4),o>=6?u=o-3:1===d&&(s=2,r=new Array(2),u=o)),r[0]=s<<3,r[0]|=(15&o)>>>1,r[1]=(15&o)<<7,r[1]|=(15&d)<<3,5===s&&(r[1]|=(15&u)>>>1,r[2]=(1&u)<<7,r[2]|=8,r[3]=0),{config:r,samplingRate:l,channelCount:d,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+a}}},{key:"_parseMP3AudioData",value:function(e,t,n,i){if(n<4)return void l.default.w(this.TAG,"Flv: Invalid MP3 packet, header missing!");var r=(this._littleEndian,new Uint8Array(e,t,n)),s=null;if(i){if(255!==r[0])return;var a=r[1]>>>3&3,o=(6&r[1])>>1,u=(240&r[2])>>>4,d=(12&r[2])>>>2,h=r[3]>>>6&3,f=3!==h?2:1,c=0,_=0;switch(a){case 0:c=this._mpegAudioV25SampleRateTable[d];break;case 2:c=this._mpegAudioV20SampleRateTable[d];break;case 3:c=this._mpegAudioV10SampleRateTable[d]}switch(o){case 1:34,u>>4,o=15&s;if(7!==o)return void this._onError(m.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+o);this._parseAVCVideoPacket(e,t+1,n-1,i,r,a)}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,i,r,s){if(n<4)return void l.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");var a=this._littleEndian,o=new DataView(e,t,n),u=o.getUint8(0),d=16777215&o.getUint32(0,!a);if(0===u)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===u)this._parseAVCVideoData(e,t+4,n-4,i,r,s,d);else if(2!==u)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid video packet type "+u)}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)return void l.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");var i=this._videoMetadata,r=this._videoTrack,s=this._littleEndian,a=new DataView(e,t,n);i?void 0!==i.avcc&&l.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),i=this._videoMetadata={},i.type="video",i.id=r.id,i.timescale=this._timescale,i.duration=this._duration);var o=a.getUint8(0),u=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1!==o||0===u)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=1+(3&a.getUint8(4)),3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(m.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));var d=31&a.getUint8(5);if(0===d)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS");d>1&&l.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+d);for(var h=6,f=0;f1&&l.default.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+w),h++;for(var R=0;R=n){l.default.w(this.TAG,"Malformed Nalu near timestamp "+_+", offset = "+f+", dataSize = "+n);break}var p=u.getUint32(f,!o);if(3===c&&(p>>>=8),p>n-c)return void l.default.w(this.TAG,"Malformed Nalus near timestamp "+_+", NaluSize > DataSize!");var v=31&u.getUint8(f+c);5===v&&(m=!0);var g=new Uint8Array(e,t+f,c+p),y={type:v,data:g};d.push(y),h+=g.byteLength,f+=c+p}if(d.length){var E=this._videoTrack,b={units:d,length:h,isKeyframe:m,dts:_,cts:a,pts:_+a};m&&(b.fileposition=r),E.samples.push(b),E.length+=h}}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i=(4&t[4])>>>2!=0,r=0!=(1&t[4]),a=s(t,5);return a<9?n:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:i,hasVideoTrack:r}}}]),e}();n.default=y},{"../core/media-info.js":7,"../utils/exception.js":40,"../utils/logger.js":41,"./amf-parser.js":15,"./demux-errors.js":16,"./sps-parser.js":19}],19:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(i[r]=t[s],r++);return new Uint8Array(i.buffer,0,r)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new a.default(n);i.readByte();var r=i.readByte();i.readByte();var s=i.readByte();i.readUEG();var o=e.getProfileString(r),u=e.getLevelString(s),l=1,d=420,h=[0,420,422,444],f=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(l=i.readUEG(),3===l&&i.readBits(1),l<=3&&(d=h[l]),f=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool()))for(var c=3!==l?8:12,_=0;_0&&I<16?(w=x[I-1],R=M[I-1]):255===I&&(w=i.readByte()<<8|i.readByte(),R=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){var D=i.readBits(32),B=i.readBits(32);O=i.readBool(),T=B,C=2*D,A=T/C}}var j=1;1===w&&1===R||(j=w/R);var P=0,U=0;if(0===l)P=1,U=2-E;else{var N=3===l?1:2,F=1===l?2:1;P=N,U=F*(2-E)}var G=16*(g+1),V=16*(y+1)*(2-E);G-=(b+S)*P,V-=(k+L)*U;var z=Math.ceil(G*j);return i.destroy(),i=null,{profile_string:o,level_string:u,bit_depth:f,chroma_format:d,chroma_format_string:e.getChromaFormatString(d),frame_rate:{fixed:O,fps:A,fps_den:C,fps_num:T},sar_ratio:{width:w,height:R},codec_size:{width:G,height:V},present_size:{width:z,height:V}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,i=8,r=0,s=0;s=15048,t=!f.default.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}}]),l(t,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&void 0!=e.redirectedURL&&(i=e.redirectedURL);var r=this._seekHandler.getConfig(i,t),s=new self.Headers;if("object"===o(r.headers)){var a=r.headers;for(var u in a)a.hasOwnProperty(u)&&s.append(u,a[u])}var l={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};!1===e.cors&&(l.mode="same-origin"),e.withCredentials&&(l.credentials="include"),e.referrerPolicy&&(l.referrerPolicy=e.referrerPolicy),this._status=c.LoaderStatus.kConnecting,self.fetch(r.url,l).then(function(e){if(n._requestAbort)return n._requestAbort=!1,void(n._status=c.LoaderStatus.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(n._contentLength=parseInt(i),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=c.LoaderStatus.kError,!n._onError)throw new _.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(function(e){if(n._status=c.LoaderStatus.kError,!n._onError)throw e;n._onError(c.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then(function(n){if(n.done)t._status=c.LoaderStatus.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(!0===t._requestAbort)return t._requestAbort=!1,t._status=c.LoaderStatus.kComplete,e.cancel();t._status=c.LoaderStatus.kBuffering;var i=n.value.buffer,r=t._range.from+t._receivedLength;t._receivedLength+=i.byteLength,t._onDataArrival&&t._onDataArrival(i,r,t._receivedLength),t._pump(e)}}).catch(function(e){if(11!==e.code||!f.default.msedge){t._status=c.LoaderStatus.kError;var n=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new l.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return s(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new b.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new k.default(t,n)}else{if("custom"!==e.seekType)throw new L.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new L.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(this._isWebSocketURL)this._loaderClass=y.default;else if(f.default.isSupported())this._loaderClass=f.default;else if(_.default.isSupported())this._loaderClass=_.default;else{if(!v.default.isSupported())throw new L.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=v.default}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new L.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(i,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,r=0,s=n;if(e=t[i]&&e=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed),u=this._dispatchChunks(o,this._stashByteStart);if(u0){var l=new Uint8Array(o,u);a.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=u}}else this._stashUsed=0,this._stashByteStart+=u;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var d=this._dispatchChunks(e,t);if(dthis._bufferSize&&(this._expandBuffer(h),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,d),0),this._stashUsed+=h,this._stashByteStart=t+d}}}else if(0===this._stashUsed){var f=this._dispatchChunks(e,t);if(fthis._bufferSize&&this._expandBuffer(c);var _=new Uint8Array(this._stashBuffer,0,this._bufferSize);_.set(new Uint8Array(e,f),0),this._stashUsed+=c,this._stashByteStart=t+f}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p0){var v=new Uint8Array(this._stashBuffer,p);m.set(v,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),i=t.byteLength-n;if(n0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),s=new Uint8Array(t,n);r.set(s,0),this._stashUsed=s.byteLength,this._stashByteStart+=n}return 0}o.default.w(this.TAG,i+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,i}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){switch(o.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=d.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case d.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n0)for(var s=n.split("&"),a=0;a0;o[0]!==this._startName&&o[0]!==this._endName&&(u&&(r+="&"),r+=s[a])}return 0===r.length?t:t+"?"+r}}]),e}();n.default=s},{}],26:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}();n.default=s},{}],28:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var a=r.get;if(void 0!==a)return a.call(i)},o=function(){function e(e,t){for(var n=0;n299)){if(this._status=h.LoaderStatus.kError,!this._onError)throw new f.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=h.LoaderStatus.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==h.LoaderStatus.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){if(!0===this._requestAbort)return void(this._requestAbort=!1);this._status!==h.LoaderStatus.kError&&(this._status=h.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}},{key:"_onXhrError",value:function(e){this._status=h.LoaderStatus.kError;var t=0,n=null;if(this._contentLength&&e.loaded=200&&t.status<=299){if(this._status=h.LoaderStatus.kBuffering,void 0!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}var i=t.getResponseHeader("Content-Length");if(null!=i&&null==this._contentLength){var r=parseInt(i);r>0&&(this._contentLength=r,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}}else{if(this._status=h.LoaderStatus.kError,!this._onError)throw new f.RuntimeException("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(h.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else if(3===t.readyState&&t.status>=200&&t.status<=299){this._status=h.LoaderStatus.kBuffering;var s=t.response;this._reader.readAsArrayBuffer(s)}}},{key:"_xhrOnError",value:function(e){this._status=h.LoaderStatus.kError;var t=h.LoaderErrors.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new f.RuntimeException(n.msg);this._onError(t,n)}},{key:"_msrOnProgress",value:function(e){var t=e.target,n=t.result;if(null==n)return void this._doReconnectIfNeeded();var i=n.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=n.byteLength;var r=this._totalRange.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength),n.byteLength>=this._bufferLimit&&(d.default.v(this.TAG,"MSStream buffer exceeded max size near "+(r+i.byteLength)+", reconnecting..."),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(null==this._contentLength||this._receivedLength=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(void 0!=this._currentRedirectedURL?n=this._currentRedirectedURL:void 0!=e.redirectedURL&&(n=e.redirectedURL));var i=this._seekHandler.getConfig(n,t);this._currentRequestURL=i.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",i.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&r.withCredentials&&(r.withCredentials=!0),"object"===o(i.headers)){var s=i.headers;for(var a in s)s.hasOwnProperty(a)&&r.setRequestHeader(a,s[a])}r.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=_.LoaderStatus.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(void 0!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=_.LoaderStatus.kBuffering}else{if(this._status=_.LoaderStatus.kError,!this._onError)throw new m.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(_.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==_.LoaderStatus.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,r=0,s=n;if(e=t[i]&&e=3&&(t=this._speedSampler.currentKBps),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var s=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new p.default(this._mediaDataSource,this._config),this._transmuxer.on(g.default.INIT_SEGMENT,function(t,n){e._msectl.appendInitSegment(n)}),this._transmuxer.on(g.default.MEDIA_SEGMENT,function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;n.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(d.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}}),this._transmuxer.on(g.default.LOADING_COMPLETE,function(){e._msectl.endOfStream(),e._emitter.emit(_.default.LOADING_COMPLETE)}),this._transmuxer.on(g.default.RECOVERED_EARLY_EOF,function(){e._emitter.emit(_.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(g.default.IO_ERROR,function(t,n){e._emitter.emit(_.default.ERROR,k.ErrorTypes.NETWORK_ERROR,t,n)}),this._transmuxer.on(g.default.DEMUX_ERROR,function(t,n){e._emitter.emit(_.default.ERROR,k.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:n})}), +this._transmuxer.on(g.default.MEDIA_INFO,function(t){e._mediaInfo=t,e._emitter.emit(_.default.MEDIA_INFO,Object.assign({},t))}),this._transmuxer.on(g.default.STATISTICS_INFO,function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(_.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))}),this._transmuxer.on(g.default.RECOMMEND_SEEKPOINT,function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)}),this._transmuxer.open()}}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,i=0;i=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(d.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){d.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,i=0;i=r&&e=s-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(d.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n=i&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var i=n.start(0);if(i<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(d.default.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(d.default.STATISTICS_INFO,this.statisticsInfo)}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",t={mimeType:e+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}}]),e}();n.default=c},{"../config.js":5,"../utils/exception.js":40,"./player-events.js":35,events:2}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorDetails=n.ErrorTypes=void 0;var i=e("../io/loader.js"),r=e("../demux/demux-errors.js"),s=function(e){return e&&e.__esModule?e:{default:e}}(r);n.ErrorTypes={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},n.ErrorDetails={NETWORK_EXCEPTION:i.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:i.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:i.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:i.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:s.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:s.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:s.default.CODEC_UNSUPPORTED}},{"../demux/demux-errors.js":16,"../io/loader.js":24}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",STATISTICS_INFO:"statistics_info"};n.default=i},{}],36:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var a=8,o=0;o>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.presentWidth,s=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,s>>>8&255,255&s,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],r)}},{key:"mp4a",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,r,e.esds(t))}},{key:"esds",value:function(t){var n=t.config||[],i=n.length,r=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(n).concat([6,1,2]));return e.box(e.types.esds,r)}},{key:"avc1",value:function(t){var n=t.avcc,i=t.codecWidth,r=t.codecHeight,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,s,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var i=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),a=e.sdtp(t),o=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,s,o,a)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],i=n.length,r=new Uint8Array(4+i),s=0;s>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var o=0;o>>24&255,u>>>16&255,u>>>8&255,255&u,l>>>24&255,l>>>16&255,l>>>8&255,255&l,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*o)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();s.init(),n.default=s},{}],38:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=1?A[A.length-1].duration:Math.floor(a);var D=!1,B=null;if(M>1.5*a&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!c.default.safari){D=!0;var j=Math.abs(M-a),P=Math.ceil(j/a),U=x+a;o.default.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\ndts: "+(x+M)+" ms, expected: "+(x+Math.round(a))+" ms, delta: "+Math.round(j)+" ms, generate: "+P+" frames");var N=h.default.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==N&&(o.default.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),N=C),B=[];for(var F=0;F0){var V=B[B.length-1];V.duration=G-V.dts}var z={dts:G,pts:G,cts:0,unit:N,size:N.byteLength,duration:0,originalDts:I,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};B.push(z),v+=C.byteLength,U+=a}var H=B[B.length-1];H.duration=x+M-H.dts,M=Math.round(a)}A.push({dts:x,pts:x,cts:0,unit:T.unit,size:T.unit.byteLength,duration:M,originalDts:I,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),D&&A.push.apply(A,B)}u?p=new Uint8Array(v):(p=new Uint8Array(v),p[0]=v>>>24&255,p[1]=v>>>16&255,p[2]=v>>>8&255,p[3]=255&v,p.set(l.default.types.mdat,4));for(var K=0;K>>24&255,h[1]=d>>>16&255,h[2]=d>>>8&255,h[3]=255&d,h.set(l.default.types.mdat,4);var f=n[0].dts-this._dtsBase;if(this._videoNextDts)i=f-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())i=0;else{var c=this._videoSegmentInfoList.getLastSampleBefore(f);if(null!=c){var m=f-(c.originalDts+c.duration);m<=3&&(m=0);var p=c.dts+c.duration+m;i=f-p}else i=0}for(var v=new _.MediaSegmentInfo,g=[],y=0;y=1?g[g.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(S){var A=new _.SampleInfo(k,w,R,E.dts,!0);A.fileposition=E.fileposition,v.appendSyncPoint(A)}g.push({dts:k,pts:w,cts:L,units:E.units,size:E.length,isKeyframe:S,duration:R,originalDts:b,flags:{isLeading:0,dependsOn:S?2:1,isDependedOn:S?1:0,hasRedundancy:0,isNonSync:S?0:1}})}for(var O=0;O=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},s={};if(r.browser){s[r.browser]=!0;var a=r.majorVersion.split(".");s.version={major:parseInt(r.majorVersion,10),string:r.version},a.length>1&&(s.version.minor=parseInt(a[1],10)),a.length>2&&(s.version.build=parseInt(a[2],10))}r.platform&&(s[r.platform]=!0), +(s.chrome||s.opr||s.safari)&&(s.webkit=!0),(s.rv||s.iemobile)&&(s.rv&&delete s.rv,r.browser="msie",s.msie=!0),s.edge&&(delete s.edge,r.browser="msedge",s.msedge=!0),s.opr&&(r.browser="opera",s.opera=!0),s.safari&&s.android&&(r.browser="android",s.android=!0),s.name=r.browser,s.platform=r.platform;for(var o in i)i.hasOwnProperty(o)&&delete i[o];Object.assign(i,s)}(),n.default=i},{}],40:[function(e,t,n){"use strict";function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)}}]),e}();o.GLOBAL_TAG="flv.js",o.FORCE_GLOBAL_TAG=!1,o.ENABLE_ERROR=!0,o.ENABLE_INFO=!0,o.ENABLE_WARN=!0,o.ENABLE_DEBUG=!0,o.ENABLE_VERBOSE=!0,o.ENABLE_CALLBACK=!1,o.emitter=new a.default,n.default=o},{events:2}],42:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){l.default.emitter.addListener("log",t),l.default.emitter.listenerCount("log")>0&&(l.default.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){l.default.emitter.removeListener("log",t),0===l.default.emitter.listenerCount("log")&&(l.default.ENABLE_CALLBACK=!1,e._notifyChange())}},{key:"forceGlobalTag",get:function(){return l.default.FORCE_GLOBAL_TAG},set:function(t){l.default.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return l.default.GLOBAL_TAG},set:function(t){l.default.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return l.default.ENABLE_VERBOSE&&l.default.ENABLE_DEBUG&&l.default.ENABLE_INFO&&l.default.ENABLE_WARN&&l.default.ENABLE_ERROR},set:function(t){l.default.ENABLE_VERBOSE=t,l.default.ENABLE_DEBUG=t,l.default.ENABLE_INFO=t,l.default.ENABLE_WARN=t,l.default.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return l.default.ENABLE_DEBUG},set:function(t){l.default.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return l.default.ENABLE_VERBOSE},set:function(t){l.default.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return l.default.ENABLE_INFO},set:function(t){l.default.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return l.default.ENABLE_WARN},set:function(t){l.default.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return l.default.ENABLE_ERROR},set:function(t){l.default.ENABLE_ERROR=t,e._notifyChange()}}]),e}();d.emitter=new o.default,n.default=d},{"./logger.js":41,events:2}],43:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=128){t.push(String.fromCharCode(65535&a)),r+=2;continue}}}else if(n[r]<240){if(i(n,r,2)){var o=(15&n[r])<<12|(63&n[r+1])<<6|63&n[r+2];if(o>=2048&&55296!=(63488&o)){t.push(String.fromCharCode(65535&o)),r+=3;continue}}}else if(n[r]<248&&i(n,r,3)){var u=(7&n[r])<<18|(63&n[r+1])<<12|(63&n[r+2])<<6|63&n[r+3];if(u>65536&&u<1114112){u-=65536,t.push(String.fromCharCode(u>>>10|55296)),t.push(String.fromCharCode(1023&u|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}]},{},[21])(21)}); +//# sourceMappingURL=flv.min.js.map diff --git a/xz_mini/webview/flv/js/jquery-2.1.4.min.js b/xz_mini/webview/flv/js/jquery-2.1.4.min.js new file mode 100644 index 0000000..b31a789 --- /dev/null +++ b/xz_mini/webview/flv/js/jquery-2.1.4.min.js @@ -0,0 +1,3 @@ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ +return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("