diff --git a/api/modifyAddress/modifyAddress.js b/api/modifyAddress/modifyAddress.js index b703176..34d4d74 100644 --- a/api/modifyAddress/modifyAddress.js +++ b/api/modifyAddress/modifyAddress.js @@ -1,14 +1,14 @@ import request from "../request.js" // 根据被护理人id查询基本信息 -export function goodPatientInfo(patientId){ +export function goodPatientInfo(patientId) { return request({ url: `/nurseApplet/nursingStationGoods/goodPatientInfo?patientId=${patientId}`, method: 'GET' }) } // 新增基本信息 -export function addnursingStation(data){ +export function addnursingStation(data) { return request({ url: '/nurseApplet/nursingStationGoods/add', method: 'POST', @@ -18,7 +18,7 @@ export function addnursingStation(data){ // 修改基本信息 -export function updatenursingStation(data){ +export function updatenursingStation(data) { return request({ url: '/nurseApplet/nursingStationGoods/edit', method: 'POST', @@ -26,7 +26,7 @@ export function updatenursingStation(data){ }) } // 修改反显 -export function nursingStationGoodsinfo(id){ +export function nursingStationGoodsinfo(id) { return request({ url: '/nurseApplet/nursingStationGoods/' + id, method: 'GET' @@ -35,24 +35,46 @@ export function nursingStationGoodsinfo(id){ // 删除 export function delnursingStation(id) { - return request({ - url: '/nurseApplet/nursingStationGoods/' + id, - method: 'delete' - }) + return request({ + url: '/nurseApplet/nursingStationGoods/' + id, + method: 'delete' + }) } // 查询 -export function getSubordinate(areaCode){ +export function getSubordinate(areaCode) { return request({ url: `/nurseApplet/nursingStationGoods/getSubordinateRegions?areaCode=${areaCode}`, method: 'GET' }) } -//区街道list +// //区街道list +// export function getSubordinateRegions(areaCode) { +// return request({ +// url: `/nurseApplet/nursingStationGoods/getSubordinateRegions?areaCode=${areaCode}`, +// method: 'GET' +// }) +// } +//省list export function getSubordinateRegions(areaCode) { return request({ - url: `/nurseApplet/login/getRegionAndStreetInfo?areaCode=${areaCode}`, + url: `/nurseApplet/login/getProvinceInfo?areaCode=${areaCode}`, + method: 'GET' + }) +} +//市区街道list +export function getSubordinateInfo(id) { + return request({ + url: `/nurseApplet/login/getSubordinateInfo?areaCode=${id}`, method: 'GET' }) } +//默认地址 +export function updateDefaultAddress(data) { + return request({ + url: `/nurseApplet/nursingStationGoods/updateDefaultAddress`, + method: 'POST', + data + }) +} diff --git a/api/order/index.js b/api/order/index.js new file mode 100644 index 0000000..7bbe944 --- /dev/null +++ b/api/order/index.js @@ -0,0 +1,9 @@ +import request from "../request.js" + +export function orderCount(patientId) { + return request({ + url: `/nurseApp/login/orderCount?patientId=${patientId}`, + method: 'GET' + }) +} + diff --git a/pages.json b/pages.json index 811b319..c43abb9 100644 --- a/pages.json +++ b/pages.json @@ -9,14 +9,20 @@ "navigationBarTitleText": "", "navigationStyle": "custom" } - },{ + }, { "path": "pages/modifyAddress/modifyAddress", "style": { "navigationBarTitleText": "修改地址", - "enablePullDownRefresh": false, - "navigationBarBackgroundColor": "#ffffff" //背景颜色 + "navigationBarBackgroundColor": "#ffffff", //背景颜色 + "enablePullDownRefresh": true //设置参数为true + } + }, { + "path": "pages/information/information", + "style": { + "navigationBarTitleText": "完善个人信息", + "navigationBarBackgroundColor": "#ffffff", //背景颜色 + "enablePullDownRefresh": false } - }, { "path": "pages/lookrate/lookrate", @@ -64,13 +70,6 @@ "enablePullDownRefresh": false, "navigationBarBackgroundColor": "#ffffff" //背景颜色 } - }, { - "path": "pages/information/information", - "style": { - "navigationBarTitleText": "完善个人信息", - "navigationBarBackgroundColor": "#ffffff", //背景颜色 - "enablePullDownRefresh": false - } }, { "path": "pages/appointmenttime/appointmenttime", "style": { @@ -333,7 +332,7 @@ "navigationBarBackgroundColor": "#ffffff" } } - ], + ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "", diff --git a/pages/CommodityDetails/CommodityDetails.vue b/pages/CommodityDetails/CommodityDetails.vue index f27ad43..ce6db32 100644 --- a/pages/CommodityDetails/CommodityDetails.vue +++ b/pages/CommodityDetails/CommodityDetails.vue @@ -9,7 +9,7 @@ 暂无 - ¥{{goodsPrice}} 起 + ¥{{goodsPrice}} @@ -59,7 +59,7 @@ - + @@ -76,31 +76,70 @@ 库存数量:{{updata.goodsStock}} - - - 商品规格 - - - {{item.attributeDetailsName}} - - - - - - 数量 - - - - + + + + + + + {{updata.receiver}},{{updata.phone}} + + + {{updata.receiveAddress}} + + + 前往完善个人信息 + + + + + + + + + 商品规格 + + + + + + {{item.attributeDetailsName}} + + + + + + + + 数量 + + + + + + + + + + 支付方式 + + + + 微信支付 + + + + 立即购买 @@ -136,6 +175,10 @@ goodPatientInfo } from '@/api/modifyAddress/modifyAddress.js'; import baseurl from '@/api/baseurl.js' + import { + addStationGoodsOrder, + appletGoodsOrderPay + } from '@/api/confirmOrder/index.js' export default { data() { return { @@ -150,6 +193,7 @@ goodshow: true, //商品规格开关 buyshow: false, //立即购买遮罩层开关 info: [], //轮播list + goodsAttributeId: null, //商品规格id updata: { //订单表 goodsPrice: 0.00, goodsName: "", @@ -172,10 +216,20 @@ attributeDetailsId: '', //商品属性明细表id goodsAttributeId: '', goodsAttributeDetailsId: '', - } + }, + scrollTop: 0, + old: { + scrollTop: 0 + }, + userid: null, }; }, methods: { + upper: function(e) {}, + lower: function(e) {}, + scroll: function(e) { + this.old.scrollTop = e.detail.scrollTop + }, //跳转完善页面 goinformation() { this.usershow = false @@ -185,84 +239,128 @@ }, //立即购买跳转确认订单页面 tapbuy() { - let that = this + var that = this try { const value = uni.getStorageSync('openid'); - if (value) { - const value2 = uni.getStorageSync('patientId'); - if (value2) { - if (!that.updata.patientId) { - that.goodsList() - } - that.updata.patientId = value2 - AppIdentification(value2).then(res => { - if (res.code == 200) { - if (res.data.loginFlag) { - if (that.goodshow == true) { - if (that.updata.goodsAttributeName == '') { - that.$refs.uToast.show({ - title: '未选择商品', - type: 'error' - }) - } else if (that.updata.goodsStock == 0) { - that.$refs.uToast.show({ - title: '库存数量不足,无法购买', - type: 'error' - }) - } else { - that.buyshow = false - that.updata.totalPrice = (that.updata.goodsPrice * that.updata - .goodsCount).toFixed( - 2) - uni.navigateTo({ - url: `/pages/confirmOrder/confirmOrder?updata=${JSON.stringify(that.updata)}` - }) - } - } else { + const value2 = uni.getStorageSync('patientId'); + if (value && value2) { + that.updata.patientId = value2 + AppIdentification(value2).then(res => { + if (res.code == 200) { + if (res.data.loginFlag) { + if (this.goodshow == true) { + if (this.updata.goodsAttributeName == '') { that.$refs.uToast.show({ title: '未选择商品', type: 'error' }) - // that.buyshow = false - // uni.navigateTo({ - // url: `/pages/confirmOrder/confirmOrder?updata=${JSON.stringify(that.updata)}` - // }) + } else if (this.updata.goodsStock == 0) { + that.$refs.uToast.show({ + title: '库存数量不足,无法购买', + type: 'error' + }) + } else { + this.buyshow = false + this.updata.totalPrice = (this.updata.goodsPrice * this.updata + .goodsCount).toFixed( + 2) + addStationGoodsOrder(this.updata).then(res => { + if (res.code == 500) { + that.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } else { + let id = res.data.id + let paydata = res.data + paydata.openid = value + paydata.payType = "WECHAT_PAY" + paydata.paymentPrice = res.data.totalPrice + appletGoodsOrderPay(paydata).then(response => { + if (response.code == 200) { + uni.requestPayment({ + timeStamp: response + .data.timeStamp, + nonceStr: response.data + .nonceStr, + package: response.data + .prepayId, + signType: response.data + .signType, + paySign: response.data + .paySign, + success: function( + res) { + that.goodsDetailsinfo( + that + .goodsInfoId + ) + that.$refs + .uToast + .show({ + title: '支付成功', + type: 'success', + duration: 1000, + url: '/pages/paysuccess/paysuccess' + }) + }, + fail: function(err) { + that.goodsDetailsinfo( + that + .goodsInfoId + ) + that.$refs + .uToast + .show({ + title: '取消支付', + type: 'error', + duration: 1000, + url: `/pages/payorderDetails/payorderDetails?goodsOrderId=${id}` + }) + // uni.navigateTo({ + // url: `/pages/payorderDetails/payorderDetails?goodsOrderId=${id}` + // }) + } + }); + } else { + that.$refs.uToast.show({ + title: response.msg, + type: 'error', + duration: 1000 + }) + } + }) + } + }) } } else { - that.buyshow = false - that.usershow = true - } - } else if (res.code == 9999) { - - } 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' + that.$refs.uToast.show({ + title: '未选择商品', + type: 'error' }) - }, 1500) + // that.buyshow = false + // uni.navigateTo({ + // url: `/pages/confirmOrder/confirmOrder?updata=${JSON.stringify(that.updata)}` + // }) + } + } else { + this.usershow = true } - }) - } else { - that.$refs.uToast.show({ - title: '未登录,请先登录', - type: 'error' - }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - uni.navigateTo({ - url: '/pages/login/login' + } else if (res.code == 9999) {} else { + that.$refs.uToast.show({ + title: res.msg, + type: 'error' }) - }, 1500) - } + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.navigateTo({ + url: '/pages/login/login' + }) + }, 1500) + } + }) } else { that.$refs.uToast.show({ title: '未登录,请先登录', @@ -281,26 +379,28 @@ }, //选择商品 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 @@ -311,32 +411,23 @@ goodsDetailsinfo(goodsInfoId) { let that = this goodsDetails(goodsInfoId).then(res => { - if (res.code == 200) { - try { - const value = uni.getStorageSync('patientId'); - if (value) { - that.updata.patientId = value - that.goodsList() - } else {} - } catch (e) {} - } uni.removeStorageSync('Refresh'); - if (res.data[0].goodsRemark) { - res.data[0].goodsRemark = res.data[0].goodsRemark.replace(/\ { + res.data.goodAttributeDetailsLists.forEach(e => { e.attributePitureUrl = this.baseurl + e.attributePitureUrl e.isActive = false var objs = { @@ -344,47 +435,132 @@ } this.info.push(objs) }) - this.goodDetailsLists = res.data[0].goodDetailsLists + this.goodDetailsLists = res.data.goodAttributeDetailsLists this.goodshow = true } - this.goodsDetailslist = res.data[0] + this.goodsDetailslist = res.data this.updata.goodsName = this.goodsDetailslist.goodsName this.updata.nurseStationId = this.goodsDetailslist.nurseStationId - this.updata.img = res.data[0].goodsPictureUrl - this.updata.goodsAttributeName = '' - this.updata.goodsPrice = 0 - this.updata.attributeDetailsId = '' - this.updata.goodsStock = 0 - this.updata.img = this.image + if (this.goodDetailsLists.length == 1) { + this.goodDetailsLists[0].isActive = true + this.updata.img = this.goodDetailsLists[0].attributePitureUrl + this.updata.goodsAttributeName = this.goodDetailsLists[0].attributeDetailsName + this.updata.goodsPrice = this.goodDetailsLists[0].goodsPrice + this.updata.goodsPrice = this.updata.goodsPrice.toFixed(2) + this.updata.attributeDetailsId = this.goodDetailsLists[0].attributeDetailsId + this.updata.goodsStock = this.goodDetailsLists[0].goodsStock + this.updata.goodsAttributeId = this.goodDetailsLists[0].goodsAttributeId + this.updata.goodsAttributeDetailsId = this.goodDetailsLists[0].attributeDetailsId + } else { + var list = {} + this.goodsDetailslist.goodAttributeDetailsLists.forEach(e => { + if (e.goodsAttributeId == this.goodsAttributeId) { + list = e + e.isActive = true + this.updata.goodsAttributeId = e.goodsAttributeId + this.updata.goodsAttributeDetailsId = e.attributeDetailsId + } + }) + this.updata.img = list.attributePitureUrl + this.updata.goodsAttributeName = list.attributeDetailsName + this.updata.goodsPrice = list.goodsPrice + this.updata.attributeDetailsId = list.attributeDetailsId + this.updata.goodsStock = list.goodsStock + this.updata.img = list.attributePitureUrl + } + // this.updata.nurseStationId = this.goodsDetailslist.nurseStationId + // this.updata.img = res.data.goodsPictureUrl + // this.updata.goodsAttributeName = '' + // this.updata.goodsPrice = 0 + // this.updata.attributeDetailsId = '' + // this.updata.goodsStock = 0 + // this.updata.img = list.image }) }, + //跳转到全部收货地址 + upaddress() { + 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 + // 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) { //获取传值 - console.log(options) + var that = this + this.goodsPrice = options.goodsPrice //页面价格 + this.goodsAttributeId = options.goodsAttributeId this.updata.buySource = options.buySource - if (options.goodsPrice == 'null' || !options.goodsPrice) { - this.goodsPrice = 0 //页面价格 - } else { - this.goodsPrice = options.goodsPrice //页面价格 - } this.goodsInfoId = options.goodsInfoId + const value = uni.getStorageSync('patientId'); + if (value) { + that.updata.patientId = value + that.goodsList() + } else {} }, onShow() { + var that = this this.baseurl = baseurl this.usershow = false this.goodsDetailsinfo(this.goodsInfoId) + goodPatientInfo(this.updata.patientId).then(res => { + var user = res.data.filter(e => e.id == this.userid) + 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].areaName + res.data[0].receiveAddress + this.updata.phone = res.data[0].receivePhone + this.userid = res.data[0].id + } + }) + let useritem = null + uni.$on('updata', function(data) { + that.updata = JSON.parse(data.updata) + if (data.useritem) { + useritem = JSON.parse(data.useritem) + that.updata.receiver = useritem.receiveName + that.updata.phone = useritem.receivePhone + // that.updata.receiveAddress = useritem.address + that.updata.receiveAddress = useritem.areaName + useritem.receiveAddress + that.userid = useritem.id + } + }) }, //1.分享给朋友 onShareAppMessage(res) { diff --git a/pages/CommodityDetails/CommodityDetailsstyle.scss b/pages/CommodityDetails/CommodityDetailsstyle.scss index 96b13a2..fa8850b 100644 --- a/pages/CommodityDetails/CommodityDetailsstyle.scss +++ b/pages/CommodityDetails/CommodityDetailsstyle.scss @@ -1,6 +1,9 @@ .app { padding: 0; - + .scroll-Y { + height: 790rpx; + background-color: #F4F5F7; + } .mask { .information { width: 70%; @@ -50,25 +53,71 @@ .PurchasePage { position: fixed; bottom: 0; + height: 1150rpx; width: 100%; background: #FFFFFF; border-radius: 30rpx 30rpx 0px 0px; font-size: 36rpx; padding-bottom: 20rpx; - + .bodys { + background-color: #FFFFFF; + width: 96%; + margin: 10rpx auto 0; + border-radius: 20rpx; + padding: 15rpx 0 20rpx; + position: relative; + .addressinfo { + font-size: 32rpx; + line-height: 65rpx; + margin-left: 90rpx; + image{ + width: 40rpx; + height: 50rpx; + position: absolute; + top:50%; + left:20rpx; + transform: translateY(-50%); + } + .address{ + padding-top: 10rpx; + width:92%; + font-size: 30rpx; + word-break:break-all; + line-height: 45rpx; + } + .namephone{ + width: 70%; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } + .picture2 { + position: absolute; + top:50%; + right:20rpx; + transform: translateY(-50%); + image { + width: 18rpx; + height: 18rpx; + color: #FFFFFF; + margin-left: 20rpx; + } + } + } + } .close { width: 31rpx; height: 31rpx; position: absolute; top: 2%; right: 2%; + z-index: 999; } .topcontent { - width: 90%; + width: 96%; margin: 0 auto; - padding-bottom: 24rpx; - border-bottom: 1rpx solid #D8D4D4; + padding-bottom: 15rpx; position: relative; .goodsStock{ font-size: 24rpx; @@ -86,7 +135,7 @@ .title { font-size: 36rpx; position: absolute; - top: 0%; + top: 3%; left: 38%; font-weight: 600; width: 58%; @@ -100,11 +149,9 @@ } .image { - width: 215rpx; - height: 215rpx; - background: rgba(150, 147, 148, 0.21); - margin: 35rpx 0 0 0; - + width: 200rpx; + height: 200rpx; + margin: 15rpx 0 0 0; image { width: 201rpx; height: 201rpx; @@ -122,16 +169,41 @@ text-align: center; line-height: 71rpx; border-radius: 26rpx; - margin: 40rpx 0 0 20%; + position: absolute; + bottom:30rpx; + left:20%; } .bottomcontent { - margin-top: 34rpx; - padding-bottom: 35rpx; - + margin-top: 10rpx; + padding: 35rpx 0; + background-color: #FFFFFF; + border-radius: 15rpx; + .chat { + height: 130rpx; + position: relative; + span { + font-size: 30rpx; + position: absolute; + left:130rpx; + top:50%; + transform: translateY(-50%); + } + + image { + position: absolute; + left:30rpx; + top:50%; + transform: translateY(-50%); + width: 65rpx; + height: 55rpx; + } + } .header { + font-size: 32rpx; display: inline-block; vertical-align: middle; + margin-left: 17rpx; } .number { @@ -142,35 +214,54 @@ } .centercontent { - margin-top: 34rpx; - font-size: 36rpx; + font-size: 32rpx; + background-color: #FFFFFF; + margin-top: 10rpx; + padding-top: 20rpx; + border-radius: 20rpx; .header { margin-bottom: 20rpx; + margin-left: 17rpx; } + .productmodel { - font-size: 24rpx; - display: inline-block; - height: 60rpx; - border: 1rpx solid #D8D4D4; - line-height: 60rpx; - border-radius: 25rpx; - text-align: center; - padding: 0 15rpx; - margin: 15rpx 15rpx 0 0; + border: 4rpx solid #FFFFFF; } .Productmodel { - font-size: 24rpx; - display: inline-block; - height: 60rpx; background: #ECF1FA; - border: 1rpx solid #4C7BC9; - line-height: 60rpx; - border-radius: 25rpx; + border: 4rpx solid #4C7BC9; color: #4C7BC9; + } + .productmodel,.Productmodel{ + background-color: #F6F6F6; + height: 300rpx; text-align: center; - padding: 0 15rpx; - margin: 15rpx 15rpx 0 0; + width:30%; + font-size: 24rpx; + border-radius: 10rpx; + margin: 5rpx 1.5% 10rpx; + padding: 0 0 10rpx; + view{ + background-color: #F6F6F6; + margin: 10rpx auto; + width: 98%; + // height: 90rpx; + border-radius: 10rpx; + font-size: 24rpx; + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; + } + image{ + border-radius: 10rpx; + width: 100%; + height: 200rpx; + } } } } diff --git a/pages/CommodityOrder/CommodityOrder.vue b/pages/CommodityOrder/CommodityOrder.vue index 1dd5968..46c5124 100644 --- a/pages/CommodityOrder/CommodityOrder.vue +++ b/pages/CommodityOrder/CommodityOrder.vue @@ -8,8 +8,7 @@ 店铺名称 - 待付款 - 订单已关闭 + 待付款 退款中 已取消 待收货 @@ -45,8 +44,7 @@ 查看物流 - + 去支付 确认收货 @@ -175,7 +173,7 @@ that.$refs.uToast.show({ title: '支付成功', type: 'success', - toast: 1500, + duration: 1500, url: `/pages/paysuccess/paysuccess`, }) }, @@ -183,7 +181,7 @@ that.$refs.uToast.show({ title: '取消支付', type: 'error', - toast: 1500, + duration: 1500, }) } }); @@ -191,7 +189,7 @@ that.$refs.uToast.show({ title: response.msg, type: 'error', - toast: 2000 + duration: 2000 }) } }) @@ -221,12 +219,12 @@ res => { if (res.code == 200) { this.orderlist = res.rows - 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 + // }) uni.removeStorageSync('Refresh'); this.total = res.total } @@ -304,10 +302,10 @@ ssgoodsOrder(this.patientId, this.orderStatus, this.goodsOrderId, this.pageSize, this.pageNum, this .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 2bc8464..ce72b81 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'"> 去支付 退款中 @@ -214,7 +213,7 @@ that.$refs.uToast.show({ title: '支付成功', type: 'success', - toast: 1500, + duration: 1500, url: `/pages/paysuccess/paysuccess`, }) }, @@ -222,7 +221,7 @@ that.$refs.uToast.show({ title: '取消支付', type: 'error', - toast: 1500, + duration: 1500, }) } }); @@ -230,7 +229,7 @@ this.$refs.uToast.show({ title: response.msg, type: 'error', - toast: 2000 + duration: 2000 }) } }) @@ -240,12 +239,12 @@ if (res.code == 200) { uni.removeStorageSync('Refresh'); this.list = res.rows; - 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 + // }) this.total = res.total } }) @@ -261,10 +260,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/Personal/Personal.vue b/pages/Personal/Personal.vue index 6d46bb1..90ab0fc 100644 --- a/pages/Personal/Personal.vue +++ b/pages/Personal/Personal.vue @@ -68,26 +68,28 @@ var that = this try { const value = uni.getStorageSync('openid'); - if (value) { - const value2 = uni.getStorageSync('patientId'); - if (value2) { - uni.navigateTo({ - url: '/pages/order/order' - }) - } else { - uni.navigateTo({ - url: '/pages/login/login' - }) - } - } else { - uni.navigateTo({ - url: '/pages/login/login' + const value3 = uni.getStorageSync('token'); + var that = this + if (value && value3) { + existPatientInfo(value).then(res => { + if (res.code == 200 && res.msg == 'LOGIN') { + const value2 = uni.getStorageSync('patientId'); + if (value2) { + uni.navigateTo({ + url: '/pages/order/order' + }) + } else { + that.remove() + } + } else { + that.remove() + } }) + } else { + that.remove() } - } catch (e) { - uni.navigateTo({ - url: '/pages/login/login' - }) + } catch { + that.remove() } }, //跳转个人信息页面 diff --git a/pages/ProductList/ProductList.vue b/pages/ProductList/ProductList.vue index db94bd9..11d2acd 100644 --- a/pages/ProductList/ProductList.vue +++ b/pages/ProductList/ProductList.vue @@ -10,6 +10,9 @@ {{item.goodsName}} + + {{item.attributeDetailsName}} + ¥{{item.goodsPrice}} @@ -95,7 +98,7 @@ //跳转详情页 goCommodityDetails(item) { uni.navigateTo({ - url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'SHOPPING_MALL'}` + url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'SHOPPING_MALL'}&goodsAttributeId=${item.goodsAttributeId}` }) }, }, @@ -218,23 +221,37 @@ margin-bottom: 40rpx; .price { - font-size: 42rpx; + font-size: 36rpx; color: #D43953; line-height: 79rpx; - padding-left: 20rpx; + padding-left: 15rpx; + } + + .text { + font-size: 24rpx; + padding: 0 15rpx; + // text-overflow: ellipsis; + // overflow: hidden; + // white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } .title { - font-size: 39rpx; + font-size: 36rpx; color: #000000; line-height: 69rpx; - padding-left: 20rpx; + padding-left: 15rpx; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } image { + border-radius: 25rpx 25rpx 0 0 ; width: 100%; height: 340rpx; } diff --git a/pages/ServiceDetails/ServiceDetails.scss b/pages/ServiceDetails/ServiceDetails.scss index 1fd59cb..01de41d 100644 --- a/pages/ServiceDetails/ServiceDetails.scss +++ b/pages/ServiceDetails/ServiceDetails.scss @@ -4,6 +4,59 @@ font-size: 36rpx; padding-top: 10rpx; font-size: 34rpx; + .masks{ + image{ + position: absolute; + bottom:380rpx; + left:50%; + transform: translateX(-50%); + z-index: 999; + width: 250rpx; + border-radius: 25rpx; + height: 250rpx; + } + .ratetitle{ + font-size: 34rpx; + position: absolute; + bottom:320rpx; + left:50%; + transform: translateX(-50%); + z-index: 999; + } + .mask{ + position: absolute; + bottom:0; + width: 750rpx; + height: 703rpx; + background: #FFFFFF; + border-radius: 30rpx 30rpx 0px 0px; + display: flex; + justify-content: space-around; + .rateitem{ + margin-top:200rpx; + width: 217rpx; + height: 222rpx; + line-height: 222rpx; + text-align: center; + color: #ffffff; + background: #BFBFBF; + font-size: 40rpx; + border-radius: 25rpx; + } + + .lookrateitem{ + font-size: 32rpx; + margin-top:440rpx; + width: 200rpx; + height: 200rpx; + line-height: 200rpx; + text-align: center; + color: #ffffff; + background: #BFBFBF; + border-radius: 25rpx; + } + } + } .time{ height: 80rpx; width: 95%; diff --git a/pages/ServiceDetails/ServiceDetails.vue b/pages/ServiceDetails/ServiceDetails.vue index 53c5e89..eeba129 100644 --- a/pages/ServiceDetails/ServiceDetails.vue +++ b/pages/ServiceDetails/ServiceDetails.vue @@ -1,13 +1,10 @@ @@ -105,6 +121,9 @@ getAppointmentDetailsInfo, addAppointmentEvaluate } from '@/api/ServiceDetails/ServiceDetails.js' + import { + lookrate + } from '@/api/lookrate/index.js' export default { data() { return { @@ -116,6 +135,12 @@ orderNo: '', timer: null, timestamp: 0, + lookrateshow: false, //查看评价 + ratelist: null, + rateimgtitle: { + img: null, + title: null, + }, } }, onShow() { @@ -136,6 +161,16 @@ this.getlist() }, methods: { + //查看评价 + lookrate(item) { + console.log(item) + this.rateimgtitle.img = item.itemPictureUrl + this.rateimgtitle.title = item.nurseItemName + lookrate(item.orderNo).then(res => { + this.ratelist = res.data + this.lookrateshow = true + }) + }, //支付 buy() { let obj = { @@ -162,7 +197,7 @@ that.$refs.uToast.show({ title: '支付成功', type: 'success', - toast: 1500, + duration: 1500, url: `/pages/paysuccess/paysuccess?delta=${3}` }) }, @@ -170,7 +205,7 @@ that.$refs.uToast.show({ title: '取消支付', type: 'error', - toast: 1500, + duration: 1500, }) } }); @@ -178,12 +213,11 @@ this.$refs.uToast.show({ title: response.msg, type: 'error', - toast: 2000 + duration: 2000 }) } }) }, - //评价 taprate(item) { var obj = { @@ -221,7 +255,6 @@ }, //打电话 gophone() { - console.log(this.list) var that = this uni.getSystemInfo({ success: function(res) { @@ -249,7 +282,8 @@ getlist() { getAppointmentDetailsInfo(this.orderNo).then(res => { this.list = res.data - var time = new Date(this.list.createTime).getTime() / 1000 + (60 * 60 * 24) + var ordertimes = this.list.createTime.replaceAll(/\-/gi, "/") + var time = new Date(ordertimes).getTime() / 1000 + (60 * 60 * 24) var times = new Date().getTime() / 1000 this.timestamp = time - times }) diff --git a/pages/appointmenttime/appointmenttime.vue b/pages/appointmenttime/appointmenttime.vue index aaf9650..af86a7b 100644 --- a/pages/appointmenttime/appointmenttime.vue +++ b/pages/appointmenttime/appointmenttime.vue @@ -201,13 +201,9 @@ //被护理人信息 getAppPatientList(that.patientId).then(response => { that.personInfo = response.data - that.personInfo.address = response.data.provinceName + response.data - .cityName + response.data.regionName + response.data.streetName + - response.data.address + that.personInfo.address = response.data.areaName + response.data.address that.orderlist.patientId = response.data.patientId - that.orderlist.serviceAddress = response.data.provinceName + response.data - .cityName + response.data.regionName + response.data.streetName + - response.data.address + that.orderlist.serviceAddress = response.data.areaName + response.data.address }) } } catch (e) {} @@ -275,7 +271,7 @@ that.$refs.uToast.show({ title: '预约成功', type: 'success', - toast: 1500, + duration: 1500, url: `/pages/paysuccess/paysuccess` }) }, @@ -283,7 +279,7 @@ that.$refs.uToast.show({ title: '取消预约', type: 'error', - toast: 1500, + duration: 1500, url: `/pages/menttimeorder/menttimeorder?list=${JSON.stringify(obj)}` }) } @@ -292,7 +288,7 @@ that.$refs.uToast.show({ title: response.msg, type: 'error', - toast: 2000 + duration: 2000 }) } }) diff --git a/pages/confirmOrder/confirmOrder.vue b/pages/confirmOrder/confirmOrder.vue index 9165de0..6e19aff 100644 --- a/pages/confirmOrder/confirmOrder.vue +++ b/pages/confirmOrder/confirmOrder.vue @@ -142,7 +142,7 @@ that.$refs.uToast.show({ title: '支付成功', type: 'success', - toast: 1500, + duration: 1500, url: '/pages/paysuccess/paysuccess' }) }, @@ -150,7 +150,7 @@ that.$refs.uToast.show({ title: '取消支付', type: 'error', - toast: 1500, + duration: 1500, url: `/pages/payorderDetails/payorderDetails?goodsOrderId=${id}` }) // uni.navigateTo({ @@ -162,7 +162,7 @@ that.$refs.uToast.show({ title: response.msg, type: 'error', - toast: 2000 + duration: 2000 }) } }) diff --git a/pages/information/information.scss b/pages/information/information.scss index 3716c8c..c4e1254 100644 --- a/pages/information/information.scss +++ b/pages/information/information.scss @@ -1,6 +1,9 @@ .app { padding:0; height:100vh; + /deep/ .u-drawer{ + z-index: 0 !important; + } .Agreement{ width: 100%; background-color: #F4F5F7; diff --git a/pages/information/information.vue b/pages/information/information.vue index 00c52fb..55667fa 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -15,7 +15,7 @@ 身份证号: - + 所属区域: {{address}} @@ -25,14 +25,19 @@ 所在位置: - - {{chooseLocation}} + + {{query.locationName}} - + + + + + @@ -92,17 +97,27 @@ information } from '@/api/information/index.js' import contenttext from './text.vue' + import { + getSubordinateRegions, + } from '@/api/modifyAddress/modifyAddress.js'; + import gkcity from "../m-city/m-city.vue"; export default { components: { - contenttext + contenttext, + "m-city": gkcity }, data() { return { radio: 1, - chooseLocation: '', //地图选址 + // chooseLocation: '', //地图选址 arealist: [], //区街道list + list: [{ + id: "", + localName: "请选择", + children: [], + }, ], areashow: false, //经纬度开关 - maskshow:false,//用户协议 + maskshow: false, //用户协议 getNurseTypelist: [], //护理类型数组 medicalcarelist: [], //医疗护理数组 address: '', //页面所属区域 @@ -117,69 +132,93 @@ nurseTypeIdList: [], diseaseInfoList: [], patientId: '', - locationName: null, + locationName: '', }, timer: null, + addresslength: null, }; }, methods: { //提交信息 informationinfo() { var that = this - try { - const value = uni.getStorageSync('phone'); - if (value) { - that.query.phone = value - if (that.radio == 1) { - that.$refs.uToast.show({ - title: '请审核并同意用户协议', - type: 'error' - }) - } else { - information(that.query).then(res => { - if (res.code == 200) { + if (this.addresslength) { + if (this.addresslength.length > 2) { + try { + const value = uni.getStorageSync('phone'); + if (value) { + that.query.phone = value + if (that.radio == 1) { that.$refs.uToast.show({ - title: '完善信息成功', - type: 'success', - duration: '1500' + title: '请审核并同意用户协议', + type: 'error' }) - if (that.timer) { - clearTimeout(that.timer) - } - that.timer = setTimeout(e => { - uni.navigateBack({ - delta: 1 - }) - }, 1500) - } else if (res.code == 500) { - that.$refs.uToast.show({ - title: res.msg, - type: 'error', + } else { + information(that.query).then(res => { + if (res.code == 200) { + that.$refs.uToast.show({ + title: '完善信息成功', + type: 'success', + duration: '1500' + }) + if (that.timer) { + clearTimeout(that.timer) + } + that.timer = setTimeout(e => { + uni.navigateBack({ + delta: 1 + }) + }, 1500) + } else if (res.code == 500) { + that.$refs.uToast.show({ + title: res.msg, + type: 'error', + }) + } }) } - }) - } - + } + } catch (e) {} + } else { + that.$refs.uToast.show({ + title: '所属区域应选择所在的区或街道,请重新选择!', + type: 'error' + }) } - } catch (e) {} + } else { + that.$refs.uToast.show({ + title: '所属区域应选择所在的区或街道,请重新选择!', + type: 'error' + }) + } }, //获取所在位置 getAddress() { - uni.getLocation({ - type: 'wgs84', - success: function(res) { - const key = '3VABZ-6LZWK-YPAJ3-AMQED-D7RUK-VPB37'; //使用在腾讯位置服务申请的key - const referer = '泉医到家'; //调用插件的app的名称 - const location = JSON.stringify({ - latitude: 39.89631551, - longitude: 116.323459711 - }); - wx.navigateTo({ - url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer - }); + var that = this; + uni.chooseLocation({ + success: function(location) { + that.query.locationName = location.address + that.query.homeLongitude = location.longitude; + that.query.homeLatitude = location.latitude; } }); }, + // getAddress() { + // uni.getLocation({ + // type: 'wgs84', + // success: function(res) { + // const key = '3VABZ-6LZWK-YPAJ3-AMQED-D7RUK-VPB37'; //使用在腾讯位置服务申请的key + // const referer = '泉医到家'; //调用插件的app的名称 + // const location = JSON.stringify({ + // latitude: 39.89631551, + // longitude: 116.323459711 + // }); + // wx.navigateTo({ + // url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + // }); + // } + // }); + // }, //护理类型请求 getNurseTypeInfo() { getNurseType().then(res => { @@ -189,25 +228,32 @@ }, //区街道 areaInfo() { - getRegionAndStreetInfo().then(res => { - //区下无街道添加一个空街道 - res.data.forEach(e => { - if (e.children.length == 0) { - e.children.push({ - areaCode: "", - areaName: "暂无街道", - children: null, - id: '', - }) - } - }) - this.arealist = res.data; + getSubordinateRegions().then(res => { + this.list = res.data; }) }, - //区街道选择 - areaconfirm(e) { - this.query.areaCode = e[e.length - 1].value - this.address = e[0].label + '-' + e[1].label + // 三级地址联动回调 + getpickerParentValue(e) { + this.addresslength = e + if (e.length == 4) { + this.address = e[0].localName + e[1].localName + e[2].localName + e[3] + .localName + this.query.areaCode = e[3].id + } else if (e.length == 3) { + this.address = e[0].localName + e[1].localName + e[2].localName + this.query.areaCode = e[2].id + } else if (e.length == 2) { + this.address = e[0].localName + e[1].localName + this.query.areaCode = e[1].id + } else if (e.length == 1) { + this.address = e[0].localName + this.query.areaCode = e[0].id + } + }, + // 显示三级地址联动 + showPicker() { + this.areashow = true + this.$refs.cityPicker.show(); }, //点击所需服务 addnurseType(item) { @@ -250,14 +296,14 @@ // 从地图选点插件返回后,在页面的onShow生命周期函数中能够调用插件接口,取得选点结果对象 onShow() { var that = this - const chooseLocation = requirePlugin('chooseLocation'); - const location = chooseLocation.getLocation(); // 如果点击确认选点按钮,则返回选点结果对象,否则返回null - if (location) { - that.query.locationName = location.address - that.chooseLocation = location.address - that.query.homeLongitude = location.longitude; - that.query.homeLatitude = location.latitude; - } + // const chooseLocation = requirePlugin('chooseLocation'); + // const location = chooseLocation.getLocation(); // 如果点击确认选点按钮,则返回选点结果对象,否则返回null + // if (location) { + // that.query.locationName = location.address + // that.chooseLocation = location.address + // that.query.homeLongitude = location.longitude; + // that.query.homeLatitude = location.latitude; + // } uni.$on('disease', function(data) { that.query.diseaseInfoList = JSON.parse(data.disease) if (that.query.diseaseInfoList.length > 0) { @@ -275,7 +321,7 @@ }, onUnload() { // 页面卸载时设置插件选点数据为null,防止再次进入页面,geLocation返回的是上次选点结果 - chooseLocation.setLocation(null); + // chooseLocation.setLocation(null); }, } diff --git a/pages/m-city/m-city.vue b/pages/m-city/m-city.vue index ebb637e..bc150b5 100644 --- a/pages/m-city/m-city.vue +++ b/pages/m-city/m-city.vue @@ -1,11 +1,18 @@ @@ -65,10 +91,15 @@ nursingStationGoodsinfo, updatenursingStation, getSubordinateRegions, - getSubordinate + getSubordinate, + updateDefaultAddress } from '@/api/modifyAddress/modifyAddress.js'; import baseurl from '@/api/baseurl.js' + import gkcity from "../m-city/m-city.vue"; export default { + components: { + "m-city": gkcity + }, data() { return { timer: null, @@ -76,33 +107,88 @@ delshow: false, //删除弹框 content: '确认要删除信息吗?', show: false, //弹框 - areashow: false, //经纬度开关 - arealist: [], //区街道list + // areashow: false, //经纬度开关 + // arealist: [], //区街道list areaCode: '', shipAddress: '添加地址', infolist: { receiveName: '', receivePhone: '', receiveAddress: '', - areaCode: '', + areaCode: null, patientId: '', - address: '', //页面所属区域 + address: null, //页面所属区域 + defaultAddressFlag: false, }, goodPatient: [], // 查询地址信息 patientId: null, url: '', updata: [], + list: [{ + id: "", + localName: "请选择", + children: [], + }, ], + cityPickershow: false, + addresslength: null, } }, onShow() { this.goodsList() + this.areaInfo() }, onLoad(options) { let that = this this.updata = JSON.parse(options.updata) - this.areaInfo() }, methods: { + change(status) { + if (!status.defaultAddressFlag) { + status.defaultAddressFlag = true + } else { + this.goodPatient.forEach(e => { + e.defaultAddressFlag = 0 + }) + status.defaultAddressFlag = 1 + updateDefaultAddress(this.goodPatient).then(res => { + if (res.code == 200) { + this.goodsList(); + uni.$emit('updata', { + updata: JSON.stringify(this.updata), + useritem: JSON.stringify(status) + }) + uni.navigateBack({ + delta: 1 + }); + } + }) + } + }, + // 三级地址联动回调 + getpickerParentValue(e) { + this.addresslength = e + if (e) { + if (e.length == 4) { + this.infolist.address = e[0].localName + '-' + e[1].localName + '-' + e[2].localName + '-' + e[3] + .localName + this.infolist.areaCode = e[3].id + } else if (e.length == 3) { + this.infolist.address = e[0].localName + '-' + e[1].localName + '-' + e[2].localName + this.infolist.areaCode = e[2].id + } else if (e.length == 2) { + this.infolist.address = e[0].localName + '-' + e[1].localName + this.infolist.areaCode = e[1].id + } else if (e.length == 1) { + this.infolist.address = e[0].localName + this.infolist.areaCode = e[0].id + } + } + }, + // 显示三级地址联动 + showPicker() { + this.cityPickershow = true + this.$refs.cityPicker.show(); + }, //将信息携带至订单页面 goorder(item) { uni.$emit('updata', { @@ -122,8 +208,12 @@ that.patientId = value goodPatientInfo(that.patientId).then(res => { res.data.forEach(e => { - e.address = e.provinceName + e.cityName + e.regionName + e - .streetName + e.receiveAddress + e.address = e.areaName + e.receiveAddress + if (e.defaultAddressFlag == 1) { + e.defaultAddressFlag = true + } else { + e.defaultAddressFlag = false + } }) that.goodPatient = res.data }) @@ -139,6 +229,7 @@ uni.navigateBack({ delta: 2 }) + }, 1500) } } catch (e) {} @@ -147,52 +238,110 @@ submit() { let that = this if (that.isedit == true) { - addnursingStation(that.infolist).then(res => { - if (res.code == 200) { - that.$refs.uToast.show({ - title: '新增成功', - type: 'success' + if (that.addresslength) { + if (that.addresslength.length > 2) { + addnursingStation(that.infolist).then(res => { + if (res.code == 200) { + that.$refs.uToast.show({ + title: '新增成功', + type: 'success' + }) + that.cencel(); + setTimeout(e => { + that.goodsList() + }, 1000) + } else { + that.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } }) - that.show = false; - setTimeout(e => { - that.goodsList() - }, 1000) - } - }) - } else { - updatenursingStation(that.infolist).then(res => { - if (res.code == 200) { - that.$refs.uToast.show({ - title: '修改成功', - type: 'success' - }) - that.show = false; - setTimeout(e => { - that.goodsList() - }, 1000) } else { - that.$refs.uToast.show({ - title: res.msg, - type: 'error' - }) + this.Toast() } - }) + } else { + this.Toast() + } + } else { + if (that.addresslength) { + if (that.addresslength.length > 2) { + this.xgdata(); + } else { + this.Toast() + } + } else { + this.xgdata(); + } } }, + Toast() { + this.$refs.uToast.show({ + title: '区域应选择所在的区或街道,请重新选择!', + type: 'error' + }) + }, + xgdata() { + var that = this + updatenursingStation(that.infolist).then(res => { + if (res.code == 200) { + that.$refs.uToast.show({ + title: '修改成功', + type: 'success' + }) + that.cencel(); + setTimeout(e => { + that.goodsList() + }, 1000) + } else { + that.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } + }) + }, + // submit() { + // if (this.addresslength) { + // if (this.addresslength.length > 2) { + // this.data(); + // } else { + // this.$refs.uToast.show({ + // title: '所属区域应选择所在的区或街道,请重新选择!', + // type: 'error' + // }) + // } + // } else { + // this.data() + // } + // }, // 修改按钮 updataxg(item) { + this.cityPickershow = true this.shipAddress = '修改地址' this.isedit = false nursingStationGoodsinfo(item.id).then(res => { this.infolist = res.data getSubordinate(res.data.areaCode).then(res => { - this.infolist.address = res.data.regionName + '-' + res.data.streetName + if (res.data.streetName) { + this.infolist.address = res.data.provinceName + '-' + res.data.cityName + + '-' + + res + .data.regionName + '-' + res.data.streetName + } else { + this.infolist.address = res.data.provinceName + '-' + res.data.cityName + + '-' + + res + .data.regionName + } this.show = true }) }) }, // 新增 add() { + this.shipAddress = '添加地址' + this.cityPickershow = true this.infolist = { receiveName: '', receivePhone: '', @@ -211,16 +360,23 @@ content: '确认要删除信息吗', success: function(res) { if (res.confirm) { - delnursingStation(item.id).then(res => { - uni.showToast({ - title: '删除成功', - duration: 1000, - }); - setTimeout(e => { - that.goodsList() - }, 1000) - that.delshow = false; - }) + if (that.goodPatient.length == 1) { + that.$refs.uToast.show({ + title: '最少保留一条地址信息', + type: 'error' + }) + } else { + delnursingStation(item.id).then(res => { + that.$refs.uToast.show({ + title: '删除成功', + type: 'success' + }) + setTimeout(e => { + that.goodsList() + }, 1000) + that.delshow = false; + }) + } } else if (res.cancel) {} } }); @@ -228,31 +384,44 @@ // 取消 cencel() { this.show = false - this.infolist = {} + this.cityPickershow = false }, // 选择区街道 areaInfo() { - getSubordinateRegions(this.areaCode).then(res => { + getSubordinateRegions().then(res => { //区下无街道添加一个空街道 - res.data.forEach(e => { - if (e.children.length == 0) { - e.children.push({ - areaCode: "", - areaName: "暂无街道", - children: null, - id: '', - }) - } - }) - this.arealist = res.data; + this.list = res.data; }) }, + // 选择区街道 + // 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.infolist.address = e[0].label + '-' + e[1].label }, - } + }, + onPullDownRefresh() { //下拉刷新 + this.goodsList() + setTimeout(function() { + uni.stopPullDownRefresh(); + }, 1000); + }, } diff --git a/pages/nursestation/nursestation.scss b/pages/nursestation/nursestation.scss index e42f783..f91a9ac 100644 --- a/pages/nursestation/nursestation.scss +++ b/pages/nursestation/nursestation.scss @@ -118,6 +118,7 @@ top:14%; left:32%; font-size: 28rpx; + overflow: hidden;white-space: nowrap;text-overflow: ellipsis; } .huanyao { color: #000000; diff --git a/pages/nursestation/nursestation.vue b/pages/nursestation/nursestation.vue index f3bc01d..d528587 100644 --- a/pages/nursestation/nursestation.vue +++ b/pages/nursestation/nursestation.vue @@ -69,8 +69,9 @@ {{item.goodsName}} + {{item.attributeDetailsName}} 购买 - ¥{{item.goodsPrice==null?'0':item.goodsPrice}}起 + ¥{{item.goodsPrice==null?'0':item.goodsPrice}} @@ -239,7 +240,7 @@ //跳转商品详情页 goCommodityDetails(item) { uni.navigateTo({ - url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'NURSE_STATION'}` + url: `/pages/CommodityDetails/CommodityDetails?goodsPrice=${item.goodsPrice}&goodsInfoId=${item.goodsInfoId}&buySource=${'NURSE_STATION'}&goodsAttributeId=${item.goodsAttributeId}` }) }, //跳转完善页面 @@ -300,9 +301,7 @@ }) }) } - } - }, onPullDownRefresh() { //下拉刷新 this.pageNum = 1; diff --git a/pages/order/order.vue b/pages/order/order.vue index d0f0feb..659798a 100644 --- a/pages/order/order.vue +++ b/pages/order/order.vue @@ -8,18 +8,42 @@ 待付款 + + {{list.waitPayCount}} + + + 99+ + 待收货 + + {{list.waitReceivedGoodsCount}} + + + 99+ + 待评价 + + {{list.receivedGoodsCount}} + + + 99+ + 已完成 + @@ -29,14 +53,34 @@ +