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