Commit f276eff2 by liuquan

A:添加药品订单分页

parent ad357a9a
......@@ -177,6 +177,36 @@ button::after {
border-radius: 5rpx;
}
/* loading */
.loading_box {
width: 100%;
text-align: center;
position: relative;
}
.loading1 image {
position: absolute;
top: 18rpx;
left: 50%;
width: 35rpx;
height: 35rpx;
margin-left: -80rpx;
}
.loading1 {
text-align: center;
font-size: 28rpx;
color: #999;
line-height: 70rpx;
margin-left: 70rpx;
}
.loading2 {
text-align: center;
font-size: 28rpx;
color: #999;
line-height: 70rpx;
}
.small{
font-size: 24rpx;
}
.loadingimg {
width: 100%;
height: 100%;
......
const Service = require('../../utils/service.js');
const {debouce} = require('../../utils/util.js');//防抖函数
const {
debouce
} = require('../../utils/util.js'); //防抖函数
const Util = require('../../utils/util.js');
Page({
......@@ -13,7 +15,8 @@ Page({
winH: null,
},
showview: false,
list:[]
list: [],
page: 1
},
/**
......@@ -30,22 +33,36 @@ Page({
},
onShow: function () {
var that = this
that.getList(that.data.nav)
that.getList(1, that.data.nav)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
var that = this
that.data.page = 1;
wx.showNavigationBarLoading() //在标题栏中显示加载
setTimeout(function () {
that.getList(that.data.nav)
that.getList(1, that.data.nav)
wx.hideNavigationBarLoading() //完成停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}, 1500);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
var that = this
var page = that.data.page + 1;
that.setData({
scrollFlag: true,
success: false,
page: page
})
that.getList(page, that.data.nav)
},
//删除订单
deleBtn:debouce(function (e) {
deleBtn: debouce(function (e) {
var that = this
wx.showModal({
content: '是否确认删除订单',
......@@ -62,54 +79,75 @@ Page({
icon: 'success',
mask: true
})
that.getList(that.data.nav)
that.getList(1, that.data.nav)
}
}).catch((Error)=> {
}).catch((Error) => {
console.warn('error:', Error); // 获取会话资料失败的相关信息
});
}
}
})
},1000,true),
}, 1000, true),
//获取列表
getList: function (status) {
getList: function (page, status) {
var that = this
var data = {
page: page,
// unionid:'oHhp80XTpjf-JKvU94VEztv3aLhc',
unionid: wx.getStorageSync('data').unionid,
status: status
};
Service.buyDrugList(data).then((res) => {
console.log("getList",res)
if (res.code == 1) {
console.log("res", res)
var list = that.data.list;
if (page > 1 && res.data.length > 0) {
for (let i = 0; i < res.data.length; i++) {
list.push(res.data[i])
}
that.setData({
success: true
})
} else if (page > 1 && res.data.length == 0) {
that.setData({
scrollFlag: false,
scrollFlag1: true,
})
setTimeout(function () {
that.setData({
success: true
})
}, 2000)
} else {
list = res.data;
}
wx.stopPullDownRefresh()
if (list.length > 0) {
that.setData({
list: res.data,
list: list,
showview: true
})
}else{
} else {
that.setData({
list: [],
showview: true
})
wx.showToast({
title:res.msg,
})
}
}).catch(function (Error) {
console.warn('error:', Error); // 获取会话资料失败的相关信息
});
console.warn('error:', Error); // 获取会话资料失败的相关信息
});
},
//选择topTab页
nav: function (e) {
let _this = this
_this.setData({
nav: e.currentTarget.dataset.index,
page: 1,
showview: false
})
_this.getList(e.currentTarget.dataset.index)
_this.getList(1, e.currentTarget.dataset.index)
},
//确认收货
confirmReceipt:debouce(function (e) {
confirmReceipt: debouce(function (e) {
let that = this
let data = {
unionid: wx.getStorageSync('data').unionid,
......@@ -120,18 +158,18 @@ Page({
success(ress) {
if (ress.confirm) {
Service.confirmReceipt(data).then((res) => {
console.log("confirmReceipt",res)
console.log("confirmReceipt", res)
wx.showToast({
title: res.msg,
})
that.getList(3)
that.getList(1, 3)
})
} else if (ress.cancel) {
console.log('用户点击取消')
}
}
})
},1000,true),
}, 1000, true),
// 查看物流-待发货
// goLogistics1: function (e) {
// console.log(1,e.currentTarget.dataset.id)
......@@ -139,51 +177,49 @@ Page({
// url: e.currentTarget.dataset.src +'?img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status + '&num=' + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber+'&com='+e.currentTarget.dataset.com +'&address='+JSON.stringify(e.currentTarget.dataset.address),
// })
// },
/**
*修改地址-待发货2
*/
editAddress:debouce(function(e){
/**
*修改地址-待发货2
*/
editAddress: debouce(function (e) {
wx.navigateTo({
url: '/packageA/addsite/addsite?item=' +JSON.stringify(e.currentTarget.dataset.address)+'&ordernumber='+e.currentTarget.dataset.ordernumber+'&type=1',
url: '/packageA/addsite/addsite?item=' + JSON.stringify(e.currentTarget.dataset.address) + '&ordernumber=' + e.currentTarget.dataset.ordernumber + '&type=1',
})
},1000,true),
/**
}, 1000, true),
/**
* 订单详情-待发货2,已发货3,已完成4
*/
goOrderDetail:debouce(function(e){
goOrderDetail: debouce(function (e) {
wx.navigateTo({
url: '/packageA/drugOrderDetail/drugOrderDetail?id=' + e.currentTarget.dataset.id,
})
},1000,true),
}, 1000, true),
//查看物流-待收货+已完成
goLogistics:debouce(function (e) {
goLogistics: debouce(function (e) {
console.log(2)
wx.navigateTo({
url: e.currentTarget.dataset.src + "?num=" + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber + '&img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status+'&com='+e.currentTarget.dataset.com+'&address='+JSON.stringify(e.currentTarget.dataset.address),
url: e.currentTarget.dataset.src + "?num=" + e.currentTarget.dataset.num + '&tel=' + e.currentTarget.dataset.tel + '&ordernumber=' + e.currentTarget.dataset.ordernumber + '&img=' + e.currentTarget.dataset.img + '&status=' + e.currentTarget.dataset.status + '&com=' + e.currentTarget.dataset.com + '&address=' + JSON.stringify(e.currentTarget.dataset.address),
})
},1000,true),
/**
* 立即支付
*/
goPay:debouce(function (e) {
let that = this;
let data = {
prescription: e.currentTarget.dataset.id ,
patient_unionid: wx.getStorageSync('data').unionid,
isquick:e.currentTarget.dataset.isquick
}
Service.getPayStatus(data).then((res) => {
if (res.code == 1) {
}, 1000, true),
goPay: debouce(function (e) {
let that = this;
let data = {
prescription: e.currentTarget.dataset.id,
patient_unionid: wx.getStorageSync('data').unionid,
isquick: e.currentTarget.dataset.isquick
}
Service.getPayStatus(data).then((res) => {
if (res.code == 1) {
that.onShow();
} else if (res.code == -1) {
} else if (res.code == -1) {
wx.navigateTo({
url: '/packageA/drugOrderInfo/drugOrderInfo?scene=' + e.currentTarget.dataset.id + "&isQuick=" + e.currentTarget.dataset.isquick,
})
}else if(res.code == 2){
} else if (res.code == 2) {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
},1000,true),
}
})
}, 1000, true),
})
\ No newline at end of file
......@@ -64,6 +64,12 @@
</view>
</view>
</block>
<view class="loading_box" wx:if='{{!success}}'>
<view class="loading1" wx:if='{{scrollFlag}}'>
<image src='/images/2.gif'></image>正在加载...
</view>
<view class="loading2" wx:if='{{scrollFlag1&&!scrollFlag}}'>没有更多了</view>
</view>
</view>
</block>
<block wx:else>
......
......@@ -108,7 +108,7 @@
<view class="ordertitle">订单详情</view>
<view class="row ordernumber">
<view>订单编号:<text style="color:#333;">{{item.ordernumber}}</text></view>
<view class="copy" bindtap="copy" data-c="C20191202000152">复制订单</view>
<view class="copy" bindtap="copy" data-c="{{item.ordernumber}}">复制订单</view>
</view>
<view>支付时间:{{item.create_time}}</view>
</view>
......
......@@ -18,13 +18,14 @@
"checkSiteMap": false,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": false,
......@@ -32,7 +33,8 @@
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
"minifyWXSS": true,
"useApiHostProcess": false
},
"compileType": "miniprogram",
"libVersion": "2.12.2",
......
......@@ -19,8 +19,9 @@ function addUserInfo(param) {
var addUserInfoUrl = config.url.addUserInfo;
return wxRequest.getRequest(addUserInfoUrl, param);
};
/** 获取Im用户userSig
* add By lq DateTime 2020-04-26
/**
* 获取Im用户userSig
* @add By lq DateTime 2020-04-26
* @param {String} user 用户注册IM的id
*/
function getUserSig(user) {
......
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