diff --git a/api/pagesB/CommodityOrder/index.js b/api/pagesB/CommodityOrder/index.js index fb55f04..1d07d6d 100644 --- a/api/pagesB/CommodityOrder/index.js +++ b/api/pagesB/CommodityOrder/index.js @@ -17,9 +17,13 @@ export function confirmReceipt(orderNo) { } -export function ssgoodsOrder(patientId, orderStatus, goodsOrderId, pageSize, pageNum, goodsName) { +export function ssgoodsOrder(data) { return request({ - url: `/nurseApplet/nursingOrder/goodsOrder?patientId=${patientId}&orderStatus=${orderStatus}&goodsOrderId=${goodsOrderId}&pageSize=${pageSize}&pageNum=${pageNum}&goodsName=${goodsName}`, - method: 'GET' + url: '/nurseApplet/nursingOrder/goodsOrder', + method: 'post', + data, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token') + }, }) } diff --git a/pagesB/CommodityOrder/CommodityOrder.vue b/pagesB/CommodityOrder/CommodityOrder.vue index fb05519..d3f4583 100644 --- a/pagesB/CommodityOrder/CommodityOrder.vue +++ b/pagesB/CommodityOrder/CommodityOrder.vue @@ -35,7 +35,7 @@ - @@ -149,6 +149,18 @@ background: { backgroundColor: '#26A888', }, + orderTypeList: { + patientId: '', + orderTypeList: [ + 'INTEGRAL_EXCHANGE', + 'DIRECT_BUY', + + ], + orderStatus: '', + pageSize: 15, // + pageNum: 1, // + goodsName: '', + }, orderNoitem: null, patientId: '', openid: '', @@ -170,7 +182,7 @@ tabschange(index) { console.log(this.tabslist) this.tabscurrent = index; - this.orderStatus = this.tabslist[index].orderStatus + this.orderTypeList.orderStatus = this.tabslist[index].orderStatus this.goodsOrderinfo(); }, //返回上一页 @@ -217,7 +229,7 @@ //支付 buy(item) { let obj = { - patientId: this.patientId, + patientId: this.orderTypeList.patientId, openid: this.openid, orderNo: item.goOrderNo, orderChannel: "WECHAT_APPLET", @@ -280,8 +292,7 @@ }, //商品订单请求 goodsOrderinfo() { - ssgoodsOrder(this.patientId, this.orderStatus, this.goodsOrderId, this.pageSize, this.pageNum, this - .goodsName).then( + ssgoodsOrder(this.orderTypeList).then( res => { if (res.code == 200) { this.orderlist = res.rows @@ -329,11 +340,12 @@ } }, onLoad(options) { //开局调用 + console.log(options, '898') let that = this const value = uni.getStorageSync('patientId'); const value2 = uni.getStorageSync('openid'); if (value && value2) { - that.patientId = value + that.orderTypeList.patientId = value that.openid = value2 if (options.orderStatus) { that.tabscurrent = options.toindex @@ -352,8 +364,7 @@ onReachBottom() { //下滑加载 if (this.orderlist.length >= this.total) {} else { this.pageNum++; - ssgoodsOrder(this.patientId, this.orderStatus, this.goodsOrderId, this.pageSize, this.pageNum, this - .goodsName).then(res => { + ssgoodsOrder(this.orderTypeList).then(res => { res.rows.forEach(e => { // e.timestamp = null // var time = new Date(e.orderTime).getTime() / 1000 + (60 * 60 * 2) @@ -377,4 +388,4 @@ + \ No newline at end of file