Commit b7f4bdc3 authored by fwz's avatar fwz

合并代码,解决冲突

parent c13a1a36
...@@ -111,18 +111,18 @@ export default { ...@@ -111,18 +111,18 @@ export default {
}) })
}, },
editCarInfo(){ editCarInfo(){
this.$refs.form1.validate().then(res => { 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 => { this.http.httpTokenRequest(opts, this.model1.carInfo).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
//添加成功 //添加成功
uni.$u.toast('修改成功') uni.$u.toast('修改成功')
this.goBack() this.goBack()
} }
}) })
}).catch(errors => { }).catch(errors => {
uni.$u.toast('校验失败') uni.$u.toast('校验失败')
}) })
}, },
}, },
onLoad(option) { onLoad(option) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="view__btn view__no__bind"> <div class="view__btn view__no__bind" @click="openUnbindModal()">
解除绑定 解除绑定
</div> </div>
<div class="view__btn view__back" @click="goBack"> <div class="view__btn view__back" @click="goBack">
...@@ -48,7 +48,8 @@ export default { ...@@ -48,7 +48,8 @@ export default {
title: "绑定手机号", title: "绑定手机号",
value: "156****9633" value: "156****9633"
} }
] ],
id: '',
}; };
}, },
methods: { methods: {
...@@ -56,8 +57,19 @@ export default { ...@@ -56,8 +57,19 @@ export default {
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} },
getMoveCode(){
let opts = { url: '/app/moveCode/' + this.id, method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.items = res.data.rows
}
})
}
}, },
onLoad(option) {
this.id = option.id
},
} }
</script> </script>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</div> </div>
<div class="item__bottom"> <div class="item__bottom">
<span @click="openUnbindModal(vo.id)">解除绑定</span> <span @click="openUnbindModal(vo.id)">解除绑定</span>
<span @click="goView">查看详情</span> <span @click="goView(vo.id)">查看详情</span>
</div> </div>
<div> <div>
<u-modal :show="unbindShow" :title="unbindTitle" :content='unbindContent' <u-modal :show="unbindShow" :title="unbindTitle" :content='unbindContent'
...@@ -58,9 +58,9 @@ export default { ...@@ -58,9 +58,9 @@ export default {
}; };
}, },
methods: { methods: {
goView(){ goView(id){
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/moveCarDetail' url: '/pagesB/pages/move-car/moveCarDetail?id=' + id
}) })
}, },
getMyMoveCodeList(){ getMyMoveCodeList(){
......
...@@ -143,43 +143,44 @@ export default { ...@@ -143,43 +143,44 @@ export default {
url: '/pagesB/pages/move-car/myMoveCar' url: '/pagesB/pages/move-car/myMoveCar'
}) })
}, },
getCarNumber(){ getCarNumber(){
let opts = { url: '/app/moveCode/owner/' + this.moveCode, method: 'get' }; let opts = { url: '/app/moveCode/owner/' + this.moveCode, method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
if(JSON.stringify(res.data.data) != "{}"){ if(JSON.stringify(res.data.data) != "{}"){
this.appBusCar = res.data.data this.appBusCar = res.data.data
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/pages/move-car/scan?moveCode=' + this.moveCode url: '/pagesB/pages/move-car/scan?moveCode=' + this.moveCode
}) })
} }
}else{ }else{
//查询挪车码失败 //查询挪车码失败
uni.showToast({ uni.showToast({
title: res.data.msg, title: res.data.msg,
icon: "error", icon: "error",
}); });
} }
}) })
}, },
}, },
}, onLoad() {
onLoad() { if(e.query) {
if(e.query) { //获取二维码携带的参数
//获取二维码携带的参数 //扫码后得到的参数
//扫码后得到的参数 let scene = decodeURIComponent(e.query.scene)
let scene = decodeURIComponent(e.query.scene) // scene = scene.split('&')
// scene = scene.split('&') // let data = {
// let data = { // //场景值
// //场景值 // scene: e.scene
// scene: e.scene // }
// } this.moveCode = scene
this.moveCode = scene console.log('scene: ' + scene);
console.log('scene: ' + scene); }
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
<u-gap bgColor="transparent" height="20"></u-gap> <u-gap bgColor="transparent" height="20"></u-gap>
<div class="car_info"> <div class="car_info">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="form1" labelWidth="100"> <u--form labelPosition="left" :model="model1" ref="form1" labelWidth="100">
<u-form-item label="收货人:" prop="userInfo.name" borderBottom ref="item1"> <u-form-item label="收货人:" prop="addressInfo.userName" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" placeholder="请填写收货人姓名" border="none"></u--input> <u--input v-model="model1.addressInfo.userName" placeholder="请填写收货人姓名" border="none"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="手机号码:" prop="userInfo.name" borderBottom ref="item1"> <u-form-item label="手机号码:" prop="addressInfo.telNumber" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" placeholder="请填写收货人手机号码" border="none"></u--input> <u--input v-model="model1.addressInfo.telNumber" placeholder="请填写收货人手机号码" border="none"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="收货地址:" prop="userInfo.name" borderBottom ref="item1"> <u-form-item label="收货地址:" prop="addressInfo.address" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" disabled placeholder="点击选择收货地址" border="none"></u--input> <u--input v-model="model1.addressInfo.address" disabled placeholder="点击选择收货地址" border="none"></u--input>
<span class="app__gps"> <span class="app__gps">
<image src="@/static/my/gps.png"> <image src="@/static/my/gps.png">
</span> </span>
...@@ -24,17 +24,17 @@ ...@@ -24,17 +24,17 @@
<image src="@/static/my/my6.png"> <image src="@/static/my/my6.png">
</span> </span>
</u-form-item> </u-form-item>
<u-form-item label="楼号门牌:" prop="userInfo.name" borderBottom ref="item1"> <u-form-item label="楼号门牌:" prop="addressInfo.detailInfo" borderBottom ref="item1">
<u--input v-model="model1.userInfo.name" placeholder="例如 2栋3单元101室" border="none"></u--input> <u--input v-model="model1.addressInfo.detailInfo" placeholder="例如 2栋3单元101室" border="none"></u--input>
</u-form-item> </u-form-item>
<u-form-item label="设置默认地址:" prop="userInfo.name" ref="item1"> <u-form-item label="设置默认地址:" prop="addressInfo.name" ref="item1">
<u-switch class="del__address" v-model="model1.value" activeColor="#5ac725" @change="change"></u-switch> <u-switch class="del__address" v-model="model1.value" activeColor="#5ac725" @change="change"></u-switch>
</u-form-item> </u-form-item>
</u--form> </u--form>
</div> </div>
<div class="add__tips">为保证您的商品准确送达,请填写正确的地址!</div> <div class="add__tips">为保证您的商品准确送达,请填写正确的地址!</div>
<div class="love__btn" @click="add"> <div class="love__btn" @click="addAddress">
<image src="@/static/move-car/love-car5.png"> 新增地址 <image src="@/static/move-car/love-car5.png"> 新增地址
</div> </div>
</div> </div>
...@@ -47,25 +47,62 @@ export default { ...@@ -47,25 +47,62 @@ export default {
return { return {
carNumber: "", carNumber: "",
model1: { model1: {
userInfo: { addressInfo: {},
name: "",
sex: "",
},
value: true value: true
}, },
rules: { rules: {
"userInfo.name": { "addressInfo.userName": {
type: "string", type: "string",
required: true, required: true,
message: "请填写姓品牌", message: "收货人不能为空",
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
"addressInfo.telNumber": {
type: "string",
required: true,
message: "手机号不能为空",
trigger: ["blur", "change"],
},
"addressInfo.address": {
type: "string",
required: true,
message: "收货地址不能为空",
trigger: ["blur", "change"],
},
"addressInfo.detailInfo": {
type: "string",
required: true,
message: "门牌号不能为空",
trigger: ["blur", "change"],
},
}, },
}; };
}, },
methods: { methods: {
addAddress(){
this.$refs.form1.validate().then(res => {
this.model1.addressInfo.defaultFlag = false
if(this.model1.value){
this.model1.addressInfo.defaultFlag = true
}
let opts = { url: '/app/user/address', method: 'post' };
console.log(this.model1.addressInfo)
this.http.httpTokenRequest(opts, this.model1.addressInfo).then(res => {
if (res.data.code == 200) {
//添加成功
uni.$u.toast('新增成功')
this.goBack()
}
})
}).catch(errors => {
uni.$u.toast('请正确填写信息')
})
},
}, },
onReady() {
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
this.$refs.form1.setRules(this.rules)
},
}; };
</script> </script>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="appCotent"> <view class="appCotent">
<div class="myAddress"> <div class="myAddress">
<div class="address__content"> <div class="address__content">
<div class="ress__item" v-for="(vo,inx) in 4" :key="inx"> <div class="ress__item" v-for="(vo,inx) in addressList" :key="inx">
<div class="item__top"> <div class="item__top">
<span>李洁洁</span> <span>李洁洁</span>
<span>15633233233</span> <span>15633233233</span>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
export default { export default {
data() { data() {
return { return {
addressList: [],
} }
}, },
methods: { methods: {
...@@ -46,6 +46,14 @@ export default { ...@@ -46,6 +46,14 @@ export default {
}); });
} }
}, },
getAddressList(){
let opts = { url: '/app/user/address/list', method: 'get' };
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.addressList = res.data.data
}
})
},
} }
</script> </script>
......
...@@ -235,6 +235,68 @@ export default { ...@@ -235,6 +235,68 @@ export default {
} }
}) })
}, },
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
this.image = this.http.baseUrl + this.userInfo.avatar
for(let item in this.formData){
if(this.formData[item].rules.name == "mobile"){
this.formData[item].rules.value = this.userInfo.mobile
}
else if(this.formData[item].rules.name == "nickName"){
this.formData[item].rules.value = this.userInfo.nickName
}
else if(this.formData[item].rules.name == "sex"){
this.formData[item].rules.value = this.userInfo.sex==0?"男":"女"
}
else if(this.formData[item].rules.name == "birthday"){
this.formData[item].rules.value = this.userInfo.birthday
}
}
}
})
},
editUserInfo(){
let user = {}
for(let i in this.formData){
let name = this.formData[i].rules.name
this.user[name] = this.formData[i].rules.value
}
},
}, },
created() { created() {
this.getUserInfo() this.getUserInfo()
......
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