Commit b5bb0472 by chenwq

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

1 parent 9159d039
......@@ -129,11 +129,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let userInfo = wx.p.storage.get('userInfo')
this.setData({userInfo})
this.getShoppingcartList()
},
onLoad: function () {},
getShoppingcartList() {
wx.p.wxApi.showLoading()
let userInfo = wx.p.storage.get('userInfo')
......@@ -189,9 +185,7 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getShoppingcartList()
},
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
......@@ -203,9 +197,7 @@ Page({
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.getShoppingcartList()
},
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
......@@ -249,4 +241,4 @@ Page({
[`goodsList[${index}].showDel`]: result
})
}
})
\ No newline at end of file
})
{
"navigationBarTitleText": "购物车",
"usingComponents": {
"stepper": "/components/Stepper/Stepper"
},
"onReachBottomDistance": 10,
"backgroundTextStyle": "dark",
"enablePullDownRefresh": true
}
\ No newline at end of file
"backgroundTextStyle": "dark"
}
page {
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 {
overflow: auto;
}
......@@ -187,4 +204,4 @@ page {
.specification {
font-size: 24rpx;
color: #B1B1B3;
}
\ No newline at end of file
}
<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);">
<block wx:if="{{shoppingcartFlag}}">
<block wx:if="{{!goodsList.length}}">
......@@ -69,4 +74,5 @@
<button class="btn text-center" bindtap="checkOut" disabled="{{count<1}}">结算({{count || 0}})</button>
</view>
</goods-action>
</block>
\ No newline at end of file
</block>
</block>
......@@ -116,17 +116,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
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)
})
},
onLoad() {},
// 获取积分会配置
getHomeData() {
......@@ -353,15 +343,7 @@ Page({
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getWalletData()
this.getGoodsList()
this.getCategory()
this.getHomeData()
if (this.data.shouldAnimate) { // 恢复公告动画
this.resetAnimation()
}
},
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
......@@ -396,4 +378,4 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {}
})
\ No newline at end of file
})
.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 */
.page-title {
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">
<view class="page-title">积分会</view>
</navigation-bar>
......@@ -77,4 +82,5 @@
<!-- 开通钱包 -->
<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>
<glsx-privacy appletName="积分会"></glsx-privacy>
\ No newline at end of file
<glsx-privacy appletName="积分会"></glsx-privacy>
</block>
......@@ -30,12 +30,11 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad() {
let userInfo = wx.p.storage.get("userInfo");
this.setData({
userInfo,
});
this.searchScoreSummaryData();
// this.getMemberCardData();
},
searchScoreSummaryData() {
......@@ -56,7 +55,10 @@ Page({
}
}).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) {
......
......@@ -70,6 +70,6 @@
],
"include": []
},
"appid": "wx7ce755e425603084",
"appid": "wx2dcdc028b44bbebd",
"libVersion": "3.9.0"
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
"libVersion": "3.9.0",
"projectname": "points",
"setting": {
"urlCheck": false,
"urlCheck": true,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!