- Fix hospital/service/caregiver images blank by prepending baseUrl for relative paths
- Add icon name mapping and resolveIcon() for service icon fallback
- Fix login phone field: res.phone -> res.data.phoneNumber
- Fix pagination stuck at page 1 in mechanism.js and qianbao.js
- Fix response parsing to handle both {code:200} and {erro:0} formats
- Replace raw wx.request calls with unified request() utility (6+ instances)
- Fix hardcoded phone number exposure in orderdetail.js
- Fix broken privacy URL (http: -> https://)
- Fix expired date range in goddess.wxml (2025 -> 2030)
- Remove duplicate refund box in orderdetail.wxml
- Fix service icon fallback ternary logic
- Add proper error handling replacing empty .catch() blocks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
72 lines
1.9 KiB
JavaScript
72 lines
1.9 KiB
JavaScript
var app = getApp();
|
|
const { request } = require('../../utils/request')
|
|
|
|
Page({
|
|
|
|
data: {
|
|
order_list: [],
|
|
navHeight: '',
|
|
menuButtonInfo: {},
|
|
searchMarginTop: 0,
|
|
searchWidth: 0,
|
|
searchHeight: 0,
|
|
page: 1,
|
|
firstLoad: true
|
|
},
|
|
|
|
back() {
|
|
wx.navigateBack()
|
|
},
|
|
|
|
onLoad: function (options) {
|
|
wx.setNavigationBarTitle({ title: '我的钱包' })
|
|
},
|
|
|
|
onShow: function () {
|
|
if (this.data.firstLoad) {
|
|
this.setData({ firstLoad: false })
|
|
this.getGoodsList()
|
|
}
|
|
},
|
|
|
|
onPullDownRefresh: function () {
|
|
this.setData({ page: 1 })
|
|
this.getGoodsList().finally(() => wx.stopPullDownRefresh())
|
|
},
|
|
|
|
activity(e) {
|
|
if (e.currentTarget.dataset.id != 0) {
|
|
wx.navigateTo({
|
|
url: "/shopping/pages/goddess/goddess?id=" + e.currentTarget.dataset.id,
|
|
});
|
|
}
|
|
},
|
|
|
|
// 交易明细列表
|
|
getGoodsList: function () {
|
|
var that = this;
|
|
return request({
|
|
url: '/app/Goddesswechat/getCapitalDetails',
|
|
method: 'POST',
|
|
loading: true,
|
|
data: {
|
|
uid: wx.getStorageSync('uid'),
|
|
token: wx.getStorageSync('token'),
|
|
page: String(this.data.page),
|
|
page_size: 10,
|
|
}
|
|
}).then(res => {
|
|
if (res.code === 200 || res.erro === 0) {
|
|
var list = res.detail || res.data || [];
|
|
if (that.data.page === 1) {
|
|
that.setData({ order_list: list })
|
|
} else {
|
|
that.setData({ order_list: that.data.order_list.concat(list) })
|
|
}
|
|
that.setData({ page: that.data.page + 1 })
|
|
}
|
|
}).catch(function() {
|
|
wx.showToast({ title: '加载失败', icon: 'none' })
|
|
})
|
|
},
|
|
}) |