|
|
@@ -12,13 +12,13 @@
|
|
|
</block>
|
|
|
<block v-else>
|
|
|
<view class="order-status">
|
|
|
- <view class="status-name" v-if="orderData.status == 1">已核销</view>
|
|
|
- <view class="status-name success" v-if="orderData.status == 2">预约中</view>
|
|
|
+ <view class="status-name" v-if="orderData.status == 1">预约中</view>
|
|
|
+ <view class="status-name success" v-if="orderData.status == 2">服务中</view>
|
|
|
<view class="status-name" v-if="orderData.status == 3">已撤销</view>
|
|
|
<view class="status-name" v-if="orderData.status == 4">已完成</view>
|
|
|
|
|
|
- <view class="status-desc" v-if="orderData.status == 1">团购券已完成核销</view>
|
|
|
- <view class="status-desc success" v-if="orderData.status == 2">预约中,如有问题可以联系客服</view>
|
|
|
+ <view class="status-desc" v-if="orderData.status == 1">预约中,如有问题可以联系客服</view>
|
|
|
+ <view class="status-desc success" v-if="orderData.status == 2">服务中,如有问题可以联系客服</view>
|
|
|
<view class="status-desc" v-if="orderData.status == 3">已撤销,可在团购订单中申请退款</view>
|
|
|
<view class="status-desc" v-if="orderData.status == 4">服务已完成,欢迎您再次使用</view>
|
|
|
|
|
|
@@ -28,12 +28,20 @@
|
|
|
<view class="goods-info">
|
|
|
<view class="name">{{ orderData.goods.product_name }}</view>
|
|
|
<view class="desc">
|
|
|
- <view class="time" v-if="orderData.end_at">有效期至:{{ orderData.end_at }} </view>
|
|
|
- <view class="num">x {{ orderData.number?orderData.number:1 }}</view>
|
|
|
+ <view class="time" v-if="orderData.parent.expire_at">有效期至:{{ orderData.parent.expire_at }} </view>
|
|
|
</view>
|
|
|
- <view class="total">合计:¥ {{orderData.goods.product_price}}</view>
|
|
|
+ <view class="desc">x {{ orderData.number?orderData.number:1 }} <text>{{ orderData.sku }}</text></view>
|
|
|
+ <!-- <view class="total">合计:¥ {{orderData.goods.product_price}}</view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="goods-item">
|
|
|
+ <view class="left">商品总额</view>
|
|
|
+ <view class="right">¥{{orderData.parent.order_amount}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="goods-item">
|
|
|
+ <view class="left">商品优惠</view>
|
|
|
+ <view class="right red">¥{{orderData.parent.order_amount}}</view>
|
|
|
+ </view>
|
|
|
<view class="goods-store" v-if="poiData">
|
|
|
<view class="title">预约门店</view>
|
|
|
<view class="store-info">
|
|
|
@@ -42,7 +50,7 @@
|
|
|
<view class="address">{{poiData.poi_address}}</view>
|
|
|
</view>
|
|
|
<view class="store-right">
|
|
|
- <view class="right-item">
|
|
|
+ <view class="right-item" @click="openLocation">
|
|
|
<image src="/static/image/map.png"></image>
|
|
|
<view class="desc">导航</view>
|
|
|
</view>
|
|
|
@@ -81,26 +89,22 @@
|
|
|
<view class="line-footer"></view>
|
|
|
<view class="footer">
|
|
|
<view class="footer-op" v-if="orderData.status == 1">
|
|
|
+ <view class="footer-left" @click="cancelOrder(1)"><text class="red">取消预约</text></view>
|
|
|
<view class="footer-right">
|
|
|
- <view class="btn">已核销</view>
|
|
|
+ <view class="btn">预约中</view>
|
|
|
+ <view class="btn full" @click="callMobile">联系商家</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="footer-op" v-if="orderData.status == 2">
|
|
|
- <view class="footer-left" @click="cancelOrder"><text>取消预约</text></view>
|
|
|
- <view class="footer-right">
|
|
|
- <pay-button-sdk
|
|
|
- :mode="1"
|
|
|
- :goods-id="orderData.goods.out_id"
|
|
|
- :order-id="orderData.order_sn"
|
|
|
- :order-status="1"
|
|
|
- :refund-total-amount="orderData.goods.product_price*100"
|
|
|
- :apply-refund-params="applyRefundParams"
|
|
|
- />
|
|
|
- <view class="btn">服务进行中</view>
|
|
|
+ <view class="footer-left" @click="cancelOrder(2)"><text class="red">取消服务</text></view>
|
|
|
+ <view class="footer-right">
|
|
|
+ <view class="btn">服务中</view>
|
|
|
+ <view class="btn full" @click="callMobile">联系商家</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="footer-op" v-if="orderData.status == 3">
|
|
|
- <view class="footer-right" @click="toGoods">
|
|
|
+ <view class="footer-left" @click="delOrder()"><text class="red">删除订单?</text></view>
|
|
|
+ <view class="footer-right">
|
|
|
<view class="btn">已撤销</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -126,6 +130,7 @@ export default {
|
|
|
poiData:null,
|
|
|
goodsData:null,
|
|
|
orderData:null,
|
|
|
+ goodsPrice:0,
|
|
|
storeData:null,
|
|
|
orderIdForRefundAmount:"",
|
|
|
applyRefundParams:{
|
|
|
@@ -139,23 +144,65 @@ export default {
|
|
|
app.order = order;
|
|
|
app.getOrder()
|
|
|
},
|
|
|
- methods: {
|
|
|
- toRefund(){
|
|
|
-
|
|
|
- },
|
|
|
- applyrefund(event) {
|
|
|
- console.log('退款申请',event);
|
|
|
- const { orderId } = event.detail;
|
|
|
- console.log('退款申请-02',orderId);
|
|
|
- const extra = { orderId }; // 开发者需要透传的参数,可自定义内容
|
|
|
- return new Promise(resolve => {
|
|
|
- resolve(extra);
|
|
|
- });
|
|
|
+ methods: {
|
|
|
+ copyOrder(order){
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.setClipboardData({
|
|
|
+ data:order,
|
|
|
+ success() {
|
|
|
+ app.$dialog.showSuccess("复制成功")
|
|
|
+ },
|
|
|
+ fail() {
|
|
|
+ app.$dialog.showSuccess("复制失败")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },300)
|
|
|
+ },
|
|
|
+ openLocation(){
|
|
|
+ uni.openLocation({
|
|
|
+ latitude:app.poiData.latitude,
|
|
|
+ longitude:app.poiData.longitude,
|
|
|
+ name:app.poiData.poi_name,
|
|
|
+ address:app.poiData.poi_address,
|
|
|
+ fail() {
|
|
|
+ app.$dialog.showSuccess("打开地图失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ callMobile(){
|
|
|
+ if (!app.storeData.service_mobile) return ;
|
|
|
+ uni.makePhoneCall({
|
|
|
+ phoneNumber:app.storeData.service_mobile,
|
|
|
+ fail() {
|
|
|
+ app.$dialog.showSuccess("联系失败")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delOrder(){
|
|
|
+ app.$dialog.showError("确定要删除该笔预约订单吗",function(res){
|
|
|
+ if (res.confirm) {
|
|
|
+ Api.del({"order":app.order}).then((res)=>{
|
|
|
+ if (res.code == 0) {
|
|
|
+ return app.$dialog.showSuccess(res.msg)
|
|
|
+ }
|
|
|
+ app.$dialog.showSuccess(res.msg,"none",function(){
|
|
|
+ uni.switchTab({
|
|
|
+ url:"/pages/order/order"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },"删除提示")
|
|
|
},
|
|
|
- cancelOrder(){
|
|
|
- app.$dialog.showError("确定要取消该预约吗?",function(res){
|
|
|
+ cancelOrder(type){
|
|
|
+ if (type == 1) {
|
|
|
+ var msg = "确定要取消该预约或服务吗?";
|
|
|
+ } else {
|
|
|
+ var msg = "该订单已在服务中,如需取消服务需联系商家审核,审核通过后即可申请退款!";
|
|
|
+ }
|
|
|
+ app.$dialog.showError(msg,function(res){
|
|
|
if (res.confirm) {
|
|
|
- Api.cancel({"order":app.order}).then((res)=>{
|
|
|
+ Api.cancel({"order":app.order,"type":type}).then((res)=>{
|
|
|
if (res.code == 0) {
|
|
|
return app.$dialog.showSuccess(res.msg)
|
|
|
}
|
|
|
@@ -164,7 +211,7 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- },"取消预约")
|
|
|
+ },"取消预约/服务")
|
|
|
},
|
|
|
getOrder(){
|
|
|
Api.orderDetail({"order":app.order}).then((res)=>{
|
|
|
@@ -174,10 +221,12 @@ export default {
|
|
|
uni.navigateBack()
|
|
|
});
|
|
|
return ;
|
|
|
- }
|
|
|
+ }
|
|
|
+ app.goodsPrice = res.data.parent.pay_amount * 100;
|
|
|
app.applyRefundParams.orderId = res.data.order_id;
|
|
|
app.orderData = res.data
|
|
|
app.poiData = res.data.poi;
|
|
|
+ app.storeData = res.data.store;
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -194,14 +243,15 @@ page{background-color: #f8f8f8;}
|
|
|
.footer{position: fixed;bottom: 0;background-color: #fff;padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;left: 0;right: 0;}
|
|
|
.footer .footer-op{display: flex;align-items: center;}
|
|
|
.footer .footer-op .footer-left{display: flex;align-items: center;gap: 10upx;justify-content: center;font-size: 32upx;color: #f00;font-weight: bold;}
|
|
|
-.footer .footer-op .footer-left text{color: #666;font-size: 24upx;font-weight: normal;}
|
|
|
+.footer .footer-op .footer-left text{color: #333;font-size: 28upx;font-weight: normal;}
|
|
|
+.footer .footer-op .footer-left text.red{color: #f56c6c;font-weight: bold;}
|
|
|
.footer .footer-op .footer-left .item{flex-direction: column;display: flex;font-size: 24rpx;color: #333;align-items: center;}
|
|
|
.footer .footer-op .footer-left image{width: 40upx;height: 40upx;}
|
|
|
|
|
|
.footer .footer-op .footer-right{margin-left: auto;margin-right: 0;display: flex;align-items: center;gap: 20upx;}
|
|
|
.footer .footer-op .footer-right .btn{font-size: 28rpx;height: 80upx;border-radius: 10upx;line-height: 80upx;text-align: center;width: 200upx;color: #333;border: 2upx solid #ccc;}
|
|
|
.footer .footer-op .footer-right .btn.danger{border:2upx solid #f00;color: #f00;}
|
|
|
-.footer .footer-op .footer-right .btn.full{background-color: #007aff;color: #fff;border:2upx solid #007aff;}
|
|
|
+.footer .footer-op .footer-right .btn.full{background-color: #224d7a;color: #fff;border:2upx solid #224d7a;}
|
|
|
.footer .footer-safe {height: env(safe-area-inset-bottom);width: 100%;}
|
|
|
|
|
|
.order-status{padding: 40upx 20upx;text-align: center;}
|
|
|
@@ -222,8 +272,11 @@ page{background-color: #f8f8f8;}
|
|
|
.order-goods image{width: 140upx;height: 140upx;}
|
|
|
.goods-info{margin-left: 20upx;font-size: 28upx;flex: 1;padding: 20upx 0;}
|
|
|
.goods-info .name{font-size: 30upx;color: #333;}
|
|
|
-.goods-info .desc{font-size: 24upx;color: #999;display: flex;align-items: center;justify-content: space-between;margin: 20upx 0;}
|
|
|
+.goods-info .desc{font-size: 24upx;color: #999;margin: 20upx 0;}
|
|
|
+.goods-info .desc text{margin-left: 20upx;}
|
|
|
.goods-info .total{font-size: 30upx;color: #333;text-align: right;font-weight: bold;}
|
|
|
+.goods-item{display: flex;align-items: center;line-height: 80upx;justify-content: space-between;font-size: 28upx;color: #333;background-color: #fff;padding: 0 20upx;border-top: 2upx solid #f8f8f8;}
|
|
|
+.goods-item .right.red{color: #f00;}
|
|
|
|
|
|
.home-store{margin: 20upx auto;display: flex;align-items: center;background-color: #fff;border-radius: 10upx;display: flex;align-items: center;padding: 30upx;}
|
|
|
.home-store .store-right{width: 120upx;height: 120upx;background-color: #fff;text-align: center;display: flex;align-items: center;justify-content: center;margin-left: auto;margin-right: 0;border-radius: 10upx;}
|