Commit dde3f637 by liuquan

no message

parent 48a96c72
......@@ -1679,7 +1679,10 @@ Page({
* payid 支付ID
*/
buyProduct: Util.debouce(function (e) {
wx.showLoading({mask:true});
wx.showLoading({
title:'加载中',
mask:true
});
let that = this;
let item = e.currentTarget.dataset.item;
// isQuick 购买方式 0-正常购买,1-二维码购买,2-快速购买
......@@ -1697,9 +1700,12 @@ Page({
wx.hideLoading();
} else if (res.code == -1) {
wx.navigateTo({
url: '/packageA/productOrderInfo/productOrderInfo?scene=' + id + '&isQuick=' + item.isQuick + '&orderId=' + this.data.orderId + '&groupID=' + that.data.groupID,
url: '/packageA/productOrderInfo/productOrderInfo?scene=' + id + '&isQuick=' + item.isQuick + '&orderId=' + this.data.orderId + '&groupID=' + that.data.groupID,
success: function() {
wx.hideLoading();
}
})
wx.hideLoading();
} else {
wx.hideLoading();
that.setData({
......
......@@ -15,12 +15,12 @@ Page({
winH: null,
},
showview: false,
success:true,
success: true,
list: [],
page: 1,
productPage: 0,
total: 0,
requestStatus:false,//请求状态
requestStatus: false, //请求状态
},
/**
......@@ -100,7 +100,7 @@ Page({
//获取列表
getList: function (page, status) {
var that = this
that.data.requestStatus=true;
that.data.requestStatus = true;
var data = {
page: page,
// unionid:'oHhp80QCN2WjClijvSyhkEFQcUwY',
......@@ -152,22 +152,23 @@ Page({
newList = res.data.list;
}
wx.stopPullDownRefresh()
if (newList.length > 0) {
if (newList.length > 5) {
that.setData({
list: newList,
total: res.data.total,
showview: true,
requestStatus:false,
requestStatus: false,
})
wx.hideLoading();
} else {
that.buyDrugList(param);
that.setData({
// list: [],
list: newList,
total: res.data.total,
// showview: true
})
that.buyDrugList(param);
}
}).catch(function (Error) {
console.warn('error:', Error); // 获取会话资料失败的相关信息
......@@ -206,19 +207,19 @@ Page({
newList = newList.concat(res.data);
}
wx.stopPullDownRefresh()
if (newList.length > 0) {
that.setData({
list: newList,
showview: true,
requestStatus:false,
requestStatus: false,
})
wx.hideLoading();
} else {
that.setData({
list: [],
showview: true,
requestStatus:false,
requestStatus: false,
})
wx.hideLoading();
}
......@@ -243,7 +244,7 @@ Page({
// title: '加载中',
// mask:true
// })
if(_this.data.requestStatus){
if (_this.data.requestStatus) {
return;
}
_this.setData({
......@@ -311,9 +312,15 @@ Page({
* 订单详情-待发货2,已发货3,已完成4
*/
goOrderDetail: debouce(function (e) {
if(e.currentTarget.dataset.class==1){
wx.navigateTo({
url: '/packageA/drugOrderDetail/drugOrderDetail?id=' + e.currentTarget.dataset.id,
})
})}else if(e.currentTarget.dataset.class==2){
wx.navigateTo({
url: '/packageA/productOrderDetail/productOrderDetail?id=' + e.currentTarget.dataset.id,
})
}
}, 1000, true),
//查看物流-待收货+已完成
goLogistics: debouce(function (e) {
......@@ -326,24 +333,44 @@ Page({
*/
goPay: debouce(function (e) {
let that = this;
let orderClass = e.currentTarget.dataset.class;
console.log("orderClass",orderClass);
let data = {
prescription: e.currentTarget.dataset.id,
patient_unionid: wx.getStorageSync('data').unionid,
isquick: e.currentTarget.dataset.isquick
}
Service.getPayStatusA(data).then((res) => {
if (res.code == 1) {
that.onShow();
} 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) {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
if (orderClass == 1) {
Service.getPayStatusA(data).then((res) => {
if (res.code == 1) {
that.onShow();
} 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) {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
} else if (orderClass == 2) {
Service.getPayStatusB(data).then((res) => {
if (res.code == 1) {
that.onShow();
} else if (res.code == -1) {
wx.navigateTo({
url: '/packageA/productOrderInfo/productOrderInfo?scene=' + e.currentTarget.dataset.id + "&isQuick=" + e.currentTarget.dataset.isquick,
})
} else{
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
}
}, 1000, true),
})
\ No newline at end of file
......@@ -70,9 +70,9 @@
<view class="ljzf" wx:if="{{item.status==3}}" bindtap="confirmReceipt" data-num="{{item.ordernumber}}">确认收货
</view>
<view class="ljzf" wx:if="{{item.status==2||item.status==3 || item.status==4}}" bindtap="goOrderDetail"
data-id="{{item.id}}">订单详情</view>
data-id="{{item.id}}" data-class="2">订单详情</view>
<view class="ljzf" wx:if="{{item.status==1}}" bindtap="goPay" data-id="{{item.yfid}}"
data-isquick="{{item.modular}}" data-class="1">立即支付</view>
data-isquick="{{item.modular}}" data-class="2">立即支付</view>
<view class="ljzf1" wx:if="{{item.status==5}}">订单过期</view>
<view class="ljzf1" wx:if="{{item.status==7}}">订单作废</view>
</view>
......@@ -135,7 +135,7 @@
<view class="ljzf" wx:if="{{item.status==3}}" bindtap="confirmReceipt" data-num="{{item.ordernumber}}">确认收货
</view>
<view class="ljzf" wx:if="{{item.status==2||item.status==3 || item.status==4}}" bindtap="goOrderDetail"
data-id="{{item.id}}">订单详情</view>
data-id="{{item.id}}" data-class="1">订单详情</view>
<view class="ljzf" wx:if="{{item.status==1}}" bindtap="goPay" data-id="{{item.yfid}}"
data-isquick="{{item.modular}}" data-class="1">立即支付</view>
<view class="ljzf1" wx:if="{{item.status==5}}">订单过期</view>
......
......@@ -51,7 +51,7 @@ Page({
area:res.data.area,
city:res.data.city,
}
if(res.code==1){
if(res.code==200){
that.setData({
item:res.data,
list:res.data.drug_arr,
......
......@@ -100,7 +100,7 @@
<view>运费:</view>
<view>¥ {{item.freight}}</view>
</view> -->
<view class="actualPay">共{{item.total}}件商品 实付款: <text style="color:#EC5B68;">¥{{item.money}}</text></view>
<view class="actualPay">共{{item.drug_num}}件商品 实付款: <text style="color:#EC5B68;">¥{{item.money}}</text></view>
</view>
<view class="br"></view>
<view class="orderinfo">
......@@ -161,7 +161,7 @@
</view>
<view class="bottom row">
<!-- <view>查看医生推荐</view> -->
<view bindtap="viewRecipe" data-item="{{item}}">查看处方</view>
<!-- <view bindtap="viewRecipe" data-item="{{item}}">查看处方</view> -->
<view wx:if="{{item.status==2}}" bindtap="editAddress" data-ordernumber="{{item.ordernumber}}"
data-address="{{address}}">修改地址</view>
<view bindtap="goLogistics" data-status="{{item.status}}" data-img="{{item.drug_arr[0].picture}}"
......
......@@ -199,7 +199,7 @@ overflow: hidden;
}
.actualPay {
border-top: 1rpx solid #e7e7e7;
/* border-top: 1rpx solid #e7e7e7; */
padding: 30rpx 0 26rpx 0;
text-align: right;
font-size: 26rpx;
......
......@@ -47,13 +47,16 @@ Page({
})
return;
}
console.log("options", options)
that.data.options = options
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
wx.showLoading({
title: '加载中',
mask:true
})
var that = this
that.login = that.selectComponent("#login");
that.modal = that.selectComponent("#modal");
......@@ -66,6 +69,7 @@ Page({
return Service.getUserData(res.openid)
}).then((res) => {
if (Util.isEmpty(res.unionid)) {
wx.hideLoading();
that.login.showLogin();
} else {
wx.setStorageSync('data', res)
......@@ -128,6 +132,7 @@ Page({
that.isChecked(res.data.healthcare);
}
}
wx.hideLoading();
})
},
// 快速开药
......@@ -168,6 +173,7 @@ Page({
that.isChecked(res.data.healthcare);
}
}
wx.hideLoading();
})
},
//如果有医生推荐药品加上选中状态
......
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