Commit 0601a3e6 by 赵雅纹

Merge branch 'feature-zyw' into 'dev'

Feature zyw

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