Commit 41e5bbb1 authored by 程新智's avatar 程新智 👽

优化

parent 78df98d1
......@@ -12,8 +12,8 @@
{{addressInfo.address}} {{addressInfo.detailInfo}}
</div>
<div class="right__phone">
<span>{{addressInfo.userName}}</span> <span>{{addressInfo.telNumber}}</span>
<span v-if="addressInfo.defaultFlag">默认</span>
<span>{{addressInfo.userName}}</span> <span>{{addressInfo.telNumber}}</span>
</div>
</div>
<div class="address__right" @click="goAddress">
......@@ -329,7 +329,9 @@ export default {
/deep/ .u-modal__content__text {
text-align: center !important;
}
/deep/ .u-input__content__field-wrapper__field {
text-align: right !important;
}
.price__bottom {
width: 100%;
height: 156rpx;
......
......@@ -94,12 +94,19 @@ export default {
message: "请填写车型",
trigger: ["blur", "change"],
},
"carInfo.carNo": {
"carInfo.carNo": [{
min: 7,
max: 8,
message: '车牌长度在7-8个字符之间'
},
{
type: "string",
required: true,
message: "请填写车牌号",
trigger: ["blur", "change"],
},
]
},
carId: '',
//免费挪车码
......@@ -112,7 +119,7 @@ export default {
},
},
methods: {
goLoveCar(){
goLoveCar() {
uni.navigateTo({
url: '/pagesB/pages/move-car/loveCar?price=1'
});
......@@ -120,8 +127,11 @@ export default {
getCarCode() {
//跳转到获取挪车码页面
this.$refs.form1.validate().then(res => {
if(!this.model1.carInfo.id){
let opts = { url: '/app/vehicleAdmin/add', method: 'post' };
if (!this.model1.carInfo.id) {
let opts = {
url: '/app/vehicleAdmin/add',
method: 'post'
};
this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => {
if (res.data.code == 200) {
......@@ -136,9 +146,12 @@ export default {
})
},
getCarInfo(){
if(this.carId){
let opts = { url: '/app/vehicleAdmin/' + this.carId, method: 'get' };
getCarInfo() {
if (this.carId) {
let opts = {
url: '/app/vehicleAdmin/' + this.carId,
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.model1.carInfo = res.data.data
......@@ -147,8 +160,11 @@ export default {
}
},
getMoveCode(){
let opts = { url: '/app/mall/free/code', method: 'get' };
getMoveCode() {
let opts = {
url: '/app/mall/free/code',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.freeCode = res.data.data
......@@ -180,11 +196,16 @@ export default {
text-align: right;
}
/deep/ .u-input__content__field-wrapper__field {
text-align: right !important;
}
.self__input__km {
display: flex;
align-items: center;
justify-content: space-between;
span{
span {
text-align: right;
display: inline-block;
width: 100rpx;
......@@ -288,6 +309,7 @@ export default {
text-align: right;
margin-top: 40rpx;
margin-bottom: 200rpx;
image {
width: 10rpx;
height: 20rpx;
......
......@@ -4,7 +4,7 @@
-->
<template>
<view class="appCotent">
<div class="addCar">
<div class="addCar">
<div class="add__content">
<div class="add__title">
填写车辆信息
......@@ -29,14 +29,14 @@
</div>
<div class="add__user">
<u-checkbox-group placement="row">
<u-checkbox :checked='checked' @change="changeBtn" ></u-checkbox>
<u-checkbox :checked='checked' @change="changeBtn"></u-checkbox>
</u-checkbox-group>
勾选同意<span>《用户服务协议》</span>
</div>
<div class="add__btn add__no__bind" @click="addCarInfo()">
完成
</div>
</div>
</div>
</view>
</template>
......@@ -48,7 +48,7 @@ export default {
},
data() {
return {
checked:false,
checked: false,
model1: {
carInfo: {
brand: '',
......@@ -67,12 +67,19 @@ export default {
message: "请填写车型",
trigger: ["blur", "change"],
},
"carInfo.carNo": {
"carInfo.carNo": [{
min: 7,
max: 8,
message: '车牌长度在7-8个字符之间'
},
{
type: "string",
required: true,
message: "请填写车牌号",
trigger: ["blur", "change"],
},
]
},
items: [{
title: "挪车码编号",
......@@ -97,7 +104,7 @@ export default {
};
},
methods: {
changeBtn(){
changeBtn() {
this.checked = !this.checked;
},
goBack() {
......@@ -105,10 +112,21 @@ export default {
delta: 1
})
},
addCarInfo(){
addCarInfo() {
//表单验证
this.$refs.form1.validate().then(res => {
let opts = { url: '/app/vehicleAdmin/add', method: 'post' };
if (!this.checked) {
uni.showToast({
title: "请同意用户协议",
icon: 'none',
duration: 2000,
});
return
}
let opts = {
url: '/app/vehicleAdmin/add',
method: 'post'
};
this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => {
if (res.data.code == 200) {
//添加成功
......@@ -131,7 +149,8 @@ export default {
<style lang="scss" scoped>
.addCar {
padding: 40rpx 0rpx;
/deep/.u-input__content__field-wrapper__field{
/deep/.u-input__content__field-wrapper__field {
text-align: right !important;
padding-right: 30rpx;
}
......
......@@ -4,7 +4,7 @@
-->
<template>
<view class="appCotent">
<div class="editCar">
<div class="editCar">
<div class="add__content">
<div class="add__title">
填写车辆信息
......@@ -23,7 +23,7 @@
</div>
</u-form-item>
<u-form-item label="车牌号" prop="carInfo.carNo" ref="item1"> </u-form-item>
<car-number v-model="model1.carInfo.carNo"></car-number>
<car-number v-if="model1.carInfo.carNo" v-model="model1.carInfo.carNo"></car-number>
</u--form>
</div>
</div>
......@@ -34,9 +34,8 @@
<div class="add__btn add__back" @click="delModal">
删除
</div>
<u-modal :show="deleteShow" :title="deleteTitle" :content='deleteContent'
@confirm="confirmModal" @cancel="cancelModal" showCancelButton="true"></u-modal>
</div>
<u-modal :show="deleteShow" :title="deleteTitle" :content='deleteContent' @confirm="confirmModal" @cancel="cancelModal" showCancelButton="true"></u-modal>
</div>
</view>
</template>
......@@ -51,7 +50,9 @@ export default {
//车辆id
id: '',
model1: {
carInfo: {},
carInfo: {
carNo: '',
},
},
deleteShow: false,
deleteTitle: '删除车辆',
......@@ -69,12 +70,19 @@ export default {
message: "请填写车型",
trigger: ["blur", "change"],
},
"carInfo.carNo": {
"carInfo.carNo": [{
min: 7,
max: 8,
message: '车牌长度在7-8个字符之间'
},
{
type: "string",
required: true,
message: "请填写车牌号",
trigger: ["blur", "change"],
},
]
},
items: [{
title: "挪车码编号",
......@@ -104,18 +112,28 @@ export default {
delta: 1
})
},
getCarInfo(){
let opts = { url: '/app/vehicleAdmin/' + this.id, method: 'get' };
getCarInfo() {
let opts = {
url: '/app/vehicleAdmin/' + this.id,
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.model1.carInfo = res.data.data
this.$nextTick(() => {
this.model1.carInfo = res.data.data;
this.model1.carInfo.carNo = res.data.data.carNo;
this.$set(this.model1.carInfo, 'carNo', res.data.data.carNo);
});
}
})
},
editCarInfo(){
editCarInfo() {
this.$refs.form1.validate().then(res => {
let opts = { url: '/app/vehicleAdmin/edit', method: 'put' };
let opts = {
url: '/app/vehicleAdmin/edit',
method: 'put'
};
this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => {
if (res.data.code == 200) {
//添加成功
......@@ -128,8 +146,11 @@ export default {
})
},
//确认删除车辆
confirmModal(){
let opts = { url: '/app/vehicleAdmin/remove/' + this.id, method: 'delete' };
confirmModal() {
let opts = {
url: '/app/vehicleAdmin/remove/' + this.id,
method: 'delete'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
uni.showToast({
......@@ -137,7 +158,7 @@ export default {
icon: "success",
});
this.goBack()
}else{
} else {
uni.showToast({
title: res.data.msg,
icon: "error",
......@@ -146,10 +167,10 @@ export default {
})
this.deleteShow = false
},
cancelModal(){
cancelModal() {
this.deleteShow = false
},
delModal(){
delModal() {
this.deleteShow = true
},
},
......@@ -160,7 +181,7 @@ export default {
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
this.$refs.form1.setRules(this.rules)
},
onShow(){
onShow() {
this.getCarInfo()
},
}
......@@ -169,14 +190,17 @@ export default {
<style lang="scss" scoped>
.editCar {
padding: 40rpx 0rpx;
/deep/ .u-input__content__field-wrapper__field{
/deep/ .u-input__content__field-wrapper__field {
text-align: right !important;
padding-right: 30rpx;
justify-content: space-evenly;
}
.u-checkbox-group {
display: inline-block !important;
}
/deep/.u-checkbox-group--row {
display: inline-block !important;
}
......
......@@ -28,6 +28,7 @@
<u-modal :show="deleteShow" :title="deleteTitle" :content='deleteContent'
@confirm="confirmModal" @cancel="cancelModal" showCancelButton="true"></u-modal>
</div>
<u-gap bgColor="transparent" height="60"></u-gap>
<div class="love__btn" @click="addCar">
<image src="@/static/move-car/love-car5.png"> 添加车辆
</div>
......@@ -203,7 +204,9 @@ export default {
color: #FFFFFF;
line-height: 76rpx;
text-align: center;
position: fixed;
width: 670rpx;
bottom: 60rpx;
image {
width: 30rpx;
height: 30rpx;
......
<template>
<view class="appCotent">
<view>
<view>
<custom-tarbar :selected="3"></custom-tarbar>
<view class="shop">
<div class="my__search" @click='goSearch'>
......@@ -25,8 +25,9 @@
</div>
<div class="shop__list__one">
<div class="view__title">车主精选 养车必备</div>
<div class="list__one__items">
<scroll-list ref="list" :option="option" @load="load">
<div class="list__one__items">
<div class="one__item" v-for="(vo,inx) in boutiqueMallList" :key="inx" @click="goDetail(vo.id)">
<div class="one__item__img">
<image :src="getImage(vo.mainImgUrl)" />
......@@ -38,14 +39,14 @@
{{vo.currentPrice/100}}<span class="num__two">{{vo.originalPrice/100}}</span>
</div>
</div>
</scroll-list>
</div>
</scroll-list>
</div>
</view>
<u-gap bgColor="transparent" height="60"></u-gap>
</view>
</view>
</view>
</template>
......@@ -77,8 +78,13 @@ export default {
// 加载数据
load(paging) {
setTimeout(() => {
let opts = { url: '/app/mall/list?pageSize='+paging.size+'&pageNum='+paging.page, method: 'get' };
this.http.httpTokenRequest(opts, {classification: "2"}).then(res => {
let opts = {
url: '/app/mall/list?pageSize=' + paging.size + '&pageNum=' + paging.page,
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "2"
}).then(res => {
if (res.data.code == 200) {
let list = res.data.data.rows
this.boutiqueMallList = [...this.boutiqueMallList, ...list];
......@@ -104,33 +110,46 @@ export default {
url: '/pagesC/pages/shop/detail?id=' + id
})
},
getMallList(){
let opts = { url: '/app/mall/list', method: 'get' };
this.http.httpTokenRequest(opts, {classification: "1"}).then(res => {
getMallList() {
let opts = {
url: '/app/mall/list',
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "1"
}).then(res => {
if (res.data.code == 200) {
this.mallList = res.data.data.rows
}
})
},
getBoutiqueMallList(){
let opts = { url: '/app/mall/list', method: 'get' };
this.http.httpTokenRequest(opts, {classification: "2"}).then(res => {
getBoutiqueMallList() {
let opts = {
url: '/app/mall/list',
method: 'get'
};
this.http.httpTokenRequest(opts, {
classification: "2"
}).then(res => {
if (res.data.code == 200) {
this.boutiqueMallList = res.data.data.rows
}
})
},
getImage(imageUrl){
getImage(imageUrl) {
return imageUrl;
},
getRotationList(){
let opts = { url: '/app/index/carouse/2', method: 'get' };
getRotationList() {
let opts = {
url: '/app/index/carouse/2',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
let data = []
data = res.data.data
let imgList = []
data.forEach(e=>{
data.forEach(e => {
imgList.push(e.imageUrl)
})
this.list3 = imgList
......@@ -160,13 +179,13 @@ export default {
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
.one__item {
width: 100%;
width: 48%;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
border-radius: 20rpx;
margin-bottom: 30rpx;
.one__item__img {
width: 100%;
height: 320rpx;
......@@ -259,6 +278,8 @@ export default {
.item2__img {
margin-bottom: 20rpx;
text-align: center;
width: 145rpx;
height: 145rpx;
image {
width: 145rpx;
......
......@@ -11,7 +11,7 @@
<image v-if="image" :src="image" />
<image v-else src="@/static/my/my2.png" />
<!-- 此处应该有默认头像 -->
<!-- <image v-else src="@/static/my/my2.png" />-->
<!-- <image v-else src="@/static/my/my2.png" />-->
<span>
<image src="@/static/my/my6.png" /></span>
</div>
......@@ -140,8 +140,14 @@ export default {
this.formData.forEach(element => {
if (element.label === '生日') {
element.rules.label = this.transformTime(e.value)
let opts = { url: '/app/user/update', method: 'post' };
let userInfoItem = { type: 4, val: element.rules.label };
let opts = {
url: '/app/user/update',
method: 'post'
};
let userInfoItem = {
type: 4,
val: element.rules.label
};
this.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) {
......@@ -155,9 +161,15 @@ export default {
this.formData.forEach(element => {
if (element.label === '性别') {
element.rules.label = val
let opts = { url: '/app/user/update', method: 'post' };
let sex = (val=='男'?"0":"1")
let userInfoItem = { type: 3, val: sex };
let opts = {
url: '/app/user/update',
method: 'post'
};
let sex = (val == '男' ? "0" : "1")
let userInfoItem = {
type: 3,
val: sex
};
this.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) {
......@@ -172,8 +184,14 @@ export default {
this.formData.forEach(element => {
if (element.label === '昵称') {
element.rules.value = this.user__nikename
let opts = { url: '/app/user/update', method: 'post' };
let userInfoItem = { type: 2, val: this.user__nikename };
let opts = {
url: '/app/user/update',
method: 'post'
};
let userInfoItem = {
type: 2,
val: this.user__nikename
};
that.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) {
......@@ -229,53 +247,70 @@ export default {
},
success: (res) => {
let uploadData = JSON.parse(res.data)
let opts = { url: '/app/user/update', method: 'post' };
let userInfoItem = { type: 1, val: uploadData.data.fileName };
let opts = {
url: '/app/user/update',
method: 'post'
};
let userInfoItem = {
type: 1,
val: uploadData.data.fileName
};
that.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) {
that.$nextTick(() => {
that.image = that.http.baseUrl + uploadData.data.fileName
}
})
}
});
}
});
},
select() {
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function (res) {
const tempFilePaths = res.tempFilePaths;
uni.uploadFile({
url: that.http.baseUrl + '/common/upload',
//url: 'http://192.168.2.21:7001/upload',//仅为示例,非真实的接口地址
method: 'POST',
filePath: tempFilePaths[0],
name: 'file',
formData: {
file: tempFilePaths[0]
},
success: (res) => {
let uploadData = JSON.parse(res.data)
let opts = { url: '/app/user/update', method: 'post' };
let userInfoItem = { type: 1, val: uploadData.data.fileName };
//console.log(userInfoItem)
that.http.httpTokenRequest(opts, userInfoItem).then(response => {
if (response.data.code == 200) {
that.userInfo.avatar = res.data.url
}
})
}
});
}
});
},
getUserInfo(){
let opts = { url: '/app/user/info', method: 'get' };
// select() {
// let that = this
// uni.chooseImage({
// count: 1, //默认9
// sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
// sourceType: ['album'], //从相册选择
// success: function (res) {
// const tempFilePaths = res.tempFilePaths;
// uni.uploadFile({
// url: that.http.baseUrl + '/common/upload',
// //url: 'http://192.168.2.21:7001/upload',//仅为示例,非真实的接口地址
// method: 'POST',
// filePath: tempFilePaths[0],
// name: 'file',
// formData: {
// file: tempFilePaths[0]
// },
// success: (res) => {
// let uploadData = JSON.parse(res.data)
// let opts = {
// url: '/app/user/update',
// method: 'post'
// };
// let userInfoItem = {
// type: 1,
// val: uploadData.data.fileName
// };
// //console.log(userInfoItem)
// that.http.httpTokenRequest(opts, userInfoItem).then(response => {
// if (response.data.code == 200) {
// that.userInfo.avatar = res.data.url
// }
// })
// }
// });
// }
// });
// },
getUserInfo() {
let opts = {
url: '/app/user/info',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.userInfo = res.data.data
......@@ -288,7 +323,7 @@ export default {
element.rules.value = this.userInfo.nickName
}
if (element.label === '性别') {
element.rules.label = this.userInfo.sex=="0"?"男":"女"
element.rules.label = this.userInfo.sex == "0" ? "男" : "女"
}
if (element.label === '生日') {
element.rules.label = this.userInfo.birthday
......@@ -297,9 +332,9 @@ export default {
}
})
},
editUserInfo(){
editUserInfo() {
let user = {}
for(let i in this.formData){
for (let i in this.formData) {
let name = this.formData[i].rules.name
this.user[name] = this.formData[i].rules.value
}
......@@ -368,6 +403,11 @@ export default {
padding: 40rpx;
/deep/ .form-container .line .input {
text-align: right !important;
padding-right: 20rpx;
}
.info__cover {
height: 140rpx;
background: #FFFFFF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment