|
|
@ -10,7 +10,7 @@ |
|
|
<view>The buyer has paid,Waiting for the merchant to deliver</view> |
|
|
<view>The buyer has paid,Waiting for the merchant to deliver</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="cancelled" v-if="details_index==4"> |
|
|
<view class="cancelled" v-if="details_index==4"> |
|
|
<view class="cancelled_left"> |
|
|
<view class="cancelled_left"> |
|
|
<image src="../../static/img/close2.png" mode=""></image> |
|
|
<image src="../../static/img/close2.png" mode=""></image> |
|
|
@ -19,25 +19,25 @@ |
|
|
<view>The transaction has been closed, looking forward to your re-selection</view> |
|
|
<view>The transaction has been closed, looking forward to your re-selection</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="cancelled completed" v-if="details_index==3" @click="goLogistics"> |
|
|
<view class="cancelled completed" v-if="details_index==3" @click="goLogistics"> |
|
|
<view class="cancelled_left"> |
|
|
<view class="cancelled_left"> |
|
|
<image src="../../static/img/completed.png" mode=""></image> |
|
|
<image src="../../static/img/completed.png" mode=""></image> |
|
|
<view class="cancelled_left_info"> |
|
|
<view class="cancelled_left_info"> |
|
|
<text class="shipped_right_text">Signed for</text> |
|
|
<text class="shipped_right_text">Signed for</text> |
|
|
<view>2022-04-27 21:15:55</view> |
|
|
<view>2022-04-27 21:15:55</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cancelled_right"> |
|
|
<view class="cancelled_right"> |
|
|
<image src="../../static/img/right2.png" mode=""></image> |
|
|
<image src="../../static/img/right2.png" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="cancelled toPaid" v-if="details_index==0"> |
|
|
<view class="cancelled toPaid" v-if="details_index==0"> |
|
|
<view class="cancelled_left"> |
|
|
<view class="cancelled_left"> |
|
|
<view > |
|
|
<view> |
|
|
<text class="shipped_right_text">Waiting for payment</text> |
|
|
<text class="shipped_right_text">Waiting for payment</text> |
|
|
<view>The timeout order will be closed automatically</view> |
|
|
<view>The timeout order will be closed automatically</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -47,21 +47,21 @@ |
|
|
<view>T-minus payment</view> |
|
|
<view>T-minus payment</view> |
|
|
</view> --> |
|
|
</view> --> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="cancelled transit" @click="goLogistics" v-if="details_index==2"> |
|
|
<view class="cancelled transit" @click="goLogistics" v-if="details_index==2"> |
|
|
<view class="cancelled_left" > |
|
|
<view class="cancelled_left"> |
|
|
<image src="../../static/img/transit.png" mode=""></image> |
|
|
<image src="../../static/img/transit.png" mode=""></image> |
|
|
<view class="cancelled_left_info"> |
|
|
<view class="cancelled_left_info"> |
|
|
<view class="shipped_right_text">【New York】Has arrived statesHas arrived states</view> |
|
|
<view class="shipped_right_text">【New York】Has arrived statesHas arrived states</view> |
|
|
<view>2022-04-27 21:15:55</view> |
|
|
<view>2022-04-27 21:15:55</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cancelled_right"> |
|
|
<view class="cancelled_right"> |
|
|
<image src="../../static/img/right2.png" mode=""></image> |
|
|
<image src="../../static/img/right2.png" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="address"> |
|
|
<view class="address"> |
|
|
<view class="address_left"> |
|
|
<view class="address_left"> |
|
|
@ -72,18 +72,18 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="address_content"> |
|
|
<view class="address_content"> |
|
|
<text>{{goodsDate.sign_building}}</text> |
|
|
<text>{{goodsDate.sign_building}}</text> |
|
|
<view >{{goodsDate.address_detail}}</view> |
|
|
<view>{{goodsDate.address_detail}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- <image src="../../static/img/right.png" class="address_more"></image> --> |
|
|
<!-- <image src="../../static/img/right.png" class="address_more"></image> --> |
|
|
<image src="../../static/img/address_xian.png" class="address_xian" mode=""></image> |
|
|
<image src="../../static/img/address_xian.png" class="address_xian" mode=""></image> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="order_popup_commodity"> |
|
|
<view class="order_popup_commodity"> |
|
|
<view class="good_info" v-for="(item,index) in goods_list " :key="index" @click="goDetails(item.goods_id)"> |
|
|
<view class="good_info" v-for="(item,index) in goods_list " :key="index" @click="goDetails(item.goods_id)"> |
|
|
<view class="good_info_left "> |
|
|
<view class="good_info_left "> |
|
|
<view class="good_info_image" style="border-radius: 10rpx;"> |
|
|
<view class="good_info_image" style="border-radius: 10rpx;"> |
|
|
<image :src="item.goods_thumb" mode="" style="border-radius: 10rpx;"></image> |
|
|
<image :src="item.goods_thumb" mode="" style="border-radius: 10rpx;"></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left_info"> |
|
|
<view class="left_info"> |
|
|
<view class="info_name">{{item.goods_name}}</view> |
|
|
<view class="info_name">{{item.goods_name}}</view> |
|
|
@ -101,9 +101,9 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="summary"> |
|
|
<view class="summary"> |
|
|
<view class="summary_title">Order summary</view> |
|
|
<view class="summary_title">Order summary</view> |
|
|
<view class="summary_item"> |
|
|
<view class="summary_item"> |
|
|
@ -134,7 +134,7 @@ |
|
|
<text>Reward 10 points</text> |
|
|
<text>Reward 10 points</text> |
|
|
</view> --> |
|
|
</view> --> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="summary"> |
|
|
<view class="summary"> |
|
|
<view class="summary_title">Order information</view> |
|
|
<view class="summary_title">Order information</view> |
|
|
<view class="summary_item"> |
|
|
<view class="summary_item"> |
|
|
@ -160,7 +160,7 @@ |
|
|
<view>Delivery time</view> |
|
|
<view>Delivery time</view> |
|
|
<view class="summary_item_right">{{goodsDate.formated_shipping_time}}</view> |
|
|
<view class="summary_item_right">{{goodsDate.formated_shipping_time}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 完成时间 --> |
|
|
<!-- 完成时间 --> |
|
|
<view class="summary_item" v-if="details_index==3"> |
|
|
<view class="summary_item" v-if="details_index==3"> |
|
|
<view>Completion time</view> |
|
|
<view>Completion time</view> |
|
|
<view class="summary_item_right"></view> |
|
|
<view class="summary_item_right"></view> |
|
|
@ -170,20 +170,22 @@ |
|
|
<view>Cancel time</view> |
|
|
<view>Cancel time</view> |
|
|
<view class="summary_item_right"></view> |
|
|
<view class="summary_item_right"></view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="details_footer" v-if="details_index!=1"> |
|
|
<view class="details_footer" v-if="details_index!=1"> |
|
|
<button class="white" v-if=" details_index==2||details_index==3" @click="goLogistics">LOGISTICS</button> |
|
|
<button class="white" v-if=" details_index==2||details_index==3" @click="goLogistics">LOGISTICS</button> |
|
|
<button class="white" v-if="details_index==4 || details_index==3" @click.stop="openTips(1)">DELETE ORDER</button> |
|
|
<button class="white" v-if="details_index==4 || details_index==3" @click.stop="openTips(1)">DELETE |
|
|
<button class="black" v-if="details_index==3 && goodsDate.comment_status_code==0" @click="goComment()">COMMENT</button> |
|
|
ORDER</button> |
|
|
|
|
|
<button class="black" v-if="details_index==3 && goodsDate.comment_status_code==0" |
|
|
|
|
|
@click="goComment()">COMMENT</button> |
|
|
|
|
|
|
|
|
<button class="white" v-if="details_index==0 " @click.stop="openTips(0)">CANCEL ORDER</button> |
|
|
<button class="white" v-if="details_index==0 " @click.stop="openTips(0)">CANCEL ORDER</button> |
|
|
<button class="black" v-if="details_index==0" @click="isPay=true">PAY NOW</button> |
|
|
<button class="black" v-if="details_index==0" @click="isPay=true">PAY NOW</button> |
|
|
|
|
|
|
|
|
<button class="black" v-if="details_index==2" @click.stop="openTips(2)">CONFIRM RECEIPT</button> |
|
|
<button class="black" v-if="details_index==2" @click.stop="openTips(2)">CONFIRM RECEIPT</button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 支付 --> |
|
|
<!-- 支付 --> |
|
|
<view class="mask" v-show="isPay" @click="isPay=false"></view> |
|
|
<view class="mask" v-show="isPay" @click="isPay=false"></view> |
|
|
<view class="order_popup" v-show="isPay"> |
|
|
<view class="order_popup" v-show="isPay"> |
|
|
@ -193,24 +195,26 @@ |
|
|
</text> |
|
|
</text> |
|
|
<image src="../../static/img/close1.png" mode="" @click="isPay=false"></image> |
|
|
<image src="../../static/img/close1.png" mode="" @click="isPay=false"></image> |
|
|
</view> |
|
|
</view> |
|
|
<view class="order_popup_pay" > |
|
|
<view class="order_popup_pay"> |
|
|
<view class="pay_item" @click="selectPay(0)"> |
|
|
<view class="pay_item" @click="selectPay(0)"> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0"></image> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==0"> |
|
|
|
|
|
</image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<view class="pay_item_right"> |
|
|
<view class="pay_item_right"> |
|
|
<image src="../../static/img/pay_pal.png" mode=""></image> |
|
|
<image src="../../static/img/pay_pal.png" mode=""></image> |
|
|
<text>Pay Pal</text> |
|
|
<text>Pay Pal</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- <view class="pay_item" @click="selectPay(1)"> |
|
|
<view class="pay_item" @click="selectPay(1)"> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1"></image> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==1"> |
|
|
|
|
|
</image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<view class="pay_item_right"> |
|
|
<view class="pay_item_right"> |
|
|
<image src="../../static/img/card.png" mode=""></image> |
|
|
<image src="../../static/img/card.png" mode=""></image> |
|
|
<text>Credit/Debit Card</text> |
|
|
<text>Credit/Debit Card</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="pay_item" @click="selectPay(2)"> |
|
|
<!-- <view class="pay_item" @click="selectPay(2)"> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image> |
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==2"></image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
<view class="pay_item_right"> |
|
|
<view class="pay_item_right"> |
|
|
@ -226,208 +230,238 @@ |
|
|
<text>Apple pay</text> |
|
|
<text>Apple pay</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<button @click="getPayDate">PAY NOW</button> |
|
|
<button @click="getPayDate">PAY NOW</button> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 删除、取消弹框 --> |
|
|
<!-- 删除、取消弹框 --> |
|
|
<uni-popup ref="alertDialog" type="dialog"> |
|
|
<uni-popup ref="alertDialog" type="dialog"> |
|
|
<uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo" @confirm="dialogConfirm" ></uni-popup-dialog> |
|
|
<uni-popup-dialog type="error" cancelText="Close" :confirmText="tipsBut" title="Tips" :content="tipsInfo" |
|
|
|
|
|
@confirm="dialogConfirm"></uni-popup-dialog> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import {defaultRequest2} from '../../api/index.js' |
|
|
import { |
|
|
|
|
|
defaultRequest2 |
|
|
|
|
|
} from '../../api/index.js' |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
// 0、待发货 1、已取消 2、已完成 3、待支付 4、运输中 (已废弃) |
|
|
// 0、待发货 1、已取消 2、已完成 3、待支付 4、运输中 (已废弃) |
|
|
// 0、待支付 1、待发货 2、运输中 3、已完成 4、已取消 |
|
|
// 0、待支付 1、待发货 2、运输中 3、已完成 4、已取消 |
|
|
details_index:4, |
|
|
details_index: 4, |
|
|
query:{ |
|
|
query: { |
|
|
_action:'getorder', |
|
|
_action: 'getorder', |
|
|
order_id:'', |
|
|
order_id: '', |
|
|
order_sn:'' |
|
|
order_sn: '' |
|
|
}, |
|
|
}, |
|
|
goodsDate:{}, |
|
|
goodsDate: {}, |
|
|
goods_list:[], |
|
|
goods_list: [], |
|
|
isPay:false, |
|
|
isPay: false, |
|
|
payQuery:{ |
|
|
payQuery: { |
|
|
_action:'payorder', |
|
|
_action: 'payorder', |
|
|
order_id:'', |
|
|
order_id: '', |
|
|
order_type:'GOODSBUY', |
|
|
order_type: 'GOODSBUY', |
|
|
payment_method:'alipay.native' |
|
|
payment_method: 'alipay.native' |
|
|
}, |
|
|
}, |
|
|
pay_index:0, |
|
|
pay_index: 0, |
|
|
logisticsinfo:{}, |
|
|
logisticsinfo: {}, |
|
|
// 弹出提示框的状态 0:取消订单 1、删除订单 2、确认收货 |
|
|
// 弹出提示框的状态 0:取消订单 1、删除订单 2、确认收货 |
|
|
tipsType:0, |
|
|
tipsType: 0, |
|
|
tipsInfo:'', |
|
|
tipsInfo: '', |
|
|
tipsBut:'', |
|
|
tipsBut: '', |
|
|
cancelQuery:{ |
|
|
cancelQuery: { |
|
|
_action:'cancelorder', |
|
|
_action: 'cancelorder', |
|
|
order_id:'' |
|
|
order_id: '' |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods: { |
|
|
// 跳转商品详情 |
|
|
// 跳转商品详情 |
|
|
goDetails(id){ |
|
|
goDetails(id) { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:'/pages/productDetails/index?goodid='+id |
|
|
url: '/pages/productDetails/index?goodid=' + id |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 跳转评论页面 |
|
|
// 跳转评论页面 |
|
|
goComment(){ |
|
|
goComment() { |
|
|
let data=this.goodsDate |
|
|
let data = this.goodsDate |
|
|
data.order_goods=this.goods_list |
|
|
data.order_goods = this.goods_list |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:'../productDetails/review?data='+JSON.stringify(data) |
|
|
url: '../productDetails/review?data=' + JSON.stringify(data) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 淡出提示 |
|
|
// 淡出提示 |
|
|
openTips(type){ |
|
|
openTips(type) { |
|
|
this.tipsType=type |
|
|
this.tipsType = type |
|
|
if(type==0){ |
|
|
if (type == 0) { |
|
|
this.tipsInfo='Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation' |
|
|
this.tipsInfo = |
|
|
this.tipsBut='CancelOrder' |
|
|
'Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation' |
|
|
this.cancelQuery._action='cancelorder' |
|
|
this.tipsBut = 'CancelOrder' |
|
|
}else if(type==1){ |
|
|
this.cancelQuery._action = 'cancelorder' |
|
|
this.tipsInfo='Are you sure you want to delete this order?' |
|
|
} else if (type == 1) { |
|
|
this.tipsBut='DeleteOrder' |
|
|
this.tipsInfo = 'Are you sure you want to delete this order?' |
|
|
this.cancelQuery._action='deleteorder' |
|
|
this.tipsBut = 'DeleteOrder' |
|
|
}else if(type==2){ |
|
|
this.cancelQuery._action = 'deleteorder' |
|
|
this.tipsInfo='Are you sure you have received the products?' |
|
|
} else if (type == 2) { |
|
|
this.tipsBut='Confirm' |
|
|
this.tipsInfo = 'Are you sure you have received the products?' |
|
|
this.cancelQuery._action='affirmorder' |
|
|
this.tipsBut = 'Confirm' |
|
|
|
|
|
this.cancelQuery._action = 'affirmorder' |
|
|
} |
|
|
} |
|
|
this.$refs.alertDialog.open() |
|
|
this.$refs.alertDialog.open() |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 提示框点击确操作 取消订单、删除订单 |
|
|
// 提示框点击确操作 取消订单、删除订单 |
|
|
dialogConfirm(){ |
|
|
dialogConfirm() { |
|
|
defaultRequest2(this.cancelQuery).then(res=>{ |
|
|
defaultRequest2(this.cancelQuery).then(res => { |
|
|
console.info(res) |
|
|
console.info(res) |
|
|
if(res.error==0){ |
|
|
if (res.error == 0) { |
|
|
if(this.tipsType==0){ |
|
|
if (this.tipsType == 0) { |
|
|
this.details_index=4 |
|
|
this.details_index = 4 |
|
|
}else if(this.tipsType==1){ |
|
|
} else if (this.tipsType == 1) { |
|
|
uni.navigateBack() |
|
|
uni.navigateBack() |
|
|
}else{ |
|
|
} else { |
|
|
this.details_index=3 |
|
|
this.details_index = 3 |
|
|
} |
|
|
} |
|
|
this.getList() |
|
|
this.getList() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
goLogistics(){ |
|
|
goLogistics() { |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:'./logisticsDetails?order_id='+this.goodsDate.order_id |
|
|
url: './logisticsDetails?order_id=' + this.goodsDate.order_id |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 选择支付方式 |
|
|
// 选择支付方式 |
|
|
selectPay(index){ |
|
|
selectPay(index) { |
|
|
this.pay_index=index |
|
|
this.pay_index = index |
|
|
}, |
|
|
}, |
|
|
// 获取调用支付信息数据 |
|
|
// 获取调用支付信息数据 |
|
|
getPayDate(){ |
|
|
getPayDate() { |
|
|
console.log(this.pay_index) |
|
|
console.log(this.pay_index) |
|
|
if(this.pay_index == 0){ |
|
|
if (this.pay_index == 0) { |
|
|
let data ={_action:'payorder',order_id:this.payQuery.order_id,order_type:'GOODSBUY',payment_method:'paypal'} |
|
|
let data = { |
|
|
defaultRequest2(data).then(res=>{ |
|
|
_action: 'payorder', |
|
|
|
|
|
order_id: this.payQuery.order_id, |
|
|
|
|
|
order_type: 'GOODSBUY', |
|
|
|
|
|
payment_method: 'paypal' |
|
|
|
|
|
} |
|
|
|
|
|
defaultRequest2(data).then(res => { |
|
|
console.info(data) |
|
|
console.info(data) |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
if(res.error == 0){ |
|
|
if (res.error == 0) { |
|
|
if(res.data.need_pay_amount==0) return |
|
|
if (res.data.need_pay_amount == 0) return |
|
|
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) |
|
|
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) |
|
|
// this.src = res.data.prepay_data.checkoutnow_url |
|
|
// this.src = res.data.prepay_data.checkoutnow_url |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:'./paypalWebview?src='+res.data.prepay_data.checkoutnow_url |
|
|
url: './paypalWebview?src=' + res.data.prepay_data.checkoutnow_url |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} else if(this.pay_index == 1) { |
|
|
else{ |
|
|
let data = { |
|
|
console.info(this.payQuery,'支付宝') |
|
|
_action: 'payorder', |
|
|
defaultRequest2(this.payQuery).then(res=>{ |
|
|
order_id: this.payQuery.order_id, |
|
|
console.info(res,'支付宝') |
|
|
order_type: 'GOODSBUY', |
|
|
if(res.error==0){ |
|
|
payment_method: 'oceanpay' |
|
|
//订单对象,从服务器获取 |
|
|
|
|
|
if(res.data.need_pay_amount==0) return |
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
provider: 'alipay', |
|
|
|
|
|
orderInfo: res.data.prepay_data.order_info, //支付宝订单数据 |
|
|
|
|
|
success: function (res) { |
|
|
|
|
|
console.log('success:' + JSON.stringify(res)); |
|
|
|
|
|
uni.redirectTo({ |
|
|
|
|
|
url: 'paySuccess?order_id='+this.payQuery.order_id |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function (err) { |
|
|
|
|
|
console.log('fail:' + JSON.stringify(err)); |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title:'Payment failed', |
|
|
|
|
|
icon:'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
defaultRequest2(data).then(res => { |
|
|
|
|
|
console.info(data) |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
if (res.error == 0) { |
|
|
|
|
|
if (res.data.need_pay_amount == 0) return |
|
|
|
|
|
// plus.runtime.openURL(res.data.prepay_data.checkoutnow_url) |
|
|
|
|
|
// this.src = res.data.prepay_data.checkoutnow_url |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: './paypalWebview?src=' + res.data.prepay_data.checkoutnow_url |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.info(this.payQuery, '支付宝') |
|
|
|
|
|
defaultRequest2(this.payQuery).then(res => { |
|
|
|
|
|
console.info(res, '支付宝') |
|
|
|
|
|
if (res.error == 0) { |
|
|
|
|
|
//订单对象,从服务器获取 |
|
|
|
|
|
if (res.data.need_pay_amount == 0) return |
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
provider: 'alipay', |
|
|
|
|
|
orderInfo: res.data.prepay_data.order_info, //支付宝订单数据 |
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
console.log('success:' + JSON.stringify(res)); |
|
|
|
|
|
uni.redirectTo({ |
|
|
|
|
|
url: 'paySuccess?order_id=' + this.payQuery.order_id |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
fail: function(err) { |
|
|
|
|
|
console.log('fail:' + JSON.stringify(err)); |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: 'Payment failed', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
payNow(id){ |
|
|
payNow(id) { |
|
|
this.payQuery.order_id=id |
|
|
this.payQuery.order_id = id |
|
|
this.isPay=true |
|
|
this.isPay = true |
|
|
}, |
|
|
}, |
|
|
getDate(){ |
|
|
getDate() { |
|
|
defaultRequest2(this.query).then(res=>{ |
|
|
defaultRequest2(this.query).then(res => { |
|
|
console.info(res) |
|
|
console.info(res) |
|
|
if(res.error==0){ |
|
|
if (res.error == 0) { |
|
|
this.goodsDate=res.data |
|
|
this.goodsDate = res.data |
|
|
this.goods_list=res.goods_list |
|
|
this.goods_list = res.goods_list |
|
|
if(this.details_index==4){ |
|
|
if (this.details_index == 4) { |
|
|
this.getLogistics() |
|
|
this.getLogistics() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getLogistics(){ |
|
|
getLogistics() { |
|
|
let data ={_action:'getlogisticsinfo',order_id:this.goodsDate.order_id,order_sn:''} |
|
|
let data = { |
|
|
defaultRequest2(data).then(res=>{ |
|
|
_action: 'getlogisticsinfo', |
|
|
|
|
|
order_id: this.goodsDate.order_id, |
|
|
|
|
|
order_sn: '' |
|
|
|
|
|
} |
|
|
|
|
|
defaultRequest2(data).then(res => { |
|
|
console.info(res) |
|
|
console.info(res) |
|
|
if(res.error==0){ |
|
|
if (res.error == 0) { |
|
|
this.logisticsinfo=res.data[0] |
|
|
this.logisticsinfo = res.data[0] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 复制 |
|
|
// 复制 |
|
|
Copy(e){ |
|
|
Copy(e) { |
|
|
console.log(e) |
|
|
console.log(e) |
|
|
uni.setClipboardData({ |
|
|
uni.setClipboardData({ |
|
|
data:e, |
|
|
data: e, |
|
|
success:()=>{ |
|
|
success: () => { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title:'ok!', |
|
|
title: 'ok!', |
|
|
icon:'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(e){ |
|
|
onLoad(e) { |
|
|
console.info(e) |
|
|
console.info(e) |
|
|
this.details_index=e.details_index |
|
|
this.details_index = e.details_index |
|
|
this.query.order_id=e.id |
|
|
this.query.order_id = e.id |
|
|
this.cancelQuery.order_id=e.id |
|
|
this.cancelQuery.order_id = e.id |
|
|
this.payQuery.order_id = e.id |
|
|
this.payQuery.order_id = e.id |
|
|
this.getDate() |
|
|
this.getDate() |
|
|
}, |
|
|
}, |
|
|
filters:{ |
|
|
filters: { |
|
|
goodsAttr(e){ |
|
|
goodsAttr(e) { |
|
|
return e.replace(/\s\n/g,';'); |
|
|
return e.replace(/\s\n/g, ';'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -435,11 +469,10 @@ |
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@import "@/common/scss/order.scss"; |
|
|
@import "@/common/scss/order.scss"; |
|
|
page{ |
|
|
|
|
|
|
|
|
page {} |
|
|
} |
|
|
|
|
|
.body{ |
|
|
.body { |
|
|
padding-bottom: 130rpx; |
|
|
padding-bottom: 130rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|