Funny 3 éve
szülő
commit
6395df085e

+ 1 - 1
src/api/http.js

@@ -2,7 +2,7 @@ import axios from 'axios';
 import qs from 'qs';
 import { message } from 'element-ui';
 const requestUrl = 'http://153.37.175.42:8086/'; // 测试内部接口
-// const requestUrl = 'http://121.4.100.145:8082/'; // 测试内部接口
+// const requestUrl = 'http://192.168.50.97:8082/'; // 测试内部接口
 // const requestUrl = 'https://api.liebaoai.cn/'; // 统一正式接口
 //创建axios实例
 const service = axios.create({

+ 40 - 2
src/components/accountCompoents/consumption.vue

@@ -3,7 +3,7 @@
     <el-row class="order_tab">
       <el-col :span="24">
         <div class="order_list_sel">
-          <div class="sel_item">
+          <div class="sel_item" v-if="$store.state.userInfo.memberType !== 1">
             <span class="name">门店:</span>
             <el-select size="small" class="item1" v-model="params.shopId" placeholder="请选择门店">
               <el-option v-for="(v,i) in shopList" :key="i" :label="v.name" :value="v.shopId"></el-option>
@@ -11,7 +11,7 @@
           </div>
           <div class="sel_item sel_item2">
             <span class="name">日期:</span>
-            <el-date-picker size="small" v-model="value1" class="item3" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+            <el-date-picker size="small" v-model="value1" class="item3" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
             </el-date-picker>
           </div>
           <el-button size='small' @click="search" style="background: #0D1E40;color:#fff">查询</el-button>
@@ -71,13 +71,51 @@ export default {
       },
       total: 0,
       value1: [],
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
     };
   },
   created() {
+    this.init();
     this.getAccountFlow();
     this.getShopList();
   },
   methods: {
+    init() {
+      const start = new Date().getTime() - 3600 * 1000 * 24 * 7;
+      this.params.startTime = this.$tool.formatDateTime(start, "yyyy-MM-dd");
+      this.params.endTime = this.$tool.formatDateTime(new Date(), "yyyy-MM-dd");
+      this.value1 = [this.params.startTime, this.params.endTime];
+    },
     search() {
       if (this.value1 && this.value1.length) {
         this.params.startTime = this.$tool.getFormatDate(

+ 18 - 13
src/components/orderComponents/orderAMap.vue

@@ -24,7 +24,7 @@
         </div>
       </div>
     </el-form>
-    <el-amap vid="container" :zoom="zoom" :center="center" style="height: 600px;" class="amap-demo">
+    <el-amap ref="map" vid="container" :zoom="zoom" :center="center" style="height: 600px;" class="amap-demo">
       <el-amap-marker v-for="(marker,index) in markers" :key="index" :position="marker.position" :icon="marker.icon"></el-amap-marker>
       <el-amap-text v-for="text in texts" :key="text.id" :text="text.text" :offset="text.offset" :position="text.position" :events="text.events"></el-amap-text>
       <!-- <el-amap-polyline :path="polyline.path"></el-amap-polyline> -->
@@ -36,6 +36,7 @@
 
 <script>
 import { getInputPrompt, getGeoCode, getMapData } from "../../api/order.js";
+
 export default {
   data() {
     return {
@@ -58,6 +59,7 @@ export default {
     };
   },
   created() {},
+  mounted() {},
   methods: {
     seachEnterFun(e) {
       var keyCode = window.event ? e.keyCode : e.which;
@@ -141,6 +143,9 @@ export default {
       if (mapData.shipperLng && mapData.shipperLat) {
         this.markers.push(riderM);
       }
+      this.$nextTick(() => {
+        this.$refs.map.$$getInstance().setFitView();
+      });
 
       let orderDistance =
         mapData.orderDistance > 1000
@@ -218,18 +223,18 @@ export default {
   padding: 4px 8px;
   border: none;
 }
-/deep/ .amap-overlay-text-container:before{
-    content: '';
-    width: 0;
-    height: 0;
-    border-left: 10px solid transparent;
-    border-right: 10px solid transparent;
-    border-top: 10px solid #fc7200;
-    position: absolute;
-    bottom: -10px;
-    left: 50%;
-    transform: translateX(-50%);
-  }
+/deep/ .amap-overlay-text-container:before {
+  content: "";
+  width: 0;
+  height: 0;
+  border-left: 10px solid transparent;
+  border-right: 10px solid transparent;
+  border-top: 10px solid #fc7200;
+  position: absolute;
+  bottom: -10px;
+  left: 50%;
+  transform: translateX(-50%);
+}
 .map-btn {
   background: #fc7200;
   border: none;

+ 1 - 1
src/components/orderComponents/orderDetail.vue

@@ -67,7 +67,7 @@
       <div class="detail_title2">订单金额</div>
       <div class="info2 info4">
         <div class="title">商品金额:</div>
-        <div class="cont">¥{{orderDetail.productAmount}}</div>
+        <div class="cont">{{orderDetail.productAmount ? '¥' + orderDetail.productAmount : '--'}}</div>
       </div>
       <div class="detail_ine"></div>
       <div class="detail_title2">订单信息</div>

+ 1 - 1
src/components/orderComponents/orderList.vue

@@ -166,7 +166,7 @@
                 {{ item.receiptCityName }} -->
                 {{ item.receiptDistrictName }}
                 {{ item.receiptAddress }}
-                <span class="distance" v-if="item.orderDistance" @click.stop="checkMap(item)">
+                <span class="distance" @click.stop="checkMap(item)">
                   <i class="el-icon-location"></i>
                   <span>查看地图</span>
                   <!-- <span v-if="item.orderDistance < 1000">

+ 42 - 2
src/components/orderSearch.vue

@@ -29,7 +29,7 @@
           </div>
           <div class="sel_item sel_item2">
             <span class="name">日期:</span>
-            <el-date-picker size="small" v-model="value1" class="item3" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
+            <el-date-picker size="small" v-model="value1" class="item3" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
             </el-date-picker>
           </div>
           <el-button size='small' @click="search" style="background: #0D1E40;color:#fff">查询</el-button>
@@ -131,6 +131,37 @@ export default {
       orderDetailStutus: 1,
       markerNum: "",
       clickBool: false,
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: "最近一周",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近一个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+          {
+            text: "最近三个月",
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit("pick", [start, end]);
+            },
+          },
+        ],
+      },
     };
   },
   components: {
@@ -142,6 +173,7 @@ export default {
     if (searchKey) {
       this.params.searchKey = searchKey;
     }
+
     this.init();
     this.getShopList();
     this.getOrder();
@@ -158,6 +190,14 @@ export default {
       }
     },
     init() {
+      const start = new Date().getTime() - 3600 * 1000 * 24 * 7;
+      this.params.startDate = this.$tool.formatDateTime(start, "yyyy-MM-dd");
+      this.params.endDate = this.$tool.formatDateTime(
+        new Date(),
+        "yyyy-MM-dd"
+      );
+      this.value1 = [this.params.startDate,this.params.endDate]
+
       bus.$on("refreshData2", () => {
         console.log("执行refreshData2");
         this.orderList = [];
@@ -167,7 +207,7 @@ export default {
     search() {
       if (this.value1 && this.value1.length) {
         this.params.startDate = this.$tool.formatDateTime(this.value1[0]);
-        this.params.endtDate = this.$tool.formatDateTime(this.value1[1]);
+        this.params.endDate = this.$tool.formatDateTime(this.value1[1]);
       } else {
         this.params.startDate = "";
         this.params.endDate = "";

BIN
static/image/map-rider.png