|
|
|
@ -8,7 +8,8 @@ |
|
|
|
<view class="body"> |
|
|
|
<template v-if="isList==true && scroll_active==0"> |
|
|
|
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id"> |
|
|
|
<view class="order" v-if="item.pay_status_code==0"> |
|
|
|
<!-- 待支付订单 --> |
|
|
|
<view class="order" v-if="item.pay_status_code==0 && item.order_status_code==0"> |
|
|
|
<view class="order_title"> |
|
|
|
<text>Waiting for payment</text> |
|
|
|
<view class="order_title_right"> |
|
|
|
@ -34,11 +35,41 @@ |
|
|
|
<text>Reward 10 points</text> |
|
|
|
</view> |
|
|
|
<view class="order_button"> |
|
|
|
<button class="cancel">CANCEL ORDER</button> |
|
|
|
<button class="pay">PAY NOW</button> |
|
|
|
<button class="cancel" @click="cancelorder(item.order_id)">CANCEL ORDER</button> |
|
|
|
<button class="pay" @click="payNow(item.order_id)">PAY NOW</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 已取消订单 --> |
|
|
|
<view class="order" v-if="item.order_status_code==2" @click="goDetails(1)"> |
|
|
|
<view class="order_title"> |
|
|
|
<text>cancelled</text> |
|
|
|
<view class="order_title_right"> |
|
|
|
<text>order#{{item.order_sn}}</text> |
|
|
|
<image src="../../static/img/right.png" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order_content"> |
|
|
|
<view class="good_info"> |
|
|
|
<view class="good_info_left"> |
|
|
|
<view class="good_info_image" v-for="(item1,index1) in item.order_goods" :key="index1"> |
|
|
|
<image :src="item.goods_img" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="good_info_right"> |
|
|
|
<text>{{item.order_goods.length}} ltems</text> |
|
|
|
<image src="../../static/img/right.png" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="good_price">total:US${{item.order_amount}}</view> |
|
|
|
<view class="order_button"> |
|
|
|
<button class="cancel">DELETE ORDER</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
@ -151,32 +182,6 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<navigator url="/pages/order/details?details_index=1"> |
|
|
|
<view class="order"> |
|
|
|
<view class="order_title"> |
|
|
|
<text>cancelled</text> |
|
|
|
<view class="order_title_right"> |
|
|
|
<text>order#20245512141212</text> |
|
|
|
<image src="../../static/img/right.png" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order_content"> |
|
|
|
<view class="good_info"> |
|
|
|
<view class="good_info_left"> |
|
|
|
<view class="good_info_image" v-for="(item,index) in 4" :key="index"></view> |
|
|
|
</view> |
|
|
|
<view class="good_info_right"> |
|
|
|
<text>4 ltems</text> |
|
|
|
<image src="../../static/img/right.png" mode=""></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="good_price">total:US$12.5</view> |
|
|
|
<view class="order_button"> |
|
|
|
<button class="cancel">DELETE ORDER</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</navigator> |
|
|
|
</template> |
|
|
|
<template v-if="isList==true && scroll_active==2"> |
|
|
|
<navigator url="/pages/order/details?details_index=0"> |
|
|
|
@ -296,8 +301,57 @@ |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="mask" v-show="isPay" @click="isShow=false"></view> |
|
|
|
<view class="order_popup" v-show="isPay"> |
|
|
|
<view class="order_popup_title"> |
|
|
|
<text> |
|
|
|
Payment Method |
|
|
|
</text> |
|
|
|
<image src="../../static/img/close1.png" mode="" @click="isPay=false"></image> |
|
|
|
</view> |
|
|
|
<view class="order_popup_pay" > |
|
|
|
<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/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
|
<view class="pay_item_right"> |
|
|
|
<image src="../../static/img/pay_pal.png" mode=""></image> |
|
|
|
<text>Pay Pal</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<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/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
|
<view class="pay_item_right"> |
|
|
|
<image src="../../static/img/card.png" mode=""></image> |
|
|
|
<text>Credit/Debit Card</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<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/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
|
<view class="pay_item_right"> |
|
|
|
<image src="../../static/img/GPay.png" mode=""></image> |
|
|
|
<text>Google Pay</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="pay_item" @click="selectPay(3)"> |
|
|
|
<image src="../../static/img/select1.png" mode="" class="pay_item_select" v-if="pay_index==3"></image> |
|
|
|
<image src="../../static/img/select2.png" mode="" class="pay_item_select" v-else></image> |
|
|
|
<view class="pay_item_right"> |
|
|
|
<image src="../../static/img/APay.png" mode=""></image> |
|
|
|
<text>Apple pay</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <navigator url="/pages/order/paySuccess"> --> |
|
|
|
<button @click="getPayDate">PAY NOW</button> |
|
|
|
<!-- </navigator> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-popup ref="alertDialog" type="dialog"> |
|
|
|
<uni-popup-dialog type="error" cancelText="Close" confirmText="CancelOrder" title="Tips" |
|
|
|
content="Are you sure you want to cancel this order? This order will be regarded as invalid after cancellation" |
|
|
|
@confirm="dialogConfirm" ></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -309,10 +363,78 @@ |
|
|
|
scrollList:[{text:'All'},{text:'Unpaid'},{text:'Processing'},{text:'Shipped'},{text:'Returns'},{text:'Completed'},{text:'Closed'}], |
|
|
|
scroll_active:0, |
|
|
|
isList:true, |
|
|
|
orderList:[] |
|
|
|
orderList:[], |
|
|
|
isPay:false, |
|
|
|
payQuery:{ |
|
|
|
_action:'payorder', |
|
|
|
order_id:'', |
|
|
|
order_type:'GOODSBUY', |
|
|
|
payment_method:'alipay.native' |
|
|
|
}, |
|
|
|
pay_index:0, |
|
|
|
cancelQuery:{ |
|
|
|
_action:'cancelorder', |
|
|
|
order_id:'' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
// 订单详情 |
|
|
|
goDetails(index){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'../order/details?details_index='+index |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 选择支付方式 |
|
|
|
selectPay(index){ |
|
|
|
this.pay_index=index |
|
|
|
}, |
|
|
|
// 获取调用支付信息数据 |
|
|
|
getPayDate(){ |
|
|
|
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){ |
|
|
|
this.payQuery.order_id=id |
|
|
|
this.isPay=true |
|
|
|
}, |
|
|
|
// 取消订单 |
|
|
|
cancelorder(id){ |
|
|
|
this.cancelQuery.order_id=id |
|
|
|
this.$refs.alertDialog.open() |
|
|
|
|
|
|
|
}, |
|
|
|
// 提示框点击确操作 |
|
|
|
dialogConfirm(){ |
|
|
|
defaultRequest2(this.cancelQuery).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
if(res.error==0){ |
|
|
|
this.getList() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getList(){ |
|
|
|
let data={_action:'getuserorders',page_index:1,page_size:10,payingstatus:'',status:''} |
|
|
|
defaultRequest2(data).then(res=>{ |
|
|
|
|