shish 1 سال پیش
والد
کامیت
26336dd50b
3فایلهای تغییر یافته به همراه25 افزوده شده و 9 حذف شده
  1. 3 3
      ghsApp/src/admin/item/detail.vue
  2. 4 0
      hdApp/src/api/purchase/index.js
  3. 18 6
      hdApp/src/pagesPurchase/purDetails.vue

+ 3 - 3
ghsApp/src/admin/item/detail.vue

@@ -166,10 +166,10 @@
 
         <tui-list-cell class="line-cell" :hover="false">
           <view class="tui-title">每人限购</view>
-          <input v-model="form.limitBuy" style="width:110upx;" @focus="form.limitBuy=''" placeholder-class="phcolor" class="tui-input" name="limitBuy" placeholder="0不限购" maxlength="50" type="number" />
+          <input v-model="form.limitBuy" style="width:105upx;" @focus="form.limitBuy=''" placeholder-class="phcolor" class="tui-input" name="limitBuy" placeholder="0不限购" maxlength="50" type="number" />
 
-          <button v-if="productData.id > 0 && form.limitBuy>0" class="admin-button-com blue middle" @click.stop="clearBuyCache()" style="width:150upx;">清已购</button>
-          <button v-if="productData.id > 0 && form.limitBuy>0" class="admin-button-com blue middle" style="width:180upx;margin-left:10upx;" @click.stop="hasBuyList">已购列表</button>
+          <button v-if="productData.id > 0" class="admin-button-com blue middle" @click.stop="clearBuyCache()" style="width:150upx;">清已购</button>
+          <button v-if="productData.id > 0" class="admin-button-com blue middle" style="width:180upx;margin-left:10upx;" @click.stop="hasBuyList">已购列表</button>
 
         </tui-list-cell>
 

+ 4 - 0
hdApp/src/api/purchase/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const cancelOrder = data => {
+	return https.get("/purchase/cancel", data);
+};
+
 export const getAliPayCode = data => {
 	return https.get("/purchase/get-ali-pay-code", data);
 };

+ 18 - 6
hdApp/src/pagesPurchase/purDetails.vue

@@ -303,20 +303,22 @@
     </view>
     <view class="app-footer open_btn">
 
+
+      <button class="admin-button-com blue big" v-if="detailInfo.status == 1" style="margin-right:40upx;" @click="cancelMyOrder()">取消</button>
+
       <block v-if="detailInfo.status != 1">
         <block v-if="afterSale == 1">
-          <button class="admin-button-com blue big" style="margin-right:60upx;" @click="refundOrder()">申请售后</button>
+          <button class="admin-button-com blue big" style="margin-right:40upx;" @click="refundOrder()" v-if="detailInfo.payStatus == 1">申请售后</button>
         </block>
       </block>
 
-      <button class="admin-button-com blue big" open-type="share" v-if="detailInfo.status!=5 && detailInfo.payStatus != 1" 
-      style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">邀请付款</button>
+      <button class="admin-button-com blue big" open-type="share" v-if="detailInfo.status!=5 && detailInfo.payStatus != 1" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">邀请付款</button>
 
       <block v-if="detailInfo.book == 0">
-        <button class="admin-button-com blue big" v-if="detailInfo.status== 3 || detailInfo.status== 2" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
+        <button class="admin-button-com blue big" v-if="detailInfo.status== 3 || detailInfo.status== 2" @click="affirmTake()" style="margin-right:50upx;padding-left:30upx;padding-right:30upx;">确认收货</button>
       </block>
       <block v-else>
-        <button class="admin-button-com blue big" v-if="detailInfo.status== 3" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
+        <button class="admin-button-com blue big" v-if="detailInfo.status== 3" @click="affirmTake()" style="margin-right:40upx;padding-left:30upx;padding-right:30upx;">确认收货</button>
       </block>
 
       <!-- <button class="admin-button-com blue big" v-if="detailInfo.status== 4" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">再次改价</button> -->
@@ -335,7 +337,7 @@
 <script>
 import { mapGetters } from "vuex";
 import { getCgExpressTrack } from "@/api/express"
-import { purchaseDetail, purchaseDebtPay,purchaseClearCreateOrder,confirmTake } from "@/api/purchase";
+import { purchaseDetail, purchaseDebtPay,purchaseClearCreateOrder,confirmTake,cancelOrder } from "@/api/purchase";
 import TuiListCell from "@/components/plugin/list-cell";
 import { getGhsDataApi } from "@/api/ghs";
 export default {
@@ -431,6 +433,16 @@ export default {
 				}
 			});
 		},
+    cancelMyOrder(){
+        this.$util.confirmModal({content:'确认取消?'},() => {
+          cancelOrder({id:this.detailInfo.id}).then(res=>{
+            if(res.code == 1){
+              this.$msg('取消成功')
+              this.beginInit()
+            }
+          })
+        })
+    },
     refundOrder(){
       if(this.loginStyle == 0){
         this.$msg('请先登录')