Ver código fonte

都能运app xu

xuwenqiang1992 2 anos atrás
pai
commit
b5daa7339c

+ 4 - 5
common/libs/request.js

@@ -1,8 +1,7 @@
-const devBaseUrl = "http://61.163.210.204:51106";
-const proBaseUrl = "http://61.163.210.204:51106";
-//const proBaseUrl = "http://61.163.210.202:39510";
-// const devBaseUrl = "http://218.3.230.230:39510";
-// const proBaseUrl = "http://218.3.230.230:39510";
+const devBaseUrl = "http://192.168.1.24:51106";
+const proBaseUrl = "http://192.168.1.24:51106";
+// const devBaseUrl = "http://61.163.210.204:51106";
+// // const proBaseUrl = "http://61.163.210.204:51106";
 
 
 const httpGet = (url, data, checkToken = true) => {

+ 308 - 0
libs/util/dayjs.js

@@ -0,0 +1,308 @@
+!(function (t, e) {
+    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = e() : typeof define === 'function'
+		&& define.amd ? define(e) : t.dayjs = e()
+}(this, () => {
+    'use strict'
+
+    const t = 'millisecond'
+    const e = 'second'
+    const n = 'minute'
+    const r = 'hour'
+    const i = 'day'
+    const s = 'week'
+    const u = 'month'
+    const a = 'quarter'
+    const o = 'year'
+    const f = 'date'
+    const h = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d+)?$/
+    const c = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g
+    const d = {
+        name: 'en',
+        weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+        months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_')
+    }
+    const $ = function (t, e, n) {
+        const r = String(t)
+        return !r || r.length >= e ? t : `${Array(e + 1 - r.length).join(n)}${t}`
+    }
+    const l = {
+        s: $,
+        z(t) {
+            const e = -t.utcOffset()
+            const n = Math.abs(e)
+            const r = Math.floor(n / 60)
+            const i = n % 60
+            return `${(e <= 0 ? '+' : '-') + $(r, 2, '0')}:${$(i, 2, '0')}`
+        },
+        m: function t(e, n) {
+            if (e.date() < n.date()) return -t(n, e)
+            const r = 12 * (n.year() - e.year()) + (n.month() - e.month())
+            const i = e.clone().add(r, u)
+            const s = n - i < 0
+            const a = e.clone().add(r + (s ? -1 : 1), u)
+            return +(-(r + (n - i) / (s ? i - a : a - i)) || 0)
+        },
+        a(t) {
+            return t < 0 ? Math.ceil(t) || 0 : Math.floor(t)
+        },
+        p(h) {
+            return {
+                M: u,
+                y: o,
+                w: s,
+                d: i,
+                D: f,
+                h: r,
+                m: n,
+                s: e,
+                ms: t,
+                Q: a
+            }[h] || String(h || '').toLowerCase().replace(/s$/, '')
+        },
+        u(t) {
+            return void 0 === t
+        }
+    }
+    let y = 'en'
+    const M = {}
+    M[y] = d
+    const m = function (t) {
+        return t instanceof S
+    }
+    const D = function (t, e, n) {
+        let r
+        if (!t) return y
+        if (typeof t === 'string') M[t] && (r = t), e && (M[t] = e, r = t)
+        else {
+            const i = t.name
+            M[i] = t, r = i
+        }
+        return !n && r && (y = r), r || !n && y
+    }
+    const v = function (t, e) {
+        if (m(t)) return t.clone()
+        const n = typeof e === 'object' ? e : {}
+        return n.date = t, n.args = arguments, new S(n)
+    }
+    const g = l
+    g.l = D, g.i = m, g.w = function (t, e) {
+        return v(t, {
+            locale: e.$L,
+            utc: e.$u,
+            x: e.$x,
+            $offset: e.$offset
+        })
+    }
+    var S = (function () {
+        function d(t) {
+            this.$L = D(t.locale, null, !0), this.parse(t)
+        }
+        const $ = d.prototype
+        return $.parse = function (t) {
+            this.$d = (function (t) {
+                const e = t.date
+                const n = t.utc
+                if (e === null) return new Date(NaN)
+                if (g.u(e)) return new Date()
+                if (e instanceof Date) return new Date(e)
+                if (typeof e === 'string' && !/Z$/i.test(e)) {
+                    const r = e.match(h)
+                    if (r) {
+                        const i = r[2] - 1 || 0
+                        const s = (r[7] || '0').substring(0, 3)
+                        return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3]
+								|| 1, r[4] || 0, r[5] || 0, r[6] || 0, s)
+                    }
+                }
+                return new Date(e)
+            }(t)), this.$x = t.x || {}, this.init()
+        }, $.init = function () {
+            const t = this.$d
+            this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(),
+            this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds()
+        }, $.$utils = function () {
+            return g
+        }, $.isValid = function () {
+            return !(this.$d.toString() === 'Invalid Date')
+        }, $.isSame = function (t, e) {
+            const n = v(t)
+            return this.startOf(e) <= n && n <= this.endOf(e)
+        }, $.isAfter = function (t, e) {
+            return v(t) < this.startOf(e)
+        }, $.isBefore = function (t, e) {
+            return this.endOf(e) < v(t)
+        }, $.$g = function (t, e, n) {
+            return g.u(t) ? this[e] : this.set(n, t)
+        }, $.unix = function () {
+            return Math.floor(this.valueOf() / 1e3)
+        }, $.valueOf = function () {
+            return this.$d.getTime()
+        }, $.startOf = function (t, a) {
+            const h = this
+            const c = !!g.u(a) || a
+            const d = g.p(t)
+            const $ = function (t, e) {
+                const n = g.w(h.$u ? Date.UTC(h.$y, e, t) : new Date(h.$y, e, t), h)
+                return c ? n : n.endOf(i)
+            }
+            const l = function (t, e) {
+                return g.w(h.toDate()[t].apply(h.toDate('s'), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), h)
+            }
+            const y = this.$W
+            const M = this.$M
+            const m = this.$D
+            const D = `set${this.$u ? 'UTC' : ''}`
+            switch (d) {
+            case o:
+                return c ? $(1, 0) : $(31, 11)
+            case u:
+                return c ? $(1, M) : $(0, M + 1)
+            case s:
+                var v = this.$locale().weekStart || 0
+                var S = (y < v ? y + 7 : y) - v
+                return $(c ? m - S : m + (6 - S), M)
+            case i:
+            case f:
+                return l(`${D}Hours`, 0)
+            case r:
+                return l(`${D}Minutes`, 1)
+            case n:
+                return l(`${D}Seconds`, 2)
+            case e:
+                return l(`${D}Milliseconds`, 3)
+            default:
+                return this.clone()
+            }
+        }, $.endOf = function (t) {
+            return this.startOf(t, !1)
+        }, $.$set = function (s, a) {
+            let h; const c = g.p(s)
+            const d = `set${this.$u ? 'UTC' : ''}`
+            const $ = (h = {}, h[i] = `${d}Date`, h[f] = `${d}Date`, h[u] = `${d}Month`, h[o] = `${d}FullYear`, h[r] = `${d}Hours`,
+            h[n] = `${d}Minutes`, h[e] = `${d}Seconds`, h[t] = `${d}Milliseconds`, h)[c]
+            const l = c === i ? this.$D + (a - this.$W) : a
+            if (c === u || c === o) {
+                const y = this.clone().set(f, 1)
+                y.$d[$](l), y.init(), this.$d = y.set(f, Math.min(this.$D, y.daysInMonth())).$d
+            } else $ && this.$d[$](l)
+            return this.init(), this
+        }, $.set = function (t, e) {
+            return this.clone().$set(t, e)
+        }, $.get = function (t) {
+            return this[g.p(t)]()
+        }, $.add = function (t, a) {
+            let f; const
+                h = this
+            t = Number(t)
+            const c = g.p(a)
+            const d = function (e) {
+                const n = v(h)
+                return g.w(n.date(n.date() + Math.round(e * t)), h)
+            }
+            if (c === u) return this.set(u, this.$M + t)
+            if (c === o) return this.set(o, this.$y + t)
+            if (c === i) return d(1)
+            if (c === s) return d(7)
+            const $ = (f = {}, f[n] = 6e4, f[r] = 36e5, f[e] = 1e3, f)[c] || 1
+            const l = this.$d.getTime() + t * $
+            return g.w(l, this)
+        }, $.subtract = function (t, e) {
+            return this.add(-1 * t, e)
+        }, $.format = function (t) {
+            const e = this
+            if (!this.isValid()) return 'Invalid Date'
+            const n = t || 'YYYY-MM-DDTHH:mm:ssZ'
+            const r = g.z(this)
+            const i = this.$locale()
+            const s = this.$H
+            const u = this.$m
+            const a = this.$M
+            const o = i.weekdays
+            const f = i.months
+            const h = function (t, r, i, s) {
+                return t && (t[r] || t(e, n)) || i[r].substr(0, s)
+            }
+            const d = function (t) {
+                return g.s(s % 12 || 12, t, '0')
+            }
+            const $ = i.meridiem || function (t, e, n) {
+                const r = t < 12 ? 'AM' : 'PM'
+                return n ? r.toLowerCase() : r
+            }
+            const l = {
+                YY: String(this.$y).slice(-2),
+                YYYY: this.$y,
+                M: a + 1,
+                MM: g.s(a + 1, 2, '0'),
+                MMM: h(i.monthsShort, a, f, 3),
+                MMMM: h(f, a),
+                D: this.$D,
+                DD: g.s(this.$D, 2, '0'),
+                d: String(this.$W),
+                dd: h(i.weekdaysMin, this.$W, o, 2),
+                ddd: h(i.weekdaysShort, this.$W, o, 3),
+                dddd: o[this.$W],
+                H: String(s),
+                HH: g.s(s, 2, '0'),
+                h: d(1),
+                hh: d(2),
+                a: $(s, u, !0),
+                A: $(s, u, !1),
+                m: String(u),
+                mm: g.s(u, 2, '0'),
+                s: String(this.$s),
+                ss: g.s(this.$s, 2, '0'),
+                SSS: g.s(this.$ms, 3, '0'),
+                Z: r
+            }
+            return n.replace(c, (t, e) => e || l[t] || r.replace(':', ''))
+        }, $.utcOffset = function () {
+            return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
+        }, $.diff = function (t, f, h) {
+            let c; const d = g.p(f)
+            const $ = v(t)
+            const l = 6e4 * ($.utcOffset() - this.utcOffset())
+            const y = this - $
+            let M = g.m(this, $)
+            return M = (c = {}, c[o] = M / 12, c[u] = M, c[a] = M / 3, c[s] = (y - l) / 6048e5, c[i] = (y - l) / 864e5, c[r] =					y / 36e5, c[n] = y / 6e4, c[e] = y / 1e3, c)[d] || y, h ? M : g.a(M)
+        }, $.daysInMonth = function () {
+            return this.endOf(u).$D
+        }, $.$locale = function () {
+            return M[this.$L]
+        }, $.locale = function (t, e) {
+            if (!t) return this.$L
+            const n = this.clone()
+            const r = D(t, e, !0)
+            return r && (n.$L = r), n
+        }, $.clone = function () {
+            return g.w(this.$d, this)
+        }, $.toDate = function () {
+            return new Date(this.valueOf())
+        }, $.toJSON = function () {
+            return this.isValid() ? this.toISOString() : null
+        }, $.toISOString = function () {
+            return this.$d.toISOString()
+        }, $.toString = function () {
+            return this.$d.toUTCString()
+        }, d
+    }())
+    const p = S.prototype
+    return v.prototype = p, [
+        ['$ms', t],
+        ['$s', e],
+        ['$m', n],
+        ['$H', r],
+        ['$W', i],
+        ['$M', u],
+        ['$y', o],
+        ['$D', f]
+    ].forEach((t) => {
+        p[t[1]] = function (e) {
+            return this.$g(e, t[0], t[1])
+        }
+    }), v.extend = function (t, e) {
+        return t.$i || (t(e, S, v), t.$i = !0), v
+    }, v.locale = D, v.isDayjs = m, v.unix = function (t) {
+        return v(1e3 * t)
+    }, v.en = M[y], v.Ls = M, v.p = {}, v
+}))

