信息确认 预约 支付 诊断结果

This commit is contained in:
shidongli 2022-10-21 17:48:22 +08:00
parent fdd656b241
commit f24d7a3a29
2 changed files with 103 additions and 81 deletions

View File

@ -38,4 +38,20 @@ export function delnursingStation(id) {
url: '/nurseApplet/nursingStationGoods/' + id, url: '/nurseApplet/nursingStationGoods/' + id,
method: 'delete' method: 'delete'
}) })
} }
// 查询
export function getSubordinate(areaCode){
return request({
url: `/nurseApplet/nursingStationGoods/getSubordinateRegions?areaCode=${areaCode}`,
method: 'GET'
})
}
//区街道list
export function getSubordinateRegions(areaCode) {
return request({
url: `/nurseApplet/login/getRegionAndStreetInfo?areaCode=${areaCode}`,
method: 'GET'
})
}

View File

@ -15,14 +15,9 @@
<view class="up" @tap='del(item)'> <view class="up" @tap='del(item)'>
删除 删除
</view> </view>
<!-- <u-modal width="50%" v-model="delshow" style='background-color: rgba(118, 118, 118, 0.6);'
@confirm='delconfirm' :content="content" show-cancel-button>
</u-modal> -->
</view> </view>
</view> </view>
</view> </view>
<view class="ADDress" @tap='add()'> <view class="ADDress" @tap='add()'>
<image src="../../static/add.png" mode=""></image> <image src="../../static/add.png" mode=""></image>
<span class="ADDtext"> <span class="ADDtext">
@ -32,25 +27,25 @@
<!-- 弹框 --> <!-- 弹框 -->
<u-popup v-model="show" mode="center" width="80%" height="50%" border-radius="30"> <u-popup v-model="show" mode="center" width="80%" height="55%" border-radius="30">
<view class="payment"> <view class="payment">
添加收货地址 <span>{{shipAddress}}</span>
<view class="cencel" @tap="cencel()"> <view class="cencel" @tap="cencel()">
<image src="../../static/gb.png" mode=""></image> <image src="../../static/gb.png" mode=""></image>
</view> </view>
<view class="addinfos"> <view class="addinfos">
<u-field v-model="list.receiveName" label="收货人" placeholder="姓名" class="items"> <u-field v-model="infolist.receiveName" label="收货人" placeholder="姓名" class="items" maxlength='30'>
</u-field> </u-field>
<u-field v-model="list.receivePhone" label="手机号" placeholder="电话" class="items"> <u-field v-model="infolist.receivePhone" label="手机号" placeholder="电话" class="items" maxlength='11'>
</u-field> </u-field>
<view class="area"> <view class="area" @tap='areashow=true'>
<u-field v-model="list.areaCode" label="地区" placeholder="请选择" class="items"> <u-field v-model="infolist.address" label="地区" placeholder="请选择" class="items" disabled>
</u-field> </u-field>
<image src="../../static/jiantou.png" mode=""></image> <image src="../../static/jiantou.png" mode=""></image>
</view> </view>
<u-field v-model="list.receiveAddress" label-width="170" label="详细地址" placeholder="如街道、门牌号、小区等" <u-field v-model="infolist.receiveAddress" label-width="170" label="详细地址" placeholder="如街道、门牌号、小区等"
class="items"> class="items" maxlength='50'>
</u-field> </u-field>
</view> </view>
<view class="save" @tap='submit()'> <view class="save" @tap='submit()'>
@ -60,6 +55,8 @@
</view> </view>
</u-popup> </u-popup>
<u-select v-model="areashow" mode="mutil-column-auto" label-name='areaName' value-name='areaCode'
:list="arealist" @confirm="areaconfirm"></u-select>
</view> </view>
</template> </template>
@ -70,6 +67,8 @@
delnursingStation, delnursingStation,
nursingStationGoodsinfo, nursingStationGoodsinfo,
updatenursingStation, updatenursingStation,
getSubordinateRegions,
getSubordinate
} from '@/api/modifyAddress/modifyAddress.js'; } from '@/api/modifyAddress/modifyAddress.js';
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
export default { export default {
@ -79,24 +78,26 @@
delshow: false, // delshow: false, //
content: '确认要删除信息吗?', content: '确认要删除信息吗?',
show: false, // show: false, //
list: { areashow: false, //
arealist: [], //list
areaCode: '',
shipAddress: '添加收货地址',
infolist: {
receiveName: '', receiveName: '',
receivePhone: '', receivePhone: '',
receiveAddress: '', receiveAddress: '',
areaCode: '', areaCode: '',
patientId: 2, patientId: 2,
address: '', //
}, },
goodPatient: [], // goodPatient: [], //
patientId: 2, patientId: 2,
// delId: '',
} }
}, },
onLoad(options) { onLoad(options) {
// //
this.goodsList() this.goodsList()
this.areaInfo()
}, },
methods: { methods: {
// //
@ -108,120 +109,126 @@
}, },
// //
submit() { submit() {
let that=this let that = this
if (that.isedit == true) { if (that.isedit == true) {
addnursingStation(that.list).then(res => { addnursingStation(that.infolist).then(res => {
if (res.code == 200) { if (res.code == 200) {
that.$refs.uToast.show({ uni.showToast({
title: '新增成功', title: '新增成功',
duration: 20000000 duration: 1500
}); });
that.show = false; that.show = false;
// console.log(res) setTimeout(e => {
that.goodsList() that.goodsList()
that.list = {} }, 1500)
} }
}) })
} else { } else {
updatenursingStation(that.list).then(res => { updatenursingStation(that.infolist).then(res => {
uni.showToast({ uni.showToast({
title: '修改成功', title: '修改成功',
duration: 2000 duration: 1500
}); });
that.show = false; that.show = false;
// console.log(res) setTimeout(e => {
that.goodsList() that.goodsList()
// this.list = {} }, 1500)
}) })
} }
}, },
// //
updata(item) { updata(item) {
this.shipAddress = '修改收货地址'
this.isedit = false this.isedit = false
nursingStationGoodsinfo(item.id).then(res => { nursingStationGoodsinfo(item.id).then(res => {
console.log(item) this.infolist = res.data
this.list = res.data getSubordinate(res.data.areaCode).then(res => {
this.show = true this.infolist.address = res.data.regionName + res.data.streetName
console.log(this.infolist)
this.show = true
})
}) })
}, },
// //
add() { add() {
this.infolist = {
receiveName: '',
receivePhone: '',
receiveAddress: '',
areaCode: '',
patientId: 2,
}
this.isedit = true this.isedit = true
this.show = true this.show = true
}, },
// delconfirm() {
// // console.log(1111)
// delnursingStation(this.delId).then(res => {
// if (res.code == 200) {
// this.$refs.uToast.show({
// title: '',
// type: 'success',
// duration: 2000
// })
// this.delshow = false;
// console.log(res)
// this.goodsList()
// }
// })
// },
// //
del(item) { del(item) {
let that=this let that = this
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确认要删除信息吗', content: '确认要删除信息吗',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
delnursingStation(item.id).then(res => { delnursingStation(item.id).then(res => {
uni.showToast({
uni.showToast({ title: '删除成功',
title: '删除成功', duration: 1500,
duration: 2000,
});
console.log(111),
that.delshow = false;
that.goodsList()
// console.log(this)
});
setTimeout(e => {
that.goodsList()
}, 1500)
that.delshow = false;
}) })
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
}); });
// this.delId = item.id
// this.delshow = true
}, },
// //
cencel() { cencel() {
this.show = false this.show = false
this.list = {} this.infolist = {}
} // this.address=""
},
//
areaInfo() {
getSubordinateRegions(this.areaCode).then(res => {
//
res.data.forEach(e => {
if (e.children.length == 0) {
e.children.push({
areaCode: "",
areaName: "暂无街道",
children: null,
id: '',
})
}
})
this.arealist = res.data;
})
},
//
areaconfirm(e) {
this.infolist.areaCode = e[e.length - 1].value
this.address = e[0].label + '-' + e[1].label
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
::v-deep .u-mask {
background-color: rgba(118, 118, 118, 0.6);
}
.app { .app {
padding: 4%; padding: 4%;
// height: 100%;
padding-bottom: 100rpx;
.address { .address {
/* position: absolute; */
width: 99%; width: 99%;
height: 270rpx; height: 280rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03); box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 20rpx; border-radius: 20rpx;
@ -335,6 +342,5 @@
color: #030001; color: #030001;
line-height: 40rpx; line-height: 40rpx;
} }
} }
</style> </style>