diff --git a/teamwork/js_sdk/mmmm-image-tools/index.js b/teamwork/js_sdk/mmmm-image-tools/index.js deleted file mode 100644 index acf40bc87f76346c39eed90d603d5af884ca81e4..0000000000000000000000000000000000000000 --- a/teamwork/js_sdk/mmmm-image-tools/index.js +++ /dev/null @@ -1,196 +0,0 @@ -function getLocalFilePath(path) { - if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) { - return path - } - if (path.indexOf('file://') === 0) { - return path - } - if (path.indexOf('/storage/emulated/0/') === 0) { - return path - } - if (path.indexOf('/') === 0) { - var localFilePath = plus.io.convertAbsoluteFileSystem(path) - if (localFilePath !== path) { - return localFilePath - } else { - path = path.substr(1) - } - } - return '_www/' + path -} - -function dataUrlToBase64(str) { - var array = str.split(',') - return array[array.length - 1] -} - -var index = 0 -function getNewFileId() { - return Date.now() + String(index++) -} - -function biggerThan(v1, v2) { - var v1Array = v1.split('.') - var v2Array = v2.split('.') - var update = false - for (var index = 0; index < v2Array.length; index++) { - var diff = v1Array[index] - v2Array[index] - if (diff !== 0) { - update = diff > 0 - break - } - } - return update -} - -export function pathToBase64(path) { - return new Promise(function(resolve, reject) { - if (typeof window === 'object' && 'document' in window) { - if (typeof FileReader === 'function') { - var xhr = new XMLHttpRequest() - xhr.open('GET', path, true) - xhr.responseType = 'blob' - xhr.onload = function() { - if (this.status === 200) { - let fileReader = new FileReader() - fileReader.onload = function(e) { - resolve(e.target.result) - } - fileReader.onerror = reject - fileReader.readAsDataURL(this.response) - } - } - xhr.onerror = reject - xhr.send() - return - } - var canvas = document.createElement('canvas') - var c2x = canvas.getContext('2d') - var img = new Image - img.onload = function() { - canvas.width = img.width - canvas.height = img.height - c2x.drawImage(img, 0, 0) - resolve(canvas.toDataURL()) - canvas.height = canvas.width = 0 - } - img.onerror = reject - img.src = path - return - } - if (typeof plus === 'object') { - plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) { - entry.file(function(file) { - var fileReader = new plus.io.FileReader() - fileReader.onload = function(data) { - resolve(data.target.result) - } - fileReader.onerror = function(error) { - reject(error) - } - fileReader.readAsDataURL(file) - }, function(error) { - reject(error) - }) - }, function(error) { - reject(error) - }) - return - } - if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { - wx.getFileSystemManager().readFile({ - filePath: path, - encoding: 'base64', - success: function(res) { - resolve('data:image/png;base64,' + res.data) - }, - fail: function(error) { - reject(error) - } - }) - return - } - reject(new Error('not support')) - }) -} - -export function base64ToPath(base64) { - return new Promise(function(resolve, reject) { - if (typeof window === 'object' && 'document' in window) { - base64 = base64.split(',') - var type = base64[0].match(/:(.*?);/)[1] - var str = atob(base64[1]) - var n = str.length - var array = new Uint8Array(n) - while (n--) { - array[n] = str.charCodeAt(n) - } - return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type }))) - } - var extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/) - if (extName) { - extName = extName[1] - } else { - reject(new Error('base64 error')) - } - var fileName = getNewFileId() + '.' + extName - if (typeof plus === 'object') { - var basePath = '_doc' - var dirPath = 'uniapp_temp' - var filePath = basePath + '/' + dirPath + '/' + fileName - if (!biggerThan(plus.os.name === 'Android' ? '1.9.9.80627' : '1.9.9.80472', plus.runtime.innerVersion)) { - plus.io.resolveLocalFileSystemURL(basePath, function(entry) { - entry.getDirectory(dirPath, { - create: true, - exclusive: false, - }, function(entry) { - entry.getFile(fileName, { - create: true, - exclusive: false, - }, function(entry) { - entry.createWriter(function(writer) { - writer.onwrite = function() { - resolve(filePath) - } - writer.onerror = reject - writer.seek(0) - writer.writeAsBinary(dataUrlToBase64(base64)) - }, reject) - }, reject) - }, reject) - }, reject) - return - } - var bitmap = new plus.nativeObj.Bitmap(fileName) - bitmap.loadBase64Data(base64, function() { - bitmap.save(filePath, {}, function() { - bitmap.clear() - resolve(filePath) - }, function(error) { - bitmap.clear() - reject(error) - }) - }, function(error) { - bitmap.clear() - reject(error) - }) - return - } - if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { - var filePath = wx.env.USER_DATA_PATH + '/' + fileName - wx.getFileSystemManager().writeFile({ - filePath: filePath, - data: dataUrlToBase64(base64), - encoding: 'base64', - success: function() { - resolve(filePath) - }, - fail: function(error) { - reject(error) - } - }) - return - } - reject(new Error('not support')) - }) -} \ No newline at end of file diff --git a/teamwork/js_sdk/mmmm-image-tools/package.json b/teamwork/js_sdk/mmmm-image-tools/package.json deleted file mode 100644 index e8b9c0a6bb7d96529c53dc75e3563d52d8e505c3..0000000000000000000000000000000000000000 --- a/teamwork/js_sdk/mmmm-image-tools/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "mmmm-image-tools", - "name": "image-tools", - "version": "1.4.0", - "description": "图像转换工具,可用于图像和base64的转换", - "keywords": [ - "base64", - "保存", - "图像" - ] -} \ No newline at end of file diff --git a/teamwork/pages.json b/teamwork/pages.json index 32521e9c7663d0fd3efc2b7c330ffdfd5826b17c..e893cce44a4a23b586002282d0efb28688da5f94 100644 --- a/teamwork/pages.json +++ b/teamwork/pages.json @@ -94,6 +94,16 @@ "style": { "navigationStyle": "custom" } + }, { + "path": "pages/team/member-list", + "style": { + "navigationStyle": "custom" + } + }, { + "path": "pages/team/activity-detail", + "style": { + "navigationStyle": "custom" + } }, { "path": "pages/my/main", "style": { diff --git a/teamwork/pages/my/main.vue b/teamwork/pages/my/main.vue index a9da5fb07b065d062cba197c13c2b7bc567657b5..2ff70923d874e3988004a42c90c0b1a48104defb 100644 --- a/teamwork/pages/my/main.vue +++ b/teamwork/pages/my/main.vue @@ -8,7 +8,7 @@ - + {{nickname}} @@ -20,10 +20,7 @@ 运动小队:{{teamName}} - - - 运动积分:{{point}} - + @@ -33,7 +30,7 @@ 我的帖子 - + 运动记录 @@ -55,11 +52,11 @@ export default { data () { return { - iStatusBarHeight:0, - nickname:'王二蛋', - schoolName:'福州大学', - teamName:'must go', - point:'1250' + headPortraitIcon:'', + nickname:'', + schoolName:'', + teamName:'', + point:'' } }, methods:{ @@ -77,10 +74,31 @@ uni.navigateTo({ url: '/pages/my/my-resetpassword' }) - } + }, + goToRunningRecord() { + uni.navigateTo({ + url: '/pages/my/my-running-record' + }) + }, + getData() { + uniCloud.callFunction({ + name: 'fe-my-information', + data: {userId:'6450da43e1a35c371b3699cc'} + }) + .then(res => { + this.headPortraitIcon=res.result.data.icon, + this.nickname=res.result.data.username, + this.schoolName=res.result.data.school, + this.teamName=res.result.data.team, + + //this.activityList=res.result.data.activityList, + console.log(res); + }); + }, }, onLoad() { plus.navigator.setStatusBarBackground('#EDEEF0'); + this.getData() } } @@ -120,8 +138,8 @@ height: 200rpx; border-radius: 50%; background-size:100% 100%; - background-image:url("/static/my/main/head-portrait.png") ; - background-repeat:no-repeat; + /* background-image:url("/static/my/main/head-portrait.png") ; + background-repeat:no-repeat; */ float: left; } .nickname{ @@ -139,21 +157,21 @@ border-radius: 20rpx; background-color: #FFFFFF; width:75%; - height: 60%; + height: 40%; margin-top: 50px; margin-left: auto; margin-right: auto; } .school{ - height: 30%; - margin-top: 20rpx; + height: 50%; + } .school-icon{ - width: 70rpx; - height: 70rpx; - margin-top: 50rpx; + width: 100rpx; + height: 100rpx; + margin-top: 30rpx; margin-left: 50rpx; background-size:100% 100%; background-image:url("/static/my/main/school-icon.png"); @@ -162,23 +180,23 @@ } .school-name{ - width: 320rpx; + width: 340rpx; height: 30rpx; margin-top: 60rpx; - margin-right: 55rpx; + margin-right: 45rpx; font-size: 35rpx; text-align: left; float: right; } .team{ - height: 30%; + height: 50%; } .team-icon{ - width: 70rpx; - height: 70rpx; - margin-top: 50rpx; + width: 100rpx; + height: 100rpx; + margin-top: 40rpx; margin-left: 50rpx; background-size:100% 100%; background-image:url("/static/my/main/team-icon.png"); @@ -187,43 +205,19 @@ } .team-name{ - width: 320rpx; - height: 30rpx; - margin-top: 60rpx; - margin-right: 55rpx; - font-size: 35rpx; - text-align: left; - float: right; - } - .point{ - - height: 30%; - } - .point-icon{ - - width: 70rpx; - height: 70rpx; - margin-top: 50rpx; - margin-left: 50rpx; - background-size:100% 100%; - background-image:url("/static/my/main/point-icon.png"); - background-repeat:no-repeat; - float: left; - } - .point-num{ - - width: 320rpx; + width: 340rpx; height: 30rpx; margin-top: 60rpx; - margin-right: 55rpx; + margin-right: 45rpx; font-size: 35rpx; text-align: left; float: right; } + .func{ width:75%; - margin-top: 30rpx; + /* margin-top: 10rpx; */ margin-left: auto; margin-right: auto; display: flex; diff --git a/teamwork/pages/my/my-modify.vue b/teamwork/pages/my/my-modify.vue index e11084e17df6088933c54e3a31c1df0e3e272fa2..67b8de24fc381967e272a236f70e572708cad411 100644 --- a/teamwork/pages/my/my-modify.vue +++ b/teamwork/pages/my/my-modify.vue @@ -6,15 +6,14 @@ - - + + - - - - 修改头像 - 设置头像 + + + + 修改头像 @@ -30,9 +29,9 @@ 性别 - + - {{sex[index1].name}} + {{selectSex[index1].name}} @@ -46,27 +45,25 @@ - + + + \ No newline at end of file diff --git a/teamwork/pages/my/my-setting.vue b/teamwork/pages/my/my-setting.vue index 4d94cd1e5a0329c4d14e4ddf841574108e268162..3c02578e887bff820bce00d895631f3cc2905608 100644 --- a/teamwork/pages/my/my-setting.vue +++ b/teamwork/pages/my/my-setting.vue @@ -44,9 +44,11 @@ showCancel: true, //是否显示取消按钮 success: function (res) { if (res.confirm) { //confirm为ture,代表用户点击确定 - console.log('点击了确定按钮'); + uni.navigateTo({ + url: '/pages/login/login' + }) } else if (res.cancel) { //cancel为ture,代表用户点击取消 - console.log('点击了取消按钮'); + } } }) diff --git a/teamwork/pages/team/activity-detail.vue b/teamwork/pages/team/activity-detail.vue new file mode 100644 index 0000000000000000000000000000000000000000..99bf6ce8295b0f5c726adad5787114a59541d632 --- /dev/null +++ b/teamwork/pages/team/activity-detail.vue @@ -0,0 +1,283 @@ + + + + + \ No newline at end of file diff --git a/teamwork/pages/team/main.vue b/teamwork/pages/team/main.vue index 6aaa97eed093fc616884140433af5f41ea8ec293..7eca4d983833c6a8725841e20c4f7e109394c003 100644 --- a/teamwork/pages/team/main.vue +++ b/teamwork/pages/team/main.vue @@ -19,11 +19,12 @@ - - {{name}} + + {{name}} + - + {{item.title}} @@ -33,17 +34,19 @@ + style="width: 230px;height: 200px;" /> 您还没有加入任何小队哦~- + + + - - @@ -61,10 +64,11 @@ data() { return { + icon:'/static/icon/1.png', current: 0, show: false, value1: "", - join: 'true', + join: null, userId: '644a643a0c801ca878983559', list: [{ name: '我的小队' @@ -83,11 +87,44 @@ ] }; }, - methods: { tabChange(index) { this.current = index.index; }, + showActivityDetail(activityId){ + uni.reLaunch({ + url: '/pages/team/activity-detail?activityId='+activityId, + animationType: 'pop-in', + animationDuration: 300 + }) + }, + showMember(){ + uni.reLaunch({ + url: '/pages/team/member-list', + animationType: 'pop-in', + animationDuration: 300 + }) + }, + toggleMessage() { + this.$refs['popupDialog'].open(); + }, + dialogConfirm() { + uniCloud.callFunction({ + name: 'fe-team-leaveTeam', + data: { + userId: this.userId + } + }) + .then(res => { + console.log(res) + this.join = false + console.log(this.join) + }) + this.$refs['popupDialog'].close(); + }, + dialogClose() { + this.$refs.popupDialog.close(); + }, }, onLoad() { @@ -102,6 +139,7 @@ this.name = res.result.data.username, this.activityList = res.result.data.activityList, this.join = res.result.join, + this.icon = res.result.data.icon console.log(this.join) }) } @@ -114,7 +152,7 @@ } .icon-with-name { - width: 80%; + width: 100%; height: 45px; margin-left: 10px; margin-top: 15px; @@ -131,6 +169,14 @@ float: left; } + .out-team { + float: right; + margin-right: 30px; + width: 30px; + margin-top: 11px; + height: 30px; + } + .name { float: left; margin-bottom: auto; @@ -175,28 +221,33 @@ justify-content: center; word-wrap: break-word; } - .text-no{ + + .text-no { font-weight: bold; display: flex; margin: auto; flex-direction: column; color: #F1992D; - + } + .horn-icon { flex-shrink: 0; margin: auto 0; } - .nojoin-icon{ + + .nojoin-icon { display: flex; flex-direction: column; margin: auto; display: block; } - .nojoin-icon-view{ + + .nojoin-icon-view { margin-top: 50px; } - .text-no-view{ + + .text-no-view { margin: 30px auto; } \ No newline at end of file diff --git a/teamwork/pages/team/member-list.vue b/teamwork/pages/team/member-list.vue new file mode 100644 index 0000000000000000000000000000000000000000..d525dc47149347ca5582b142e1b041eb494417be --- /dev/null +++ b/teamwork/pages/team/member-list.vue @@ -0,0 +1,115 @@ + + + + + \ No newline at end of file diff --git a/teamwork/static/my/my-running-record/duration.png b/teamwork/static/my/my-running-record/duration.png new file mode 100644 index 0000000000000000000000000000000000000000..2a3a7401b05ccb196fab41187fe34eb8d2594fd8 Binary files /dev/null and b/teamwork/static/my/my-running-record/duration.png differ diff --git a/teamwork/static/my/my-running-record/pace.png b/teamwork/static/my/my-running-record/pace.png new file mode 100644 index 0000000000000000000000000000000000000000..879a6fb3a2d5cf08b3c2c8e8e9e8af9218dc06f4 Binary files /dev/null and b/teamwork/static/my/my-running-record/pace.png differ diff --git a/teamwork/static/my/my-running-record/running.png b/teamwork/static/my/my-running-record/running.png new file mode 100644 index 0000000000000000000000000000000000000000..f4f4f4d239a98609986fa10da06536c646e67ffe Binary files /dev/null and b/teamwork/static/my/my-running-record/running.png differ diff --git a/teamwork/static/my/my-running-record/walking.png b/teamwork/static/my/my-running-record/walking.png new file mode 100644 index 0000000000000000000000000000000000000000..8adf6d30a323e339cd1e3ba01c143239cf910902 Binary files /dev/null and b/teamwork/static/my/my-running-record/walking.png differ diff --git a/teamwork/static/team/out.png b/teamwork/static/team/out.png new file mode 100644 index 0000000000000000000000000000000000000000..be526fc27bc6b064a507e47a1beecd208459f5ec Binary files /dev/null and b/teamwork/static/team/out.png differ