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

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

@@ -67,14 +67,14 @@
</template>
<script setup>
import { getCurrentInstance, reactive, ref } from 'vue';
import { reactive, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js';
import { shopStaffDetail,getShopStaffPermission,shopStaffAdd,shopStaffPut } from "@/http/api/staff.js"
import { getShopPermission } from "@/http/api/index.js"
import { getRoleList } from "@/http/api/role.js"
const currentInstance = getCurrentInstance()
const props = defineProps({
type: {
type: String
@@ -99,6 +99,7 @@
[]
]);
const show = ref(false)
const message = ref()
onShow(() => {
init()
})
@@ -170,16 +171,13 @@
async function sumbitEvent() {
// 效验
if (!datas.formData.name || !datas.formData.phone || !datas.formData.code || !datas.formData.accountPwd) {
currentInstance.ctx.$refs.uToastRef.show({
message: "请填写必填项",
type: 'default',
})
uni.$utils.showToast("请输入必填项")
return
}
let rolesId = datas.rolesList.filter(ele => ele.name == datas.rolesdata)
if (rolesId.length == 0) {
currentInstance.ctx.$refs.message.open()
message.value.open()
return
}
datas.formData.roleId = rolesId[0].id