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({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
integralsList: {},
integral: '',
code: ''
}, },
/** /**
...@@ -26,7 +33,7 @@ Page({ ...@@ -26,7 +33,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getData();
}, },
/** /**
...@@ -56,4 +63,54 @@ Page({ ...@@ -56,4 +63,54 @@ Page({
onReachBottom: function () { 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,27 +6,44 @@ ...@@ -6,27 +6,44 @@
<text class="t1">我的红包</text> <text class="t1">我的红包</text>
</view> </view>
<view class="num"> <view class="num">
<text class="t1">10.93</text> <text class="t1">{{integral}}</text>
<text class="t2">元</text> <text class="t2">元</text>
</view> </view>
<view class="code-text"> <view class="code-text">
<text class="t1">红包码:</text> <text class="t1">红包码:</text>
<text class="t2">RDD23423</text> <text class="t2">{{code}}</text>
</view> </view>
</view> </view>
<view class="column"> <view class="column">
<text class="rule">查看规则</text> <text class="rule">查看规则</text>
<view class="exchange row verCenter "> <view class="exchange row verCenter ">
<text class="t1">兑换记录</text> <navigator url="/pages/person/exchange/index" class="t1">兑换记录</navigator>
<view 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>
</view> </navigator>
</view> </view>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="list-wrap row verCenter bothSide bor"> <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>
<view> <view>
<text class="t1">邀请好友</text> <text class="t1">邀请好友</text>
...@@ -98,6 +115,6 @@ ...@@ -98,6 +115,6 @@
</view> </view>
</view> </view>
<view class="btn yellow">去报价</view> <view class="btn yellow">去报价</view>
</view> </view> -->
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -136,39 +136,54 @@ Page({ ...@@ -136,39 +136,54 @@ Page({
this.getData() this.getData()
} }
}, },
getData: function() { getData: function () {
let me = this; let me = this;
let url, token = wx.getStorageSync('access_token'); let url, token = wx.getStorageSync('access_token');
let str = ""; let str = "";
let params = { let params = {
offset: me.data.limit, offset: me.data.limit,
p: me.data.p, p: me.data.p,
"goods_name/like": me.data.confirmKey "goods_name/like": me.data.confirmKey
}; };
if (me.data.tabIndex == 1) { if (me.data.tabIndex == 1) {
url = apis.goodsSearch url = apis.goodsSearch
str = "goods_list" str = "goods_list"
} else { } else {
url = apis.inquirySearch; url = apis.inquirySearch;
str = "inquiry_list" str = "inquiry_list"
} }
if (token) { if (token) {
params.token = token params.token = token
} }
getData(url, 'get', params, function(res) {
getData(url, 'get', params, function (res) {
if (res.errcode === 0) { if (res.errcode === 0) {
let newArr = []; let newArr = [];
if (me.data.p > 1) { if (me.data.p > 1) {
newArr = me.data.priceList; newArr = me.data.priceList;
} }
for (let key in res[str]) { for (let key in res[str]) {
newArr.push(res[str][key]) newArr.push(res[str][key])
} }
me.setData({ me.setData({
priceList: newArr, priceList: newArr,
total: res.total, total: res.total,
}); });
} else { } else {
if (me.data.p == 1) { if (me.data.p == 1) {
me.setData({ me.setData({
priceList: [] priceList: []
......
...@@ -58,6 +58,20 @@ ...@@ -58,6 +58,20 @@
"id": -1, "id": -1,
"name": "版本更新", "name": "版本更新",
"pathName": "pages/tab/home/home", "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 "scene": null
} }
] ]
......
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
// const home_url = 'https://home.icsales.com'; // const home_url = 'https://home.icsales.com';
const auth_url = 'http://authapi.icsales.cc'; const auth_url = 'http://authapi.icsales.cc';
const so_url = 'http://soapi.icsales.cc'; const so_url = 'http://soapi.icsales.cc';
const offer_url = "http://offerapi.icsales.cc"; const offer_url = "http://offerapi.icsales.cc";
const user_url = 'http://userapi.icsales.cc'; const user_url = 'http://userapi.icsales.cc';
const goods_url = 'http://goodsapi.icsales.cc'; const goods_url = 'http://goodsapi.icsales.cc';
const home_url = 'http://home.icsales.cc'; const home_url = 'http://home.icsales.cc';
const welfare_url = 'http://welfareapi.icsales.cc';
const apis = {
const apis = {
/** /**
* 授权接口 * 授权接口
*/ */
...@@ -65,8 +67,8 @@ const apis = { ...@@ -65,8 +67,8 @@ const apis = {
*/ */
authme: auth_url + '/auth/me', authme: auth_url + '/auth/me',
/*** /***
* 手动注册im账号 * 手动注册im账号
*/ */
authregistim: auth_url + '/auth/registIMUser', authregistim: auth_url + '/auth/registIMUser',
/*** /***
* 新增会员认证信息 * 新增会员认证信息
...@@ -250,13 +252,65 @@ const apis = { ...@@ -250,13 +252,65 @@ const apis = {
*/ */
evaluateAdd: user_url + '/evaluate/add', evaluateAdd: user_url + '/evaluate/add',
/** /**
* 删除自己发出的评价 * 删除自己发出的评价
*/ */
evaluateDel: user_url + '/evaluate/del', evaluateDel: user_url + '/evaluate/del',
/** /**
* 申述自己收到的评价 * 申述自己收到的评价
*/ */
evaluateAppeal: user_url + '/evaluate/appeal/add', 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