Commit b5bb0472 by chenwq

refactor: 优化购物车和积分会页面,移除不必要的代码,添加即将上线提示

1 parent 9159d039
...@@ -129,11 +129,7 @@ Page({ ...@@ -129,11 +129,7 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function () {},
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
this.getShoppingcartList()
},
getShoppingcartList() { getShoppingcartList() {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
let userInfo = wx.p.storage.get('userInfo') let userInfo = wx.p.storage.get('userInfo')
...@@ -189,9 +185,7 @@ Page({ ...@@ -189,9 +185,7 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {},
this.getShoppingcartList()
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
...@@ -203,9 +197,7 @@ Page({ ...@@ -203,9 +197,7 @@ Page({
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {},
this.getShoppingcartList()
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
......
{ {
"navigationBarTitleText": "购物车", "navigationBarTitleText": "购物车",
"usingComponents": { "backgroundTextStyle": "dark"
"stepper": "/components/Stepper/Stepper"
},
"onReachBottomDistance": 10,
"backgroundTextStyle": "dark",
"enablePullDownRefresh": true
} }
page { page {
background: #F7F8FA; background: #F7F8FA;
} }
.coming-soon {
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #7A8299;
font-size: 32rpx;
}
.coming-soon-image {
width: 260rpx;
height: 260rpx;
margin-bottom: 24rpx;
}
.layout { .layout {
overflow: auto; overflow: auto;
} }
......
<view class="coming-soon">
<image class="coming-soon-image" mode="aspectFit" src="https://coresg-normal.trae.ai/api/ide/v1/tool_text_to_image?prompt=Minimal%20modern%203D%20illustration%20of%20a%20warm%20orange%20gift%20box%20with%20a%20small%20clock%20and%20sparkles%2C%20isolated%20on%20a%20pale%20cream%20background%2C%20no%20text%2C%20clean%20mobile%20app%20empty%20state%2C%20soft%20shadows&amp;image_size=square" />
<text>敬请期待</text>
</view>
<block wx:if="{{false}}">
<view class="layout" style="padding-bottom:{{padding_bottom }}px;height: calc(100vh - {{padding_bottom}}px);"> <view class="layout" style="padding-bottom:{{padding_bottom }}px;height: calc(100vh - {{padding_bottom}}px);">
<block wx:if="{{shoppingcartFlag}}"> <block wx:if="{{shoppingcartFlag}}">
<block wx:if="{{!goodsList.length}}"> <block wx:if="{{!goodsList.length}}">
...@@ -70,3 +75,4 @@ ...@@ -70,3 +75,4 @@
</view> </view>
</goods-action> </goods-action>
</block> </block>
</block>
...@@ -116,17 +116,7 @@ Page({ ...@@ -116,17 +116,7 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {},
const userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
wx.p.router.getRouterParams(options).then(params => {
this.setData({loginPageFlag: params?.loginPageFlag}, () => {
this.getPointsWallet()
})
}).catch(err => {
console.error('参数获取失败:', err)
})
},
// 获取积分会配置 // 获取积分会配置
getHomeData() { getHomeData() {
...@@ -353,15 +343,7 @@ Page({ ...@@ -353,15 +343,7 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {},
this.getWalletData()
this.getGoodsList()
this.getCategory()
this.getHomeData()
if (this.data.shouldAnimate) { // 恢复公告动画
this.resetAnimation()
}
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
......
.coming-soon {
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #7A8299;
font-size: 32rpx;
}
.coming-soon-image {
width: 260rpx;
height: 260rpx;
margin-bottom: 24rpx;
}
/* pages/tab/index/pages/index/index.wxss */ /* pages/tab/index/pages/index/index.wxss */
.page-title { .page-title {
text-align: center; text-align: center;
......
<view class="coming-soon">
<image class="coming-soon-image" mode="aspectFit" src="https://coresg-normal.trae.ai/api/ide/v1/tool_text_to_image?prompt=Minimal%20modern%203D%20illustration%20of%20a%20warm%20orange%20gift%20box%20with%20a%20small%20clock%20and%20sparkles%2C%20isolated%20on%20a%20pale%20cream%20background%2C%20no%20text%2C%20clean%20mobile%20app%20empty%20state%2C%20soft%20shadows&amp;image_size=square" />
<text>敬请期待</text>
</view>
<block wx:if="{{false}}">
<navigation-bar page-title="积分会" custom navStyle="{{navStyle}}" bindnavbarReady="navbarReady"> <navigation-bar page-title="积分会" custom navStyle="{{navStyle}}" bindnavbarReady="navbarReady">
<view class="page-title">积分会</view> <view class="page-title">积分会</view>
</navigation-bar> </navigation-bar>
...@@ -78,3 +83,4 @@ ...@@ -78,3 +83,4 @@
<enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}"></enable-wallet> <enable-wallet show="{{showEnableWallet}}" walletObj="{{walletObj}}"></enable-wallet>
<sku bind:cancelSku="closeSku" wx:if="{{showSku}}" bind:getCount="getCount" show="{{showSku}}" goods="{{detailInfo}}" clickType="join"></sku> <sku bind:cancelSku="closeSku" wx:if="{{showSku}}" bind:getCount="getCount" show="{{showSku}}" goods="{{detailInfo}}" clickType="join"></sku>
<glsx-privacy appletName="积分会"></glsx-privacy> <glsx-privacy appletName="积分会"></glsx-privacy>
</block>
...@@ -30,12 +30,11 @@ Page({ ...@@ -30,12 +30,11 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad() {
let userInfo = wx.p.storage.get("userInfo"); let userInfo = wx.p.storage.get("userInfo");
this.setData({ this.setData({
userInfo, userInfo,
}); });
this.searchScoreSummaryData();
// this.getMemberCardData(); // this.getMemberCardData();
}, },
searchScoreSummaryData() { searchScoreSummaryData() {
...@@ -56,7 +55,10 @@ Page({ ...@@ -56,7 +55,10 @@ Page({
} }
}).catch((err) => { }).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err)) const errorCode = err?.code || err?.cause?.code || err?.reason?.code;
// 同一接口刷新时会主动取消前一个请求,无需提示用户。
if (errorCode === "CANCELLED" || errorCode === "CANCELED") return;
wx.p.wxApi.showToast(err?.message || err?.detail || err?.errMsg || "积分信息获取失败");
}) })
}, },
go(e) { go(e) {
......
...@@ -70,6 +70,6 @@ ...@@ -70,6 +70,6 @@
], ],
"include": [] "include": []
}, },
"appid": "wx7ce755e425603084", "appid": "wx2dcdc028b44bbebd",
"libVersion": "3.9.0" "libVersion": "3.9.0"
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"libVersion": "3.9.0", "libVersion": "3.9.0",
"projectname": "points", "projectname": "points",
"setting": { "setting": {
"urlCheck": false, "urlCheck": true,
"coverView": true, "coverView": true,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false, "skylineRenderEnable": false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!