[更新]企获客初步测试版本

This commit is contained in:
唐明明
2020-12-30 15:50:33 +08:00
50 changed files with 2092 additions and 156 deletions

View File

@@ -11,9 +11,16 @@
"pages/user/index", "pages/user/index",
"pages/user/companyMine/myActives/myActives", "pages/user/companyMine/myActives/myActives",
"pages/user/companyMine/focusedProject/focusedProject", "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/companyMine/companyOrder",
"pages/user/user_coupon/user_coupon", "pages/user/user_coupon/user_coupon",
"pages/user/user_coupon_data/user_coupon_data", "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/index",
"pages/mall/mall_address/mall_address", "pages/mall/mall_address/mall_address",
"pages/mall/mall_address_form/mall_address_form", "pages/mall/mall_address_form/mall_address_form",

View File

@@ -42,7 +42,7 @@
<view wx:if='{{info.signed==0}}' class="active_now_act {{!info.canEnroll?'acted':''}}" <view wx:if='{{info.signed==0}}' class="active_now_act {{!info.canEnroll?'acted':''}}"
catchtap="{{info.canEnroll?'nowActed':''}}" data-acted='{{acted}}'> catchtap="{{info.canEnroll?'nowActed':''}}" data-acted='{{acted}}'>
<view class="left">{{info.price> 0 ? '¥' + info.price:'免费'}} </view> <view class="left">{{info.price> 0 ? '¥' + info.price:'免费'}} </view>
<span>{{!info.canEnroll?'无法报名':'立即报名'}}</span> <span>{{info.canEnrollText}}</span>
</view> </view>
<view wx:if='{{info.signed==1 || info.signed==2}}' class="active_now_act {{info.signed==2?'acted':''}}" <view wx:if='{{info.signed==1 || info.signed==2}}' class="active_now_act {{info.signed==2?'acted':''}}"
catchtap="{{info.signed==1?'signIn':''}}" data-id='{{info.active_id}}'> catchtap="{{info.signed==1?'signIn':''}}" data-id='{{info.active_id}}'>

View File

@@ -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({})
});
}
}
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "我关注的企业",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,15 @@
<!-- <view class="content" wx:for="{{lists}}" :key="index"> -->
<view class="content" wx:for="{{10}}" :key="index">
<image src="{{item.cover}}" mode="aspectFill"></image>
<view class="left">
<view class="title">域展科技 <span catchtap="crowdfundsUnLike" data-id='{{item.crowdfund_id}}'
data-index='{{index}}'>已关注</span></view>
<view class="bottom"><span>诚信值1587</span></view>
</view>
<navigator hover-class="none" url="/pages/home/index" class="runIn">进入</navigator>
</view>
<view class="has_more">
<image wx:if='{{lists.length==0}}' src="/static/images/no_list.png" style="width:200rpx;" mode="widthFix"></image>
<span>{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</span>
</view>

View File

@@ -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;
}

View File

@@ -75,6 +75,10 @@ Page({
this.setData({ this.setData({
lists: temp lists: temp
}) })
wx.showToast({
title: '取消成功',
icon: 'none'
})
wx.hideLoading({}) wx.hideLoading({})
}); });
} }

View File

@@ -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({})
});
}
}
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "区块链证书",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,10 @@
<view class="content">
<image class="bg" src="/static/images/zs.png" mode="aspectFill"></image>
<view class="title">企获客授权 [ 艾米家的傻钢 ] 区块链证书</view>
<view class="num">
<view class="font32">区块链编号</view>
<view class="font22">jiquwrofkdjs09u834545124dkafodjfihi</view>
</view>
</view>
<view class="bottom">区块链技术支持:域展科技</view>

View File

@@ -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;
}

View File

@@ -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({})
});
}
}
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的团队",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,20 @@
<!-- <view class="content" wx:for="{{lists}}" :key="index"> -->
<view class="content" wx:for="{{10}}" :key="index">
<image src="{{item.cover || '/static/images/company_bg4.png'}}" mode="aspectFill"></image>
<view class="left">
<view class="title">
域展科技
<!-- <span catchtap="crowdfundsUnLike">游客</span> -->
<span class="vip">
<image src="/static/images/zuan.png" style="width:24rpx;" mode="widthFix"></image> VIP会员
</span>
</view>
<span class="total">旗下团队5人</span>
<view class="bottom"><span>2020-11-11 11:11:11</span></view>
</view>
</view>
<view class="has_more">
<image wx:if='{{lists.length==0}}' src="/static/images/no_list.png" style="width:200rpx;" mode="widthFix"></image>
<span>{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</span>
</view>

View File

@@ -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;
}

