Commit 10a2e649 by 施宇

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

parents 964ac899 c8d39dde
// pages/person/welfare/index.js
const http = require('../../../utils/util.js');
import {
apis
} from '../../../utils/api.js';
Page({
/**
* 页面的初始数据
*/
data: {
integralsList: {},
integral: '',
code: ''
},
/**
......@@ -26,7 +33,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getData();
},
/**
......@@ -56,4 +63,54 @@ Page({
onReachBottom: function () {
},
/**
* 获取数据
*/
getData: function () {
http.getData(apis.integralsList, 'GET', null, (res) => {
if (res.errcode === 0) {
this.setData({
integralsList: res.data,
integral: res.integral,
code: res.code
});
}
}, true, false, true);
},
/**
* 跳转地址
*/
toUrl: function (e) {
let id = e.currentTarget.dataset.id;
if (id == 1) {
wx.navigateTo({
url: "/pages/person/invitation/index"
})
} else if (id == 2) {
wx.navigateTo({
url: "/pages/form/good/index"
})
} else if (id == 3) {
wx.navigateTo({
url: "/pages/person/packet/index"
})
} else if (id == 4) {
} else if (id == 5) {
wx.navigateTo({
url: "/pages/form/xj/index"
})
} else if (id == 6) {
wx.navigateTo({
url: "/pages/list/signin/index"
})
}
}
})
\ No newline at end of file
......@@ -6,29 +6,46 @@
<text class="t1">我的红包</text>
</view>
<view class="num">
<text class="t1">10.93</text>
<text class="t1">{{integral}}</text>
<text class="t2">元</text>
</view>
<view class="code-text">
<text class="t1">红包码:</text>
<text class="t2">RDD23423</text>
<text class="t2">{{code}}</text>
</view>
</view>
<view class="column">
<text class="rule">查看规则</text>
<view class="exchange row verCenter ">
<text class="t1">兑换记录</text>
<view class="t2 row verCenter rowCenter">
<navigator url="/pages/person/exchange/index" class="t1">兑换记录</navigator>
<navigator url="/pages/person/withdrawal/index" class="t2 row verCenter rowCenter">
<text class="icon iconfont iconiconxiantiaoshouji28"></text>
<text>提现兑换</text>
</view>
</navigator>
</view>
</view>
</view>
<view class="list">
<block wx:for="{{integralsList}}" wx:for-item="item" wx:for-index="index">
<view class="list-wrap row verCenter bothSide bor">
<view>
<view>
<text class="t1">{{item.name}}</text>
<text wx:if="{{item.tips}}" class="icon iconfont iconiconxiantiaoshouji27"></text>
<text class="t2">{{item.tips}}</text>
</view>
<view>
<text class="t3">{{item.description}}</text>
</view>
</view>
<view bind:tap="toUrl" data-id="{{item.id}}" wx:if="{{item.button_text}}" class="btn blue {{index > 2 ? 'yellow':''}}">
{{item.button_text}}
</view>
</view>
</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>
......@@ -98,6 +115,6 @@
</view>
</view>
<view class="btn yellow">去报价</view>
</view>
</view> -->
</view>
</view>
\ No newline at end of file
......@@ -136,39 +136,54 @@ Page({
this.getData()
}
},
getData: function() {
getData: function () {
let me = this;
let url, token = wx.getStorageSync('access_token');
let str = "";
let params = {
offset: me.data.limit,
p: me.data.p,
"goods_name/like": me.data.confirmKey
};
if (me.data.tabIndex == 1) {
url = apis.goodsSearch
str = "goods_list"
} else {
url = apis.inquirySearch;
str = "inquiry_list"
}
if (token) {
params.token = token
}
getData(url, 'get', params, function(res) {
getData(url, 'get', params, function (res) {
if (res.errcode === 0) {
let newArr = [];
if (me.data.p > 1) {
newArr = me.data.priceList;
}
for (let key in res[str]) {
newArr.push(res[str][key])
}
me.setData({
priceList: newArr,
total: res.total,
});
} else {
if (me.data.p == 1) {
me.setData({
priceList: []
......
......@@ -58,6 +58,20 @@
"id": -1,
"name": "版本更新",
"pathName": "pages/tab/home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/list/signin/index",
"pathName": "pages/list/signin/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/person/welfare/index",
"pathName": "pages/person/welfare/index",
"scene": null
}
]
......
......@@ -10,6 +10,8 @@ const offer_url = "http://offerapi.icsales.cc";
const user_url = 'http://userapi.icsales.cc';
const goods_url = 'http://goodsapi.icsales.cc';
const home_url = 'http://home.icsales.cc';
const welfare_url = 'http://welfareapi.icsales.cc';
const apis = {
/**
......@@ -253,10 +255,62 @@ const apis = {
* 删除自己发出的评价
*/
evaluateDel: user_url + '/evaluate/del',
/**
* 申述自己收到的评价
*/
/**
* 申述自己收到的评价
*/
evaluateAppeal: user_url + '/evaluate/appeal/add',
/**
* 红包活动列表
*/
integralsList: welfare_url + '/integrals/list',
/**
* 红包获取明细(积分明细)
*/
integralBillsList: welfare_url + '/integral_bills/list',
/**
* 兑换记录(话费充值, 微信转账)
*/
userExchanges: welfare_url + '/user_exchanges/list',
/**
* 兑换配置列表(话费, 微信兑换页面的可兑换项)
*/
exchangeSettings: welfare_url + '/exchange_settings/list',
/**
* 兑换接口
*/
userExchanges: welfare_url + '/user_exchanges/exchange',
/**
* 邀请好友
*/
invitesAdd: welfare_url + '/invites/add',
/**
* 邀请好友历史记录
*/
invitesList: welfare_url + '/invites/list',
/**
* 邀请好友统计信息(邀请好友获得的金额和邀请好友数)
*/
invitesInfo: welfare_url + '/invites/info',
/**
* 每日分享
*/
shareAdd: welfare_url + '/share/add',
/**
* 每日签到
*/
checkInAdd: welfare_url + '/check_in/add',
/**
* 红包码兑换
*/
codesAdd: welfare_url + '/codes/add',
/**
* 获取好友助力列表
*/
assistsList: welfare_url + '/assists/list',
/**
* 添加好友助力
*/
assistsAdd: welfare_url + '/assists/add'
}
......
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