Commit bf161d1a by 梁建民

js

parent 95dba4d9
...@@ -18,6 +18,11 @@ Page({ ...@@ -18,6 +18,11 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let exchange_id = options.exchange_id;
this.setData({
exchange_id: exchange_id
});
}, },
...@@ -67,7 +72,7 @@ Page({ ...@@ -67,7 +72,7 @@ Page({
*/ */
assistance: function () { assistance: function () {
http.getData(apis.assistsAdd, 'GET', { http.getData(apis.assistsAdd, 'GET', {
exchange_id: 24 exchange_id: this.data.exchange_id
}, (res) => { }, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
this.getData(); this.getData();
...@@ -86,7 +91,7 @@ Page({ ...@@ -86,7 +91,7 @@ Page({
getData: function (type) { getData: function (type) {
http.getData(apis.assistsList, 'GET', { http.getData(apis.assistsList, 'GET', {
exchange_id: 24 exchange_id: this.data.exchange_id
}, (res) => { }, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
this.setData({ this.setData({
......
<view class="packet" hover-class="none" hover-stop-propagation="false"> <view class="packet" hover-class="none" hover-stop-propagation="false">
<form bindsubmit='formSubmit'> <form bindsubmit='formSubmit'>
<view class="head"> <view class="head">
<view class="wrap column rowCenter verCenter"> <view class="wrap column rowCenter verCenter">
<text class="t1">输入好友的红包码</text> <text class="t1">输入好友的红包码</text>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<input type="text" value="{{code}}" placeholder="请输入红包码" class="inpt" placeholder-class="plac" name='code' disabled="{{flag}}"></input> <input type="text" value="{{code}}" placeholder="请输入红包码" class="inpt" placeholder-class="plac" name='code' disabled="{{flag}}"></input>
</view> </view>
</view> </view>
<button class="btn {{flag? 'opac':''}}" form-type="submit">兑换好友红包</button> <button class="btn {{flag? 'opac':''}}" form-type="submit">兑换好友红包</button>
</form> </form>
<view class="txt column"> <view class="txt column">
<text class="tit">温馨提示:</text> <text class="tit">温馨提示:</text>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<text class="t3">{{codesAdd.amount}}</text> <text class="t3">{{codesAdd.amount}}</text>
<text class="t4">元</text> <text class="t4">元</text>
</view> </view>
<view class="btn">收下红包</view> <view class="btn" bind:tap="isShow">收下红包</view>
<view class="close row rowCenter verCenter" bind:tap="isShow"> <view class="close row rowCenter verCenter" bind:tap="isShow">
<text class="icon iconfont iconiconxiantiaoshouji13"></text> <text class="icon iconfont iconiconxiantiaoshouji13"></text>
</view> </view>
......
...@@ -64,6 +64,25 @@ Page({ ...@@ -64,6 +64,25 @@ Page({
}, },
/** /**
* 分享
*/
onShareAppMessage: function (res) {
http.getData(apis.shareAdd, 'GET', {
user_id: wx.getStorageSync('user_id')
}, (res) => {
if (res.errcode === 0) {
}
}, true, false, true);
return {
title: '每日分享',
path: "/pages/person/invitation/index"
}
},
/**
* 获取数据 * 获取数据
*/ */
getData: function () { getData: function () {
...@@ -107,9 +126,23 @@ Page({ ...@@ -107,9 +126,23 @@ Page({
url: "/pages/form/xj/index" url: "/pages/form/xj/index"
}) })
} else if (id == 6) { } else if (id == 6) {
wx.navigateTo({
url: "/pages/list/signin/index"
}) http.getData(apis.checkInAdd, 'GET', null, (res) => {
if (res.errcode === 0) {
} else {
wx.showToast({
title: res.errmsg,
icon: 'none',
duration: 2000
});
}
}, true, false, true);
// wx.navigateTo({
// url: "/pages/list/signin/index"
// })
} }
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<text class="rule">查看规则</text> <text class="rule">查看规则</text>
<view class="exchange row verCenter "> <view class="exchange row verCenter ">
<navigator url="/pages/person/exchange/index" class="t1">兑换记录</navigator> <navigator url="/pages/person/exchange/index" class="t1">兑换记录</navigator>
<navigator url="/pages/person/withdrawal/index" class="t2 row verCenter rowCenter"> <navigator url="/pages/person/withdrawal/index" class="t2 row verCenter rowCenter">
<text class="icon iconfont iconiconxiantiaoshouji28"></text> <text class="icon iconfont iconiconxiantiaoshouji28"></text>
<text>提现兑换</text> <text>提现兑换</text>
</navigator> </navigator>
...@@ -38,83 +38,17 @@ ...@@ -38,83 +38,17 @@
<text class="t3">{{item.description}}</text> <text class="t3">{{item.description}}</text>
</view> </view>
</view> </view>
<view bind:tap="toUrl" data-id="{{item.id}}" wx:if="{{item.button_text}}" class="btn blue {{index > 2 ? 'yellow':''}}"> <block wx:if="{{item.id == 4}}">
{{item.button_text}} <button class="btn blue {{index > 2 ? 'yellow':''}}" open-type="share">
</view> {{item.button_text}}
</button>
</block>
<block wx:else>
<view bind:tap="toUrl" data-id="{{item.id}}" wx:if="{{item.button_text}}" class="btn blue {{index > 2 ? 'yellow':''}}">
{{item.button_text}}
</view>
</block>
</view> </view>
</block> </block>
<!-- <view class="list-wrap row verCenter bothSide bor">
<view>
<view>
<text class="t1">邀请好友</text>
<text class="icon iconfont iconiconxiantiaoshouji27"></text>
<text class="t2">立得三元</text>
</view>
<view>
<text class="t3">限时活动,邀请好友注册立得三元红包</text>
</view>
</view>
<view class="btn blue">去邀请</view>
</view>
<view class="list-wrap row verCenter bothSide bor">
<view>
<view>
<text class="t1">每日上传商品</text>
<text class="icon iconfont iconiconxiantiaoshouji27"></text>
<text class="t2">最高88元红包</text>
</view>
<view>
<text class="t3">每日首次上传商品,得随机红包奖励</text>
</view>
</view>
<view class="btn blue">去上传</view>
</view>
<view class="list-wrap row verCenter bothSide">
<view>
<view>
<text class="t1">输入红包码</text>
<text class="icon iconfont iconiconxiantiaoshouji27"></text>
<text class="t2">随机红包</text>
</view>
<view>
<text class="t3">领取好友红包,每个用户限领一次</text>
</view>
</view>
<view class="btn blue">去兑换</view>
</view>
<view class="hr"></view>
<view class="list-wrap row verCenter bothSide bor">
<view>
<view>
<text class="t1">天天签到领金币</text>
</view>
<view>
<text class="t3">领取好友红包,每个用户限领一次。</text>
</view>
</view>
<view class="btn yellow">签到</view>
</view>
<view class="list-wrap row verCenter bothSide bor">
<view>
<view>
<text class="t1">每日分享</text>
</view>
<view>
<text class="t3">每日首次分享,被好友点击后可获得奖励</text>
</view>
</view>
<view class="btn yellow">去分享</view>
</view>
<view class="list-wrap row verCenter bothSide">
<view>
<view>
<text class="t1">每日报价</text>
</view>
<view>
<text class="t3">每日首次回复报价,可获得奖励</text>
</view>
</view>
<view class="btn yellow">去报价</view>
</view> -->
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -75,7 +75,7 @@ Page({ ...@@ -75,7 +75,7 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
return { return {
title: '好友助力', title: '好友助力',
path: "/pages/person/helpfriend/index" path: "/pages/person/helpfriend/index?exchange_id=" + this.data.weixin_exchange_info.exchange_id
} }
}, },
/** /**
...@@ -170,9 +170,7 @@ Page({ ...@@ -170,9 +170,7 @@ Page({
exchange_id: exchange_id exchange_id: exchange_id
}, (res) => { }, (res) => {
if (res.errcode === 0) { if (res.errcode === 0) {
this.setData({ this.getData(2);
exchanging: true
})
} else { } else {
wx.showToast({ wx.showToast({
title: res.errmsg, title: res.errmsg,
...@@ -187,6 +185,9 @@ Page({ ...@@ -187,6 +185,9 @@ Page({
}, },
/**
* 关闭提示
*/
closeTip: function () { closeTip: function () {
this.setData({ this.setData({
isShowTip: false isShowTip: false
......
...@@ -55,13 +55,13 @@ ...@@ -55,13 +55,13 @@
</view> </view>
</block> </block>
</view> </view>
<block wx:if="{{weixin_exchange_info.exchanging == 0 || exchanging}}"> <block wx:if="{{weixin_exchange_info.exchanging == 0 }}">
<button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawal"> <button class="btn {{can_exchange == -1 || can_exchange == 0 ? 'opacity':''}}" bind:tap="withdrawal">
申请提现 申请提现
</button> </button>
</block> </block>
<block wx:else> <block wx:else>
<button class="btns">分享给好友助力,可提现</button> <button class="btns" open-type="share">分享给好友助力,可提现</button>
</block> </block>
<text class="fr-txt">好友助力,已完成({{weixin_exchange_info.assist_count}}/2)</text> <text class="fr-txt">好友助力,已完成({{weixin_exchange_info.assist_count}}/2)</text>
</view> </view>
......
.mine { .mine {
.head { .head {
position: relative; position: relative;
padding: 0 24rpx; padding: 0 24rpx;
......
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