View File

@@ -1,38 +1,25 @@
<!-- 个人中心 --> <!-- 个人中心 -->
<view class="userTop"> <view class="userTop">
<view class="userTop-head"> <view class="userTop-head">
<view class="userTop-name"> <view class="userTop-name"> 艾米家的傻钢^ <text>游客</text> </view>
艾米家的傻钢^
<text>游客</text>
</view>
<image class="userTop-img" src="/static/images/goods_text.png"></image> <image class="userTop-img" src="/static/images/goods_text.png"></image>
</view> </view>
<view class="userTop-nav"> <view class="userTop-nav">
<view class="userTop-label"> <!-- <view class="userTop-label"> <text>89</text> 钱包 </view> -->
<text>89</text> <navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/myTeam/myTeam">
钱包 <text>128</text> 团队 </navigator>
</view> <navigator hover-class="none" class="userTop-label" url="/pages/user/companyMine/focusedCompany/focusedCompany">
<view class="userTop-label"> <text>11259</text> 关注企业 </navigator>
<text>5</text>
关注
</view>
<view class="userTop-label">
<text>125</text>
团队
</view>
</view> </view>
<view class="userTop-vip"> <view class="userTop-vip">
<view class="userTop-text"> <view class="userTop-text">
<image src="/static/user_iocn/user_crown.png"></image> <image src="/static/user_iocn/user_crown.png"></image>升级VIP会员 享会员特权
升级VIP会员 享会员特权
</view> </view>
<view class="userTop-btn"> <view class="userTop-btn">
<image src="/static/user_iocn/user_vip.png"></image> <image src="/static/user_iocn/user_vip.png"></image>立即开通
立即开通
</view> </view>
</view> </view>
</view> </view>
<view class="userNav"> <view class="userNav">
<navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label"> <navigator hover-class="none" url="/pages/user/user_coupon/user_coupon" class="userNav-label">
<view class="userNav-label-img"> <view class="userNav-label-img">
@@ -78,11 +65,12 @@
</view> </view>
<text>我的购物车</text> <text>我的购物车</text>
</navigator> </navigator>
<view class="userTool-label"> <view class="userTool-label" >
<view class="userTool-label-img"> <button class="userTool-label-img-button" size="mini" open-type="contact" bindcontact="handleContact"
style='border:0;background-color:#fff;width:94rpx;height:94rpx;padding:0;margin:0;margin-bottom:10rpx;'>
<image src="/static/user_iocn/userTool_03.png"></image> <image src="/static/user_iocn/userTool_03.png"></image>
</view> </button>
<text>客服服务</text> <view>客服服务</view>
</view> </view>
<navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label"> <navigator hover-class="none" url="/pages/mall/mall_address/mall_address" class="userTool-label">
<view class="userTool-label-img"> <view class="userTool-label-img">
@@ -97,18 +85,24 @@
</view> </view>
<text>项目关注</text> <text>项目关注</text>
</navigator> </navigator>
<view class="userTool-label"> <navigator hover-class="none" url="/pages/user/companyMine/myBlockchain/myBlockchain" class="userTool-label">
<view class="userTool-label-img"> <view class="userTool-label-img">
<image src="/static/user_iocn/userTool_06.png"></image> <image src="/static/user_iocn/userTool_06.png"></image>
</view> </view>
<text>区块链证书</text> <text>区块链证书</text>
</navigator>
<view class="userTool-label ">
<view class="userTool-label-img">
<image src="/static/user_iocn/userTool_08.png"></image>
</view>
<text>企获客广场</text>
</view> </view>
<view class="userTool-label"> <navigator hover-class="none" url="/pages/user/setting/setting" class="userTool-label">
<view class="userTool-label-img"> <view class="userTool-label-img">
<image src="/static/user_iocn/userTool_07.png"></image> <image src="/static/user_iocn/userTool_07.png"></image>
</view> </view>
<text>设置</text> <text>设置</text>
</view> </navigator>
</view> </view>
</view> </view>

