diff --git a/api/modifyAddress/modifyAddress.js b/api/modifyAddress/modifyAddress.js index 2c444e5..8e59b42 100644 --- a/api/modifyAddress/modifyAddress.js +++ b/api/modifyAddress/modifyAddress.js @@ -68,3 +68,13 @@ export function getSubordinateInfo(id) { method: 'GET' }) } + +//默认地址 + +export function updateDefaultAddress(data) { + return request({ + url: `/nurseApplet/nursingStationGoods/updateDefaultAddress`, + method: 'POST', + data + }) +} \ No newline at end of file diff --git a/pages/CommodityDetails/CommodityDetails.vue b/pages/CommodityDetails/CommodityDetails.vue index 87896a1..a32b179 100644 --- a/pages/CommodityDetails/CommodityDetails.vue +++ b/pages/CommodityDetails/CommodityDetails.vue @@ -9,7 +9,7 @@ 暂无 - ¥{{goodsPrice}} 起 + ¥{{goodsPrice}} @@ -82,15 +82,18 @@ - + {{updata.receiver}},{{updata.phone}} + + {{updata.receiveAddress}} + + + 前往完善个人信息 + - - {{updata.receiveAddress}} - @@ -165,10 +168,17 @@ import { goodsDetails } from '@/api/CommodityDetails/CommodityDetails.js' + import { + AppIdentification + } from '@/api/AppIdentification/index.js' import { goodPatientInfo } from '@/api/modifyAddress/modifyAddress.js'; import baseurl from '@/api/baseurl.js' + import { + addStationGoodsOrder, + appletGoodsOrderPay + } from '@/api/confirmOrder/index.js' export default { data() { return { @@ -228,31 +238,31 @@ }) }, //立即购买跳转确认订单页面 - tapbuy() { - - }, + tapbuy() {}, //选择商品 isActivegoods(item) { - this.updata.goodsPrice = 0 - this.updata.goodsAttributeName = '' if (item.isActive == true) { - this.goodDetailsLists.forEach(e => { - e.isActive = false - }) - this.updata.goodsAttributeName = '' - this.updata.goodsPrice = 0 - this.updata.attributeDetailsId = '' - this.updata.goodsStock = 0 - this.updata.img = this.image + // this.updata.goodsPrice = 0 + // this.updata.goodsAttributeName = '' + // this.goodDetailsLists.forEach(e => { + // e.isActive = false + // }) + // this.updata.goodsAttributeName = '' + // this.updata.goodsPrice = 0 + // this.updata.attributeDetailsId = '' + // this.updata.goodsStock = 0 + // this.updata.img = this.image } else { this.goodDetailsLists.forEach(e => { e.isActive = false }) item.isActive = true + this.goodsAttributeId = item.goodsAttributeId this.updata.img = item.attributePitureUrl this.updata.goodsAttributeName = item.attributeDetailsName this.updata.goodsPrice = item.goodsPrice this.updata.goodsPrice = this.updata.goodsPrice.toFixed(2) + this.goodsPrice = this.updata.goodsPrice this.updata.attributeDetailsId = item.attributeDetailsId this.updata.goodsStock = item.goodsStock this.updata.goodsAttributeId = item.goodsAttributeId @@ -268,7 +278,6 @@ res.data.goodsRemark = res.data.goodsRemark.replace(/\ { if (e.goodsAttributeId == this.goodsAttributeId) { @@ -332,36 +341,49 @@ }, //跳转到全部收货地址 upaddress() { - uni.navigateTo({ - url: `/pages/modifyAddress/modifyAddress?updata=${JSON.stringify(this.updata)}` - }) + if (this.updata.receiver) { + uni.navigateTo({ + url: `/pages/modifyAddress/modifyAddress?updata=${JSON.stringify(this.updata)}` + }) + } else { + uni.navigateTo({ + url: '/pages/information/information' + }) + } }, // 收件人 goodsList() { goodPatientInfo(this.updata.patientId).then(res => { - res.data.forEach(e => { - e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e - .receiveAddress - }) - this.updata.receiver = res.data[0].receiveName - this.updata.receiveAddress = res.data[0].address - this.updata.phone = res.data[0].receivePhone - this.userid = res.data[0].id + // res.data.forEach(e => { + // e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e + // .receiveAddress + // }) + var list = res.data.filter(e => e.defaultAddressFlag == 1) + if (list.length >= 1) { + this.updata.receiver = list[0].receiveName + this.updata.receiveAddress = list[0].areaName + list[0].receiveAddress + this.updata.phone = list[0].receivePhone + this.userid = list[0].id + } else { + this.updata.receiver = res.data[0].receiveName + this.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress + this.updata.phone = res.data[0].receivePhone + this.userid = res.data[0].id + } }) }, }, onLoad(options) { //获取传值 var that = this + this.goodsPrice = options.goodsPrice //页面价格 this.goodsAttributeId = options.goodsAttributeId this.updata.buySource = options.buySource this.goodsInfoId = options.goodsInfoId - try { - const value = uni.getStorageSync('patientId'); - if (value) { - that.updata.patientId = value - that.goodsList() - } else {} - } catch (e) {} + const value = uni.getStorageSync('patientId'); + if (value) { + that.updata.patientId = value + that.goodsList() + } else {} }, onShow() { var that = this @@ -370,14 +392,23 @@ this.goodsDetailsinfo(this.goodsInfoId) goodPatientInfo(this.updata.patientId).then(res => { var user = res.data.filter(e => e.id == this.userid) - if (user.length == 0) { - res.data.forEach(e => { - e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e - .receiveAddress - }) + if (user.length >= 1) { + // user[0].address = user[0].provinceName + user[0].cityName + user[0].regionName + user[0] + // .streetName + user[0].receiveAddress + this.updata.receiver = user[0].receiveName + this.updata.receiveAddress = user[0].areaName + user[0].receiveAddress + this.updata.phone = user[0].receivePhone + this.userid = user[0].id + } else { + // res.data.forEach(e => { + // e.address = e.provinceName + e.cityName + e.regionName + e.streetName + e + // .receiveAddress + // }) this.updata.receiver = res.data[0].receiveName - this.updata.receiveAddress = res.data[0].address + // this.updata.receiveAddress = res.data[0].address + this.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress this.updata.phone = res.data[0].receivePhone + this.userid = res.data[0].id } }) let useritem = null @@ -387,7 +418,8 @@ useritem = JSON.parse(data.useritem) that.updata.receiver = useritem.receiveName that.updata.phone = useritem.receivePhone - that.updata.receiveAddress = useritem.address + // that.updata.receiveAddress = useritem.address + that.updata.receiveAddress = useritem.areaName + useritem.receiveAddress that.userid = useritem.id } }) diff --git a/pages/CommodityDetails/CommodityDetailsstyle.scss b/pages/CommodityDetails/CommodityDetailsstyle.scss index a80859f..fa8850b 100644 --- a/pages/CommodityDetails/CommodityDetailsstyle.scss +++ b/pages/CommodityDetails/CommodityDetailsstyle.scss @@ -79,9 +79,11 @@ transform: translateY(-50%); } .address{ + padding-top: 10rpx; width:92%; - font-size: 32rpx; + font-size: 30rpx; word-break:break-all; + line-height: 45rpx; } .namephone{ width: 70%; @@ -178,7 +180,7 @@ background-color: #FFFFFF; border-radius: 15rpx; .chat { - height: 130rpx; + height: 130rpx; position: relative; span { font-size: 30rpx; @@ -223,12 +225,12 @@ } .productmodel { - border: 1rpx solid #FFFFFF; + border: 4rpx solid #FFFFFF; } .Productmodel { background: #ECF1FA; - border: 1rpx solid #4C7BC9; + border: 4rpx solid #4C7BC9; color: #4C7BC9; } .productmodel,.Productmodel{ diff --git a/pages/CommodityOrder/CommodityOrder.vue b/pages/CommodityOrder/CommodityOrder.vue index 6471d99..bae2c64 100644 --- a/pages/CommodityOrder/CommodityOrder.vue +++ b/pages/CommodityOrder/CommodityOrder.vue @@ -8,8 +8,7 @@ 店铺名称 - 待付款 - 订单已关闭 + 待付款 退款中 已取消 待收货 @@ -44,7 +43,7 @@ 查看物流 - 去支付 @@ -168,12 +167,12 @@ res => { this.orderlist = res.rows this.total = res.total - this.orderlist.forEach(e => { - e.timestamp = null - var time = new Date(e.orderTime).getTime() / 1000 + (60 * 60 * 24) - var times = new Date().getTime() / 1000 - e.timestamp = time - times - }) + // this.orderlist.forEach(e => { + // e.timestamp = null + // var time = new Date(e.orderTime).getTime() / 1000 + (60 * 60 * 24) + // var times = new Date().getTime() / 1000 + // e.timestamp = time - times + // }) }) }, //确认收货 @@ -228,10 +227,10 @@ .goodsName).then( res => { res.rows.forEach(e => { - e.timestamp = null - var time = new Date(e.orderTime).getTime() / 1000 + (60 * 60 * 24) - var times = new Date().getTime() / 1000 - e.timestamp = time - times + // e.timestamp = null + // var time = new Date(e.orderTime).getTime() / 1000 + (60 * 60 * 24) + // var times = new Date().getTime() / 1000 + // e.timestamp = time - times this.orderlist.push(e) }) this.total = res.total diff --git a/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue b/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue index 8dfc7d8..51d2137 100644 --- a/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue +++ b/pages/Nursingstationserviceorder/Nursingstationserviceorder.vue @@ -4,8 +4,7 @@ {{item.createTime}} - {{item.orderStatus=='WAIT_PAY'&&item.timestamp>0?'待付款':''}} - {{item.orderStatus=='WAIT_PAY'&&item.timestamp<=0?'订单已关闭':''}} + {{item.orderStatus=='WAIT_PAY'?'待付款':''}} {{item.orderStatus=='PAY'?'已付款':''}} {{item.orderStatus=='WAIT_DISPATCH'?'待服务':''}} {{item.orderStatus=='NOT_FINISH'?'待完成':''}} @@ -29,7 +28,7 @@ + v-if="item.orderStatus=='WAIT_PAY'"> 去支付 退款中 @@ -148,7 +147,6 @@ taprate(item) { var obj = { "patientId": this.patientId, - "openid": this.openid, "orderNo": this.orderNo, "evaluateChannel": "PHONE_APP", "evaluateSatisfaction": item, @@ -177,12 +175,12 @@ appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => { this.list = res.rows; this.total = res.total - this.list.forEach(e => { - e.timestamp = null - var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24) - var times = new Date().getTime() / 1000 - e.timestamp = time - times - }) + // this.list.forEach(e => { + // e.timestamp = null + // var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24) + // var times = new Date().getTime() / 1000 + // e.timestamp = time - times + // }) }) }, gofinished(item) { @@ -196,10 +194,10 @@ this.pageNum++ appServiceOrder(this.patientId, this.pageSize, this.pageNum).then(res => { res.rows.forEach(e => { - e.timestamp = null - var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24) - var times = new Date().getTime() / 1000 - e.timestamp = time - times + // e.timestamp = null + // var time = new Date(e.createTime).getTime() / 1000 + (60 * 60 * 24) + // var times = new Date().getTime() / 1000 + // e.timestamp = time - times this.list.push(e) }) }) diff --git a/pages/ProjectDetails/ProjectDetails.vue b/pages/ProjectDetails/ProjectDetails.vue index c199bc7..ff772b7 100644 --- a/pages/ProjectDetails/ProjectDetails.vue +++ b/pages/ProjectDetails/ProjectDetails.vue @@ -70,39 +70,21 @@ //预约 goappointments() { let that = this - try { - const value = uni.getStorageSync('openid'); - if (value) { - const value2 = uni.getStorageSync('patientId'); - if (value2) { - AppIdentification(value2).then(res => { - if (res.code == 200) { - if (res.data.loginFlag) { - that.usershow = false - uni.navigateTo({ - url: `/pages/appointmenttime/appointmenttime?stationId=${this.list.stationId}&stationItemId=${this.list.stationItemId}&stationItemPriceId=${this.list.stationItemPriceId}`, - }) - } else { - that.usershow = true - } - } else { - that.$refs.uToast.show({ - title: res.msg, - type: 'error' - }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - uni.navigateTo({ - url: '/pages/login/login' - }) - }, 1500) - } - }) + const value = uni.getStorageSync('patientId'); + if (value) { + AppIdentification(value).then(res => { + if (res.code == 200) { + if (res.data.loginFlag) { + that.usershow = false + uni.navigateTo({ + url: `/pages/appointmenttime/appointmenttime?stationId=${this.list.stationId}&stationItemId=${this.list.stationItemId}&stationItemPriceId=${this.list.stationItemPriceId}`, + }) + } else { + that.usershow = true + } } else { that.$refs.uToast.show({ - title: '未登录,请先登录', + title: res.msg, type: 'error' }) if (that.timer) { @@ -114,24 +96,20 @@ }) }, 1500) } - } else { - that.$refs.uToast.show({ - title: '未登录,请先登录', - type: 'error' - }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - uni.navigateTo({ - url: '/pages/login/login' - }) - }, 1500) - } - } catch (e) { - uni.navigateTo({ - url: '/pages/login/login' }) + } else { + that.$refs.uToast.show({ + title: '未登录,请先登录', + type: 'error' + }) + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.navigateTo({ + url: '/pages/login/login' + }) + }, 1500) } }, //跳转完善页面 diff --git a/pages/ServiceDetails/ServiceDetails.vue b/pages/ServiceDetails/ServiceDetails.vue index cdcfdd7..1a776da 100644 --- a/pages/ServiceDetails/ServiceDetails.vue +++ b/pages/ServiceDetails/ServiceDetails.vue @@ -1,13 +1,10 @@