oil-station/gasStation-uni/pagesMy/CardManagement/Detail.vue

143 lines
2.6 KiB
Vue
Raw Normal View History

2023-12-18 16:32:08 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
2023-12-28 13:14:35 +08:00
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
2023-12-18 16:32:08 +08:00
<view class="my-text">添加子卡</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="input_">
<view class="">请输入手机号</view>
<view class="">
2023-12-28 13:14:35 +08:00
<input type="text" v-model="cardValueChildrens.cardChildPhones" placeholder="请输入手机号" />
2023-12-18 16:32:08 +08:00
</view>
</view>
2023-12-28 13:14:35 +08:00
<view class="anniu" @click="submitCardValChildren">
2023-12-18 16:32:08 +08:00
<text>提交</text>
</view>
</view>
</view>
</template>
<script>
2023-12-28 13:14:35 +08:00
import request from '../../utils/request'
2023-12-18 16:32:08 +08:00
export default {
data() {
return {
title: '',
2023-12-28 13:14:35 +08:00
cardValueChildrens:{
cardChildPhones:"",
2024-01-10 11:06:41 +08:00
storeId:uni.getStorageSync("storeId"),
2023-12-28 13:14:35 +08:00
},
2023-12-18 16:32:08 +08:00
}
},
components: {
},
methods: {
2023-12-28 13:14:35 +08:00
// 添加子卡信息
submitCardValChildren(){
2024-01-10 11:06:41 +08:00
console.log(this.cardValueChildrens);
2023-12-28 13:14:35 +08:00
if(this.cardValueChildrens.cardChildPhones==""){
uni.showToast({
title:"请填写子卡手机号",
icon:"none"
})
return;
}
if(this.cardValueChildrens.cardChildPhones.length!=11){
uni.showToast({
title:"请填写正确的手机号",
icon:"none"
})
return;
}
request({
url: "cardValudChildrens",
method: 'post',
data:this.cardValueChildrens,
}).then((res) => {
2024-01-10 11:06:41 +08:00
// console.log(res)
if (res.data.error){
2023-12-28 13:14:35 +08:00
uni.showToast({
title:res.data.error,
icon:"none"
})
}else{
uni.showToast({
title:"添加成功",
icon:"success"
})
this.goBack()
}
})
},
goBack() {
2023-12-18 16:32:08 +08:00
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #ffffff;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.input_ {
width: 90%;
box-sizing: border-box;
padding: 15px 0px;
display: flex;
align-items: center;
border-bottom: 1px solid #DDDDDD;
margin: 15px auto;
}
.anniu {
width: 90%;
height: 42px;
margin: 15px auto;
display: flex;
align-items: center;
justify-content: center;
color: white;
border-radius: 8px;
background: #ff6e05;
2023-12-19 09:31:53 +08:00
2023-12-18 16:32:08 +08:00
}
2023-12-19 09:31:53 +08:00
</style>