lanan-old/lanan-master-uniapp/subRepairPages/maidan/maidan.vue
愉快的大福 7dc28dc701 init
2024-07-17 14:16:22 +08:00

153 lines
2.7 KiB
Vue

<template>
<view class="container">
<view class="cont-top">
<view class="top-left">备注:</view>
<view class="top-right">
<!-- @input="onInput" -->
<input type="text" placeholder="请输入备注" v-model="title" >
</view>
</view>
<view class="cont-top">
<view class="top-left">金额:</view>
<view class="top-right">
<!-- @input="onInput" -->
<input type="number" placeholder="请输入金额" v-model="num" >
</view>
</view>
<view class="anniu" @click="getpayment">
<text>下一步</text>
</view>
</view>
</template>
<script>
export default {
data(){
return{
title:'',
num:'',
inputValue: '',
actindex:'',
}
},
mounted() {
// this.num = this.num/100
},
methods:{
getindex(index,text){
this.actindex = index
this.inputValue = text
},
onInput(event) {
const regex = /^\d*$/; // 只允许输入数字
if (!regex.test(event.target.value)) {
this.inputValue = this.inputValue.replace(/\D/g, ''); // 移除非数字字符
}
},
// 创建订单 吊起支付
getpayment(){
if(!this.title){
uni.showToast({
title:"请输入备注",
icon: "error"
})
return
}
if(!this.num||this.num<=0){
uni.showToast({
title:"请输入正确金额",
icon: "error"
})
return
}
uni.navigateTo({
url:'/subRepairPages/orders/orders?title='+this.title +'&num='+this.num
})
},
}
}
</script>
<style scoped lang="scss">
.container{
width: 100%;
height:calc(100vh);
box-sizing: border-box;
background-color: #242A38;
padding-top: 40px;
}
.cont-top{
width: 95%;
margin: 0 auto;
box-sizing: border-box;
overflow: hidden;
padding-bottom: 10px;
display: flex;
align-items: center;
border-bottom: 1px solid #FFE3AD;
margin-top: 20px;
}
.top-right{
width: 70%;
input{
width: 100%;
color: white;
font-size: 18px;
font-weight: 600;
}
}
.top-left{
color: #FFE3AD;
font-size: 18px;
font-weight: 600;
margin-right: 5px;
}
.cont-box{
margin: 0 auto;
margin-top: 20px;
width: 95%;
display: flex;
flex-wrap: wrap;
}
.box{
width: 30%;
height: 40px;
border-radius: 8px;
border: 1px solid #FFE3AD;
margin-top: 10px;
margin-right: 11px;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
color: white;
font-weight: bold;
}
.anniu{
width: 80%;
height: 40px;
border-radius: 6px;
border: 1px solid #FFE3AD;
background-color: #FFE3AD ;
margin: 0 auto;
margin-top: 40px;
color: white;
display: flex;
justify-content: center;
align-items: center;
font-size: 18px;
font-weight: bold;
}
.indexbox{
background: #FFE3AD;
}
</style>