Commit dde3f637 by liuquan

no message

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