shish 4 лет назад
Родитель
Сommit
8af6e37c75
2 измененных файлов с 18 добавлено и 14 удалено
  1. 1 1
      hdApp/src/api/purchase/index.js
  2. 17 13
      hdApp/src/pagesPurchase/purDetails.vue

+ 1 - 1
hdApp/src/api/purchase/index.js

@@ -80,7 +80,7 @@ export const createPurchaseOrderApi = async data => {
 /** *
  * 采购详情   /purchase/wx-pay
  */
- export const purchaseDetail = async data => {
+ export const purchaseDetail = data => {
 	return https.get("/purchase/detail", data);
 };
 

+ 17 - 13
hdApp/src/pagesPurchase/purDetails.vue

@@ -217,7 +217,7 @@
 
 <script>
 
-import { purchaseDetail, purchaseDebtPay, purchaseClearCreateOrder } from "@/api/purchase/index";
+import { purchaseDetail, purchaseDebtPay } from "@/api/purchase";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
   name: "info",
@@ -288,22 +288,26 @@ export default {
       });
     },
     init() {
-      this.initData()
+      let id = 0
+      if(this.option.id){
+        id = this.option.id
+      }else{
+		//小票上的二维码打开
+		//https://api.shop.huaml.com/#/pagesPurchase/purDetails?id=1292
+		if(this.option.q){
+			let currentUrl = decodeURIComponent(this.option.q)
+			id = currentUrl.substring(currentUrl.lastIndexOf("?id=") + 4)
+		}
+      }
+      this.initData(id)
     },
-    async initData () {
-      return purchaseDetail({ id: this.option.id }).then(res => {
+    initData (id) {
+      return purchaseDetail({ id: id }).then(res => {
         this.detailInfo = res.data
-
-			this.settlePrice = Number(this.detailInfo.bookPrice) - Number(this.detailInfo.orderPrice)
-			this.settlePrice = parseFloat(this.settlePrice.toFixed(2))
-
+        this.settlePrice = Number(this.detailInfo.bookPrice) - Number(this.detailInfo.orderPrice)
+        this.settlePrice = parseFloat(this.settlePrice.toFixed(2))
         this.$forceUpdate()
       })
-      
-    },
-    // 修改花材
-    editFlr () {
-
     },
     toPay () {
       uni.navigateTo({