+ 3 - 1
manifest.json

@@ -17,7 +17,9 @@
             "delay" : 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Camera" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */

+ 9 - 0
pages.json

@@ -44,6 +44,15 @@
 
 		},
 		{
+			"path" : "pages/order/freightOrder",
+			"style" :
+			{
+				"navigationBarTitleText": "运费查询",
+				"enablePullDownRefresh": true
+			}
+
+		},
+		{
 			"path" : "pages/feedback/traceCamera",
 			"style" :
 			{

+ 6 - 0
pages/index/workTable.vue

@@ -40,6 +40,12 @@
           </view>
           <view class="grid-text">签收记录</view>
         </u-grid-item>
+        <u-grid-item @click="navTo('/pages/order/freightOrder')" :index="1">
+          <view class="home-icon icon-color01">
+            <i class="iconfont icon-tongji2"></i>
+          </view>
+          <view class="grid-text">运费查询</view>
+        </u-grid-item>
       </u-grid>
     </view>
 

+ 289 - 0
pages/order/freightOrder.vue

@@ -0,0 +1,289 @@
+<template>
+  <view class="">
+
+    <u-collapse  style="background: #fff">
+        <u-collapse-item
+            title="搜索"
+        >
+          <div style="padding: 5px 10px">
+            <u--input
+                placeholder="关键字(发货单号/专线名称)"
+                border="surround"
+                v-model="search.keyWord"
+            ></u--input>
+            <div style="height: 5px"></div>
+            <div @click="dateClickStart" class="u-input u-border u-input--radius u-input--square" style="padding: 9px 9px;border-radius:4px">{{beginTimeTitle}}</div>
+            <div style="height: 5px"></div>
+            <div @click="dateClickEnd" class="u-input u-border u-input--radius u-input--square" style="padding: 9px 9px;border-radius:4px">{{endTimeTitle}}</div>
+            <div style="height: 5px"></div>
+            <u-checkbox-group
+                v-model="checkboxValue6"
+                @change="checkboxChange"
+            >
+              <u-checkbox
+                  :customStyle="{marginRight: '16px'}"
+                  v-for="(item, index) in checkboxList6"
+                  :key="index"
+                  :label="item.name"
+                  :name="item.value"
+              >
+              </u-checkbox>
+            </u-checkbox-group>
+            <div style="height: 8px"></div>
+            <u-button @click="searchBill" :plain="true" type="primary" text="搜  索"></u-button>
+          </div>
+        </u-collapse-item>
+      </u-collapse>
+    <div class="total-con">合计:{{collection.truckMoneySum}}元,订单{{collection.freightCountSum}}条</div>
+    <uni-list>
+      <uni-list-item style="margin-top: 0;padding-top: 0" v-for="(item,index) in billList" :key="item.id" :index="index" :threshold="0">
+        <template slot="body">
+          <uni-card>
+            <view class="demo-layout">
+              <div class="do-con">
+                <div class="do-code">{{item.deliveryBillCode}}</div>
+                <div class="do-status">
+                  <u-tag v-if="item.voidFlag == 1" text="已作废" plain size="mini" type="error"></u-tag>
+                  <u-tag v-else-if="item.billState == 0" text="待派车" plain size="mini" type="warning"></u-tag>
+                  <u-tag v-else-if="item.billState == 1" text="待装车" plain size="mini"></u-tag>
+                  <u-tag v-else-if="item.billState == 2" text="待发车" plain size="mini" type="warning"></u-tag>
+                  <u-tag v-else-if="item.billState == 3" text="运输中" plain size="mini"></u-tag>
+                  <u-tag v-else-if="item.billState == 4" text="待结算" plain size="mini" type="error"></u-tag>
+                  <u-tag color="#333" v-else-if="item.billState == 10" text="已完成" plain size="mini"></u-tag>
+                </div>
+              </div>
+              <view>
+                <span v-if="item.idBranchLine == 0">{{ '干线:' + item.mainLineName }}</span>
+                <span v-else>{{ '支线:' + item.branchLineName }}</span>
+              </view>
+              <view>
+                <span v-if="item.departTime">发车时间:{{item.departTime.substring(0, 19)}}</span>
+              </view>
+              <view>
+              运费金额:<span style="margin: 0 5px;font-weight: bold;color: #e4493c;font-size: 15px">{{ item.truckMoney }}</span>元
+              </view>
+              <view>{{ item.billMemo }}</view>
+            </view>
+          </uni-card>
+        </template>
+      </uni-list-item>
+    </uni-list>
+    <view v-show="isLoadMore && !signVisible">
+      <uni-load-more :status="loadStatus" :content-text="contentText"  showIcon @clickLoadMore="loadMoreBill()"></uni-load-more>
+    </view>
+    <u-datetime-picker
+        :show="show"
+        @cancel="show=false"
+        @confirm="selectDate"
+        v-model="value1"
+        mode="date"
+    ></u-datetime-picker>
+  </view>
+</template>
+
+<script>
+import request from '@/common/libs/request.js';
+import dayjs from '../../libs/util/dayjs.js';
+
+export default {
+  data() {
+    return {
+      dateType:0,
+      collection:{},
+      show: false,
+      value1: Number(new Date()),
+      checkboxValue6: [3, 10],
+      checkboxList6: [{
+        name: '运输中',
+        value: 3,
+        disabled: false
+      },
+        {
+          name: '完成',
+          value: 10,
+          disabled: false
+        }
+      ],
+      contentText: {
+        contentdown: '查看更多',
+        contentrefresh: '加载中',
+        contentnomore: '没有更多数据了'
+      },
+      search: {
+        keyWord: '',
+        beginTime: '',
+        endTime: '',
+        billStates: '',
+        voidFlag: 0
+      },
+      beginTimeTitle:"发车开始日期",
+      endTimeTitle:"发车结束日期",
+      signVisible:false,
+      fabPattern: {
+        color: '#7A7E83',
+        backgroundColor: '#fff',
+        selectedColor: '#007AFF',
+        buttonColor: '#007AFF',
+        iconColor: '#fff'
+      },
+      billList: [],
+      page: {
+        pageIndex: 1,
+        pageSize: 20
+      },
+      isLoadMore: true,
+      loadStatus: 'noMore',
+    }
+  },
+  onLoad() {
+    this.getSignBillList();
+  },
+
+
+  onPullDownRefresh() {
+    this.billList = [];
+    this.search = {
+      keyWord: '',
+      beginTime: '',
+      endTime: '',
+      billStates: '',
+      voidFlag: 0
+    }
+    this.pageIndex = 1;
+    this.getSignBillList();
+  },
+  methods: {
+    selectDate(data) {
+      let deliveryDate = dayjs(data.value).format("YYYY-MM-DD")
+      if(this.dateType==1){
+        this.search.beginTime = deliveryDate
+        this.beginTimeTitle = deliveryDate
+      }
+      if(this.dateType==2){
+        this.search.endTime = deliveryDate
+        this.endTimeTitle = deliveryDate
+      }
+      this.show = false;
+
+    },
+    dateClickStart(){
+      let _that = this;
+      _that.dateType = 1
+      _that.show = true;
+      _that.value1 = Number(new Date());
+    },
+    dateClickEnd(){
+      let _that = this;
+      _that.show = true;
+      _that.dateType = 2
+      _that.value1 = Number(new Date());
+    },
+    checkboxChange(n) {
+      // console.log('change', n);
+      // console.log(this.checkboxValue6);
+    },
+    getSignBillList: function () {
+      let _that = this;
+      if(_that.beginTimeTitle=='发车开始日期' || _that.endTimeTitle=='发车结束日期'){
+        _that.search.beginTime = "";
+        _that.search.endTime = "";
+      }
+      if (_that.checkboxValue6.length > 0) {
+        _that.search.billStates = _that.checkboxValue6.join(',')
+      }else {
+        _that.search.billStates = ""
+      }
+      const params = _that.search;
+      // console.log(params);
+      let listData = {
+        params: JSON.stringify(params),
+        page: JSON.stringify(_that.page)
+      }
+      request.httpPost("/dnyDriver/getDeliveryBillFreightList", listData, true).then(res => {
+        // console.log("res1111", res);
+        uni.stopPullDownRefresh();
+        if (!res.data || res.data.length == 0) {
+          this.loadStatus = "noMore";
+          return;
+        }
+        this.collection = res.collection;
+        this.billList = this.billList.concat(res.data);
+
+        this.loadStatus = "more";
+        // supplierIndex = 0;
+      });
+    },
+    searchBill() {
+      const _that = this;
+      _that.billList = [];
+      _that.pageIndex = 1;
+      _that.getSignBillList();
+    },
+    loadMoreBill: function () {
+      this.loadStatus = "loading";
+      setTimeout(() => {
+        this.page.pageIndex += 1;
+        this.getSignBillList();
+      }, 100);
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.total-con{
+  padding: 5px 10px;
+}
+.collapse-con{
+  padding: 10px;
+}
+.do-con{
+  display: flex;
+  justify-content:space-between;
+}
+.tag-con {
+  color: #e4493c;
+  margin-right: 20rpx;
+}
+/deep/ .uni-list-item__container {
+  padding: 0rpx;
+}
+
+
+/deep/ .uni-list-item__container {
+  padding: 0 rpx;
+}
+/deep/ .uni-card uni-card--border{
+  padding: 0 rpx;
+}
+.card-actions {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  align-items: center;
+  height: 45px;
+  border-top: 1px #eee solid;
+}
+
+.card-actions-item {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.card-actions-item-text {
+  font-size: 12px;
+  color: #666;
+  margin-left: 5px;
+}
+
+.textTitle {
+  border-left: 0px solid #007AFF;
+  display: inline-block;
+  width: 180 rpx;
+  text-align: left;
+  margin-bottom: 5px;
+  color: #8799a3;
+}
+</style>
+

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
unpackage/dist/dev/app-plus/manifest.json