代客下单修改,登录页面修改,部分页面调整,请求封装调整
This commit is contained in:
119
components/my-components/modal.vue
Normal file
119
components/my-components/modal.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-popup :show="show" mode="center">
|
||||
<view class="popup-content" :style="returnStyle">
|
||||
<view class="top u-flex u-row-between">
|
||||
<text class="font-bold u-font-32 color-333">{{ title }}</text>
|
||||
<up-icon size="18" name="close" @click="show = false"></up-icon>
|
||||
</view>
|
||||
<up-line></up-line>
|
||||
<scroll-view style="max-height: 50vh" :scroll-y="true" v-if="isSroll">
|
||||
<slot></slot>
|
||||
</scroll-view>
|
||||
<template v-else>
|
||||
<slot></slot>
|
||||
</template>
|
||||
<up-line></up-line>
|
||||
|
||||
<view class="bottom">
|
||||
<view class="btn cancel" :class="[btnShape]" @click="close">{{
|
||||
cancelText
|
||||
}}</view>
|
||||
<view class="btn success" :class="[btnShape]" @click="confirm">{{
|
||||
confirmText
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
const props = defineProps({
|
||||
width: {
|
||||
type: String || Number,
|
||||
default: "640rpx",
|
||||
},
|
||||
isSroll: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "标题",
|
||||
},
|
||||
confirmText: {
|
||||
type: String,
|
||||
default: "保存",
|
||||
},
|
||||
cancelText: {
|
||||
type: String,
|
||||
default: "取消",
|
||||
},
|
||||
btnShape: {
|
||||
type: String,
|
||||
default: "square",
|
||||
},
|
||||
});
|
||||
const show = defineModel({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
});
|
||||
const emits = defineEmits(["close", "confirm"]);
|
||||
function close() {
|
||||
show.value = false;
|
||||
emits("close");
|
||||
}
|
||||
function confirm() {
|
||||
emits("confirm");
|
||||
}
|
||||
|
||||
const returnStyle = computed(() => {
|
||||
if (typeof props.width === "string") {
|
||||
return {
|
||||
width: props.width || "640rpx",
|
||||
};
|
||||
}
|
||||
return {
|
||||
width: props.width +'rpx'
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.popup-content {
|
||||
background: #fff;
|
||||
width: 640rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.top {
|
||||
padding: 40rpx 48rpx;
|
||||
}
|
||||
.bottom {
|
||||
padding: 48rpx 52rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 50rpx;
|
||||
.btn {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 18rpx 60rpx;
|
||||
font-size: 32rpx;
|
||||
border: 2rpx solid transparent;
|
||||
&.success {
|
||||
background-color: $my-main-color;
|
||||
color: #fff;
|
||||
}
|
||||
&.cancel {
|
||||
border-color: #d9d9d9;
|
||||
box-shadow: 0 4rpx 0 0 #00000005;
|
||||
}
|
||||
&.round {
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
&.square {
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -201,8 +201,8 @@
|
||||
|
||||
const getCode = () => {
|
||||
getCodeImg().then(res => {
|
||||
vdata.formData.img = res.data.code
|
||||
vdata.formData.uuid = res.data.uuid
|
||||
vdata.formData.img = res.code
|
||||
vdata.formData.uuid = res.uuid
|
||||
})
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
uni.removeStorageSync('tokenInfo')
|
||||
uni.removeStorageSync('shopId')
|
||||
// 登录成功
|
||||
loginFinishFunc(res.data)
|
||||
loginFinishFunc(res)
|
||||
}).catch(e => {
|
||||
getCode()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user