购物车历史订单增加,代码优化
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user