Commit e5a5f9c3 by chenwq

移除草稿保存按钮,优化底部操作按钮栏布局

1 parent 1c068aea
...@@ -158,9 +158,6 @@ Page({ ...@@ -158,9 +158,6 @@ Page({
wx.hideLoading(); wx.hideLoading();
}); });
}, },
handleSaveDraft() {
this.saveOrderData("draft");
},
// handleValidChange(e) { // handleValidChange(e) {
// this.setData({ isFormValid: e.detail.isValid }); // this.setData({ isFormValid: e.detail.isValid });
...@@ -221,23 +218,21 @@ Page({ ...@@ -221,23 +218,21 @@ Page({
}, },
/** /**
* 封装的统一调用接口(草稿/上一步/下一步/发拍) * 封装的统一调用接口(上一步/下一步/发拍)
* @param {String} actionType 'draft' | 'prev' | 'next' | 'submit' * @param {String} actionType 'prev' | 'next' | 'submit'
*/ */
saveOrderData(actionType) { saveOrderData(actionType) {
if (this.data.isRequesting) return; if (this.data.isRequesting) return;
const { formData, currentStep, optType } = this.data; const { formData, currentStep, optType } = this.data;
// 按需求:true=提交发拍,false=保存草稿/上一步/下一步 // 按需求:true=提交发拍,false=上一步/下一步
const isSubmit = actionType === "submit"; const isSubmit = actionType === "submit";
// 当 optType 为 republish 且不是最终提交时,只做本地步骤切换,不调用接口 // 当 optType 为 republish 且不是最终提交时,只做本地步骤切换,不调用接口
if (optType === "republish" && !isSubmit) { if (optType === "republish" && !isSubmit) {
const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" }; const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" };
if (actionType === "draft") { if (actionType === "prev") {
wx.p.router.goHome();
} else if (actionType === "prev") {
const prevNum = currentStep - 1; const prevNum = currentStep - 1;
this.setData({ currentStep: prevNum, step: stepMap[prevNum] }); this.setData({ currentStep: prevNum, step: stepMap[prevNum] });
} else if (actionType === "next") { } else if (actionType === "next") {
...@@ -280,12 +275,6 @@ Page({ ...@@ -280,12 +275,6 @@ Page({
const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" }; const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" };
switch (actionType) { switch (actionType) {
case "draft":
setTimeout(() => {
wx.p.router.goHome();
}, 1000);
break;
case "prev": case "prev":
const prevNum = currentStep - 1; const prevNum = currentStep - 1;
this.setData({ currentStep: prevNum, step: stepMap[prevNum] }); this.setData({ currentStep: prevNum, step: stepMap[prevNum] });
......
...@@ -375,18 +375,10 @@ page { ...@@ -375,18 +375,10 @@ page {
z-index: 100; z-index: 100;
border-top: 1rpx solid #eeeeee; border-top: 1rpx solid #eeeeee;
.btn-draft {
font-size: var(--fontSize32);
color: #2F6DFA;
padding: 0 var(--fontSize40);
flex-shrink: 0;
font-weight: 500;
}
.right-btns { .right-btns {
display: flex; display: flex;
flex: 1; flex: 1;
padding-right: var(--fontSize32); padding: 0 var(--fontSize32);
gap: var(--fontSize24); gap: var(--fontSize24);
justify-content: flex-end; justify-content: flex-end;
......
...@@ -63,8 +63,6 @@ ...@@ -63,8 +63,6 @@
<!-- 底部操作按钮栏 --> <!-- 底部操作按钮栏 -->
<view class="bottom-action-bar"> <view class="bottom-action-bar">
<view class="btn-draft" bindtap="handleSaveDraft">存草稿</view>
<view class="right-btns"> <view class="right-btns">
<view wx:if="{{currentStep > 1}}" class="action-btn btn-prev" bindtap="handlePrevStep">上一步</view> <view wx:if="{{currentStep > 1}}" class="action-btn btn-prev" bindtap="handlePrevStep">上一步</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!