xxm 6 years ago
parent
commit
4f856cbf41
6 changed files with 84 additions and 65 deletions
  1. 1 0
      .gitignore
  2. 16 30
      package-lock.json
  3. 1 1
      package.json
  4. 59 31
      pages/bills/_id.vue
  5. 1 2
      pages/wo/bills.vue
  6. 6 1
      yarn.lock

+ 1 - 0
.gitignore

@@ -97,3 +97,4 @@ build/Release
 node_modules
 plugins
 .DS_Store
+nuxt.config.js

+ 16 - 30
package-lock.json

@@ -2613,8 +2613,7 @@
             },
             "ansi-regex": {
               "version": "2.1.1",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "aproba": {
               "version": "1.2.0",
@@ -2632,13 +2631,11 @@
             },
             "balanced-match": {
               "version": "1.0.0",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "brace-expansion": {
               "version": "1.1.11",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "balanced-match": "^1.0.0",
                 "concat-map": "0.0.1"
@@ -2651,18 +2648,15 @@
             },
             "code-point-at": {
               "version": "1.1.0",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "concat-map": {
               "version": "0.0.1",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "console-control-strings": {
               "version": "1.1.0",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "core-util-is": {
               "version": "1.0.2",
@@ -2765,8 +2759,7 @@
             },
             "inherits": {
               "version": "2.0.3",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "ini": {
               "version": "1.3.5",
@@ -2776,7 +2769,6 @@
             "is-fullwidth-code-point": {
               "version": "1.0.0",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "number-is-nan": "^1.0.0"
               }
@@ -2789,20 +2781,17 @@
             "minimatch": {
               "version": "3.0.4",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "brace-expansion": "^1.1.7"
               }
             },
             "minimist": {
               "version": "0.0.8",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "minipass": {
               "version": "2.3.5",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "safe-buffer": "^5.1.2",
                 "yallist": "^3.0.0"
@@ -2819,7 +2808,6 @@
             "mkdirp": {
               "version": "0.5.1",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "minimist": "0.0.8"
               }
@@ -2892,8 +2880,7 @@
             },
             "number-is-nan": {
               "version": "1.0.1",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "object-assign": {
               "version": "4.1.1",
@@ -2903,7 +2890,6 @@
             "once": {
               "version": "1.4.0",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "wrappy": "1"
               }
@@ -2979,8 +2965,7 @@
             },
             "safe-buffer": {
               "version": "5.1.2",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "safer-buffer": {
               "version": "2.1.2",
@@ -3010,7 +2995,6 @@
             "string-width": {
               "version": "1.0.2",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "code-point-at": "^1.0.0",
                 "is-fullwidth-code-point": "^1.0.0",
@@ -3028,7 +3012,6 @@
             "strip-ansi": {
               "version": "3.0.1",
               "bundled": true,
-              "optional": true,
               "requires": {
                 "ansi-regex": "^2.0.0"
               }
@@ -3067,13 +3050,11 @@
             },
             "wrappy": {
               "version": "1.0.2",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             },
             "yallist": {
               "version": "3.0.3",
-              "bundled": true,
-              "optional": true
+              "bundled": true
             }
           }
         }
@@ -7916,6 +7897,11 @@
       "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
       "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
     },
+    "qs": {
+      "version": "6.8.0",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.8.0.tgz",
+      "integrity": "sha512-tPSkj8y92PfZVbinY1n84i1Qdx75lZjMQYx9WZhnkofyxzw2r7Ho39G3/aEvSUdebxpnnM4LZJCtvE/Aq3+s9w=="
+    },
     "query-string": {
       "version": "4.3.4",
       "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",

+ 1 - 1
package.json

@@ -26,7 +26,7 @@
     "moment": "^2.24.0",
     "node-sass": "^4.12.0",
     "nuxt": "^2.6.3",
-    "qs": "^6.7.0",
+    "qs": "^6.8.0",
     "sass-loader": "^7.1.0",
     "style-loader": "^0.23.1",
     "vue-quill-editor": "^3.0.6"

+ 59 - 31
pages/bills/_id.vue

@@ -37,7 +37,7 @@
           <div class="center-box">
             <section class="group-list">
               <div id="order_detailbox">
-                <h3 style="font-size:24px">{{inforDetail.product_title}}</h3>
+                <h3 style="font-size:24px">{{product_title}}</h3>
                 <span class="lines"></span>
                 <div class="order-infos">
                   <span v-if="status==1">
@@ -52,46 +52,46 @@
                     <p>
                       <span class="pays-title">实际金额:</span>
                       <span
-                        v-if="inforDetail.real_amount>=0"
+                        v-if=" real_amount>=0"
                         class="detail-pays green font20"
-                      >+{{(inforDetail.real_amount/100).toFixed(2)}}</span>
+                      >+{{( real_amount/100).toFixed(2)}}</span>
                       <span
                         v-else
                         class="detail-pays orange font20"
-                      >{{(inforDetail.real_amount/100).toFixed(2)}}</span>
+                      >{{( real_amount/100).toFixed(2)}}</span>
                     </p>
                     <p>
                       <span class="pays-title">原始金额:</span>
-                      <span v-if="inforDetail.amount>=0" class>+{{inforDetail.amount}}</span>
-                      <span v-else class>{{inforDetail.amount}}</span>
+                      <span v-if=" amount>=0" class>+{{ amount}}</span>
+                      <span v-else class>{{ amount}}</span>
                     </p>
                     <p>
                       <span class="pays-title">支付方式:</span>
-                      <span>{{inforDetail.channel_name}}</span>
+                      <span>{{ channel_name}}</span>
                     </p>
                   </div>
                   <div class="pays-others">
                     <p>
                       <span>创建时间:</span>
-                      <span>{{inforDetail.created_at?(formatDate(inforDetail.created_at)):""}}</span>
+                      <span>{{ created_at?(formatDate( created_at)):""}}</span>
                     </p>
 
                     <p>
                       <span>到账时间:</span>
-                      <span>{{inforDetail.pay_time?(formatDate(inforDetail.pay_time)):""}}</span>
+                      <span>{{ pay_time?(formatDate( pay_time)):""}}</span>
                     </p>
                     <p>
                       <span>订单编号:</span>
-                      <span>{{inforDetail.order_no}}</span>
+                      <span>{{ order_no}}</span>
                     </p>
                     <p>
                       <span>支付编号:</span>
-                      <span>{{inforDetail.out_order_id}}</span>
+                      <span>{{ out_order_id}}</span>
                     </p>
 
                     <p>
                       <span>备注说明:</span>
-                      <span>{{inforDetail.remark}}</span>
+                      <span>{{ remark}}</span>
                     </p>
                   </div>
                   <span class="lines"></span>
@@ -109,7 +109,7 @@
           <div class="business-list">
             <section class="group-list group-list-mobile">
               <div id="order_detailbox">
-                <h3 style="font-size:24px">{{inforDetail.product_title}}</h3>
+                <h3 style="font-size:24px">{{ product_title}}</h3>
                 <span class="lines"></span>
                 <div class="order-infos">
                   <span v-if="status==1">
@@ -124,46 +124,46 @@
                     <p>
                       <span class="pays-title">实际金额:</span>
                       <span
-                        v-if="inforDetail.real_amount>=0"
+                        v-if=" real_amount>=0"
                         class="detail-pays green font20"
-                      >+{{(inforDetail.real_amount/100).toFixed(2)}}</span>
+                      >+{{( real_amount/100).toFixed(2)}}</span>
                       <span
                         v-else
                         class="detail-pays orange font20"
-                      >{{(inforDetail.real_amount/100).toFixed(2)}}</span>
+                      >{{( real_amount/100).toFixed(2)}}</span>
                     </p>
                     <p>
                       <span class="pays-title">原始金额:</span>
-                      <span v-if="inforDetail.amount>=0" class>+{{inforDetail.amount}}</span>
-                      <span v-else class>{{inforDetail.amount}}</span>
+                      <span v-if=" amount>=0" class>+{{ amount}}</span>
+                      <span v-else class>{{ amount}}</span>
                     </p>
                     <p>
                       <span class="pays-title">支付方式:</span>
-                      <span>{{inforDetail.channel_name}}</span>
+                      <span>{{ channel_name}}</span>
                     </p>
                   </div>
                   <div class="pays-others">
                     <p>
                       <span>创建时间:</span>
-                      <span>{{inforDetail.created_at?(formatDate(inforDetail.created_at)):""}}</span>
+                      <span>{{ created_at?(formatDate( created_at)):""}}</span>
                     </p>
 
                     <p>
                       <span>到账时间:</span>
-                      <span>{{inforDetail.pay_time?(formatDate(inforDetail.pay_time)):""}}</span>
+                      <span>{{ pay_time?(formatDate( pay_time)):""}}</span>
                     </p>
                     <p>
                       <span>订单编号:</span>
-                      <span>{{inforDetail.order_no}}</span>
+                      <span>{{ order_no}}</span>
                     </p>
                     <p>
                       <span>支付编号:</span>
-                      <span>{{inforDetail.out_order_id}}</span>
+                      <span>{{ out_order_id}}</span>
                     </p>
 
                     <p>
                       <span>备注说明:</span>
-                      <span>{{inforDetail.remark}}</span>
+                      <span>{{ remark}}</span>
                     </p>
                   </div>
                   <span class="lines"></span>
@@ -178,6 +178,7 @@
 </template>
 
 <script>
+import qs from "qs";
 import { Pagination } from "element-ui";
 import moment from "moment";
 
@@ -195,7 +196,18 @@ export default {
       statusTF: true,
       centerDialogVisible: false,
       ids: "",
-      inforDetail: { related_project: "" },
+      // inforDetail: {
+      product_title: "",
+      related_project: "",
+      amount: "",
+      real_amount: "",
+      channel_name: "",
+      created_at: "",
+      pay_time: "",
+      order_no: "",
+      out_order_id: "",
+      remark: "",
+      // },
       status: 1,
       iconUrl: "",
       nikeName: "",
@@ -221,7 +233,7 @@ export default {
     var index = url.lastIndexOf("/");
     var str = url.substring(index + 1, url.length);
     this.ids = str;
-    // console.log(this.ids);
+    console.log("ids", this.ids);
   },
   methods: {
     formatDate(time) {
@@ -263,12 +275,28 @@ export default {
       //       });
       //   }, 1000);
       // });
-      const res = await this.$axios.$post("/api/admin/order/get", body);
+      const res = await this.$axios.$post(
+        "/api/admin/order/get",
+        qs.stringify(body)
+      );
+
       var data = res.data;
-      this.inforDetail = data;
-      (this.iconUrl = data.user_info.icon_url),
-        (this.nikeName = data.user_info.nickname),
-        (this.status = res.status);
+      alert(res.info);
+      // this.inforDetail = data;
+      console.log("datass:", data);
+      this.product_title = data.product_title;
+      this.related_project = data.related_project;
+      this.amount = data.amount;
+      this.real_amount = data.real_amount;
+      this.channel_name = data.channel_name;
+      this.created_at = data.created_at;
+      this.pay_time = data.pay_time;
+      this.order_no = data.order_no;
+      this.out_order_id = data.out_order_id;
+      this.remark = data.remark;
+      this.iconUrl = data.user_info.icon_url;
+      this.nikeName = data.user_info.nickname;
+      this.status = res.status;
     }
   }
 };

+ 1 - 2
pages/wo/bills.vue

@@ -227,7 +227,6 @@ export default {
   //   }
   // },
   mounted() {
-    document.title = "交易账单-程序员客栈"
     this.screenWidth = window.screen.width;
     this.getOrders();
   },
@@ -251,7 +250,7 @@ export default {
       }
     },
     timeFormat(el) {
-      return moment.unix(el).format("YYYY-MM-DD HH:mm");
+      return moment.unix(el).format("YYYY-MM-DD hh:mm");
     },
     handleCurrentChange(val) {
       this.page = val;

+ 6 - 1
yarn.lock

@@ -6434,11 +6434,16 @@ q@^1.1.2:
   resolved "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
   integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
 
-qs@6.7.0, qs@^6.7.0:
+qs@6.7.0:
   version "6.7.0"
   resolved "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
   integrity sha1-QdwaAV49WB8WIXdr4xr7KHapsbw=
 
+qs@^6.8.0:
+  version "6.8.0"
+  resolved "https://registry.yarnpkg.com/qs/-/qs-6.8.0.tgz#87b763f0d37ca54200334cd57bb2ef8f68a1d081"
+  integrity sha512-tPSkj8y92PfZVbinY1n84i1Qdx75lZjMQYx9WZhnkofyxzw2r7Ho39G3/aEvSUdebxpnnM4LZJCtvE/Aq3+s9w==
+
 qs@~6.5.2:
   version "6.5.2"
   resolved "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"