Commit 5774327b by 施宇

Merge branch 'master' of http://119.23.72.7/shiyu/icsalesProgram

# Conflicts:
#	app.json
#	project.config.json
parents 85367f37 777a7291
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
"pages/person/invitationrecord/index", "pages/person/invitationrecord/index",
"pages/form/report/index", "pages/form/report/index",
"pages/list/notice/index", "pages/list/notice/index",
"pages/person/notice/index" "pages/person/notice/index",
"pages/person/helpfriend/index"
], ],
"subPackages": [ "subPackages": [
{ {
......
...@@ -10,7 +10,7 @@ image { ...@@ -10,7 +10,7 @@ image {
vertical-align: middle; vertical-align: middle;
} }
.va-m{ .va-m {
vertical-align: middle; vertical-align: middle;
} }
...@@ -53,7 +53,7 @@ image { ...@@ -53,7 +53,7 @@ image {
align-items: center; align-items: center;
} }
.boxFlex{ .boxFlex {
-webkit-box-flex: 1; -webkit-box-flex: 1;
-moz-box-flex: 1; -moz-box-flex: 1;
-webkit-flex: 1; -webkit-flex: 1;
...@@ -61,7 +61,15 @@ image { ...@@ -61,7 +61,15 @@ image {
flex: 1; flex: 1;
} }
.tc{ .boxFlexs {
-webkit-box-flex: 2;
-moz-box-flex: 2;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
}
.tc {
text-align: center; text-align: center;
} }
...@@ -123,8 +131,8 @@ image { ...@@ -123,8 +131,8 @@ image {
} }
.placeholderClass { .placeholderClass {
color: #adb6bf; color: #adb6bf;
font-size:28rpx; font-size: 28rpx;
} }
/* /头部搜索公共样式 */ /* /头部搜索公共样式 */
...@@ -135,7 +143,7 @@ image { ...@@ -135,7 +143,7 @@ image {
.nodata .img { .nodata .img {
width: 600rpx; width: 600rpx;
height:393rpx; height: 393rpx;
margin: 0 auto; margin: 0 auto;
} }
...@@ -287,22 +295,26 @@ image { ...@@ -287,22 +295,26 @@ image {
background-color: #0d84d1; background-color: #0d84d1;
box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3); box-shadow: 0px 6px 10px 0px rgba(97, 160, 242, 0.3);
} }
.btn-com-disable{
.btn-com-disable {
background-color: #DAE1E7; background-color: #DAE1E7;
} }
.data-bottom{
padding:24rpx 60rpx; .data-bottom {
padding: 24rpx 60rpx;
} }
.data-bottom .line{
height:1px; .data-bottom .line {
border-top:1px solid #F0F4F7; height: 1px;
flex:0 0 200rpx; border-top: 1px solid #F0F4F7;
flex: 0 0 200rpx;
} }
.data-bottom .text{
.data-bottom .text {
font-size: 26rpx; font-size: 26rpx;
color:#8A9299; color: #8A9299;
flex:1; flex: 1;
text-align: center; text-align: center;
} }
...@@ -313,10 +325,12 @@ image { ...@@ -313,10 +325,12 @@ image {
overflow: hidden; overflow: hidden;
transition: height linear .25s; transition: height linear .25s;
} }
.tip.noheight{
height:0; .tip.noheight {
height: 0;
} }
.tip .close-icon { .tip .close-icon {
color: #d8dfe6; color: #d8dfe6;
} }
...@@ -341,16 +355,19 @@ image { ...@@ -341,16 +355,19 @@ image {
.tip-c .pc-url { .tip-c .pc-url {
color: #61a0f2; color: #61a0f2;
} }
/***消息模块的公共样式*/ /***消息模块的公共样式*/
.message-item { .message-item {
margin-left: 25rpx; margin-left: 25rpx;
padding: 24rpx 24rpx 24rpx 0; padding: 24rpx 24rpx 24rpx 0;
} }
.message-avar { .message-avar {
height: 68rpx; height: 68rpx;
width: 68rpx; width: 68rpx;
border-radius: 50% 50%; border-radius: 50% 50%;
} }
.system-avar { .system-avar {
flex: 0 0 68rpx; flex: 0 0 68rpx;
background-color: #52cca8; background-color: #52cca8;
...@@ -363,6 +380,7 @@ image { ...@@ -363,6 +380,7 @@ image {
font-size: 40rpx; font-size: 40rpx;
color: #fff; color: #fff;
} }
.message-l-view { .message-l-view {
margin-left: 24rpx; margin-left: 24rpx;
} }
...@@ -388,9 +406,11 @@ image { ...@@ -388,9 +406,11 @@ image {
color: #adb6bf; color: #adb6bf;
padding-bottom: 12rpx; padding-bottom: 12rpx;
} }
.message-t-text{
.message-t-text {
white-space: normal; white-space: normal;
} }
/**询报价列表**/ /**询报价列表**/
/**字体**/ /**字体**/
@import 'res/fonts/iconfont.wxss' @import 'res/fonts/iconfont.wxss'
\ No newline at end of file
const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
exchange_id: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getData();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 获取数据
*/
getData: function (type) {
http.getData(apis.assistsList, 'GET', {
exchange_id: 24
}, (res) => {
if (res.errcode === 0) {
}
}, true, false, true);
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "好友助力",
"navigationBarBackgroundColor": "#e9196c",
"navigationBarTextStyle": "white",
"backgroundColor": "#0d84d1"
}
\ No newline at end of file
.helpfriend {
background: #e01b34;
width: 100%;
padding-bottom: 57rpx;
overflow-x: hidden;
.wrap {
position: relative;
width: 100%;
height: 970rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/3e45f01531a74905046d3366b17a858d.png') no-repeat center;
background-size: cover;
.con {
position: absolute;
top: 374rpx;
left: 0;
right: 0;
width: 100%;
height: 746rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/14a97c92b299de4fd8e0d7fc014b022a.png') no-repeat center;
background-size: cover;
z-index: 11;
.im {
position: absolute;
top: -72rpx;
left: 0;
right: 0;
width: 160rpx;
height: 160rpx;
border-radius: 50%;
border: 2px solid #fff;
box-sizing: border-box;
margin: 0 auto;
}
.t1 {
margin-top: 121rpx;
display: block;
font-size: 36rpx;
color: #000000;
text-align: center;
font-weight: 600;
}
.t2 {
margin: 55rpx auto 29rpx;
color: #1a1a1a;
font-size: 32rpx;
text-align: center;
text {
font-size: 38rpx;
color: #de1c27;
font-weight: 600;
}
}
.t3 {
text-align: center;
display: block;
font-size: 32rpx;
color: #1a1a1a;
}
.t4 {
margin-top: 36rpx;
text-align: center;
font-size: 28rpx;
color: #1a1a1a;
text {
color: #de1c27;
font-weight: 600;
}
}
.btn {
margin: 168rpx auto 0;
width: 380rpx;
height: 80rpx;
background-image: linear-gradient(0deg, #ff7316 0%, #f3cc14 100%);
box-shadow: 0px 6rpx 0px 0px #cb7700, inset 0px 0px 10rpx 0px rgba(255, 255, 255, 0.26);
border-radius: 40rpx;
color: #ffffff;
font-size: 38rpx;
text-align: center;
line-height: 80rpx;
}
}
}
.bar {
padding-top: 155rpx;
text-align: center;
.t1 {
text-align: center;
font-size: 24rpx;
color: #ed6f6f;
}
.bg {
width: 222rpx;
height: 47rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/4b9701dd685f038d017ef70fb9f40b23.png') no-repeat center;
background-size: contain;
font-size: 36rpx;
color: #ffffff;
text-align: center;
line-height: 47rpx;
margin: 84rpx auto 0;
}
.pic {
margin: 60rpx auto 0;
.list {
width: 101rpx;
height: 100rpx;
background: rgba(5, 5, 5, 0.2);
border: dashed 2px #ffffff;
color: #fff;
text-align: center;
line-height: 100rpx;
border-radius: 50%;
&:first-child {
margin-right: 59rpx;
}
}
}
}
.text {
margin: 57rpx auto 83rpx;
padding: 0 0 0 55rpx;
text {
font-size: 24rpx;
color: #ff9292;
line-height: 31rpx;
display: block;
margin-bottom: 24rpx;
}
}
.footer {
display: block;
font-size: 22rpx;
color: #ed6f6f;
text-align: center;
}
}
\ No newline at end of file
<view class="helpfriend">
<view class="wrap">
<view class="con">
<image class="im" src="http://img.ichunt.com/images/ichunt/minProgram/4c42da6667beedcd6688f504138fa3be.jpg"></image>
<text class="t1">深圳市猎芯科技有限公司</text>
<view class="t2">
我正在提现
<text>5元</text>
现金红包,
</view>
<text class="t3">请帮我助力吧! 谢谢!</text>
<button class="btn">分享给好友</button>
<view class="t4">
还需
<text>1人</text>
助力
</view>
</view>
</view>
<view class="bar">
<text class="t1">*助力好友需要登录后,才能帮助好友助力</text>
<view class="bg">助力记录</view>
<view class="pic row rowCenter">
<view class="list">?</view>
<view class="list">?</view>
</view>
<view class="bg">活动规则</view>
</view>
<view class="text">
<text>1. 用户需邀请2名芯掌柜用户助力即可提现;</text>
<text>2. 每位用户每天只能提现1次;</text>
<text>3. 助力成功申请现金提现于1-3个工作日内通过微信钱包入帐;</text>
<text>4. 不得使用任何不正当手段破坏活动规则,否则驳回提现申请。</text>
</view>
<text class="footer">*在法律允许范围内,本活动最终解释权归芯掌柜所有*</text>
</view>
\ No newline at end of file
.helpfriend {
background: #e01b34;
width: 100%;
padding-bottom: 57rpx;
overflow-x: hidden;
}
.helpfriend .wrap {
position: relative;
width: 100%;
height: 970rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/3e45f01531a74905046d3366b17a858d.png') no-repeat center;
background-size: cover;
}
.helpfriend .wrap .con {
position: absolute;
top: 374rpx;
left: 0;
right: 0;
width: 100%;
height: 746rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/14a97c92b299de4fd8e0d7fc014b022a.png') no-repeat center;
background-size: cover;
z-index: 11;
}
.helpfriend .wrap .con .im {
position: absolute;
top: -72rpx;
left: 0;
right: 0;
width: 160rpx;
height: 160rpx;
border-radius: 50%;
border: 2px solid #fff;
box-sizing: border-box;
margin: 0 auto;
}
.helpfriend .wrap .con .t1 {
margin-top: 121rpx;
display: block;
font-size: 36rpx;
color: #000000;
text-align: center;
font-weight: 600;
}
.helpfriend .wrap .con .t2 {
margin: 55rpx auto 29rpx;
color: #1a1a1a;
font-size: 32rpx;
text-align: center;
}
.helpfriend .wrap .con .t2 text {
font-size: 38rpx;
color: #de1c27;
font-weight: 600;
}
.helpfriend .wrap .con .t3 {
text-align: center;
display: block;
font-size: 32rpx;
color: #1a1a1a;
}
.helpfriend .wrap .con .t4 {
margin-top: 36rpx;
text-align: center;
font-size: 28rpx;
color: #1a1a1a;
}
.helpfriend .wrap .con .t4 text {
color: #de1c27;
font-weight: 600;
}
.helpfriend .wrap .con .btn {
margin: 168rpx auto 0;
width: 380rpx;
height: 80rpx;
background-image: linear-gradient(0deg, #ff7316 0%, #f3cc14 100%);
box-shadow: 0px 6rpx 0px 0px #cb7700, inset 0px 0px 10rpx 0px rgba(255, 255, 255, 0.26);
border-radius: 40rpx;
color: #ffffff;
font-size: 38rpx;
text-align: center;
line-height: 80rpx;
}
.helpfriend .bar {
padding-top: 155rpx;
text-align: center;
}
.helpfriend .bar .t1 {
text-align: center;
font-size: 24rpx;
color: #ed6f6f;
}
.helpfriend .bar .bg {
width: 222rpx;
height: 47rpx;
background: url('http://img.ichunt.com/images/ichunt/minProgram/4b9701dd685f038d017ef70fb9f40b23.png') no-repeat center;
background-size: contain;
font-size: 36rpx;
color: #ffffff;
text-align: center;
line-height: 47rpx;
margin: 84rpx auto 0;
}
.helpfriend .bar .pic {
margin: 60rpx auto 0;
}
.helpfriend .bar .pic .list {
width: 101rpx;
height: 100rpx;
background: rgba(5, 5, 5, 0.2);
border: dashed 2px #ffffff;
color: #fff;
text-align: center;
line-height: 100rpx;
border-radius: 50%;
}
.helpfriend .bar .pic .list:first-child {
margin-right: 59rpx;
}
.helpfriend .text {
margin: 57rpx auto 83rpx;
padding: 0 0 0 55rpx;
}
.helpfriend .text text {
font-size: 24rpx;
color: #ff9292;
line-height: 31rpx;
display: block;
margin-bottom: 24rpx;
}
.helpfriend .footer {
display: block;
font-size: 22rpx;
color: #ed6f6f;
text-align: center;
}
// pages/person/invitation/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
invitesInfo: {}
}, },
/** /**
...@@ -26,7 +31,7 @@ Page({ ...@@ -26,7 +31,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getData();
}, },
/** /**
...@@ -56,4 +61,54 @@ Page({ ...@@ -56,4 +61,54 @@ Page({
onReachBottom: function () { onReachBottom: function () {
}, },
/**
* 分享
*/
onShareAppMessage: function (res) {
http.getData(apis.invitesAdd, 'GET', {
user_id: this.data.invitesInfo.user_id
}, (res) => {
if (res.errcode === 0) {
}
}, false, false, true);
return {
title: '邀请好友',
path: "/pages/person/invitation/index"
}
},
toUrl: function (e) {
if (this.data.invitesInfo.amount <= 0) {
wx.showToast({
title: '您暂未成功邀请好友',
icon: 'none',
duration: 2000
});
return false;
} else {
wx.navigateTo({
url: '/pages/person/withdrawal/index'
});
}
},
/**
* 获取数据
*/
getData: function (type) {
http.getData(apis.invitesInfo, 'GET', null, (res) => {
if (res.errcode === 0) {
this.setData({
invitesInfo: res.data
});
}
}, true, false, true);
}
}) })
\ No newline at end of file
...@@ -16,20 +16,20 @@ ...@@ -16,20 +16,20 @@
<view class="show-text row verCenter rowCenter"> <view class="show-text row verCenter rowCenter">
<view class="column boxFlex tc"> <view class="column boxFlex tc">
<text class="t1">邀请人数</text> <text class="t1">邀请人数</text>
<text class="t2 mt">12</text> <text class="t2 mt">{{invitesInfo.count}}</text>
<text class="t3">邀请记录</text> <navigator url="/pages/person/invitationrecord/index" class="t3">邀请记录</navigator>
</view> </view>
<view class="column boxFlex tc"> <view class="column boxFlex tc">
<text class="t1">获得红包</text> <text class="t1">获得红包</text>
<view class="mt"> <view class="mt">
<text class="t2">0.00</text> <text class="t2">{{invitesInfo.amount}}</text>
<text class="t1">元</text> <text class="t1">元</text>
</view> </view>
<text class="t3">立即提现</text> <text class="t3" bind:tap="toUrl">立即提现</text>
</view> </view>
</view> </view>
</view> </view>
<button class="btn">立即邀请赚钱</button> <button class="btn" open-type="share">立即邀请赚钱</button>
<view class="show-ico row verCenter avarage"> <view class="show-ico row verCenter avarage">
<view class="column"> <view class="column">
<text class="icon iconfont iconjuxing6"></text> <text class="icon iconfont iconjuxing6"></text>
......
// pages/person/invitationrecord/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
invitesList: []
}, },
/** /**
...@@ -26,7 +30,7 @@ Page({ ...@@ -26,7 +30,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getData();
}, },
/** /**
...@@ -56,4 +60,20 @@ Page({ ...@@ -56,4 +60,20 @@ Page({
onReachBottom: function () { onReachBottom: function () {
}, },
/**
* 获取数据
*/
getData: function (type) {
http.getData(apis.invitesList, 'GET', null, (res) => {
if (res.errcode === 0) {
this.setData({
invitesList: res.data
});
}
}, true, false, true);
}
}) })
\ No newline at end of file
<view class="invitationrecord" hover-class="none" hover-stop-propagation="false"> <view class="invitationrecord" hover-class="none" hover-stop-propagation="false">
<view class="wrap row bothSide verCenter bor"> <block wx:if="{{invitesList.length > 0}}">
<view class="column"> <block wx:for="{{invitesList}}" wx:key="item">
<text class="t1">深圳市猎芯科技有限公司</text> <view class="wrap row bothSide verCenter bor">
<text class="t2">2019-05-10 10:15</text> <view class="column">
<text class="t1">{{item.invited_user_name}}</text>
<text class="t2">2019-05-10 10:15</text>
</view>
<view class="row verCenter">
<text class="t3">+</text>
<text class="t4">¥{{item.amount}}</text>
</view>
</view>
</block>
</block>
<block wx:else>
<view class="nodata">
<image src="/res/images/imgs/noxb.png" class="img"></image>
<view class="h3 bold">暂无邀请记录</view>
</view> </view>
<view class="row verCenter"> </block>
<text class="t3">+</text>
<text class="t4">¥0.05</text>
</view>
</view>
<view class="wrap row bothSide verCenter bor">
<view class="column">
<text class="t1">深圳市猎芯科技有限公司</text>
<text class="t2">2019-05-10 10:15</text>
</view>
<view class="row verCenter">
<text class="t3">+</text>
<text class="t4">¥0.05</text>
</view>
</view>
</view> </view>
\ No newline at end of file
// pages/person/packet/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
isShow: true isShow: false,
flag: false,
code: '',
codesAdd:{}
}, },
/** /**
...@@ -26,7 +33,13 @@ Page({ ...@@ -26,7 +33,13 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let code = wx.getStorageSync('code');
if (code) {
this.setData({
flag: true,
code: code
});
}
}, },
/** /**
...@@ -63,5 +76,40 @@ Page({ ...@@ -63,5 +76,40 @@ Page({
this.setData({ this.setData({
isShow: false isShow: false
}); });
},
formSubmit: function (e) {
let code = e.detail.value.code;
if (!code) {
wx.showToast({
title: '请输入红包码',
icon: 'none',
duration: 2000
});
return false;
}
http.getData(apis.codesAdd, 'GET', {
code: code
}, (res) => {
if (res.errcode === 0) {
this.setData({
flag: true,
isShow: true,
codesAdd:res.data
})
wx.setStorage({
key: "code",
data: res.data.code
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
} }
}) })
\ No newline at end of file
...@@ -169,11 +169,16 @@ ...@@ -169,11 +169,16 @@
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
border: 2rpx solid #ffffff; border: 2rpx solid #ffffff;
border-radius: 50%; border-radius: 50%;
.icon{
font-size:40rpx; .icon {
color:#fff; font-size: 40rpx;
color: #fff;
} }
} }
} }
}
.opac {
opacity: 0.5;
} }
\ No newline at end of file
<view class="packet" hover-class="none" hover-stop-propagation="false"> <view class="packet" hover-class="none" hover-stop-propagation="false">
<view class="head"> <form bindsubmit='formSubmit'>
<view class="wrap column rowCenter verCenter"> <view class="head">
<text class="t1">输入好友的红包码</text> <view class="wrap column rowCenter verCenter">
<text class="t2">领取随机红包</text> <text class="t1">输入好友的红包码</text>
<text class="t2">领取随机红包</text>
</view>
<view class="inp">
<input type="text" value="{{code}}" placeholder="请输入红包码" class="inpt" placeholder-class="plac" name='code' disabled="{{flag}}"></input>
</view>
</view> </view>
<view class="inp"> <button class="btn {{flag? 'opac':''}}" form-type="submit">兑换好友红包</button>
<input type="text" placeholder="请输入红包码" class="inpt" placeholder-class="plac"></input> </form>
</view>
</view>
<button class="btn">兑换好友红包</button>
<view class="txt column"> <view class="txt column">
<text class="tit">温馨提示:</text> <text class="tit">温馨提示:</text>
<text class="t1">1.红包码可向已注册好友索要,填写后可获得随机红包。</text> <text class="t1">1.红包码可向已注册好友索要,填写后可获得随机红包。</text>
...@@ -16,7 +18,6 @@ ...@@ -16,7 +18,6 @@
<text class="t1">3.本活动最终解释权归深圳市电界网络科技有限公司所有。</text> <text class="t1">3.本活动最终解释权归深圳市电界网络科技有限公司所有。</text>
</view> </view>
</view> </view>
<!-- 弹出层 --> <!-- 弹出层 -->
<view wx:if="{{isShow}}" class="layer-mask column verCenter rowCenter" hover-class="none" hover-stop-propagation="false"> <view wx:if="{{isShow}}" class="layer-mask column verCenter rowCenter" hover-class="none" hover-stop-propagation="false">
<view class="layer column verCenter rowCenter"> <view class="layer column verCenter rowCenter">
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
<text class="t1">恭喜您</text> <text class="t1">恭喜您</text>
<text class="t2">获得</text> <text class="t2">获得</text>
<view class="mt"> <view class="mt">
<text class="t3">0.06</text> <text class="t3">{{codesAdd.amount}}</text>
<text class="t4">元</text> <text class="t4">元</text>
</view> </view>
<view class="btn">收下红包</view> <view class="btn">收下红包</view>
......
...@@ -155,3 +155,6 @@ ...@@ -155,3 +155,6 @@
font-size: 40rpx; font-size: 40rpx;
color: #fff; color: #fff;
} }
.opac {
opacity: 0.5;
}
// pages/person/withdrawal/index.js const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tabIndex: 1 tabIndex: 1,
exchangeSettings: {},
integral: '',
can_exchange: '',
mobile: '',
indexOf: -1,
exchanging: false,
exchange_id: '',
weixin_exchange_info: {}
}, },
/** /**
...@@ -26,7 +38,7 @@ Page({ ...@@ -26,7 +38,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getData(1);
}, },
/** /**
...@@ -57,6 +69,48 @@ Page({ ...@@ -57,6 +69,48 @@ Page({
}, },
/** /**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
return {
title: '好友助力',
path: "/pages/person/helpfriend/index"
}
},
/**
* 获取数据
*/
getData: function (type) {
http.getData(apis.exchangeSettings, 'GET', {
type: type
}, (res) => {
if (res.errcode === 0) {
this.setData({
exchangeSettings: res.data,
integral: res.integral,
can_exchange: res.can_exchange,
mobile: res.mobile,
weixin_exchange_info: res.weixin_exchange_info,
exchange_id: res.weixin_exchange_info.exchange_id
});
}
}, true, false, true);
},
/**
* 选择金额
*/
tab: function (e) {
let index = e.currentTarget.dataset.index;
this.setData({
indexOf: index
});
},
/**
* tab切换 * tab切换
*/ */
switchTab: function (e) { switchTab: function (e) {
...@@ -64,13 +118,126 @@ Page({ ...@@ -64,13 +118,126 @@ Page({
if (i == 1) { if (i == 1) {
this.setData({ this.setData({
tabIndex: 1 tabIndex: 1,
indexOf: -1
}); });
this.getData(1);
} else if (i == 2) { } else if (i == 2) {
this.setData({ this.setData({
tabIndex: 2 tabIndex: 2,
indexOf: -1
}); });
this.getData(2);
} }
},
/**
* 提现
*/
withdrawal: function (e) {
if (this.data.can_exchange === 0) {
wx.showToast({
title: '今天已经兑换过了,请明天再来吧',
icon: 'none',
duration: 2000
});
return false;
} else if (this.data.can_exchange === -1) {
wx.showToast({
title: '用户无法兑换,用户未认证',
icon: 'none',
duration: 2000
});
return false;
}
if (this.data.indexOf == -1) {
wx.showToast({
title: '请选择金额',
icon: 'none',
duration: 2000
});
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.setData({
exchanging: true
})
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
}
},
/**
* 提交
*/
submit: function (e) {
if (this.data.can_exchange === 0) {
wx.showToast({
title: '今天已经兑换过了,请明天再来吧',
icon: 'none',
duration: 2000
});
return false;
} else if (this.data.can_exchange === -1) {
wx.showToast({
title: '用户无法兑换,用户未认证',
icon: 'none',
duration: 2000
});
return false;
}
if (this.data.indexOf == -1) {
wx.showToast({
title: '请选择金额',
icon: 'none',
duration: 2000
});
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) {
wx.navigateTo({
url: '/pages/person/withdrawalsuccess/index'
});
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
}
} }
}) })
\ No newline at end of file
...@@ -142,13 +142,13 @@ ...@@ -142,13 +142,13 @@
font-size: 32rpx; font-size: 32rpx;
color: #515559; color: #515559;
line-height: 45rpx; line-height: 45rpx;
font-weight: 600;
} }
.t2 { .t2 {
font-size: 22rpx; font-size: 22rpx;
color: #8A9299; color: #8A9299;
line-height: 30px; line-height: 30rpx;
} }
&.curr { &.curr {
...@@ -182,6 +182,21 @@ ...@@ -182,6 +182,21 @@
line-height: 98rpx; line-height: 98rpx;
} }
.btns {
margin: 36rpx 55rpx 0 55rpx;
height: 98rpx;
background: rgba(255, 255, 255, 1);
border-radius: 8rpx;
font-size: 32rpx;
text-align: center;
display: block;
line-height: 98rpx;
border: 2rpx solid rgba(216, 223, 230, 1);
color: #0D84D1;
box-sizing: border-box;
}
.fr-txt { .fr-txt {
margin-top: 40rpx; margin-top: 40rpx;
font-size: 26rpx; font-size: 26rpx;
...@@ -209,4 +224,8 @@ ...@@ -209,4 +224,8 @@
color: #8A9299; color: #8A9299;
} }
} }
}
.opacity {
opacity: 0.5;
} }
\ No newline at end of file
...@@ -18,81 +18,54 @@ ...@@ -18,81 +18,54 @@
<text class="t1">红包提现</text> <text class="t1">红包提现</text>
</view> </view>
</view> </view>
<block wx:if="{{tabIndex == '1'}}"> <block wx:if="{{tabIndex == 1}}">
<view class="content"> <view class="content">
<view class="inp boxsiz row bothSide verCenter"> <view class="inp boxsiz row bothSide verCenter">
<view class="boxFlex"> <view class="boxFlexs">
<input type="text" placeholder="" value="15012479484" class="inpt"></input> <input type="text" placeholder="" value="{{mobile}}" class="inpt" disabled></input>
</view> </view>
<text class="boxFlex t1">默认注册号码</text> <text class="boxFlex t1">默认注册号码</text>
</view> </view>
<view class="bar boxsiz row verCenter"> <view class="bar boxsiz row verCenter">
<text class="t1">兑换话费</text> <text class="t1">兑换话费</text>
<text class="t2">账户红包:¥10.94</text> <text class="t2">账户红包:¥{{integral}}</text>
</view> </view>
<view class="list row avarage boxsiz"> <view class="list row boxsiz">
<view class="wrap column rowCenter verCenter"> <block wx:for="{{exchangeSettings}}" wx:key="item" wx:for-index="index">
<text class="t1">10元</text> <view class="wrap column rowCenter verCenter boxsiz {{index == indexOf ? 'curr':''}}" data-index="{{index}}" data-id="{{item.id}}" data-stock="{{item.stock}}" bind:tap="tab">
<text class="t2">剩余名额:10</text> <text class="t1">{{item.name}}</text>
</view> <text class="t2">剩余名额:{{item.stock}}</text>
<view class="wrap column rowCenter verCenter"> </view>
<text class="t1">20元</text> </block>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">30元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">50元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">100元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">200元</text>
<text class="t2">剩余名额:20</text>
</view>
</view> </view>
<button class="btn">立即兑换</button> <button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="submit">
立即兑换
</button>
</view> </view>
</block> </block>
<block wx:elif="{{tabIndex == '2'}}"> <block wx:elif="{{tabIndex == 2}}">
<view class="content"> <view class="content">
<view class="bar boxsiz row verCenter"> <view class="bar boxsiz row verCenter">
<text class="t1">红包提现</text> <text class="t1">红包提现</text>
<text class="t2">账户红包:¥10.94</text> <text class="t2">账户红包:¥{{integral}}</text>
</view> </view>
<view class="list row avarage boxsiz"> <view class="list row boxsiz">
<view class="wrap column rowCenter verCenter"> <block wx:for="{{exchangeSettings}}" wx:key="item" wx:for-index="index">
<text class="t1">1元</text> <view class="wrap column rowCenter verCenter boxsiz {{index == indexOf ? 'curr':''}}" data-index="{{index}}" data-id="{{item.id}}" data-stock="{{item.stock}}" bind:tap="tab">
<text class="t2">剩余名额:10</text> <text class="t1">{{item.name}}</text>
</view> <text class="t2">剩余名额:{{item.stock}}</text>
<view class="wrap column rowCenter verCenter"> </view>
<text class="t1">5元</text> </block>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">10元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">20元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">50元</text>
<text class="t2">剩余名额:20</text>
</view>
<view class="wrap column rowCenter verCenter">
<text class="t1">100元</text>
<text class="t2">剩余名额:20</text>
</view>
</view> </view>
<button class="btn">申请提现</button> <block wx:if="{{weixin_exchange_info.exchanging == 0 || exchanging}}">
<text class="fr-txt">好友助力,已完成(2/2)</text> <button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawal">
申请提现
</button>
</block>
<block wx:else>
<button class="btns">分享给好友助力,可提现</button>
</block>
<text class="fr-txt">好友助力,已完成({{weixin_exchange_info.assist_count}}/2)</text>
</view> </view>
</block> </block>
<view class="txt column"> <view class="txt column">
......
...@@ -119,11 +119,12 @@ ...@@ -119,11 +119,12 @@
font-size: 32rpx; font-size: 32rpx;
color: #515559; color: #515559;
line-height: 45rpx; line-height: 45rpx;
font-weight: 600;
} }
.withdrawal .content .list .wrap .t2 { .withdrawal .content .list .wrap .t2 {
font-size: 22rpx; font-size: 22rpx;
color: #8A9299; color: #8A9299;
line-height: 30px; line-height: 30rpx;
} }
.withdrawal .content .list .wrap.curr { .withdrawal .content .list .wrap.curr {
background: #ffffff; background: #ffffff;
...@@ -148,6 +149,19 @@ ...@@ -148,6 +149,19 @@
display: block; display: block;
line-height: 98rpx; line-height: 98rpx;
} }
.withdrawal .content .btns {
margin: 36rpx 55rpx 0 55rpx;
height: 98rpx;
background: #ffffff;
border-radius: 8rpx;
font-size: 32rpx;
text-align: center;
display: block;
line-height: 98rpx;
border: 2rpx solid #d8dfe6;
color: #0D84D1;
box-sizing: border-box;
}
.withdrawal .content .fr-txt { .withdrawal .content .fr-txt {
margin-top: 40rpx; margin-top: 40rpx;
font-size: 26rpx; font-size: 26rpx;
...@@ -171,3 +185,6 @@ ...@@ -171,3 +185,6 @@
line-height: 42rpx; line-height: 42rpx;
color: #8A9299; color: #8A9299;
} }
.opacity {
opacity: 0.5;
}
...@@ -69,6 +69,13 @@ ...@@ -69,6 +69,13 @@
"scene": null "scene": null
}, },
{ {
"id": 2,
"name": "pages/person/withdrawal/index",
"pathName": "pages/person/withdrawal/index",
"query": "",
"scene": null
},
{
"id": -1, "id": -1,
"name": "pages/person/welfare/index", "name": "pages/person/welfare/index",
"pathName": "pages/person/welfare/index", "pathName": "pages/person/welfare/index",
...@@ -79,6 +86,8 @@ ...@@ -79,6 +86,8 @@
"id": -1, "id": -1,
"name": "pages/person/notice/index", "name": "pages/person/notice/index",
"pathName": "pages/person/notice/index", "pathName": "pages/person/notice/index",
"name": "pages/person/invitation/index",
"pathName": "pages/person/invitation/index",
"query": "", "query": "",
"scene": null "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