View File

@@ -5,6 +5,7 @@
page { page {
background-color: #e9e9e9; background-color: #e9e9e9;
padding-bottom: 20rpx;
} }
/* 个人中心头部 */ /* 个人中心头部 */
@@ -13,11 +14,12 @@ page {
padding: 0 30rpx; padding: 0 30rpx;
box-sizing: border-box; box-sizing: border-box;
color: #fff; color: #fff;
padding-bottom: 80rpx;
} }
.userTop-head { .userTop-head {
display: flex; display: flex;
padding: 30rpx; padding: 24rpx 30rpx;
} }
.userTop-name { .userTop-name {
@@ -45,25 +47,29 @@ page {
.userTop-nav { .userTop-nav {
display: flex; display: flex;
flex-direction: row;
justify-content: flex-start;
padding-left: 30rpx;
} }
.userTop-label { .userTop-label {
flex: 3; text-align: left;
text-align: center; font-size: 26rpx;
font-size: 28rpx; min-width: 160rpx;
} }
.userTop-label text { .userTop-label text {
display: block; display: block;
font-size: 42rpx; font-size: 36rpx;
font-weight: 600;
} }
.userTop-vip { .userTop-vip {
background-image: linear-gradient(to left, #1b2653, #354273); background-image: linear-gradient(to left, #1b2653, #354273);
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx;
padding: 25rpx; padding: 16rpx 25rpx;
box-sizing: border-box; box-sizing: border-box;
margin-top: 30rpx; margin-top: 46rpx;
} }
.userTop-vip, .userTop-vip,
@@ -75,7 +81,7 @@ page {
.userTop-text { .userTop-text {
flex: 1; flex: 1;
line-height: 60rpx; line-height: 60rpx;
font-size: 30rpx; font-size: 28rpx;
} }
.userTop-text image { .userTop-text image {
@@ -91,7 +97,7 @@ page {
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
padding-right: 20rpx; padding-right: 20rpx;
font-size: 26rpx; font-size: 24rpx;
} }
.userTop-btn image { .userTop-btn image {
@@ -107,37 +113,43 @@ page {
background-color: white; background-color: white;
overflow: hidden; overflow: hidden;
margin: 30rpx 20rpx; margin: 30rpx 20rpx;
position: relative;
top: -80rpx;
} }
.userNav-label { .userNav-label {
width: 33.33%; width: 33.33%;
float: left; float: left;
text-align: center; text-align: center;
font-weight: 600; font-weight: 400;
color: #353535; color: #353535;
font-size: 30rpx; font-size: 28rpx;
} }
.userNav-label-img { .userNav-label-img {
width: 104rpx; width: 104rpx;
height: 104rpx; height: 104rpx;
border-radius: 40rpx; border-radius: 40rpx;
margin: 0 auto 20rpx; margin: 0 auto 1rpx;
color: #fff; color: #fff;
padding: 25rpx; padding: 25rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.userNav-label:nth-child(1) .userNav-label-img { .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 { .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 { .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 { .userNav-label image {
@@ -154,6 +166,8 @@ page {
margin: 0 20rpx; margin: 0 20rpx;
padding: 30rpx 20rpx 0; padding: 30rpx 20rpx 0;
box-sizing: border-box; box-sizing: border-box;
position: relative;
top: -80rpx;
} }
.userTool-title { .userTool-title {
@@ -166,7 +180,7 @@ page {
.userTool-title::after { .userTool-title::after {
position: absolute; position: absolute;
content: ''; content: '';
background-color: #066aff; background-color: #378fff;
left: 0; left: 0;
top: 15%; top: 15%;
width: 8rpx; width: 8rpx;
@@ -185,6 +199,8 @@ page {
float: left; float: left;
text-align: center; text-align: center;
margin-bottom: 50rpx; margin-bottom: 50rpx;
font-size: 26rpx;
color: #333;
} }
.userTool-label-img { .userTool-label-img {
@@ -195,6 +211,20 @@ page {
margin-bottom: 15rpx; 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 { .userTool-label-img image {
position: absolute; position: absolute;
left: 0; left: 0;

View File

@@ -0,0 +1,3 @@
Page({
data: {}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "意见建议",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1 @@
yijian

View File

@@ -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;
}

View File

@@ -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()
}
})
}
}
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "设置"
}

View File

@@ -0,0 +1,67 @@
<view class="info_blcok">
<view class="info_list cover">
<view class="info_list_title">头像</view>
<view class="end" bindtap="upload">
<image class="header" src="{{cover}}" mode="widthFix"></image>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">昵称</view>
<view class="end" bindtap="goUrl">
<input class="txt nowrap" placeholder="请输入昵称"></input>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">真实姓名</view>
<view class="end" bindtap="goUrl">
<input class="txt nowrap" placeholder="请输入真实姓名"></input>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">性别</view>
<view class="end" bindtap="goUrl">
<picker bindchange="pickSex" value="{{ gender }}" class="sex" range="{{ columns }}">
<view>
{{ columns[gender] == "" ? "请输入性别" : "" }}{{ columns[gender] }}
</view>
</picker>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">手机号</view>
<view class="end" bindtap="goUrl">
<input class="txt nowrap" placeholder="请输入手机号" maxlength="11"></input>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">生日</view>
<view class="end" bindtap="goUrl">
<picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
<view class="picker">
当前选择: {{date}}
</view>
</picker>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
<view class="info_list">
<view class="info_list_title">所在区域</view>
<view class="end" bindtap="goUrl">
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="picker">
当前选择:{{region[0]}}{{region[1]}}{{region[2]}}
</view>
</picker>
<image src="/static/icons/arrow_right.png" mode="widthFix" style="width:30rpx;"></image>
</view>
</view>
</view>
<view class="beSure" catchtap="logOut">退出登录</view>
<view class="beSure beSure1" catchtap="beSure">保存</view>

View File

@@ -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);
}

View File

@@ -0,0 +1,3 @@
Page({
data: {}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "设置",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1 @@
关于我们

View File

@@ -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;
}

View File

@@ -0,0 +1,3 @@
Page({
data: {}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "设置",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,9 @@
<navigator class="item" hover-class="none" url="/pages/user/setting/aboutMine/aboutMine">
<image src="/static/images/aboutMine.png" mode="widthFix" /> 个人信息
</navigator>
<navigator class="item" hover-class="none" url="/pages/user/setting/aboutAdvice/aboutAdvice">
<image src="/static/images/aboutAdvice.png" mode="widthFix" /> 意见建议
</navigator>
<navigator class="item" hover-class="none" url="/pages/user/setting/aboutUs/aboutUs">
<image src="/static/images/aboutUs.png" mode="widthFix" /> 关于我们
</navigator>

View File

@@ -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;
}

View File

@@ -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;
}
},
})

View File

@@ -0,0 +1,5 @@
{
"navigationBarBackgroundColor": "#000000",
"navigationBarTitleText": "",
"navigationBarTextStyle": "white"
}

View File

@@ -0,0 +1,46 @@
<view class="wx-content-info">
<view class='cropper-content'>
<view wx:if="{{isShowImg}}" class="wx-corpper" style="background:#000;">
<view class="wx-corpper-content"
style="width:{{cropperW}}rpx;height:{{cropperH}}rpx;left:{{cropperL}}rpx;top:{{cropperT}}rpx">
<image src="{{imageSrc}}" style="width:{{cropperW}}rpx;height:{{cropperH}}rpx"></image>
<view class="wx-corpper-crop-box" bindtouchstart="contentStartMove" bindtouchmove="contentMoveing"
bindtouchend="contentTouchEnd"
style="left:{{cutL}}rpx;top:{{cutT}}rpx;right:{{cutR}}rpx;bottom:{{cutB}}rpx">
<view class="wx-cropper-view-box">
<view class="wx-cropper-dashed-h"></view>
<view class="wx-cropper-dashed-v"></view>
<view class="wx-cropper-line-t" data-drag="top" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-line-r" data-drag="right" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-line-b" data-drag="bottom" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-line-l" data-drag="left" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-point point-t" data-drag="top" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-point point-tr" data-drag="topTight"></view>
<view class="wx-cropper-point point-r" data-drag="right" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-point point-rb" data-drag="rightBottom" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-point point-b" data-drag="bottom" catchtouchstart="dragStart"
catchtouchmove="dragMove" catchtouchend="dragEnd"></view>
<view class="wx-cropper-point point-bl" data-drag="bottomLeft"></view>
<view class="wx-cropper-point point-l" data-drag="left" catchtouchstart="dragStart"
catchtouchmove="dragMove"></view>
<view class="wx-cropper-point point-lt" data-drag="leftTop"></view>
</view>
</view>
</view>
</view>
</view>
<view class='cropper-config'>
<!-- <text class="cropper-cancle" bindtap="close">取消</text> -->
<text class="cropper-cancle" bindtap="getImage">选择图片</text>
<text class="cropper-save" bindtap="getImageInfo">确认</text>
</view>
<canvas canvas-id="myCanvas"
style="position:absolute;border: 1px solid red; width:{{qualityWidth}}px;height:{{qualityWidth/innerAspectRadio}}px;top:-9999px;left:-9999px;"></canvas>
</view>

View File

@@ -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;
}

View File

@@ -1,120 +1,120 @@
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "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": { "enableEngineNative": false,
"urlCheck": true, "bundle": false,
"es6": true, "useIsolateContext": true,
"enhance": false, "useCompilerModule": false,
"postcss": true, "userConfirmedUseCompilerModuleSwitch": false,
"preloadBackgroundData": false, "userConfirmedBundleSwitch": false,
"minified": true, "packNpmManually": false,
"newFeature": true, "packNpmRelationList": [],
"coverView": true, "minifyWXSS": true
"nodeModules": true, },
"autoAudits": false, "compileType": "miniprogram",
"showShadowRootInWxmlPanel": true, "libVersion": "2.13.2",
"scopeDataCheck": false, "appid": "wxd931d03dfe955254",
"uglifyFileName": false, "projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas",
"checkInvalidKey": true, "debugOptions": {
"checkSiteMap": true, "hidedInDevtools": []
"uploadWithSourceMap": true, },
"compileHotReLoad": false, "isGameTourist": false,
"useMultiFrameRuntime": false, "simulatorType": "wechat",
"useApiHook": true, "simulatorPluginLibVersion": {},
"babelSetting": { "condition": {
"ignore": [], "plugin": {
"disablePlugins": [], "list": []
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
}, },
"compileType": "miniprogram", "game": {
"libVersion": "2.13.2", "list": []
"appid": "wxd931d03dfe955254",
"projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas",
"debugOptions": {
"hidedInDevtools": []
}, },
"isGameTourist": false, "gamePlugin": {
"simulatorType": "wechat", "list": []
"simulatorPluginLibVersion": {}, },
"condition": { "miniprogram": {
"plugin": { "list": [
"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": "pages/user/index",
{ "pathName": "pages/user/index",
"name": "登录", "query": "",
"pathName": "pages/login/login", "scene": null
"query": "", },
"scene": null {
}, "name": "pages/user/companyMine/companyOrder",
{ "pathName": "pages/user/companyMine/companyOrder",
"name": "搜索", "query": "orderid=20201229132338964625",
"pathName": "pages/company/search/search", "scene": null
"query": "", },
"scene": null {
}, "name": "pages/user/companyMine/companyOrder",
{ "pathName": "pages/user/companyMine/companyOrder",
"name": "商城", "query": "orderid=20201229132338964625",
"pathName": "pages/mall/index", "scene": null
"query": "", },
"scene": null {
}, "name": "pages/user/companyMine/projectDetail/projectDetail",
{ "pathName": "pages/user/companyMine/projectDetail/projectDetail",
"name": "pages/user/index", "query": "orderid=20201229132338964625",
"pathName": "pages/user/index", "scene": null
"query": "", },
"scene": null {
}, "name": "pages/user/companyMine/refundInfo/refundInfo",
{ "pathName": "pages/user/companyMine/refundInfo/refundInfo",
"name": "pages/user/companyMine/companyOrder", "query": "orderid=20201229132338964625",
"pathName": "pages/user/companyMine/companyOrder", "scene": null
"query": "orderid=20201229132338964625", },
"scene": null {
}, "name": "pages/home/index",
{ "pathName": "pages/home/index",
"name": "pages/user/companyMine/companyOrder", "query": "orderid=20201229132338964625",
"pathName": "pages/user/companyMine/companyOrder", "scene": null
"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
}
]
} }
]
} }
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
static/images/aboutMine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
static/images/aboutUs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/images/zs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
static/images/zuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB