|
|
@@ -50,7 +50,7 @@
|
|
|
联系客服
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="w-33 flex-direction align-items-center" @click="contactShop(infoData.shop_phone)">
|
|
|
+ <view class="w-33 flex-direction align-items-center" @click="contactShop(infoData.shop.shop_phone)">
|
|
|
<image class="mb-4 icon" src="@/static/img/order/lxsj.png" mode=""></image>
|
|
|
<view class="fs-24 fc-3">
|
|
|
联系商家
|
|
|
@@ -159,8 +159,7 @@
|
|
|
{{infoData.time}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26"
|
|
|
- v-show="infoData.order_status == 6 || infoData.order_status == 7">
|
|
|
+ <view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26">
|
|
|
<view class="fs-28 fc-9">
|
|
|
骑手信息
|
|
|
</view>
|
|
|
@@ -222,10 +221,35 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
+ <uni-popup ref="popupReason" type="bottom" :is-mask-click="false" background-color="#fff" border-radius="10px 10px 0 0">
|
|
|
+ <view class="popup-reason-box flex-direction">
|
|
|
+ <view class="text-align-center fs-38 fw-600 fc-3 mb-18">
|
|
|
+ 选择取消原因
|
|
|
+ </view>
|
|
|
+ <picker-view @change="bindChange" class="picker-view flex-1" :immediate-change='true'>
|
|
|
+ <picker-view-column>
|
|
|
+ <view class="picker-view-item" v-for="(item,index) in refundReason" :key="index">
|
|
|
+ {{item.refund_msg}}
|
|
|
+ </view>
|
|
|
+ </picker-view-column>
|
|
|
+ </picker-view>
|
|
|
+ <view class="align-items-center flex-justify-space plr-24 box-border-box">
|
|
|
+ <view class="flex-1 mr-20 pop-b text-align-center fs-36 b-r-ccc" @click="popCancel">
|
|
|
+ 取消
|
|
|
+ </view>
|
|
|
+ <view class="flex-1 pop-b text-align-center bgc-41ABF5 fc-f fs-36" @click="popSure">
|
|
|
+ 确定
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ commonRefundReason
|
|
|
+ } from "@/api/common.js"
|
|
|
import {
|
|
|
orderInfo,
|
|
|
orderCancel,
|
|
|
@@ -250,7 +274,9 @@
|
|
|
s: '',
|
|
|
},
|
|
|
isAJAX: false,
|
|
|
- address_id: ''
|
|
|
+ address_id: '',
|
|
|
+ refund_msg: '', // 退款理由
|
|
|
+ refundReason: [] //退款原因
|
|
|
};
|
|
|
},
|
|
|
onLoad(data) {
|
|
|
@@ -332,69 +358,78 @@
|
|
|
this.orderPay(this.infoData.id)
|
|
|
},
|
|
|
orderPay(id) {
|
|
|
- // 票务支付
|
|
|
+ // 外卖支付
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/pages-takeout/pay-page?orderId=${id}`
|
|
|
+ });
|
|
|
+ // if (this.isAJAX) {
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.isAJAX = true;
|
|
|
+ // orderPay({
|
|
|
+ // order_id: id
|
|
|
+ // }).then((ret) => {
|
|
|
+ // if (ret.code === 1) {
|
|
|
+ // uni.requestPayment({
|
|
|
+ // provider: "wxpay", //支付类型-固定值
|
|
|
+ // timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
|
|
|
+ // nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
|
|
|
+ // package: ret.data.wx_pay.package, // 固定值
|
|
|
+ // signType: ret.data.wx_pay.signType, //固定值
|
|
|
+ // paySign: ret.data.wx_pay.paySign, //签名
|
|
|
+ // success: (ren) => {
|
|
|
+ // tools.success("支付成功");
|
|
|
+ // this.isAJAX = false;
|
|
|
+ // this.orderInfo(this.infoData.id)
|
|
|
+ // },
|
|
|
+ // fail: (err) => {
|
|
|
+ // this.isAJAX = false;
|
|
|
+ // tools.error("支付失败");
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.isAJAX = false;
|
|
|
+ // tools.error("支付失败");
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ cancelOrder() {
|
|
|
+ // 外卖取消订单
|
|
|
+ commonRefundReason().then((res) => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.refundReason = res.data
|
|
|
+ this.refund_msg = res.data[0].refund_msg
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$refs.popupReason.open()
|
|
|
+ },
|
|
|
+ popCancel() {
|
|
|
+ // 退款取消
|
|
|
+ this.$refs.popupReason.close()
|
|
|
+ },
|
|
|
+ popSure() {
|
|
|
+ // 退款确认
|
|
|
if (this.isAJAX) {
|
|
|
return
|
|
|
}
|
|
|
this.isAJAX = true;
|
|
|
- orderPay({
|
|
|
- order_id: id
|
|
|
- }).then((ret) => {
|
|
|
- if (ret.code === 1) {
|
|
|
- uni.requestPayment({
|
|
|
- provider: "wxpay", //支付类型-固定值
|
|
|
- timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
|
|
|
- nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
|
|
|
- package: ret.data.wx_pay.package, // 固定值
|
|
|
- signType: ret.data.wx_pay.signType, //固定值
|
|
|
- paySign: ret.data.wx_pay.paySign, //签名
|
|
|
- success: (ren) => {
|
|
|
- tools.success("支付成功");
|
|
|
- this.isAJAX = false;
|
|
|
- this.orderInfo(this.infoData.id)
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- this.isAJAX = false;
|
|
|
- tools.error("支付失败");
|
|
|
- },
|
|
|
- });
|
|
|
+ orderCancel({
|
|
|
+ order_id: this.infoData.id,
|
|
|
+ refund_msg: this.refund_msg
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ tools.success(res.msg)
|
|
|
+ this.$refs.popupReason.close()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.orderInfo(this.infoData.id)
|
|
|
+ }, 1500)
|
|
|
+ this.isAJAX = false;
|
|
|
} else {
|
|
|
+ tools.error(res.msg)
|
|
|
this.isAJAX = false;
|
|
|
- tools.error("支付失败");
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- cancelOrder() {
|
|
|
- // 外卖取消订单
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否取消订单?',
|
|
|
- confirmText: '确定',
|
|
|
- confirmColor: '#FB3D03',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm === true) {
|
|
|
- if (this.isAJAX) {
|
|
|
- return
|
|
|
- }
|
|
|
- this.isAJAX = true;
|
|
|
- orderCancel({
|
|
|
- order_id: this.infoData.id
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 1) {
|
|
|
- tools.success(res.msg, 3000)
|
|
|
- setTimeout(() => {
|
|
|
- this.orderInfo(this.infoData.id)
|
|
|
- }, 3000)
|
|
|
- this.isAJAX = false;
|
|
|
- } else {
|
|
|
- tools.error(res.msg)
|
|
|
- this.isAJAX = false;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
openGoods() {
|
|
|
this.goodsShow = !this.goodsShow
|
|
|
},
|
|
|
@@ -528,4 +563,30 @@
|
|
|
height: auto;
|
|
|
transition: all .5s linear;
|
|
|
}
|
|
|
+ .popup-reason-box {
|
|
|
+ width: 100%;
|
|
|
+ height: 45vh;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 20rpx 20rpx 0 0;
|
|
|
+ background: #fff;
|
|
|
+ padding: 24rpx 0 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .picker-view {
|
|
|
+ width: 100%;
|
|
|
+ // height: 70%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .picker-view-item {
|
|
|
+ // height: 90rpx;
|
|
|
+ line-height: 68rpx;
|
|
|
+ text-align: center;
|
|
|
+ background: #F5F5F5;
|
|
|
+ }
|
|
|
+ .pop-b {
|
|
|
+ height: 80rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ }
|
|
|
</style>
|