Commit 0601a3e6 by 赵雅纹

Merge branch 'feature-zyw' into 'dev'

Feature zyw

See merge request !6
parents 2ec7b8e0 2a1c24ae
...@@ -42,6 +42,7 @@ Component({ ...@@ -42,6 +42,7 @@ Component({
if (res.detail.userInfo) { if (res.detail.userInfo) {
console.log('点击了同意') console.log('点击了同意')
this.setUserInfo() this.setUserInfo()
let token = buyer-token;
utils.getUserInfoByBtn(userInfo).then(({ token = '', data = {} }) => { utils.getUserInfoByBtn(userInfo).then(({ token = '', data = {} }) => {
wx.setStorageSync('_accreditUserInfo', userInfo) wx.setStorageSync('_accreditUserInfo', userInfo)
wx.hideNavigationBarLoading() wx.hideNavigationBarLoading()
......
...@@ -4,7 +4,7 @@ const needMock = '' // ...@@ -4,7 +4,7 @@ const needMock = '' //
// appid_dev wxc3b64b09b1d3dfc2 // appid_dev wxc3b64b09b1d3dfc2
// appid_prod // appid_prod
const devCtx = 'http://111.231.86.64/member' const devCtx = 'http://111.231.86.64'
const prodCtx = '' // 发生产时解开此注释 const prodCtx = '' // 发生产时解开此注释
const config = { const config = {
......
...@@ -9,7 +9,11 @@ wxService.page({ ...@@ -9,7 +9,11 @@ wxService.page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
params:{
pageNo:'1',
pageSize:'10'
},
totalPages:''
}, },
/** /**
...@@ -20,51 +24,62 @@ wxService.page({ ...@@ -20,51 +24,62 @@ wxService.page({
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
}, },
/** //获取消费列表
* 生命周期函数--监听页面隐藏 initOrderList(type){
*/ wx.showLoading({
onHide: function () { title: '加载中'
})
}, wxService.post('/sale/order/list',this.data.params).then(res => {
let orderList = [];
/** orderList = this.data.params.pageNo == 1 ? res.data.data : this.data.orderList.concat(res.data.data);
* 生命周期函数--监听页面卸载 this.setData({
*/ orderList,
onUnload: function () { totalPages: res.data.data.totalPages,
})
wx.hideLoading();
if (type && type.pullDown) wx.stopPullDownRefresh();
}).finally(() => {
wx.hideLoading();
this.setData({
orderList: ''
})
})
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.setData({
params: {
pageNo: 1,
pageSize: 10,
},
})
this.initOrderList({
pullDown: true
});
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { bindDownLoad: function () {
if (this.data.params.pageNo < this.data.totalPages) {
this.setData({
params: {
pageNo: this.data.params.pageNo + 1,
pageSize: 10
}, },
loadDataDone: true
/** })
* 用户点击右上角分享 this.initOrderList()
*/
onShareAppMessage: function () {
} }
},
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "我的消费", "navigationBarTitleText": "我的消费",
"usingComponents": {} "usingComponents": {},
"enablePullDownRefresh": true,
"onPullDownRefresh": true,
"onReachBottom": true
} }
\ No newline at end of file
<!--pages/userCenter.wxml--> <!--pages/userCenter.wxml-->
<view class='page-mySpend'> <view class='page-mySpend'>
<scroll-view> <scroll-view scroll-y bindscrolltolower="bindDownLoad">
<view class='spend-wrap'> <view class='spend-wrap'>
<navigator url='/pages/consumptionDetails/consumptionDetails'></navigator> <navigator url='/pages/consumptionDetails/consumptionDetails' hover-class='none'>
<view class='spend-list'> <view class='spend-list'>
<view class='spend-id fs-22'>订单编号:8327878435</view> <view class='spend-id fs-22'>订单编号:8327878435</view>
<view class='spend-time fs-25'>消费时间:</view> <view class='spend-time fs-25'>消费时间:</view>
<view class='spend-shop fs-25'>消费门店:张江高科店</view> <view class='spend-shop fs-25'>消费门店:张江高科店</view>
<view class="spend-status fs-22 {{true ? 'fail-status' : ''}}">交易成功</view> <view class="spend-status fs-22 {{true ? 'fail-status' : ''}}">交易成功</view>
</view> </view>
</navigator>
</view> </view>
<view class='spend-wrap'> <view class='spend-wrap'>
<view class='spend-list'> <view class='spend-list'>
......
/* pages/userCenter.wxss */ /* pages/userCenter.wxss */
@import './../../base/base.wxss'; @import './../../base/base.wxss';
page{
background-color: #ffffff;
}
.page-mySpend{ .page-mySpend{
padding: 0 32rpx; padding: 0 32rpx;
} }
......
...@@ -158,7 +158,7 @@ function getUserInfoByBtn(userInfo) { ...@@ -158,7 +158,7 @@ function getUserInfoByBtn(userInfo) {
icon: 'none', icon: 'none',
mask: true mask: true
}) })
return wxService.post(`/minaLogin`, { return wxService.post(`/member/minaLogin`, {
code: res[1].code, code: res[1].code,
wechatInfo: res[0] wechatInfo: res[0]
}) })
......
...@@ -65,7 +65,7 @@ class WXService extends Http { ...@@ -65,7 +65,7 @@ class WXService extends Http {
url, url,
data, data,
header: { header: {
token: this.getToken() 'buyer-token': this.getToken()
}, },
method, method,
dataType, dataType,
...@@ -155,7 +155,7 @@ class WXService extends Http { ...@@ -155,7 +155,7 @@ class WXService extends Http {
let newBaseUserInfo = { ...baseUserInfo, ...res.data.data } let newBaseUserInfo = { ...baseUserInfo, ...res.data.data }
this.baseUserInfo = newBaseUserInfo this.baseUserInfo = newBaseUserInfo
wx.setStorageSync('_baseUserInfo', newBaseUserInfo) wx.setStorageSync('_baseUserInfo', newBaseUserInfo)
wx.setStorageSync('token', res.data.data.token) wx.setStorageSync('buyer-token', res.data.data.token)
this.startReport() this.startReport()
return Promise.resolve({ state: 1, info: res.data.data }) return Promise.resolve({ state: 1, info: res.data.data })
} else { } else {
...@@ -290,7 +290,7 @@ class WXService extends Http { ...@@ -290,7 +290,7 @@ class WXService extends Http {
app.globalData.baseUserInfo = baseUserInfo app.globalData.baseUserInfo = baseUserInfo
} }
if (!app.globalData.userNo) { if (!app.globalData.userNo) {
const token = wx.getStorageSync('token') const token = wx.getStorageSync('buyer-token')
app.globalData.userNo = token.split('###')[0] app.globalData.userNo = token.split('###')[0]
} }
} }
......
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 to comment