diff --git a/app.json b/app.json index ce9050d..094bf25 100644 --- a/app.json +++ b/app.json @@ -11,9 +11,16 @@ "pages/user/index", "pages/user/companyMine/myActives/myActives", "pages/user/companyMine/focusedProject/focusedProject", + "pages/user/companyMine/focusedCompany/focusedCompany", + "pages/user/companyMine/myTeam/myTeam", + "pages/user/companyMine/myBlockchain/myBlockchain", "pages/user/companyMine/companyOrder", "pages/user/user_coupon/user_coupon", "pages/user/user_coupon_data/user_coupon_data", + "pages/user/setting/setting", + "pages/user/setting/aboutUs/aboutUs", + "pages/user/setting/aboutMine/aboutMine", + "pages/user/setting/aboutAdvice/aboutAdvice", "pages/mall/index", "pages/mall/mall_address/mall_address", "pages/mall/mall_address_form/mall_address_form", diff --git a/pages/home/activeDetail/activeDetail.wxml b/pages/home/activeDetail/activeDetail.wxml index 6e687e5..35514a1 100644 --- a/pages/home/activeDetail/activeDetail.wxml +++ b/pages/home/activeDetail/activeDetail.wxml @@ -42,7 +42,7 @@ {{info.price> 0 ? '¥' + info.price:'免费'}} - {{!info.canEnroll?'无法报名':'立即报名'}} + {{info.canEnrollText}} diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.js b/pages/user/companyMine/focusedCompany/focusedCompany.js new file mode 100644 index 0000000..54c9f16 --- /dev/null +++ b/pages/user/companyMine/focusedCompany/focusedCompany.js @@ -0,0 +1,88 @@ +// pages/user/companyMine/focusedProject/focusedProject.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + lists: [], + page: 1, + has_more: true + }, + onShow() { + this.getList(); + }, + + // 获取活动列表 + getList() { + wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => { + setTimeout(() => { + wx.hideLoading({}) + }, 1000); + var lists = this.data.lists.concat(res.data) + if (res.page.has_more) { + this.setData({ + has_more: res.page.has_more, + page: this.data.page + 1, + lists: lists + }) + } else { + this.setData({ + has_more: res.page.has_more, + lists: lists + }) + } + }) + }, + // 触底加载更多 + onReachBottom() { + if (this.data.has_more) { + this.getList(); + } else { + wx.showToast({ + icon: 'none', + title: '没有更多', + }) + } + }, + //跳转到详情页 + goUrl(e) { + wx.navigateTo({ + url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, + }) + }, + // 取消项目 + crowdfundsUnLike(e) { + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + var arr = this.data.lists + var temp = [] + for (var i = 0; i < arr.length; i++) { + if (i != index) { + temp.push(arr[i]); + } + } + console.log(temp) + wx.showModal({ + title: '提示', + content: '确认取消关注么?', + success: res => { + if (res.confirm) { + wx.showLoading({ + title: '取消中', + }) + wx.$api.companyModule.crowdfundsUnLike(id).then(res => { + this.setData({ + lists: temp + }) + wx.showToast({ + title: '取消成功', + icon:'none' + }) + wx.hideLoading({}) + }); + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.json b/pages/user/companyMine/focusedCompany/focusedCompany.json new file mode 100644 index 0000000..c471cf8 --- /dev/null +++ b/pages/user/companyMine/focusedCompany/focusedCompany.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我关注的企业", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.wxml b/pages/user/companyMine/focusedCompany/focusedCompany.wxml new file mode 100644 index 0000000..e7f31c4 --- /dev/null +++ b/pages/user/companyMine/focusedCompany/focusedCompany.wxml @@ -0,0 +1,15 @@ + + + + + 域展科技 已关注 + 诚信值1587 + + 进入 + + + + + {{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}} + \ No newline at end of file diff --git a/pages/user/companyMine/focusedCompany/focusedCompany.wxss b/pages/user/companyMine/focusedCompany/focusedCompany.wxss new file mode 100644 index 0000000..fda985b --- /dev/null +++ b/pages/user/companyMine/focusedCompany/focusedCompany.wxss @@ -0,0 +1,82 @@ +.content { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + background-color: #fff; + padding: 20rpx 30rpx; + /* box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.1); */ + margin-top: 2rpx; +} + +.content image { + width: 100rpx; + height: 100rpx; + border-radius: 50%; +} + +.content .left { + flex: 1; + margin-left: 20rpx; + box-sizing: border-box; +} + +.content .title { + color: #333; + font-size: 30rpx; + padding-right: 120rpx; + position: relative; +} + +.content .title>span { + color: #378fff; + border: solid 1rpx #378fff; + border-radius: 50rpx; + font-size: 20rpx; + padding: 4rpx 16rpx; + /* position: absolute; + top: 0; + right: 0; */ + margin-left: 20rpx; + position: relative; + top: -4rpx; +} + +.content .bottom { + justify-content: space-between; + display: flex; + flex-direction: row; + align-items: stretch; + box-sizing: border-box; + font-size: 26rpx; + color: #222; + font-weight: 600; + padding: 10rpx 0; +} + +.has_more { + color: #999; + font-size: 26rpx; + text-align: center; + padding: 30rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding-top: 30rpx; +} + +.has_more image { + margin-bottom: 30rpx; +} + +.runIn { + color: #fff; + border: solid 1rpx #fff; + border-radius: 50rpx; + background-color: #378fff; + font-size: 30rpx; + padding: 4rpx 20rpx 4rpx 30rpx; +} \ No newline at end of file diff --git a/pages/user/companyMine/focusedProject/focusedProject.js b/pages/user/companyMine/focusedProject/focusedProject.js index c820175..d2e9f14 100644 --- a/pages/user/companyMine/focusedProject/focusedProject.js +++ b/pages/user/companyMine/focusedProject/focusedProject.js @@ -75,6 +75,10 @@ Page({ this.setData({ lists: temp }) + wx.showToast({ + title: '取消成功', + icon: 'none' + }) wx.hideLoading({}) }); } diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.js b/pages/user/companyMine/myBlockchain/myBlockchain.js new file mode 100644 index 0000000..54c9f16 --- /dev/null +++ b/pages/user/companyMine/myBlockchain/myBlockchain.js @@ -0,0 +1,88 @@ +// pages/user/companyMine/focusedProject/focusedProject.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + lists: [], + page: 1, + has_more: true + }, + onShow() { + this.getList(); + }, + + // 获取活动列表 + getList() { + wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => { + setTimeout(() => { + wx.hideLoading({}) + }, 1000); + var lists = this.data.lists.concat(res.data) + if (res.page.has_more) { + this.setData({ + has_more: res.page.has_more, + page: this.data.page + 1, + lists: lists + }) + } else { + this.setData({ + has_more: res.page.has_more, + lists: lists + }) + } + }) + }, + // 触底加载更多 + onReachBottom() { + if (this.data.has_more) { + this.getList(); + } else { + wx.showToast({ + icon: 'none', + title: '没有更多', + }) + } + }, + //跳转到详情页 + goUrl(e) { + wx.navigateTo({ + url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, + }) + }, + // 取消项目 + crowdfundsUnLike(e) { + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + var arr = this.data.lists + var temp = [] + for (var i = 0; i < arr.length; i++) { + if (i != index) { + temp.push(arr[i]); + } + } + console.log(temp) + wx.showModal({ + title: '提示', + content: '确认取消关注么?', + success: res => { + if (res.confirm) { + wx.showLoading({ + title: '取消中', + }) + wx.$api.companyModule.crowdfundsUnLike(id).then(res => { + this.setData({ + lists: temp + }) + wx.showToast({ + title: '取消成功', + icon:'none' + }) + wx.hideLoading({}) + }); + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.json b/pages/user/companyMine/myBlockchain/myBlockchain.json new file mode 100644 index 0000000..bf379dd --- /dev/null +++ b/pages/user/companyMine/myBlockchain/myBlockchain.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "区块链证书", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.wxml b/pages/user/companyMine/myBlockchain/myBlockchain.wxml new file mode 100644 index 0000000..74d983f --- /dev/null +++ b/pages/user/companyMine/myBlockchain/myBlockchain.wxml @@ -0,0 +1,10 @@ + + + 企获客授权 [ 艾米家的傻钢 ] 区块链证书 + + 区块链编号 + jiquwrofkdjs09u834545124dkafodjfihi + + + +区块链技术支持:域展科技 \ No newline at end of file diff --git a/pages/user/companyMine/myBlockchain/myBlockchain.wxss b/pages/user/companyMine/myBlockchain/myBlockchain.wxss new file mode 100644 index 0000000..ae24a62 --- /dev/null +++ b/pages/user/companyMine/myBlockchain/myBlockchain.wxss @@ -0,0 +1,53 @@ +.content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + box-sizing: border-box; + padding: 20rpx 140rpx; + margin-top: 2rpx; + position: relative; + width: 100%; + height: 1066rpx; +} + +.content .bg { + width: 750rpx; + height: 1066rpx; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} + +.bottom { + color: #999; + font-size: 26rpx; + text-align: center; + padding-top: 30rpx; +} + +.content .title { + color: #043e5f; + font-size: 40rpx; + font-weight: 600; + text-align: center; +} + +.content .num { + position: absolute; + bottom: 264rpx; + color: #043e5f; + text-align: center; +} + +.font22 { + font-size: 24rpx; + padding-top: 16rpx; +} + +.font32 { + font-size: 32rpx; + font-weight: 600; + +} \ No newline at end of file diff --git a/pages/user/companyMine/myTeam/myTeam.js b/pages/user/companyMine/myTeam/myTeam.js new file mode 100644 index 0000000..54c9f16 --- /dev/null +++ b/pages/user/companyMine/myTeam/myTeam.js @@ -0,0 +1,88 @@ +// pages/user/companyMine/focusedProject/focusedProject.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + lists: [], + page: 1, + has_more: true + }, + onShow() { + this.getList(); + }, + + // 获取活动列表 + getList() { + wx.$api.companyModule.getCrowdfundsLike(this.data.page).then(res => { + setTimeout(() => { + wx.hideLoading({}) + }, 1000); + var lists = this.data.lists.concat(res.data) + if (res.page.has_more) { + this.setData({ + has_more: res.page.has_more, + page: this.data.page + 1, + lists: lists + }) + } else { + this.setData({ + has_more: res.page.has_more, + lists: lists + }) + } + }) + }, + // 触底加载更多 + onReachBottom() { + if (this.data.has_more) { + this.getList(); + } else { + wx.showToast({ + icon: 'none', + title: '没有更多', + }) + } + }, + //跳转到详情页 + goUrl(e) { + wx.navigateTo({ + url: '/pages/home/activeDetail/activeDetail?id=' + e.currentTarget.dataset.id, + }) + }, + // 取消项目 + crowdfundsUnLike(e) { + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + var arr = this.data.lists + var temp = [] + for (var i = 0; i < arr.length; i++) { + if (i != index) { + temp.push(arr[i]); + } + } + console.log(temp) + wx.showModal({ + title: '提示', + content: '确认取消关注么?', + success: res => { + if (res.confirm) { + wx.showLoading({ + title: '取消中', + }) + wx.$api.companyModule.crowdfundsUnLike(id).then(res => { + this.setData({ + lists: temp + }) + wx.showToast({ + title: '取消成功', + icon:'none' + }) + wx.hideLoading({}) + }); + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/user/companyMine/myTeam/myTeam.json b/pages/user/companyMine/myTeam/myTeam.json new file mode 100644 index 0000000..495f241 --- /dev/null +++ b/pages/user/companyMine/myTeam/myTeam.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "我的团队", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/companyMine/myTeam/myTeam.wxml b/pages/user/companyMine/myTeam/myTeam.wxml new file mode 100644 index 0000000..49a30c5 --- /dev/null +++ b/pages/user/companyMine/myTeam/myTeam.wxml @@ -0,0 +1,20 @@ + + + + + + 域展科技 + + + VIP会员 + + + 旗下团队5人 + 2020-11-11 11:11:11 + + + + + + {{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}} + \ No newline at end of file diff --git a/pages/user/companyMine/myTeam/myTeam.wxss b/pages/user/companyMine/myTeam/myTeam.wxss new file mode 100644 index 0000000..981ed41 --- /dev/null +++ b/pages/user/companyMine/myTeam/myTeam.wxss @@ -0,0 +1,108 @@ +.content { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + background-color: #fff; + padding: 20rpx 30rpx; + /* box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.1); */ + margin-top: 2rpx; +} + +.content image { + width: 100rpx; + height: 100rpx; + border-radius: 50%; +} + +.content .left { + flex: 1; + margin-left: 20rpx; + box-sizing: border-box; + position: relative; +} + +.content .title { + color: #333; + font-size: 30rpx; + padding-right: 200rpx; + position: relative; + font-weight: 400; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; + box-sizing: border-box; +} + +.content .title>span { + background-color: #378fff; + color: #fff; + border: solid 1rpx #378fff; + border-radius: 50rpx; + font-size: 22rpx; + padding: 4rpx 16rpx; + margin-left: 20rpx; + position: relative; + top: -4rpx; +} + +.content .bottom { + justify-content: space-between; + display: flex; + flex-direction: row; + align-items: stretch; + box-sizing: border-box; + font-size: 24rpx; + color: #999; + font-weight: 400; + padding: 10rpx 0; +} + +.has_more { + color: #999; + font-size: 26rpx; + text-align: center; + padding: 30rpx; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding-top: 30rpx; +} + +.has_more image { + margin-bottom: 30rpx; +} + +.runIn { + color: #fff; + border: solid 1rpx #fff; + border-radius: 50rpx; + background-color: #378fff; + font-size: 30rpx; + padding: 4rpx 20rpx 4rpx 30rpx; +} + +.total { + position: absolute; + right: 0; + top: 0; + color: #333; + font-size: 26rpx; +} + +.vip { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + flex-wrap: wrap; + box-sizing: border-box; +} +.vip image{ + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 246021c..376f5ac 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -1,38 +1,25 @@ - - 艾米家的傻钢^ - 游客 - + 艾米家的傻钢^ 游客 - - 89 - 钱包 - - - 5 - 关注 - - - 125 - 团队 - + + + 128 团队 + + 11259 关注企业 - - 升级VIP会员 享会员特权 + 升级VIP会员 享会员特权 - - 立即开通 + 立即开通 - @@ -78,11 +65,12 @@ 我的购物车 - - + + + 客服服务 @@ -97,18 +85,24 @@ 项目关注 - + 区块链证书 + + + + + + 企获客广场 - + 设置 - + diff --git a/pages/user/index.wxss b/pages/user/index.wxss index 4ab7aba..5bc0bd7 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -5,6 +5,7 @@ page { background-color: #e9e9e9; + padding-bottom: 20rpx; } /* 个人中心头部 */ @@ -13,11 +14,12 @@ page { padding: 0 30rpx; box-sizing: border-box; color: #fff; + padding-bottom: 80rpx; } .userTop-head { display: flex; - padding: 30rpx; + padding: 24rpx 30rpx; } .userTop-name { @@ -45,25 +47,29 @@ page { .userTop-nav { display: flex; + flex-direction: row; + justify-content: flex-start; + padding-left: 30rpx; } .userTop-label { - flex: 3; - text-align: center; - font-size: 28rpx; + text-align: left; + font-size: 26rpx; + min-width: 160rpx; } .userTop-label text { display: block; - font-size: 42rpx; + font-size: 36rpx; + font-weight: 600; } .userTop-vip { background-image: linear-gradient(to left, #1b2653, #354273); - border-radius: 20rpx 20rpx 0 0; - padding: 25rpx; + border-radius: 20rpx; + padding: 16rpx 25rpx; box-sizing: border-box; - margin-top: 30rpx; + margin-top: 46rpx; } .userTop-vip, @@ -75,7 +81,7 @@ page { .userTop-text { flex: 1; line-height: 60rpx; - font-size: 30rpx; + font-size: 28rpx; } .userTop-text image { @@ -91,7 +97,7 @@ page { height: 60rpx; line-height: 60rpx; padding-right: 20rpx; - font-size: 26rpx; + font-size: 24rpx; } .userTop-btn image { @@ -107,37 +113,43 @@ page { background-color: white; overflow: hidden; margin: 30rpx 20rpx; + position: relative; + top: -80rpx; } .userNav-label { width: 33.33%; float: left; text-align: center; - font-weight: 600; + font-weight: 400; color: #353535; - font-size: 30rpx; + font-size: 28rpx; } .userNav-label-img { width: 104rpx; height: 104rpx; border-radius: 40rpx; - margin: 0 auto 20rpx; + margin: 0 auto 1rpx; color: #fff; padding: 25rpx; box-sizing: border-box; } .userNav-label:nth-child(1) .userNav-label-img { - background-image: linear-gradient(to top, #91d634, #75c470); + /* background-image: linear-gradient(to top, #91d634, #75c470); */ } .userNav-label:nth-child(2) .userNav-label-img { - background-image: linear-gradient(to top, #04d2c1, #3caff1); + /* background-image: linear-gradient(to top, #04d2c1, #3caff1); */ } .userNav-label:nth-child(3) .userNav-label-img { - background-image: linear-gradient(to top, #ff686c, #ff0d76); + /* background-image: linear-gradient(to top, #ff686c, #ff0d76); */ +} + +.bgcolor { + background-image: linear-gradient(to top, #91d634, #75c470); } .userNav-label image { @@ -154,6 +166,8 @@ page { margin: 0 20rpx; padding: 30rpx 20rpx 0; box-sizing: border-box; + position: relative; + top: -80rpx; } .userTool-title { @@ -166,7 +180,7 @@ page { .userTool-title::after { position: absolute; content: ''; - background-color: #066aff; + background-color: #378fff; left: 0; top: 15%; width: 8rpx; @@ -185,6 +199,8 @@ page { float: left; text-align: center; margin-bottom: 50rpx; + font-size: 26rpx; + color: #333; } .userTool-label-img { @@ -195,6 +211,20 @@ page { margin-bottom: 15rpx; } +.userTool-label-img-button { + width: 94rpx; + height: 94rpx; + margin-bottom: 15rpx; + background-color: red; +} +.userTool-label-img-button image{ + position: absolute; + left: 0; + top: 0; + height: 100%; + width: 100%; +} + .userTool-label-img image { position: absolute; left: 0; diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.js b/pages/user/setting/aboutAdvice/aboutAdvice.js new file mode 100644 index 0000000..28f0b32 --- /dev/null +++ b/pages/user/setting/aboutAdvice/aboutAdvice.js @@ -0,0 +1,3 @@ +Page({ + data: {} +}) \ No newline at end of file diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.json b/pages/user/setting/aboutAdvice/aboutAdvice.json new file mode 100644 index 0000000..a5166db --- /dev/null +++ b/pages/user/setting/aboutAdvice/aboutAdvice.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "意见建议", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.wxml b/pages/user/setting/aboutAdvice/aboutAdvice.wxml new file mode 100644 index 0000000..276fab6 --- /dev/null +++ b/pages/user/setting/aboutAdvice/aboutAdvice.wxml @@ -0,0 +1 @@ +yijian \ No newline at end of file diff --git a/pages/user/setting/aboutAdvice/aboutAdvice.wxss b/pages/user/setting/aboutAdvice/aboutAdvice.wxss new file mode 100644 index 0000000..b664d44 --- /dev/null +++ b/pages/user/setting/aboutAdvice/aboutAdvice.wxss @@ -0,0 +1,17 @@ +.item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + padding: 30rpx 30rpx; + color: #333; + font-weight: 400; + background-color: #fff; + border-top: #f7f7f7 solid 1rpx; +} + +.item image { + width: 50rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/user/setting/aboutMine/aboutMine.js b/pages/user/setting/aboutMine/aboutMine.js new file mode 100644 index 0000000..2bd47c2 --- /dev/null +++ b/pages/user/setting/aboutMine/aboutMine.js @@ -0,0 +1,89 @@ +Page({ + + /** + * 页面的初始数据 + */ + data: { + userId: "", //用户id + phone: "", //用户信息 + nickname: "", //用户昵称 + cover: "", //用户头像 + columns: ["未知", "男", "女"], + gender: 0 || wx.getStorageSync("gender") * 1, + date: '2016-09-01', + region: ['广东省', '广州市', '海珠区'], + }, + + // 选择性别 + pickSex: function (e) { + this.setData({ + gender: e.detail.value + }); + // console.log("当前选择性别-sex", e.detail.value); + }, + // 选择出生年月日 + bindTimeChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + time: e.detail.value + }) + }, + // 选择所在区域 + bindRegionChange: function (e) { + console.log('picker发送选择改变,携带值为', e.detail.value) + this.setData({ + region: e.detail.value + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + wx.$api.user.userInfoEdit().then(res => { + this.setData({ + phone: res.username, + nickname: res.nickname, + cover: res.avatar + }) + }) + }, + + // 跳转到修改页面 + goUrl() { + wx.navigateTo({ + url: "../editUserInfo/editUserInfo?nickname=" + this.data.nickname + }) + }, + + // 更新头像 + upload() { + wx.chooseImage({ + count: 1, // 默认9 + success: res => { + const src = res.tempFilePaths[0] + wx.navigateTo({ + url: '../tailoring/tailoring?src=' + src + }) + } + }) + }, + + logOut() { + wx.showModal({ + title: "退出提示", + content: "是否现在就退出", + showCancel: true, + confirmColor: "#0b0041", + confirmText: "确定", + success: (res) => { + if (res.confirm) { + wx.clearStorage({ + success: () => { + wx.navigateBack() + } + }) + } + } + }) + } +}) \ No newline at end of file diff --git a/pages/user/setting/aboutMine/aboutMine.json b/pages/user/setting/aboutMine/aboutMine.json new file mode 100644 index 0000000..e8c2c06 --- /dev/null +++ b/pages/user/setting/aboutMine/aboutMine.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "设置" +} \ No newline at end of file diff --git a/pages/user/setting/aboutMine/aboutMine.wxml b/pages/user/setting/aboutMine/aboutMine.wxml new file mode 100644 index 0000000..c49c851 --- /dev/null +++ b/pages/user/setting/aboutMine/aboutMine.wxml @@ -0,0 +1,67 @@ + + + 头像 + + + + + + + 昵称 + + + + + + + 真实姓名 + + + + + + + 性别 + + + + {{ columns[gender] == "" ? "请输入性别" : "" }}{{ columns[gender] }} + + + + + + + 手机号 + + + + + + + 生日 + + + + 当前选择: {{date}} + + + + + + + 所在区域 + + + + 当前选择:{{region[0]}},{{region[1]}},{{region[2]}} + + + + + + + + +退出登录 +保存 \ No newline at end of file diff --git a/pages/user/setting/aboutMine/aboutMine.wxss b/pages/user/setting/aboutMine/aboutMine.wxss new file mode 100644 index 0000000..a50f86d --- /dev/null +++ b/pages/user/setting/aboutMine/aboutMine.wxss @@ -0,0 +1,79 @@ +.info_blcok { + margin-top: 30rpx; +} + +.info_list { + background-color: #fff; + width: 100%; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + color: #8e8e8e; + font-size: 30rpx; + border-bottom: solid 1rpx #f7f7f7; + line-height: 90rpx; + padding: 0 30rpx; +} + +.info_list.cover { + padding: 20rpx 30rpx; +} + +.info_list:last-child { + border-bottom: none; +} + +.info_list_title { + width: 200rpx; +} + +.info_list .header { + width: 100rpx; + height: 100rpx; + border-radius: 50%; + margin-right: 10rpx; + background-color: #eee; +} + +.info_list .end { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: center; + box-sizing: border-box; + flex: 1; +} + +.info_list .txt { + padding-right: 10rpx; + color: #333; + text-align: right; +} + +.info_list .txt1 { + color: #f89602; + font-weight: 600; +} + +.beSure { + background-color: #cacaca; + color: #fff; + font-weight: bold; + position: fixed; + bottom: 30rpx; + left: 30rpx; + right: 30rpx; + height: 90rpx; + line-height: 90rpx; + text-align: center; + border-radius: 0; + font-size: 32rpx; + width: 44%; +} + +.beSure1 { + background-color: #378fff; + left: calc(48% + 30rpx); +} \ No newline at end of file diff --git a/pages/user/setting/aboutUs/aboutUs.js b/pages/user/setting/aboutUs/aboutUs.js new file mode 100644 index 0000000..28f0b32 --- /dev/null +++ b/pages/user/setting/aboutUs/aboutUs.js @@ -0,0 +1,3 @@ +Page({ + data: {} +}) \ No newline at end of file diff --git a/pages/user/setting/aboutUs/aboutUs.json b/pages/user/setting/aboutUs/aboutUs.json new file mode 100644 index 0000000..0d3baf0 --- /dev/null +++ b/pages/user/setting/aboutUs/aboutUs.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "设置", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/setting/aboutUs/aboutUs.wxml b/pages/user/setting/aboutUs/aboutUs.wxml new file mode 100644 index 0000000..3a6ecdd --- /dev/null +++ b/pages/user/setting/aboutUs/aboutUs.wxml @@ -0,0 +1 @@ +关于我们 \ No newline at end of file diff --git a/pages/user/setting/aboutUs/aboutUs.wxss b/pages/user/setting/aboutUs/aboutUs.wxss new file mode 100644 index 0000000..b664d44 --- /dev/null +++ b/pages/user/setting/aboutUs/aboutUs.wxss @@ -0,0 +1,17 @@ +.item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + padding: 30rpx 30rpx; + color: #333; + font-weight: 400; + background-color: #fff; + border-top: #f7f7f7 solid 1rpx; +} + +.item image { + width: 50rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/user/setting/setting.js b/pages/user/setting/setting.js new file mode 100644 index 0000000..28f0b32 --- /dev/null +++ b/pages/user/setting/setting.js @@ -0,0 +1,3 @@ +Page({ + data: {} +}) \ No newline at end of file diff --git a/pages/user/setting/setting.json b/pages/user/setting/setting.json new file mode 100644 index 0000000..0d3baf0 --- /dev/null +++ b/pages/user/setting/setting.json @@ -0,0 +1,6 @@ +{ + "usingComponents": {}, + "navigationBarTitleText": "设置", + "navigationBarTextStyle": "white", + "navigationBarBackgroundColor": "#378fff" +} \ No newline at end of file diff --git a/pages/user/setting/setting.wxml b/pages/user/setting/setting.wxml new file mode 100644 index 0000000..8a7e730 --- /dev/null +++ b/pages/user/setting/setting.wxml @@ -0,0 +1,9 @@ + + 个人信息 + + + 意见建议 + + + 关于我们 + \ No newline at end of file diff --git a/pages/user/setting/setting.wxss b/pages/user/setting/setting.wxss new file mode 100644 index 0000000..b664d44 --- /dev/null +++ b/pages/user/setting/setting.wxss @@ -0,0 +1,17 @@ +.item { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + box-sizing: border-box; + padding: 30rpx 30rpx; + color: #333; + font-weight: 400; + background-color: #fff; + border-top: #f7f7f7 solid 1rpx; +} + +.item image { + width: 50rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/user/setting/tailoring/tailoring.js b/pages/user/setting/tailoring/tailoring.js new file mode 100644 index 0000000..3ced202 --- /dev/null +++ b/pages/user/setting/tailoring/tailoring.js @@ -0,0 +1,555 @@ +/** + * wx-cropper 2.0 + * 基于微信小程序的图片裁剪工具 + * @author ifmiss + */ + +// 裁剪图片的宽度设置 +const CROPPER_WIDTH = 720 + +// 裁剪显示的最大比例,如果裁剪的图片过长,则做限制,默认最大宽高比例为 宽640 / 高960 (宽高比例) +const CROPPER_RATIO = 0.7 + +/** + * 初始化裁剪的比例 如果是正方形则是 1 + * 比例为宽高比 建议区间为 0.25 - 4 + * 设置为0的时候则是不固定宽高 + */ +const CROPPER_AREA_RATIO = 1 + +// 裁剪的位置 +let CUT_L, // 初始化拖拽元素的left值 + CUT_T, // 初始化拖拽元素的top值 + CUT_R, // 初始化拖拽元素的 + CUT_B, // 初始化拖拽元素的 + + // 裁剪的宽度 + CUT_W, // 初始化拖拽元素的宽度 + CUT_H, // 初始化拖拽元素的高度 + + // 拖拽相关 + PAGE_X, // 手按下的x位置 + PAGE_Y, // 手按下y的位置 + T_PAGE_X, // 手移动的时候x的位置 + T_PAGE_Y, // 手移动的时候Y的位置x + + // 图片比例 + IMG_RATIO, + + // 图片实际宽高 + IMG_REAL_W, // 图片实际的宽度 + IMG_REAL_H, // 图片实际的高度 + + // 裁剪图片区域的信息 + CROPPER_IMG_W, + CROPPER_IMG_H, + + // 移动的比例 + DRAFG_MOVE_RATIO = 750 / wx.getSystemInfoSync().windowWidth, //移动时候的比例, + + + INIT_DRAG_POSITION = 0, // 初始化屏幕宽度和裁剪区域的宽度之差,用于设置初始化裁剪的宽度 + + DRAW_IMAGE_W, // 设置生成的图片宽度 + + // 最大可显示得图片宽度,需要设定最大值,否则安卓部分机器会闪退, 控制qualityWidth的最大值 + maxQW = 2550 + +/** + * 最小裁剪宽度 由于设置了裁剪的UI样式,裁剪的宽高必须要有最小宽度,这个宽度是裁剪长或者宽的最短一方的宽度 + * 如 400 200 + * 那么如果只能设置为100的时候 + * 那么最小缩放到200 100的效果,之后只能放大不能缩小 + */ +const MIN_CROPPER_DIS = 100 + + + +Page({ + /** + * 页面的初始数据 + */ + data: { + imageSrc: "", + // 是否显示图片(在图片加载完成之后设置为true) + isShowImg: false, + + // 初始化的宽高 + cropperInitW: CROPPER_WIDTH, + cropperInitH: CROPPER_WIDTH, + + // 动态的宽高 + cropperW: CROPPER_WIDTH, + cropperH: CROPPER_WIDTH, + + // 动态的left top值 + cropperL: 0, + cropperT: 0, + + // 图片缩放值 + scaleP: 0, + + // 裁剪框 宽高 + cutL: 0, + cutT: 0, + cutB: 0, + cutR: 0, + + qualityWidth: DRAW_IMAGE_W, + + innerAspectRadio: DRAFG_MOVE_RATIO, + + // 图片类型 + cropperType : "" + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + imageSrc : options.src, + cropperType : options.type || "" + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + // 初始化 + this.loadImage(); + }, + + /** + * 选择本地图片 + * 基于底部中间的按钮的点击事件 + */ + getImage: function () { + var _this = this + wx.chooseImage({ + success: function (res) { + _this.setData({ + isShowImg: false, + imageSrc: res.tempFilePaths[0], + }) + _this.loadImage(); + }, + }) + }, + + /** + * 初始化图片信息 + * 获取图片内容,并初始化裁剪框 + */ + loadImage: function () { + var _this = this + wx.showLoading({ + title: '图片加载中...', + }) + + wx.getImageInfo({ + src: _this.data.imageSrc, + success: function success(res) { + DRAW_IMAGE_W = IMG_REAL_W = res.width + IMG_REAL_H = res.height + IMG_RATIO = IMG_REAL_W / IMG_REAL_H + + let MIN_RANGE = IMG_REAL_W > IMG_REAL_H ? IMG_REAL_W : IMG_REAL_H + + // 用于设置图片的比例(以设置裁剪的比例,方便定位裁剪的left right top bottom) + INIT_DRAG_POSITION = MIN_RANGE > INIT_DRAG_POSITION ? INIT_DRAG_POSITION : MIN_RANGE + + // 拿到裁剪位置 + let cropperPosition = _this.initCropperPosition(IMG_RATIO, CROPPER_WIDTH) + + // 根据图片的宽高显示不同的效果 保证图片可以正常显示 + if (IMG_RATIO >= 1) { + _this.setData({ + cropperW: CROPPER_WIDTH, + cropperH: CROPPER_WIDTH / IMG_RATIO, + // 初始化left right + cropperL: Math.ceil((CROPPER_WIDTH - CROPPER_WIDTH) / 2), + cropperT: 0, + cutL: cropperPosition.left, + cutT: cropperPosition.top, + cutR: cropperPosition.right, + cutB: cropperPosition.bottom, + // 图片缩放值 + scaleP: IMG_REAL_W / CROPPER_WIDTH, + qualityWidth: DRAW_IMAGE_W > maxQW ? maxQW : DRAW_IMAGE_W, + innerAspectRadio: IMG_RATIO + }) + } else { + // 此时需要判断图片的比例以设定显示裁剪区域的比例 + // let cropper_real_ratio = CROPPER_RATIO > IMG_RATIO ? CROPPER_RATIO : IMG_RATIO + + if (CROPPER_RATIO > IMG_RATIO) { + CROPPER_IMG_W = CROPPER_WIDTH / CROPPER_RATIO * IMG_RATIO + CROPPER_IMG_H = CROPPER_WIDTH / CROPPER_RATIO + } else { + CROPPER_IMG_W = CROPPER_WIDTH + CROPPER_IMG_H = CROPPER_IMG_W / IMG_RATIO + } + + // 动态生成新的CROPPER的真实宽度 高度 + // CROPPER_IMG_W = CROPPER_WIDTH * cropper_real_ratio + // CROPPER_IMG_H = CROPPER_WIDTH / cropper_real_ratio / IMG_RATIO + + + _this.setData({ + cropperW: CROPPER_IMG_W, + cropperH: CROPPER_IMG_H, + // 初始化left right + cropperL: Math.ceil((CROPPER_WIDTH - CROPPER_IMG_W) / 2), + cropperT: 0, + + cutL: cropperPosition.left, + cutT: cropperPosition.top, + cutR: cropperPosition.right, + cutB: cropperPosition.bottom, + // 图片缩放值 + scaleP: IMG_REAL_W / CROPPER_IMG_W, + qualityWidth: DRAW_IMAGE_W > maxQW ? maxQW : DRAW_IMAGE_W, + innerAspectRadio: IMG_RATIO + }) + } + _this.setData({ + isShowImg: true + }) + wx.hideLoading() + } + }) + }, + + /** + * 初始化裁剪区域的 + * left right top bottom + * 需要 CROPPER_AREA_RATIO 来判断 + * @return 返回裁剪的left, right, top bottom的值 + */ + initCropperPosition(radio) { + let left = 0, + right = 0, + top = 0, + bottom = 0, + cropperW, + cropperH + // 如果 CROPPER_AREA_RATIO = 0 则不限制固定宽高 + if (CROPPER_AREA_RATIO === 0) return { + left, + right, + top, + bottom + } + + // 宽大于等于高 + if (radio >= 1) { + cropperW = CROPPER_WIDTH + cropperH = CROPPER_WIDTH / IMG_RATIO + if (radio > CROPPER_AREA_RATIO) { + return { + left: Math.ceil((cropperW - cropperH * CROPPER_AREA_RATIO) / 2), + right: Math.ceil((cropperW - cropperH * CROPPER_AREA_RATIO) / 2), + top: 0, + bottom: 0 + } + } + return { + left: 0, + right: 0, + top: Math.ceil((cropperH - cropperW / CROPPER_AREA_RATIO) / 2), + bottom: Math.ceil((cropperH - cropperW / CROPPER_AREA_RATIO) / 2) + } + } + + // 此时需要判断图片的比例以设定显示裁剪区域的比例 + let cropper_real_ratio = CROPPER_RATIO > IMG_RATIO ? CROPPER_RATIO : IMG_RATIO + // 高大于宽 + cropperW = CROPPER_WIDTH / cropper_real_ratio * IMG_RATIO + cropperH = CROPPER_WIDTH / cropper_real_ratio + if (radio < CROPPER_AREA_RATIO) { + return { + left: 0, + right: 0, + top: Math.ceil((cropperH - cropperW / CROPPER_AREA_RATIO) / 2), + bottom: Math.ceil((cropperH - cropperW / CROPPER_AREA_RATIO) / 2) + } + } + return { + left: Math.ceil((cropperW - cropperH * CROPPER_AREA_RATIO) / 2), + right: Math.ceil((cropperW - cropperH * CROPPER_AREA_RATIO) / 2), + top: 0, + bottom: 0 + } + }, + + /** + * 拖动时候触发的touchStart事件 + */ + contentStartMove(e) { + PAGE_X = e.touches[0].pageX + PAGE_Y = e.touches[0].pageY + }, + + /** + * 拖动时候触发的touchMove事件 + */ + contentMoveing(e) { + var _this = this + var dragLengthX = (PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO + var dragLengthY = (PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO * DRAFG_MOVE_RATIO + + // 左移右移 + if (dragLengthX > 0) { + if (this.data.cutL - dragLengthX < 0) dragLengthX = this.data.cutL + } else { + if (this.data.cutR + dragLengthX < 0) dragLengthX = -this.data.cutR + } + + + // 上移下移 + if (dragLengthY > 0) { + if (this.data.cutT - dragLengthY < 0) dragLengthY = this.data.cutT + } else { + if (this.data.cutB + dragLengthY < 0) dragLengthY = -this.data.cutB + } + this.setData({ + cutL: this.data.cutL - dragLengthX, + cutT: this.data.cutT - dragLengthY, + cutR: this.data.cutR + dragLengthX, + cutB: this.data.cutB + dragLengthY + }) + + + PAGE_X = e.touches[0].pageX + PAGE_Y = e.touches[0].pageY + }, + + contentTouchEnd() { + + }, + + /** + * 点击取消关闭裁剪页面 + */ + close() { + // wx.redirectTo() + }, + + /** + * 点击完成之后 + * 生成图片信息 + */ + getImageInfo() { + var _this = this + wx.showLoading({ + title: '图片生成中...', + }) + // 将图片写入画布 + const ctx = wx.createCanvasContext('myCanvas') + let w = this.data.qualityWidth + let h = this.data.qualityWidth / IMG_RATIO + ctx.drawImage(_this.data.imageSrc, 0, 0, w, h); + ctx.draw(true, () => { + // 获取画布要裁剪的位置和宽度 均为百分比 * 画布中图片的宽度 保证了在微信小程序中裁剪的图片模糊 位置不对的问题 + var canvasW = ((_this.data.cropperW - _this.data.cutL - _this.data.cutR) / _this.data.cropperW) * w + var canvasH = ((_this.data.cropperH - _this.data.cutT - _this.data.cutB) / _this.data.cropperH) * h + var canvasL = (_this.data.cutL / _this.data.cropperW) * w + var canvasT = (_this.data.cutT / _this.data.cropperH) * h + + // 生成图片 + wx.canvasToTempFilePath({ + x: canvasL, + y: canvasT, + width: canvasW, + height: canvasH, + destWidth: canvasW, + destHeight: canvasH, + quality: 0.5, + canvasId: 'myCanvas', + success: res=> { + wx.hideLoading() + wx.$api.file.uploadImg(res.tempFilePath, {}).then(res => { + //获取页面栈 + let pages = getCurrentPages(), + updData = res + //获取所需页面 + let prevPage = pages[pages.length -2];//上一页 + + if(this.data.cropperType == "logo" || this.data.cropperType == "cardImg"){ + prevPage.setData({ + cover : updData + }) + wx.navigateBack() + }else{ + // 头像上传 + wx.$api.user.EditCover({ + value: updData.path + }).then(() => { + prevPage.setData({ + cover: updData.showpath + }); + wx.navigateBack() + }) + } + }) + } + }) + }) + }, + + /** + * 设置大小的时候触发的touchStart事件 + * 存数据 + */ + dragStart(e) { + T_PAGE_X = e.touches[0].pageX + T_PAGE_Y = e.touches[0].pageY + CUT_L = this.data.cutL + CUT_R = this.data.cutR + CUT_B = this.data.cutB + CUT_T = this.data.cutT + }, + + /** + * 设置大小的时候触发的touchMove事件 + * 根据dragType判断类型 + * 4个方向的边线拖拽效果 + * 右下角按钮的拖拽效果 + */ + dragMove(e) { + var _this = this + var dragType = e.target.dataset.drag + switch (dragType) { + case 'right': + var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO + if (CUT_R + dragLength < 0) dragLength = -CUT_R + if (CUT_R + dragLength + MIN_CROPPER_DIS > this.data.cropperW - this.data.cutL) dragLength = (this.data.cropperW - this.data.cutL) - MIN_CROPPER_DIS - CUT_R + + if (CROPPER_AREA_RATIO) { + // 底部线的限制 不允许超出 + // dragLength 最大不能超过CUT_B + if (CUT_B + dragLength / CROPPER_AREA_RATIO <= 0) { + this.setData({ + cutB: 0 + }) + return + } + this.setData({ + cutR: CUT_R + dragLength, + cutB: CUT_B + dragLength / CROPPER_AREA_RATIO + }) + } else { + this.setData({ + cutR: CUT_R + dragLength + }) + } + + break; + case 'left': + var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO + if (CUT_L - dragLength < 0) dragLength = CUT_L + if ((CUT_L - dragLength + MIN_CROPPER_DIS) > (this.data.cropperW - this.data.cutR)) dragLength = CUT_L - (this.data.cropperW - this.data.cutR) + MIN_CROPPER_DIS + + if (CROPPER_AREA_RATIO) { + // 顶部线的限制 不允许超出 + // dragLength 最大不能超过CUT_T + if (CUT_T - dragLength / CROPPER_AREA_RATIO < 0) { + this.setData({ + cutT: 0 + }) + return + } + this.setData({ + cutL: CUT_L - dragLength, + cutT: CUT_T - dragLength / CROPPER_AREA_RATIO + }) + } else { + this.setData({ + cutL: CUT_L - dragLength + }) + } + break; + case 'top': + var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO + if (CUT_T - dragLength < 0) dragLength = CUT_T + if ((CUT_T - dragLength + MIN_CROPPER_DIS) > this.data.cropperH - this.data.cutB) dragLength = CUT_T - (this.data.cropperH - this.data.cutB) + MIN_CROPPER_DIS + + if (CROPPER_AREA_RATIO) { + // left 线的限制 不允许超出 + // dragLength 最大不能超过CUT_L + if (CUT_L - dragLength * CROPPER_AREA_RATIO < 0) { + this.setData({ + cutL: 0 + }) + return + } + this.setData({ + cutL: CUT_L - dragLength * CROPPER_AREA_RATIO, + cutT: CUT_T - dragLength + }) + } else { + this.setData({ + cutT: CUT_T - dragLength + }) + } + break; + case 'bottom': + var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO + if (CUT_B + dragLength < 0) dragLength = -CUT_B + if (CUT_B + dragLength + MIN_CROPPER_DIS > this.data.cropperH - this.data.cutT) dragLength = (this.data.cropperH - this.data.cutT) - MIN_CROPPER_DIS - CUT_B + + if (CROPPER_AREA_RATIO) { + // right 线的限制 不允许超出 + // dragLength 最大不能超过 CUT_R + if (CUT_R + dragLength * CROPPER_AREA_RATIO < 0) { + this.setData({ + cutR: 0 + }) + return + } + this.setData({ + cutR: CUT_R + dragLength * CROPPER_AREA_RATIO, + cutB: CUT_B + dragLength + }) + } else { + this.setData({ + cutB: CUT_B + dragLength + }) + } + break; + case 'rightBottom': + var dragType = e.target.dataset.drag + var dragLengthX = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO + var dragLengthY = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO + if (CUT_B + dragLengthY < 0) dragLengthY = -CUT_B + if (CUT_B + dragLengthY + MIN_CROPPER_DIS > this.data.cropperH - this.data.cutT) dragLengthY = (this.data.cropperH - this.data.cutT) - MIN_CROPPER_DIS - CUT_B + if (CUT_R + dragLengthX < 0) dragLengthX = -CUT_R + if (CUT_R + dragLengthX + MIN_CROPPER_DIS > this.data.cropperW - this.data.cutL) dragLengthX = (this.data.cropperW - this.data.cutL) - MIN_CROPPER_DIS - CUT_R + + if (CROPPER_AREA_RATIO) { + // right 线的限制 不允许超出 + // dragLength 最大不能超过 CUT_R + if (CUT_R + dragLengthY * CROPPER_AREA_RATIO < 0) { + this.setData({ + cutR: 0 + }) + return + } + this.setData({ + cutR: CUT_R + dragLengthY * CROPPER_AREA_RATIO, + cutB: CUT_B + dragLengthY + }) + } else { + this.setData({ + cutB: CUT_B + dragLengthY, + cutR: CUT_R + dragLengthX + }) + } + break; + default: + break; + } + }, +}) \ No newline at end of file diff --git a/pages/user/setting/tailoring/tailoring.json b/pages/user/setting/tailoring/tailoring.json new file mode 100644 index 0000000..6461b9a --- /dev/null +++ b/pages/user/setting/tailoring/tailoring.json @@ -0,0 +1,5 @@ +{ + "navigationBarBackgroundColor": "#000000", + "navigationBarTitleText": "", + "navigationBarTextStyle": "white" +} \ No newline at end of file diff --git a/pages/user/setting/tailoring/tailoring.wxml b/pages/user/setting/tailoring/tailoring.wxml new file mode 100644 index 0000000..8a2b777 --- /dev/null +++ b/pages/user/setting/tailoring/tailoring.wxml @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/pages/user/setting/tailoring/tailoring.wxss b/pages/user/setting/tailoring/tailoring.wxss new file mode 100644 index 0000000..15b1f55 --- /dev/null +++ b/pages/user/setting/tailoring/tailoring.wxss @@ -0,0 +1,397 @@ +/* pages/wx-cropper/index.wxss */ +Page { + /* 点的颜色 */ + --primary-color: #69f; + /* 边框颜色 */ + --primary-color-outline: rgba(102, 153, 255, .75); + /* 虚线颜色 */ + --primary-color-dashed: rgba(255, 255, 255, 0.46); + /* 裁剪区域背景色 */ + --box-bg: rgba(255, 255, 255, 0.3); +} + +.wx-content-info { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: block; + align-items: center; + flex-direction: column; + background: #000; +} + +.cropper-config { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 90rpx; + display: flex; + align-items: center; + justify-content: space-between; + border-top: 1px solid rgba(255, 255, 255, .12); + padding-bottom: env(safe-area-inset-bottom); +} + +.cropper-config .cropper-cancle, +.cropper-config .cropper-save { + color: #fff; + font-size: 26rpx; + padding: 15rpx 25px; +} + +.cropper-content { + min-height: calc(100% - 80rpx); + width: 720rpx; + margin: 0 auto; + margin-top: 8rpx; + display: flex; + align-items: center; +} + +.wx-corpper { + position: relative; + overflow: visible; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; + box-sizing: border-box; +} + +.wx-corpper-content { + position: relative; +} + +.wx-corpper-content image { + display: block; + width: 100%; + min-width: 0 !important; + max-width: none !important; + height: 100%; + min-height: 0 !important; + max-height: none !important; + image-orientation: 0deg !important; + margin: 0 auto; +} + +/* 移动图片效果 */ +.wx-cropper-drag-box { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + cursor: move; + background: rgba(0, 0, 0, 0.6); + z-index: 1; +} + +/* 内部的信息 */ +.wx-corpper-crop-box { + position: absolute; + background: var(--box-bg); + z-index: 2; +} + +.wx-corpper-crop-box .wx-cropper-view-box { + position: relative; + display: block; + width: 100%; + height: 100%; + overflow: visible; + outline: 1px solid var(--primary-color-outline); +} + +/* 横向虚线 */ +.wx-cropper-dashed-h { + position: absolute; + top: 33.33333333%; + left: 0; + width: 100%; + height: 33.33333333%; + border-top: 1px dashed var(--primary-color-dashed); + border-bottom: 1px dashed var(--primary-color-dashed); +} + +/* 纵向虚线 */ +.wx-cropper-dashed-v { + position: absolute; + left: 33.33333333%; + top: 0; + width: 33.33333333%; + height: 100%; + border-left: 1px dashed var(--primary-color-dashed); + border-right: 1px dashed var(--primary-color-dashed); +} + +/* 四个方向的线 为了之后的拖动事件*/ +.wx-cropper-line-t { + position: absolute; + display: block; + width: 100%; + background-color: var(--primary-color); + top: 0; + left: 0; + height: 1px; + opacity: 0.1; + cursor: n-resize; +} + +.wx-cropper-line-t::before { + content: ''; + position: absolute; + top: 50%; + right: 0rpx; + width: 100%; + -webkit-transform: translate3d(0, -50%, 0); + transform: translate3d(0, -50%, 0); + bottom: 0; + height: 41rpx; + background: transparent; + z-index: 11; +} + +.wx-cropper-line-r { + position: absolute; + display: block; + background-color: var(--primary-color); + top: 0; + right: 0px; + width: 1px; + opacity: 0.1; + height: 100%; + cursor: e-resize; +} + +.wx-cropper-line-r::before { + content: ''; + position: absolute; + top: 0; + left: 50%; + width: 41rpx; + -webkit-transform: translate3d(-50%, 0, 0); + transform: translate3d(-50%, 0, 0); + bottom: 0; + height: 100%; + background: transparent; + z-index: 11; +} + +.wx-cropper-line-b { + position: absolute; + display: block; + width: 100%; + background-color: var(--primary-color); + bottom: 0; + left: 0; + height: 1px; + opacity: 0.1; + cursor: s-resize; +} + +.wx-cropper-line-b::before { + content: ''; + position: absolute; + top: 50%; + right: 0rpx; + width: 100%; + -webkit-transform: translate3d(0, -50%, 0); + transform: translate3d(0, -50%, 0); + bottom: 0; + height: 41rpx; + background: transparent; + z-index: 11; +} + +.wx-cropper-line-l { + position: absolute; + display: block; + background-color: var(--primary-color); + top: 0; + left: 0; + width: 1px; + opacity: 0.1; + height: 100%; + cursor: w-resize; +} + +.wx-cropper-line-l::before { + content: ''; + position: absolute; + top: 0; + left: 50%; + width: 41rpx; + -webkit-transform: translate3d(-50%, 0, 0); + transform: translate3d(-50%, 0, 0); + bottom: 0; + height: 100%; + background: transparent; + z-index: 11; +} + +.wx-cropper-point { + width: 5px; + height: 5px; + /* background-color: var(--primary-color); */ + opacity: .75; + position: absolute; + z-index: 3; +} + +.point-t { + top: -3px; + left: 50%; + margin-left: -3px; + cursor: n-resize; +} + +.point-r { + top: 50%; + left: 100%; + margin-left: -3px; + margin-top: -3px; + cursor: n-resize; +} + +.point-tr, +.point-rb, +.point-bl, +.point-lt { + cursor: n-resize; + width: 29rpx; + height: 29rpx; + position: absolute; + z-index: 1112; + opacity: 1; +} + +.point-rb { + right: 0; + bottom: 0; + -webkit-transform: translate3d(50%, 50%, 0); +} + +.point-tr { + right: 0; + top: 0; + -webkit-transform: translate3d(50%, -50%, 0); +} + +.point-bl { + left: 0; + bottom: 0; + -webkit-transform: translate3d(-50%, 50%, 0); +} + +.point-lt { + top: 0; + left: 0; + -webkit-transform: translate3d(-50%, -50%, 0); +} + +.point-rb::before, +.point-rb::after, +.point-tr::before, +.point-tr::after, +.point-bl::before, +.point-bl::after, +.point-lt::before, +.point-lt::after { + content: ''; + position: absolute; + background-color: var(--primary-color); +} + +/* 右下 */ +.point-rb::before { + width: 6rpx; + height: 30rpx; + right: calc(50% - 6rpx); + bottom: calc(50% - 6rpx); +} + +.point-rb::after { + height: 6rpx; + width: 30rpx; + right: calc(50% - 6rpx); + bottom: calc(50% - 6rpx); +} + +/* 右上 */ +.point-tr::before { + width: 6rpx; + height: 30rpx; + right: calc(50% - 6rpx); + top: calc(50% - 6rpx); +} + +.point-tr::after { + height: 6rpx; + width: 30rpx; + right: calc(50% - 6rpx); + top: calc(50% - 6rpx); +} + +/* 左下 */ +.point-bl::before { + width: 6rpx; + height: 30rpx; + left: calc(50% - 6rpx); + bottom: calc(50% - 6rpx); +} + +.point-bl::after { + height: 6rpx; + width: 30rpx; + left: calc(50% - 6rpx); + bottom: calc(50% - 6rpx); +} + +/* 左上 */ +.point-lt::before { + width: 6rpx; + height: 30rpx; + left: calc(50% - 6rpx); + top: calc(50% - 6rpx); +} + +.point-lt::after { + height: 6rpx; + width: 30rpx; + left: calc(50% - 6rpx); + top: calc(50% - 6rpx); +} + +.point-b { + left: 50%; + top: 100%; + margin-left: -3px; + margin-top: -3px; + cursor: n-resize; +} + +.point-l { + left: 0%; + top: 50%; + margin-left: -3px; + margin-top: -3px; + cursor: n-resize; +} + +/* 裁剪框预览内容 */ +.wx-cropper-viewer { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; +} + +.wx-cropper-viewer image { + position: absolute; + z-index: 2; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index dff0407..132abac 100644 --- a/project.config.json +++ b/project.config.json @@ -1,120 +1,120 @@ { - "description": "项目配置文件", - "packOptions": { - "ignore": [] + "description": "项目配置文件", + "packOptions": { + "ignore": [] + }, + "setting": { + "urlCheck": true, + "es6": true, + "enhance": false, + "postcss": true, + "preloadBackgroundData": false, + "minified": true, + "newFeature": true, + "coverView": true, + "nodeModules": true, + "autoAudits": false, + "showShadowRootInWxmlPanel": true, + "scopeDataCheck": false, + "uglifyFileName": false, + "checkInvalidKey": true, + "checkSiteMap": true, + "uploadWithSourceMap": true, + "compileHotReLoad": false, + "useMultiFrameRuntime": false, + "useApiHook": true, + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" }, - "setting": { - "urlCheck": true, - "es6": true, - "enhance": false, - "postcss": true, - "preloadBackgroundData": false, - "minified": true, - "newFeature": true, - "coverView": true, - "nodeModules": true, - "autoAudits": false, - "showShadowRootInWxmlPanel": true, - "scopeDataCheck": false, - "uglifyFileName": false, - "checkInvalidKey": true, - "checkSiteMap": true, - "uploadWithSourceMap": true, - "compileHotReLoad": false, - "useMultiFrameRuntime": false, - "useApiHook": true, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - }, - "enableEngineNative": false, - "bundle": false, - "useIsolateContext": true, - "useCompilerModule": false, - "userConfirmedUseCompilerModuleSwitch": false, - "userConfirmedBundleSwitch": false, - "packNpmManually": false, - "packNpmRelationList": [], - "minifyWXSS": true + "enableEngineNative": false, + "bundle": false, + "useIsolateContext": true, + "useCompilerModule": false, + "userConfirmedUseCompilerModuleSwitch": false, + "userConfirmedBundleSwitch": false, + "packNpmManually": false, + "packNpmRelationList": [], + "minifyWXSS": true + }, + "compileType": "miniprogram", + "libVersion": "2.13.2", + "appid": "wxd931d03dfe955254", + "projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas", + "debugOptions": { + "hidedInDevtools": [] + }, + "isGameTourist": false, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "plugin": { + "list": [] }, - "compileType": "miniprogram", - "libVersion": "2.13.2", - "appid": "wxd931d03dfe955254", - "projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas", - "debugOptions": { - "hidedInDevtools": [] + "game": { + "list": [] }, - "isGameTourist": false, - "simulatorType": "wechat", - "simulatorPluginLibVersion": {}, - "condition": { - "plugin": { - "list": [] + "gamePlugin": { + "list": [] + }, + "miniprogram": { + "list": [ + { + "name": "登录", + "pathName": "pages/login/login", + "query": "", + "scene": null }, - "game": { - "list": [] + { + "name": "搜索", + "pathName": "pages/company/search/search", + "query": "", + "scene": null }, - "gamePlugin": { - "list": [] + { + "name": "商城", + "pathName": "pages/mall/index", + "query": "", + "scene": null }, - "miniprogram": { - "list": [ - { - "name": "登录", - "pathName": "pages/login/login", - "query": "", - "scene": null - }, - { - "name": "搜索", - "pathName": "pages/company/search/search", - "query": "", - "scene": null - }, - { - "name": "商城", - "pathName": "pages/mall/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/index", - "pathName": "pages/user/index", - "query": "", - "scene": null - }, - { - "name": "pages/user/companyMine/companyOrder", - "pathName": "pages/user/companyMine/companyOrder", - "query": "orderid=20201229132338964625", - "scene": null - }, - { - "name": "pages/user/companyMine/companyOrder", - "pathName": "pages/user/companyMine/companyOrder", - "query": "orderid=20201229132338964625", - "scene": null - }, - { - "name": "pages/user/companyMine/projectDetail/projectDetail", - "pathName": "pages/user/companyMine/projectDetail/projectDetail", - "query": "orderid=20201229132338964625", - "scene": null - }, - { - "name": "pages/user/companyMine/refundInfo/refundInfo", - "pathName": "pages/user/companyMine/refundInfo/refundInfo", - "query": "orderid=20201229132338964625", - "scene": null - }, - { - "name": "pages/home/index", - "pathName": "pages/home/index", - "query": "orderid=20201229132338964625", - "scene": null - } - ] + { + "name": "pages/user/index", + "pathName": "pages/user/index", + "query": "", + "scene": null + }, + { + "name": "pages/user/companyMine/companyOrder", + "pathName": "pages/user/companyMine/companyOrder", + "query": "orderid=20201229132338964625", + "scene": null + }, + { + "name": "pages/user/companyMine/companyOrder", + "pathName": "pages/user/companyMine/companyOrder", + "query": "orderid=20201229132338964625", + "scene": null + }, + { + "name": "pages/user/companyMine/projectDetail/projectDetail", + "pathName": "pages/user/companyMine/projectDetail/projectDetail", + "query": "orderid=20201229132338964625", + "scene": null + }, + { + "name": "pages/user/companyMine/refundInfo/refundInfo", + "pathName": "pages/user/companyMine/refundInfo/refundInfo", + "query": "orderid=20201229132338964625", + "scene": null + }, + { + "name": "pages/home/index", + "pathName": "pages/home/index", + "query": "orderid=20201229132338964625", + "scene": null } + ] } + } } \ No newline at end of file diff --git a/static/images/aboutAdvice.png b/static/images/aboutAdvice.png new file mode 100644 index 0000000..77b87b9 Binary files /dev/null and b/static/images/aboutAdvice.png differ diff --git a/static/images/aboutMine.png b/static/images/aboutMine.png new file mode 100644 index 0000000..6b9dae8 Binary files /dev/null and b/static/images/aboutMine.png differ diff --git a/static/images/aboutUs.png b/static/images/aboutUs.png new file mode 100644 index 0000000..8443e98 Binary files /dev/null and b/static/images/aboutUs.png differ diff --git a/static/images/zs.png b/static/images/zs.png new file mode 100644 index 0000000..09a061f Binary files /dev/null and b/static/images/zs.png differ diff --git a/static/images/zuan.png b/static/images/zuan.png new file mode 100644 index 0000000..f102a95 Binary files /dev/null and b/static/images/zuan.png differ diff --git a/static/user_iocn/userNav_00.png b/static/user_iocn/userNav_00.png index cac57b2..642c8da 100644 Binary files a/static/user_iocn/userNav_00.png and b/static/user_iocn/userNav_00.png differ diff --git a/static/user_iocn/userNav_001.png b/static/user_iocn/userNav_001.png new file mode 100644 index 0000000..cac57b2 Binary files /dev/null and b/static/user_iocn/userNav_001.png differ diff --git a/static/user_iocn/userNav_01.png b/static/user_iocn/userNav_01.png index 10daa89..9931a43 100644 Binary files a/static/user_iocn/userNav_01.png and b/static/user_iocn/userNav_01.png differ diff --git a/static/user_iocn/userNav_0100.png b/static/user_iocn/userNav_0100.png new file mode 100644 index 0000000..10daa89 Binary files /dev/null and b/static/user_iocn/userNav_0100.png differ diff --git a/static/user_iocn/userNav_02.png b/static/user_iocn/userNav_02.png index 0259ebd..b6cc4cf 100644 Binary files a/static/user_iocn/userNav_02.png and b/static/user_iocn/userNav_02.png differ diff --git a/static/user_iocn/userNav_0211.png b/static/user_iocn/userNav_0211.png new file mode 100644 index 0000000..0259ebd Binary files /dev/null and b/static/user_iocn/userNav_0211.png differ diff --git a/static/user_iocn/userTool_08.png b/static/user_iocn/userTool_08.png new file mode 100644 index 0000000..69a0bfd Binary files /dev/null and b/static/user_iocn/userTool_08.png differ