购物车历史订单增加,代码优化

This commit is contained in:
GaoHao
2025-04-02 09:20:26 +08:00
parent 5a655ba09e
commit 5e6646b574
31 changed files with 418 additions and 357 deletions

View File

@@ -27,13 +27,12 @@
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
text="保存"></up-button>
</view>
<!-- 消息提示 -->
<up-toast ref="uToastRef"></up-toast>
</template>
<script setup>
import { ref, reactive, getCurrentInstance } from 'vue';
import { ref, reactive } from 'vue';
import { addVendor } from '@/http/api/vendor.js';
@@ -42,7 +41,6 @@
shopId: uni.getStorageSync("shopId"),
},
})
const currentInstance = getCurrentInstance()
function sumbit() {
if (!datas.form.name || !datas.form.telephone || !datas.form.address) {
@@ -53,10 +51,7 @@
return
}
addVendor(datas.form).then(res => {
currentInstance.ctx.$refs.uToastRef.show({
message: "添加成功",
type: 'default',
})
uni.$utils.showToast("添加成功")
setTimeout(() => {
uni.navigateBack()
}, 1000)