|
@@ -8,7 +8,7 @@
|
|
|
</view>
|
|
|
<view class="w2" v-if="orderDetail.orderState == 1">
|
|
|
需付款: <text class="red">¥{{orderDetail.paymentAmount}}</text>
|
|
|
- 剩余:26分钟30秒
|
|
|
+ 剩余: <u-count-down :time="orderDetail.remainTime * 1000" format="mm分ss秒"></u-count-down>
|
|
|
</view>
|
|
|
<view class="w2" v-if="orderDetail.orderState == 2">
|
|
|
取货码
|
|
@@ -182,7 +182,7 @@ import authorize from '@/components/Authorize';
|
|
|
import payment from '@/components/payment';
|
|
|
import colors from "@/mixins/color";
|
|
|
import productConSwiperGroupbuying from "@/components/productConSwiperGroupbuying";
|
|
|
-import {getUserOrderDetail} from '@/api/home.js';
|
|
|
+import {getUserOrderDetail, orderCancel} from '@/api/home.js';
|
|
|
export default {
|
|
|
components: {
|
|
|
payment,
|
|
@@ -238,10 +238,39 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+ cancelOrder() {
|
|
|
+ let _this = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定取消次订单',
|
|
|
+ confirmText: '确定',
|
|
|
+ cancelText: '我再想想',
|
|
|
+ success(res) {
|
|
|
+ console.log("success ->", _this.orderDetail)
|
|
|
+ if (res.confirm) {
|
|
|
+ orderCancel(_this.orderDetail.orderId).then(res => {
|
|
|
+ _this.getOrderDetail(_this.orderDetail.orderId);
|
|
|
+ return _this.$util.Tips({
|
|
|
+ title: _this.$t(`取消成功`),
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+
|
|
|
+ }).catch(err => {
|
|
|
+ return _this.$util.Tips({
|
|
|
+ title: err || _this.$t(`取消失败`)
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
afterSales () {
|
|
|
|
|
|
},
|
|
|
getOrderDetail(orderId) {
|
|
|
+ console.log("getOrderDetail");
|
|
|
let longitude = uni.getStorageSync('user_longitude');
|
|
|
let latitude = uni.getStorageSync('user_latitude');
|
|
|
getUserOrderDetail({
|
|
@@ -250,6 +279,10 @@ export default {
|
|
|
latitude: latitude
|
|
|
}).then(res => {
|
|
|
this.orderDetail = res.data
|
|
|
+ }).catch(err => {
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: err || that.$t(`获取订单详情失败`)
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
}
|