Commit 91f8503a by 梁建民

福利中心

parent ce979932
......@@ -186,7 +186,7 @@ Page({
},
uploadImg: function() {
let me = this;
chooseImg(apis.ossupload, 1, function(url) {
chooseImg(apis.ossupload, 4, function(url) {
me.setData({
imgUrl: url
})
......
......@@ -36,7 +36,10 @@ Page({
imgSrc: '',
disabled: false,
loading: false,
checked: 2
checked: 2,
uploaderList: [], //图片集合
uploaderNum: 0,
showUpload: true
},
/**
......@@ -159,7 +162,7 @@ Page({
*/
uploadImg: function () {
chooseImg(apis.ossupload, 1, (res) => {
chooseImg(apis.ossupload, 3, (res) => {
if (res) {
this.setData({
imgSrc: res,
......@@ -207,7 +210,7 @@ Page({
return false;
}
if (!auth_img) {
if (this.data.uploaderList.length <= 0) {
wx.showToast({
title: '请上传资料',
......@@ -282,5 +285,55 @@ Page({
index: e.detail.value,
companyTypeText: this.data.companyType[e.detail.value].name
})
},
// 删除图片
clearImg: function (e) {
var nowList = []; //新数据
var uploaderList = this.data.uploaderList; //原数据
for (let i = 0; i < uploaderList.length; i++) {
if (i == e.currentTarget.dataset.index) {
continue;
} else {
nowList.push(uploaderList[i])
}
}
this.setData({
uploaderNum: this.data.uploaderNum - 1,
uploaderList: nowList,
showUpload: true
})
},
//展示图片
showImg: function (e) {
var that = this;
wx.previewImage({
urls: that.data.uploaderList,
current: that.data.uploaderList[e.currentTarget.dataset.index]
})
},
//上传图片
upload: function (e) {
var that = this;
wx.chooseImage({
count: 3 - that.data.uploaderNum, // 默认3
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 sizeType: ['original', 'compressed']
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res)
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
let tempFilePaths = res.tempFilePaths;
let uploaderList = that.data.uploaderList.concat(tempFilePaths);
if (uploaderList.length == 3) {
that.setData({
showUpload: false
})
}
that.setData({
uploaderList: uploaderList,
uploaderNum: uploaderList.length,
})
}
})
}
})
\ No newline at end of file
......@@ -152,4 +152,75 @@
text-align: center;
line-height: 89rpx;
}
}
.ui_uploader_cell {
margin-top: 30rpx;
background: #fff;
width: 100%;
padding: 40rpx;
box-sizing: border-box;
}
.ui_uploader_cell:after {
clear: both;
content: '';
display: table;
}
.ui_uploader_item {
float: left;
position: relative;
margin-right: 30rpx;
margin-bottom: 30rpx;
width: 165rpx;
height: 165rpx;
}
.ui_uploader {
float: left;
position: relative;
margin-right: 25rpx;
margin-bottom: 25rpx;
width: 165rpx;
height: 165rpx;
border: 2rpx solid #d9d9d9;
box-sizing: border-box;
}
.ui_uploader:before {
content: " ";
position: absolute;
width: 4rpx;
height: 79rpx;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.ui_uploader:after {
content: " ";
position: absolute;
height: 4rpx;
width: 79rpx;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #d9d9d9;
}
.ui_uploader_item_icon {
position: absolute;
right: -20rpx;
top: -20rpx;
background: #fff;
border-radius: 50%;
}
.ui_uploader_item image {
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -19,7 +19,7 @@
<radio value="2" checked="{{checked == 2}}" class="radio-text" />
<text class="va-m">企业</text>
</label>
<label class="radio-wrap">
<label class="radio-wrap">
<radio value="1" checked="{{checked == 1}}" class="radio-text" />
<text class="va-m">个人</text>
</label>
......@@ -49,10 +49,21 @@
</view>
<view class="upload-box column rowCenter verCenter">
<block wx:if="{{status}}">
<view class="add column rowCenter verCenter" bindtap="uploadImg">
<view class='ui_uploader_cell'>
<!-- 根据已选择的图片临时路径数组展示图片 -->
<view class='ui_uploader_item' wx:for="{{uploaderList}}" wx:key="{{index}}">
<!-- 删除 -->
<icon class='ui_uploader_item_icon' bindtap='clearImg' data-index="{{index}}" type="clear" size="20" color="red" />
<!-- 图片 -->
<image bindtap='showImg' data-index="{{index}}" src='{{item}}'></image>
</view>
<!-- 上传按钮+框 -->
<view class='ui_uploader' bindtap='upload' wx:if="{{showUpload}}"></view>
</view>
<!-- <view class="add column rowCenter verCenter" bindtap="uploadImg">
<text class="icon iconfont iconiconxiantiaoshouji15"></text>
<text class="t1">上传资料</text>
</view>
</view> -->
</block>
<block wx:else>
<view class="view column rowCenter verCenter">
......@@ -62,6 +73,8 @@
</block>
<text class="txt">{{tip}}</text>
</view>
<button class="btn" form-type="submit" disabled="{{disabled}}" loading="{{loading}}">提交认证</button>
<button class="btn" form-type="submit" disabled="{{disabled}}" loading="{{loading}}">
提交认证
</button>
</form>
</view>
\ No newline at end of file
.certification .flex-a{flex:1}.certification .flex-b{flex:2}.certification .prompt{padding:0 24rpx;height:68rpx;background:#FFF6E6}.certification .prompt .iconiconxiantiaoshouji12{font-size:30rpx;color:#EAAD37}.certification .prompt .t1{font-size:24rpx;color:#EAA217;margin-left:12rpx}.certification .prompt .iconiconxiantiaoshouji13{font-size:30rpx;color:#D8DFE6}.certification .hr{height:10rpx;background:#F5F9FC}.certification .item{padding:0 24rpx 0 0;margin-left:24rpx;height:100rpx}.certification .item .radio-group .radio-wrap{font-size:28rpx;color:#515559;font-weight:400}.certification .item .t1{font-size:28rpx;color:#515559;font-weight:400}.certification .item .t2{font-size:28rpx;color:#8A9299;font-weight:400}.certification .item .inp{width:492r px;height:100rpx}.certification .item .radio-wrap:first-child{margin-right:50rpx}.certification .item .radio-wrap:first-child .radio-text{font-size:28rpx;font-weight:400;color:#515559}.certification .item .iconChevron{font-size:27rpx;color:#ADB6BF;margin-left:12rpx}.certification .item.bor{border-bottom:1px solid #F5F9FC}.certification .upload-box{margin-top:60rpx;margin-bottom:60rpx}.certification .upload-box .add{width:220rpx;height:220rpx;background:#F0F6FA}.certification .upload-box .add .iconiconxiantiaoshouji15{font-size:80rpx;color:#ADB6BF}.certification .upload-box .add .t1{margin-top:19rpx;font-size:24rpx;color:#8A9299}.certification .upload-box .view{position:relative;width:220rpx;height:220rpx}.certification .upload-box .view .img{width:220rpx;height:220rpx}.certification .upload-box .view .iconiconxiantiaoshouji7{position:absolute;right:-15rpx;top:-12rpx;font-size:30rpx;color:#fff;width:44rpx;height:44rpx;background:#EA1717;border-radius:50%;text-align:center;line-height:44rpx;z-index:99}.certification .upload-box .txt{margin-top:24rpx;font-size:24rpx;color:#8A9299;width:80%}.certification .btn{margin:0 55rpx;height:98rpx;background:#0d84d1 !important;box-shadow:0 6rpx 10rpx 0 rgba(97,160,242,0.3) !important;border-radius:8rpx;font-size:32rpx;color:#FFFFFF !important;text-align:center;line-height:89rpx}
\ No newline at end of file
.certification .flex-a{flex:1}.certification .flex-b{flex:2}.certification .prompt{padding:0 24rpx;height:68rpx;background:#FFF6E6}.certification .prompt .iconiconxiantiaoshouji12{font-size:30rpx;color:#EAAD37}.certification .prompt .t1{font-size:24rpx;color:#EAA217;margin-left:12rpx}.certification .prompt .iconiconxiantiaoshouji13{font-size:30rpx;color:#D8DFE6}.certification .hr{height:10rpx;background:#F5F9FC}.certification .item{padding:0 24rpx 0 0;margin-left:24rpx;height:100rpx}.certification .item .radio-group .radio-wrap{font-size:28rpx;color:#515559;font-weight:400}.certification .item .t1{font-size:28rpx;color:#515559;font-weight:400}.certification .item .t2{font-size:28rpx;color:#8A9299;font-weight:400}.certification .item .inp{width:492r px;height:100rpx}.certification .item .radio-wrap:first-child{margin-right:50rpx}.certification .item .radio-wrap:first-child .radio-text{font-size:28rpx;font-weight:400;color:#515559}.certification .item .iconChevron{font-size:27rpx;color:#ADB6BF;margin-left:12rpx}.certification .item.bor{border-bottom:1px solid #F5F9FC}.certification .upload-box{margin-top:60rpx;margin-bottom:60rpx}.certification .upload-box .add{width:220rpx;height:220rpx;background:#F0F6FA}.certification .upload-box .add .iconiconxiantiaoshouji15{font-size:80rpx;color:#ADB6BF}.certification .upload-box .add .t1{margin-top:19rpx;font-size:24rpx;color:#8A9299}.certification .upload-box .view{position:relative;width:220rpx;height:220rpx}.certification .upload-box .view .img{width:220rpx;height:220rpx}.certification .upload-box .view .iconiconxiantiaoshouji7{position:absolute;right:-15rpx;top:-12rpx;font-size:30rpx;color:#fff;width:44rpx;height:44rpx;background:#EA1717;border-radius:50%;text-align:center;line-height:44rpx;z-index:99}.certification .upload-box .txt{margin-top:24rpx;font-size:24rpx;color:#8A9299;width:80%}.certification .btn{margin:0 55rpx;height:98rpx;background:#0d84d1 !important;box-shadow:0 6rpx 10rpx 0 rgba(97,160,242,0.3) !important;border-radius:8rpx;font-size:32rpx;color:#FFFFFF !important;text-align:center;line-height:89rpx}.ui_uploader_cell{margin-top:30rpx;background:#fff;width:100%;padding:40rpx;box-sizing:border-box}.ui_uploader_cell:after{clear:both;content:'';display:table}.ui_uploader_item{float:left;position:relative;margin-right:30rpx;margin-bottom:30rpx;width:165rpx;height:165rpx}.ui_uploader{float:left;position:relative;margin-right:25rpx;margin-bottom:25rpx;width:165rpx;height:165rpx;border:2rpx solid #d9d9d9;box-sizing:border-box}.ui_uploader:before{content:" ";position:absolute;width:4rpx;height:79rpx;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);background-color:#d9d9d9}.ui_uploader:after{content:" ";position:absolute;height:4rpx;width:79rpx;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);background-color:#d9d9d9}.ui_uploader_item_icon{position:absolute;right:-20rpx;top:-20rpx;background:#fff;border-radius:50%}.ui_uploader_item image{width:100%;height:100%}
\ No newline at end of file
......@@ -11,7 +11,8 @@
background: linear-gradient(143deg, rgba(234, 162, 23, 1) 0%, rgba(255, 99, 39, 1) 100%);
box-shadow: 0px 20rpx 20rpx 0rpx rgba(242, 191, 97, 0.5);
border-radius: 10rpx;
background-image: url('http://img.ichunt.com/images/ichunt/minProgram/ea9e3f64e9f047410d576e29d392db45.png');
background-image: url('http://img.ichunt.com/images/ichunt/minProgram/ea9e3f64e9f047410d576e29d392db45.png');
.red-text {
.iconiconxiantiaoshouji27 {
font-size: 30rpx;
......@@ -140,6 +141,7 @@
font-size: 24rpx;
color: #fff;
margin: 0;
&.blue {
background: linear-gradient(143deg, rgba(97, 160, 242, 1) 0%, rgba(13, 132, 209, 1) 100%);
box-shadow: 0px 10rpx 20rpx 0rpx rgba(97, 160, 242, 0.4);
......@@ -149,6 +151,11 @@
background: linear-gradient(143deg, rgba(234, 162, 23, 1) 0%, rgba(255, 99, 39, 1) 100%);
box-shadow: 0px 10rpx 20rpx 0rpx rgba(242, 191, 97, 0.4);
}
&.gray {
background: linear-gradient(140deg, rgba(173, 182, 191, 1) 0%, rgba(138, 146, 153, 1) 100%);
box-shadow: 0px 10px 20px 0px rgba(173, 182, 191, 0.2);
}
}
&.bor {
......
......@@ -44,7 +44,7 @@
</button>
</block>
<block wx:else>
<view bind:tap="toUrl" data-id="{{item.id}}" wx:if="{{item.button_text}}" class="btn blue {{index > 2 ? 'yellow':''}}">
<view bind:tap="toUrl" data-id="{{item.id}}" wx:if="{{item.button_text}}" class="btn blue {{index > 2 ? 'yellow':''}} {{item.button_text == '已签到' ? 'gray':''}}">
{{item.button_text}}
</view>
</block>
......
.welfare {
padding-top: 30rpx;
}
.welfare .head {
margin: 0 24rpx;
padding: 0 0 0 30rpx;
height: 288rpx;
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
background: linear-gradient(143deg, #eaa217 0%, #ff6327 100%);
box-shadow: 0px 20rpx 20rpx 0rpx rgba(242, 191, 97, 0.5);
border-radius: 10rpx;
background-image: url('http://img.ichunt.com/images/ichunt/minProgram/ea9e3f64e9f047410d576e29d392db45.png');
}
.welfare .head .red-text .iconiconxiantiaoshouji27 {
font-size: 30rpx;
color: #EA4343;
}
.welfare .head .red-text .t1 {
margin-left: 8rpx;
font-size: 24rpx;
color: #FFFFFF;
}
.welfare .head .num {
margin-top: 22rpx;
margin-bottom: 23rpx;
}
.welfare .head .num .t1 {
font-size: 80rpx;
line-height: 112rpx;
color: #FFFFFF;
font-weight: 600;
}
.welfare .head .num .t2 {
font-size: 24rpx;
color: #FFFFFF;
opacity: 0.7;
}
.welfare .head .code-text .t1 {
font-size: 24rpx;
color: #FFFFFF;
opacity: 0.5;
}
.welfare .head .code-text .t2 {
font-size: 24rpx;
color: #FFFFFF;
}
.welfare .head .rule {
font-size: 24rpx;
color: #FFFFFF;
opacity: 0.5;
text-align: right;
margin-bottom: 149rpx;
margin-right: 15rpx;
}
.welfare .head .exchange .t1 {
font-size: 24rpx;
color: #FFFFFF;
opacity: 0.7;
}
.welfare .head .exchange .t2 {
margin-left: 33rpx;
width: 170rpx;
height: 48rpx;
background: #ffb526;
border-radius: 30rpx 0rpx 0rpx 30rpx;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
}
.welfare .head .exchange .t2 .iconiconxiantiaoshouji28 {
font-size: 30rpx;
color: #ffffff;
margin-right: 8rpx;
}
.welfare .list {
margin-top: 44rpx;
padding-bottom: 100rpx;
}
.welfare .list .hr {
height: 10rpx;
background: #F5F9FC;
}
.welfare .list .list-wrap {
height: 154rpx;
padding: 0 24rpx 0 0;
margin-left: 24rpx;
}
.welfare .list .list-wrap .t1 {
font-size: 28rpx;
font-weight: 600;
color: #515559;
}
.welfare .list .list-wrap .t2 {
font-size: 26rpx;
color: #EA1717;
font-weight: 400;
}
.welfare .list .list-wrap .t3 {
margin-top: 14rpx;
font-size: 24rpx;
color: #8A9299;
line-height: 33rpx;
}
.welfare .list .list-wrap .iconiconxiantiaoshouji27 {
margin-left: 24rpx;
margin-right: 5rpx;
font-size: 40rpx;
color: #EA4343;
}
.welfare .list .list-wrap .btn {
width: 150rpx;
height: 48rpx;
border-radius: 24rpx;
line-height: 48rpx;
text-align: center;
font-size: 24rpx;
color: #fff;
margin: 0;
}
.welfare .list .list-wrap .btn.blue {
background: linear-gradient(143deg, #61a0f2 0%, #0d84d1 100%);
box-shadow: 0px 10rpx 20rpx 0rpx rgba(97, 160, 242, 0.4);
}
.welfare .list .list-wrap .btn.yellow {
background: linear-gradient(143deg, #eaa217 0%, #ff6327 100%);
box-shadow: 0px 10rpx 20rpx 0rpx rgba(242, 191, 97, 0.4);
}
.welfare .list .list-wrap.bor {
border-bottom: 1px solid #F5F9FC;
}
.welfare{padding-top:30rpx}.welfare .head{margin:0 24rpx;padding:0 0 0 30rpx;height:288rpx;background-repeat:no-repeat;background-size:cover;background-position:center center;background:linear-gradient(143deg, #eaa217 0, #ff6327 100%);box-shadow:0 20rpx 20rpx 0 rgba(242,191,97,0.5);border-radius:10rpx;background-image:url('http://img.ichunt.com/images/ichunt/minProgram/ea9e3f64e9f047410d576e29d392db45.png')}.welfare .head .red-text .iconiconxiantiaoshouji27{font-size:30rpx;color:#EA4343}.welfare .head .red-text .t1{margin-left:8rpx;font-size:24rpx;color:#FFFFFF}.welfare .head .num{margin-top:22rpx;margin-bottom:23rpx}.welfare .head .num .t1{font-size:80rpx;line-height:112rpx;color:#FFFFFF;font-weight:600}.welfare .head .num .t2{font-size:24rpx;color:#FFFFFF;opacity:.7}.welfare .head .code-text .t1{font-size:24rpx;color:#FFFFFF;opacity:.5}.welfare .head .code-text .t2{font-size:24rpx;color:#FFFFFF}.welfare .head .rule{font-size:24rpx;color:#FFFFFF;opacity:.5;text-align:right;margin-bottom:149rpx;margin-right:15rpx}.welfare .head .exchange .t1{font-size:24rpx;color:#FFFFFF;opacity:.7}.welfare .head .exchange .t2{margin-left:33rpx;width:170rpx;height:48rpx;background:#ffb526;border-radius:30rpx 0 0 30rpx;font-size:24rpx;color:#FFFFFF;text-align:center}.welfare .head .exchange .t2 .iconiconxiantiaoshouji28{font-size:30rpx;color:#ffffff;margin-right:8rpx}.welfare .list{margin-top:44rpx;padding-bottom:100rpx}.welfare .list .hr{height:10rpx;background:#F5F9FC}.welfare .list .list-wrap{height:154rpx;padding:0 24rpx 0 0;margin-left:24rpx}.welfare .list .list-wrap .t1{font-size:28rpx;font-weight:600;color:#515559}.welfare .list .list-wrap .t2{font-size:26rpx;color:#EA1717;font-weight:400}.welfare .list .list-wrap .t3{margin-top:14rpx;font-size:24rpx;color:#8A9299;line-height:33rpx}.welfare .list .list-wrap .iconiconxiantiaoshouji27{margin-left:24rpx;margin-right:5rpx;font-size:40rpx;color:#EA4343}.welfare .list .list-wrap .btn{width:150rpx;height:48rpx;border-radius:24rpx;line-height:48rpx;text-align:center;font-size:24rpx;color:#fff;margin:0}.welfare .list .list-wrap .btn.blue{background:linear-gradient(143deg, #61a0f2 0, #0d84d1 100%);box-shadow:0 10rpx 20rpx 0 rgba(97,160,242,0.4)}.welfare .list .list-wrap .btn.yellow{background:linear-gradient(143deg, #eaa217 0, #ff6327 100%);box-shadow:0 10rpx 20rpx 0 rgba(242,191,97,0.4)}.welfare .list .list-wrap .btn.gray{background:linear-gradient(140deg, #adb6bf 0, #8a9299 100%);box-shadow:0 10px 20px 0 rgba(173,182,191,0.2)}.welfare .list .list-wrap.bor{border-bottom:1px solid #F5F9FC}
\ No newline at end of file
......@@ -44,7 +44,7 @@ Page({
onShow: function () {
this.getData(1);
this.setData({
tabIndex:1
tabIndex: 1
});
},
......@@ -152,6 +152,8 @@ Page({
*/
withdrawal: function (e) {
var self = this;
if (this.data.can_exchange === 0) {
wx.showToast({
title: '今天已经兑换过了,请明天再来吧',
......@@ -177,24 +179,35 @@ Page({
return false;
}
let exchange_id = this.data.exchangeSettings[this.data.indexOf].id;
if (exchange_id) {
http.getData(apis.userExchanges, 'GET', {
exchange_id: exchange_id
}, (res) => {
if (res.errcode === 0) {
this.getData(2);
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
wx.showModal({
title: '确认提示',
content: '是否兑换',
success(res) {
if (res.confirm) {
let exchange_id = self.data.exchangeSettings[self.data.indexOf].id;
if (exchange_id) {
http.getData(apis.userExchanges, 'GET', {
exchange_id: exchange_id
}, (res) => {
if (res.errcode === 0) {
self.getData(2);
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
}
} else if (res.cancel) {
console.log('用户点击取消')
}
}, true, false, true);
}
}
})
},
/**
* 关闭提示
......@@ -209,6 +222,8 @@ Page({
*/
submit: function (e) {
var self = this;
if (this.data.can_exchange === 0) {
wx.showToast({
title: '今天已经兑换过了,请明天再来吧',
......@@ -235,27 +250,41 @@ Page({
}
let exchange_id = this.data.exchangeSettings[this.data.indexOf].id;
wx.showModal({
title: '确认提示',
content: '是否兑换',
success(res) {
if (res.confirm) {
let exchange_id = self.data.exchangeSettings[self.data.indexOf].id;
if (exchange_id) {
if (exchange_id) {
http.getData(apis.userExchanges, 'GET', {
exchange_id: exchange_id
}, (res) => {
if (res.errcode === 0) {
wx.navigateTo({
url: '/pages/person/withdrawalsuccess/index'
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
http.getData(apis.userExchanges, 'GET', {
exchange_id: exchange_id
}, (res) => {
if (res.errcode === 0) {
wx.navigateTo({
url: '/pages/person/withdrawalsuccess/index'
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
}
} else if (res.cancel) {
console.log('用户点击取消')
}
}, true, false, true);
}
})
}
}
})
\ No newline at end of file
......@@ -415,6 +415,34 @@
"id": -1,
"name": "pages/list/signin/index",
"pathName": "pages/list/signin/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/certification/addcertification/index",
"pathName": "pages/person/certification/addcertification/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/tab/me/me",
"pathName": "pages/tab/me/me",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/welfare/index",
"pathName": "pages/person/welfare/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/withdrawal/index",
"pathName": "pages/person/withdrawal/index",
"scene": null
}
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment