增加基本项目配置
This commit is contained in:
@@ -0,0 +1,352 @@
|
||||
<template>
|
||||
<div class="order-details pos-order-details">
|
||||
<div class="header acea-row row-middle">
|
||||
<div class="state">{{ title }}</div>
|
||||
<div class="data">
|
||||
<div class="order-num">订单:{{ orderInfo.orderId }}</div>
|
||||
<div>
|
||||
<span class="time">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="orderingUser acea-row row-middle">{{ orderInfo.nickname }}</div>
|
||||
<div class="address">
|
||||
<div class="name">
|
||||
{{ orderInfo.realName}}
|
||||
<span class="phone">{{ orderInfo.userPhone }}</span>
|
||||
</div>
|
||||
<div>{{ orderInfo.userAddress }}</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/line.jpg'" />
|
||||
</div>
|
||||
<div class="pos-order-goods">
|
||||
<div
|
||||
class="goods acea-row row-between-wrapper"
|
||||
v-for="(item, orderInfoIndex) in orderInfo.cartInfo"
|
||||
:key="orderInfoIndex"
|
||||
>
|
||||
<div class="picTxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="item.productInfo.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-between row-column">
|
||||
<div class="info line2">{{ item.productInfo.storeName }}</div>
|
||||
<div class="attr">{{ item.productInfo.suk }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="money">
|
||||
<div class="x-money">¥{{ item.productInfo.price }}</div>
|
||||
<div class="num">x{{ item.cartNum }}</div>
|
||||
<div class="y-money">¥{{ item.productInfo.otPrice ? item.productInfo.otPrice : 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="public-total">
|
||||
共{{ orderInfo.totalNum }}件商品,应支付
|
||||
<span class="money">¥{{ orderInfo.payPrice }}</span>
|
||||
( 邮费 ¥{{
|
||||
orderInfo.payPostage
|
||||
}}
|
||||
)
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="item acea-row row-between">
|
||||
<div>订单编号:</div>
|
||||
<div class="conter acea-row row-middle row-right">
|
||||
{{ orderInfo.orderId
|
||||
}}
|
||||
<span
|
||||
class="copy copy-data"
|
||||
@click="copyClipboard(orderInfo.orderId)"
|
||||
>复制</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div>下单时间:</div>
|
||||
<div class="conter">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div>支付状态:</div>
|
||||
<div class="conter">{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div>支付方式:</div>
|
||||
<div class="conter">{{ payType }}</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div>买家留言:</div>
|
||||
<div class="conter">{{ orderInfo.mark }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="item acea-row row-between">
|
||||
<div>支付金额:</div>
|
||||
<div class="conter">¥{{ orderInfo.totalPrice }}</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div>优惠券抵扣:</div>
|
||||
<div class="conter">-¥{{ orderInfo.couponPrice }}</div>
|
||||
</div>
|
||||
<div class="actualPay acea-row row-right">
|
||||
实付款:
|
||||
<span class="money font-color-red">¥{{ orderInfo.payPrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="wrapper"
|
||||
v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2"
|
||||
>
|
||||
<div class="item acea-row row-between">
|
||||
<div>配送方式:</div>
|
||||
<div class="conter" v-if="orderInfo.delivery_type === 'express'">快递</div>
|
||||
<div class="conter" v-if="orderInfo.delivery_type === 'send'">送货</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div v-if="orderInfo.delivery_type === 'express'">快递公司:</div>
|
||||
<div v-if="orderInfo.delivery_type === 'send'">送货人:</div>
|
||||
<div class="conter">{{ orderInfo.delivery_name }}</div>
|
||||
</div>
|
||||
<div class="item acea-row row-between">
|
||||
<div v-if="orderInfo.delivery_type === 'express'">快递单号:</div>
|
||||
<div v-if="orderInfo.delivery_type === 'send'">送货人电话:</div>
|
||||
<div class="conter">
|
||||
{{ orderInfo.delivery_id
|
||||
}}
|
||||
<span
|
||||
class="copy copy-data"
|
||||
@click="copyClipboard(orderInfo.delivery_id)"
|
||||
>复制</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:100rpx;"></div>
|
||||
<div class="footer acea-row row-right row-middle">
|
||||
<div class="more"></div>
|
||||
<div class="bnt cancel" @click="modify(0)" v-if="types == 0">一键改价</div>
|
||||
<div class="bnt cancel" @click="modify(0)" v-if="types == -1">立即退款</div>
|
||||
<div
|
||||
class="bnt cancel"
|
||||
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
|
||||
@click="offlinePay"
|
||||
>确认付款</div>
|
||||
<div
|
||||
class="bnt delivery"
|
||||
v-if="types == 1"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/GoodsDeliver/index',query: { id : orderInfo.orderId}})"
|
||||
>去发货</div>
|
||||
</div>
|
||||
<PriceChange
|
||||
:change="change"
|
||||
:orderInfo="orderInfo"
|
||||
v-on:closechange="changeclose($event)"
|
||||
v-on:savePrice="savePrice"
|
||||
:status="status"
|
||||
></PriceChange>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import PriceChange from "@/components/PriceChange";
|
||||
import DataFormat from "@/components/DataFormat";
|
||||
import {
|
||||
getAdminOrderDetail,
|
||||
setAdminOrderPrice,
|
||||
setAdminOrderRemark,
|
||||
setOfflinePay,
|
||||
setOrderRefund
|
||||
} from "@/api/admin";
|
||||
import { required, num } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
import { copyClipboard } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "AdminOrder",
|
||||
components: {
|
||||
PriceChange,
|
||||
DataFormat
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
order: false,
|
||||
change: false,
|
||||
order_id: "",
|
||||
orderInfo: {
|
||||
_status: {}
|
||||
},
|
||||
status: "",
|
||||
title: "",
|
||||
payType: "",
|
||||
types: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"$yroute.query.oid": function(newVal) {
|
||||
let that = this;
|
||||
if (newVal != undefined) {
|
||||
that.order_id = newVal;
|
||||
that.getIndex();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.order_id = this.$yroute.query.oid;
|
||||
this.getIndex();
|
||||
},
|
||||
methods: {
|
||||
copyClipboard,
|
||||
more: function() {
|
||||
this.order = !this.order;
|
||||
},
|
||||
modify: function(status) {
|
||||
this.change = true;
|
||||
this.status = status;
|
||||
},
|
||||
changeclose: function(msg) {
|
||||
this.change = msg;
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
getAdminOrderDetail(that.order_id).then(
|
||||
res => {
|
||||
that.orderInfo = res.data;
|
||||
that.types = res.data._status._type;
|
||||
that.title = res.data._status._title;
|
||||
that.payType = res.data._status._payType;
|
||||
},
|
||||
err => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async savePrice(opt) {
|
||||
let that = this,
|
||||
data = {},
|
||||
price = opt.price,
|
||||
remark = opt.remark,
|
||||
refund_price = opt.refund_price.toString();
|
||||
data.orderId = that.orderInfo.orderId;
|
||||
if (that.status == 0 && that.orderInfo.refundStatus === 0) {
|
||||
try {
|
||||
await this.$validator({
|
||||
price: [
|
||||
required(required.message("金额")),
|
||||
num(num.message("金额"))
|
||||
]
|
||||
}).validate({ price });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.price = price;
|
||||
setAdminOrderPrice(data).then(
|
||||
function() {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: "改价成功",
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.getIndex();
|
||||
},
|
||||
function() {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: "改价失败",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
} else if (that.status == 0 && that.orderInfo.refundStatus === 1) {
|
||||
try {
|
||||
await this.$validator({
|
||||
refund_price: [
|
||||
required(required.message("金额")),
|
||||
num(num.message("金额"))
|
||||
]
|
||||
}).validate({ refund_price });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.price = refund_price;
|
||||
data.type = opt.type;
|
||||
setOrderRefund(data).then(
|
||||
res => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.getIndex();
|
||||
},
|
||||
err => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.getIndex();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
await this.$validator({
|
||||
remark: [required(required.message("备注"))]
|
||||
}).validate({ remark });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.remark = remark;
|
||||
setAdminOrderRemark(data).then(
|
||||
res => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.getIndex();
|
||||
},
|
||||
err => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
offlinePay: function() {
|
||||
setOfflinePay({ order_id: this.orderInfo.order_id }).then(
|
||||
res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.getIndex();
|
||||
},
|
||||
err => {
|
||||
wx.showToast({
|
||||
title: err.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,316 @@
|
||||
<template>
|
||||
<div class="pos-order-list" ref="container">
|
||||
<div class="nav acea-row row-around row-middle">
|
||||
<div class="item" :class="where.status == 0 ? 'on' : ''" @click="changeStatus(0)">待付款</div>
|
||||
<div class="item" :class="where.status == 1 ? 'on' : ''" @click="changeStatus(1)">待发货</div>
|
||||
<div class="item" :class="where.status == 2 ? 'on' : ''" @click="changeStatus(2)">待收货</div>
|
||||
<div class="item" :class="where.status == 3 ? 'on' : ''" @click="changeStatus(3)">待评价</div>
|
||||
<div class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">已完成</div>
|
||||
<div class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">退款</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, listIndex) in list" :key="listIndex">
|
||||
<div class="order-num acea-row row-middle" @click="toDetail(item)">
|
||||
<span>订单号:{{ item.orderId }}</span>
|
||||
<span class="time">
|
||||
<span>下单时间:</span>
|
||||
<data-format :data="item.addTime"></data-format>
|
||||
</span>
|
||||
</div>
|
||||
<div class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
|
||||
<div class="goods acea-row row-between-wrapper" @click="toDetail(item)">
|
||||
<div class="picTxt acea-row row-between-wrapper">
|
||||
<div class="pictrue">
|
||||
<img :src="val.productInfo.image" />
|
||||
</div>
|
||||
<div class="text acea-row row-between row-column">
|
||||
<div class="info line2">{{ val.productInfo.storeName }}</div>
|
||||
<div class="attr" v-if="val.productInfo.suk">{{ val.productInfo.suk }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="money">
|
||||
<div class="x-money">¥{{ val.productInfo.price }}</div>
|
||||
<div class="num">x{{ val.cartNum }}</div>
|
||||
<div class="y-money">¥{{ val.productInfo.otPrice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="public-total">
|
||||
共{{ item.totalNum }}件商品,应支付
|
||||
<span class="money">¥{{ item.payPrice }}</span>
|
||||
( 邮费 ¥{{
|
||||
item.totalPostage
|
||||
}}
|
||||
)
|
||||
</div>
|
||||
<div class="operation acea-row row-between-wrapper">
|
||||
<div class="more">
|
||||
<!-- <div class="iconfont icon-gengduo" @click="more(index)"></div>-->
|
||||
<!-- <div class="order" v-show="current === index">-->
|
||||
<!-- <div class="items">-->
|
||||
<!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="arrow"></div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<div class="acea-row row-middle">
|
||||
<div class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</div>
|
||||
<div
|
||||
class="bnt"
|
||||
@click="modify(item, 0)"
|
||||
v-if="where.status == -3 && item.refundStatus === 1"
|
||||
>立即退款</div>
|
||||
<div
|
||||
class="bnt cancel"
|
||||
v-if="item.pay_type === 'offline' && item.paid === 0"
|
||||
@click="offlinePay(item)"
|
||||
>确认付款</div>
|
||||
<div
|
||||
class="bnt"
|
||||
v-if="where.status == 1"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/GoodsDeliver/index',query: { id:item.orderId }})"
|
||||
>去发货</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
<PriceChange
|
||||
:change="change"
|
||||
:orderInfo="orderInfo"
|
||||
v-on:closechange="changeclose($event)"
|
||||
v-on:savePrice="savePrice"
|
||||
:status="status"
|
||||
></PriceChange>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import PriceChange from "@/components/PriceChange";
|
||||
import Loading from "@/components/Loading";
|
||||
import DataFormat from "@/components/DataFormat";
|
||||
import {
|
||||
getAdminOrderList,
|
||||
setAdminOrderPrice,
|
||||
setAdminOrderRemark,
|
||||
setOfflinePay,
|
||||
setOrderRefund
|
||||
} from "@/api/admin";
|
||||
import { required, num } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
export default {
|
||||
name: "AdminOrderList",
|
||||
components: {
|
||||
PriceChange,
|
||||
Loading,
|
||||
DataFormat
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
current: "",
|
||||
change: false,
|
||||
types: 0,
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 5,
|
||||
status: 0
|
||||
},
|
||||
list: [],
|
||||
loaded: false,
|
||||
loading: false,
|
||||
orderInfo: {},
|
||||
status: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"$yroute.query.types": function(newVal) {
|
||||
let that = this;
|
||||
if (newVal != undefined) {
|
||||
that.where.status = newVal;
|
||||
that.init();
|
||||
}
|
||||
},
|
||||
types: function() {
|
||||
this.getIndex();
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
let that = this;
|
||||
that.where.status = that.$yroute.query.types;
|
||||
that.current = "";
|
||||
that.getIndex();
|
||||
},
|
||||
onReachBottom() {
|
||||
!that.loading && that.getIndex();
|
||||
},
|
||||
methods: {
|
||||
more: function(index) {
|
||||
if (this.current === index) this.current = "";
|
||||
else this.current = index;
|
||||
},
|
||||
modify: function(item, status) {
|
||||
this.change = true;
|
||||
this.orderInfo = item;
|
||||
this.status = status;
|
||||
},
|
||||
changeclose: function(msg) {
|
||||
this.change = msg;
|
||||
},
|
||||
async savePrice(opt) {
|
||||
let that = this,
|
||||
data = {},
|
||||
price = opt.price.toString(),
|
||||
refund_price = opt.refund_price.toString(),
|
||||
refund_status = that.orderInfo.refundStatus,
|
||||
remark = opt.remark;
|
||||
data.orderId = that.orderInfo.orderId;
|
||||
if (that.status == 0 && refund_status === 0) {
|
||||
try {
|
||||
await this.$validator({
|
||||
price: [
|
||||
required(required.message("金额")),
|
||||
num(num.message("金额"))
|
||||
]
|
||||
}).validate({ price });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.price = price;
|
||||
setAdminOrderPrice(data).then(
|
||||
function() {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: "改价成功",
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
that.init();
|
||||
},
|
||||
function() {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: "改价失败",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
} else if (that.status == 0 && refund_status === 1) {
|
||||
try {
|
||||
await this.$validator({
|
||||
refund_price: [
|
||||
required(required.message("金额")),
|
||||
num(num.message("金额"))
|
||||
]
|
||||
}).validate({ refund_price });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.price = refund_price;
|
||||
data.type = opt.type;
|
||||
setOrderRefund(data).then(
|
||||
res => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.init();
|
||||
},
|
||||
err => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
try {
|
||||
await this.$validator({
|
||||
remark: [required(required.message("备注"))]
|
||||
}).validate({ remark });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
data.remark = remark;
|
||||
setAdminOrderRemark(data).then(
|
||||
res => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.init();
|
||||
},
|
||||
err => {
|
||||
that.change = false;
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
init: function() {
|
||||
this.list = [];
|
||||
this.where.page = 1;
|
||||
this.loaded = false;
|
||||
this.loading = false;
|
||||
this.getIndex();
|
||||
this.current = "";
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
if (that.loading || that.loaded) return;
|
||||
that.loading = true;
|
||||
getAdminOrderList(that.where).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
that.where.page = that.where.page + 1;
|
||||
},
|
||||
err => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
changeStatus: function(val) {
|
||||
if (this.where.status != val) {
|
||||
this.where.status = val;
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
toDetail: function(item) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/orderAdmin/AdminOrder/main",
|
||||
query: { oid: item.orderId }
|
||||
});
|
||||
},
|
||||
offlinePay: function(item) {
|
||||
setOfflinePay({ order_id: item.order_id }).then(
|
||||
res => {
|
||||
this.$wx.showToast({ title: res.msg, icon: "none", duration: 2000 });
|
||||
this.init();
|
||||
},
|
||||
error => {
|
||||
this.$dialog.error(error.msg);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<div class="deliver-goods">
|
||||
<header>
|
||||
<div class="order-num acea-row row-between-wrapper">
|
||||
<div class="num line1">订单号:{{ delivery.orderId }}</div>
|
||||
<div class="name line1">{{ delivery.nickname }}</div>
|
||||
</div>
|
||||
<div class="address">
|
||||
<div class="name">
|
||||
{{ delivery.realName
|
||||
}}
|
||||
<span class="phone">{{ delivery.userPhone }}</span>
|
||||
</div>
|
||||
<div>{{ delivery.userAddress }}</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/line.jpg'" />
|
||||
</div>
|
||||
</header>
|
||||
<div class="wrapper">
|
||||
<div class="item acea-row row-between-wrapper">
|
||||
<div>发货方式</div>
|
||||
<div class="mode acea-row row-middle row-right">
|
||||
<div
|
||||
class="goods"
|
||||
:class="active === typesIndex ? 'on' : ''"
|
||||
v-for="(item, typesIndex) in types"
|
||||
:key="typesIndex"
|
||||
@click="changeType(item, typesIndex)"
|
||||
>
|
||||
{{ item.title }}
|
||||
<span class="iconfont icon-xuanzhong2"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" v-show="active === 0">
|
||||
<div class="item acea-row row-between-wrapper">
|
||||
<div>快递公司</div>
|
||||
<input type="text" placeholder="填写快递公司" v-model="delivery_name" class="mode" />
|
||||
</div>
|
||||
<div class="item acea-row row-between-wrapper">
|
||||
<div>快递单号</div>
|
||||
<input type="text" placeholder="填写快递单号" v-model="delivery_id" class="mode" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="list" v-show="active === 1">
|
||||
<div class="item acea-row row-between-wrapper">
|
||||
<div>送货人</div>
|
||||
<input type="text" placeholder="填写送货人" v-model="delivery_name" class="mode" />
|
||||
</div>
|
||||
<div class="item acea-row row-between-wrapper">
|
||||
<div>送货电话</div>
|
||||
<input type="text" placeholder="填写送货电话" v-model="delivery_id" class="mode" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:100rpx;"></div>
|
||||
<div class="confirm" @click="saveInfo">确认提交</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getAdminOrderDelivery, setAdminOrderDelivery } from "@/api/admin";
|
||||
import { getLogistics } from "@/api/public";
|
||||
import { required } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
|
||||
export default {
|
||||
name: "GoodsDeliver",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
types: [
|
||||
{
|
||||
type: "express",
|
||||
title: "发货"
|
||||
}
|
||||
// {
|
||||
// type: "send",
|
||||
// title: "送货"
|
||||
// },
|
||||
// {
|
||||
// type: "fictitious",
|
||||
// title: "无需发货"
|
||||
// }
|
||||
],
|
||||
active: 0,
|
||||
order_id: "",
|
||||
delivery: [],
|
||||
logistics: [],
|
||||
delivery_type: "express",
|
||||
delivery_name: "",
|
||||
delivery_id: ""
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"$yroute.query.oid": function(newVal) {
|
||||
let that = this;
|
||||
if (newVal != undefined) {
|
||||
that.order_id = newVal;
|
||||
that.getIndex();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.order_id = this.$yroute.query.oid;
|
||||
this.getIndex();
|
||||
//this.getLogistics();
|
||||
},
|
||||
methods: {
|
||||
changeType: function(item, index) {
|
||||
this.active = index;
|
||||
this.delivery_type = item.type;
|
||||
this.delivery_name = "";
|
||||
this.delivery_id = "";
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
getAdminOrderDelivery(that.order_id).then(
|
||||
res => {
|
||||
that.delivery = res.data;
|
||||
},
|
||||
error => {
|
||||
wx.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
getLogistics: function() {
|
||||
let that = this;
|
||||
getLogistics().then(
|
||||
res => {
|
||||
that.logistics = res.data;
|
||||
},
|
||||
error => {
|
||||
wx.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async saveInfo() {
|
||||
let that = this,
|
||||
delivery_type = that.delivery_type,
|
||||
delivery_name = that.delivery_name,
|
||||
delivery_id = that.delivery_id,
|
||||
save = {};
|
||||
save.orderId = that.order_id;
|
||||
save.deliveryType = that.delivery_type;
|
||||
switch (delivery_type) {
|
||||
case "send":
|
||||
try {
|
||||
await this.$validator({
|
||||
delivery_name: [required(required.message("快递公司"))],
|
||||
delivery_id: [required(required.message("快递单号"))]
|
||||
}).validate({ delivery_name, delivery_id });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
save.delivery_name = delivery_name;
|
||||
save.delivery_id = delivery_id;
|
||||
that.setInfo(save);
|
||||
break;
|
||||
case "express":
|
||||
try {
|
||||
await this.$validator({
|
||||
delivery_name: [required(required.message("发货人姓名"))],
|
||||
delivery_id: [required(required.message("发货人电话"))]
|
||||
}).validate({ delivery_name, delivery_id });
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
save.deliveryName = delivery_name;
|
||||
save.deliveryId = delivery_id;
|
||||
that.setInfo(save);
|
||||
break;
|
||||
}
|
||||
},
|
||||
setInfo: function(item) {
|
||||
let that = this;
|
||||
setAdminOrderDelivery(item).then(
|
||||
res => {
|
||||
wx.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
that.$yrouter.go(-1);
|
||||
},
|
||||
error => {
|
||||
wx.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div class="OrderCancellation">
|
||||
<div class="header"></div>
|
||||
<div class="whiteBg">
|
||||
<div class="input">
|
||||
<input type="number" placeholder="0" v-model="verify_code" />
|
||||
</div>
|
||||
<div class="bnt" @click="storeCancellation">立即核销</div>
|
||||
</div>
|
||||
<div class="scan" v-if="iswechat">
|
||||
<img :src="$VUE_APP_RESOURCES_URL+'/images/scan.gif'" @click="openQRCode" />
|
||||
</div>
|
||||
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.OrderCancellation .header {
|
||||
background: url("https://h5.dayouqiantu.cn/static/images/writeOffBg.jpg") no-repeat;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.OrderCancellation .whiteBg {
|
||||
width: 6.9rem;
|
||||
background-color: #fff;
|
||||
margin: -0.93rem auto 0 auto;
|
||||
padding-top: 0.8rem;
|
||||
border-radius: 0.06rem 0.06rem 0 0;
|
||||
}
|
||||
.OrderCancellation .whiteBg .input {
|
||||
width: 5.8rem;
|
||||
margin: 0 auto;
|
||||
border-bottom: 0.01rem solid #eee;
|
||||
}
|
||||
.OrderCancellation .whiteBg .input input {
|
||||
padding-bottom: 0.25rem;
|
||||
font-size: 0.6rem;
|
||||
color: #282828;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.OrderCancellation .whiteBg .bnt {
|
||||
font-size: 0.32rem;
|
||||
color: #fff;
|
||||
width: 5.8rem;
|
||||
height: 0.86rem;
|
||||
border-radius: 0.43rem;
|
||||
background-image: linear-gradient(to right, #f67a38 0%, #f11b09 100%);
|
||||
background-image: -webkit-linear-gradient(to right, #f67a38 0%, #f11b09 100%);
|
||||
background-image: -moz-linear-gradient(to right, #f67a38 0%, #f11b09 100%);
|
||||
text-align: center;
|
||||
line-height: 0.86rem;
|
||||
margin: 0.55rem auto 0 auto;
|
||||
}
|
||||
.OrderCancellation .scan {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
margin: 1.1rem auto 0 auto;
|
||||
}
|
||||
.OrderCancellation .scan img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import WriteOff from "@/components/WriteOff";
|
||||
import { isWeixin } from "@/utils";
|
||||
// import { wechatEvevt } from "@/libs/wechat";
|
||||
import { orderVerific } from "@/api/order";
|
||||
const NAME = "OrderCancellation";
|
||||
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
WriteOff
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
iShidden: true,
|
||||
iswechat: isWeixin(),
|
||||
orderInfo: {},
|
||||
verify_code: ""
|
||||
};
|
||||
},
|
||||
mounted: function() {},
|
||||
methods: {
|
||||
cancel: function(res) {
|
||||
this.iShidden = res;
|
||||
},
|
||||
confirm: function() {
|
||||
orderVerific(this.verify_code, 1)
|
||||
.then(res => {
|
||||
this.iShidden = true;
|
||||
this.verify_code = "";
|
||||
this.$wx.showToast({ title: res.msg, icon: 'none', duration: 2000 });
|
||||
})
|
||||
.catch(res => {
|
||||
this.$dialog.error(res.msg);
|
||||
});
|
||||
},
|
||||
storeCancellation: function() {
|
||||
let ref = /[0-9]{12}/;
|
||||
if (!this.verify_code) return this.$dialog.error("请输入核销码");
|
||||
if (!ref.test(this.verify_code))
|
||||
return this.$dialog.error("请输入正确的核销码");
|
||||
wx.showLoading({ title: "查询中" });
|
||||
orderVerific(this.verify_code, 0)
|
||||
.then(res => {
|
||||
wx.hideLoading();
|
||||
this.orderInfo = res.data;
|
||||
this.iShidden = false;
|
||||
})
|
||||
.catch(() => {
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
openQRCode: function() {
|
||||
let that = this;
|
||||
// wechatEvevt("scanQRCode", {
|
||||
// needResult: 1,
|
||||
// scanType: ["qrCode", "barCode"]
|
||||
// })
|
||||
// .then(res => {
|
||||
// if (res.resultStr) {
|
||||
// that.verify_code = res.resultStr;
|
||||
// that.storeCancellation();
|
||||
// } else {
|
||||
// wx.showToast({
|
||||
// title: '没有扫描到什么!',
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// .catch(res => {
|
||||
// if (res.is_ready) {
|
||||
// res.wx.scanQRCode({
|
||||
// needResult: 1,
|
||||
// scanType: ["qrCode", "barCode"],
|
||||
// success: function(res) {
|
||||
// that.verify_code = res.resultStr;
|
||||
// that.storeCancellation();
|
||||
// },
|
||||
// fail: function(res) {
|
||||
// if (res.errMsg == "scanQRCode:permission denied") {
|
||||
// wx.showToast({
|
||||
// title: '没有权限',
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="order-index" ref="container">
|
||||
<div class="header acea-row">
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/AdminOrderList/index',query:{types:0}})"
|
||||
>
|
||||
<div class="num">{{ census.orderCount.unpaidCount }}</div>
|
||||
<div>待付款</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/AdminOrderList/index',query:{types:1}})"
|
||||
>
|
||||
<div class="num">{{ census.orderCount.unshippedCount }}</div>
|
||||
<div>待发货</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/AdminOrderList/index',query:{types:2}})"
|
||||
>
|
||||
<div class="num">{{ census.orderCount.receivedCount }}</div>
|
||||
<div>待收货</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/AdminOrderList/index',query:{types:3}})"
|
||||
>
|
||||
<div class="num">{{ census.orderCount.evaluatedCount }}</div>
|
||||
<div>待评价</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/AdminOrderList/index',query:{types:3}})"
|
||||
>
|
||||
<div class="num">{{ census.orderCount.refundCount }}</div>
|
||||
<div>退款</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="title">
|
||||
<span class="iconfont icon-shujutongji"></span>数据统计
|
||||
</div>
|
||||
<div class="list acea-row">
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'price',time:'today'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.todayPrice }}</div>
|
||||
<div>今日成交额</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'price',time:'yesterday'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.proPrice }}</div>
|
||||
<div>昨日成交额</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'price',time:'month'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.monthPrice }}</div>
|
||||
<div>本月成交额</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'order',time:'today'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.todayCount }}</div>
|
||||
<div>今日订单数</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'order',time:'yesterday'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.proCount }}</div>
|
||||
<div>昨日订单数</div>
|
||||
</div>
|
||||
<div
|
||||
class="item"
|
||||
@click="$yrouter.push({path:'/pages/orderAdmin/Statistics/index',query:{type:'order',time:'month'}})"
|
||||
>
|
||||
<div class="num">{{ census.orderTimeCount.monthCount }}</div>
|
||||
<div>本月订单数</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="public-wrapper">
|
||||
<div class="title">
|
||||
<span class="iconfont icon-xiangxishuju"></span>详细数据
|
||||
</div>
|
||||
<div class="nav acea-row row-between-wrapper">
|
||||
<div class="data">日期</div>
|
||||
<div class="browse">订单数</div>
|
||||
<div class="turnover">成交额</div>
|
||||
</div>
|
||||
<div class="conter">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, orderListIndex) in list"
|
||||
:key="orderListIndex"
|
||||
>
|
||||
<div class="data">{{ item.time }}</div>
|
||||
<div class="browse">{{ item.count }}</div>
|
||||
<div class="turnover">{{ item.price }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getStatisticsInfo, getStatisticsMonth } from "@/api/admin";
|
||||
import Loading from "@/components/Loading";
|
||||
export default {
|
||||
name: "OrderIndex",
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
census: {
|
||||
orderCount: {},
|
||||
orderTimeCount: {}
|
||||
},
|
||||
list: [],
|
||||
where: {
|
||||
page: 1,
|
||||
limit: 15
|
||||
},
|
||||
loaded: false,
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
this.getList();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getList();
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
var that = this;
|
||||
getStatisticsInfo().then(
|
||||
res => {
|
||||
that.census = res.data;
|
||||
that.census.unpaidCount = that.census.orderCount.unpaidCount;
|
||||
},
|
||||
err => {
|
||||
that.$dialog.message(err.msg);
|
||||
}
|
||||
);
|
||||
},
|
||||
getList: function() {
|
||||
var that = this;
|
||||
if (that.loading || that.loaded) return;
|
||||
that.loading = true;
|
||||
getStatisticsMonth(that.where).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.where.limit;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
that.where.page = that.where.page + 1;
|
||||
},
|
||||
error => {
|
||||
that.$dialog.message(error.msg);
|
||||
},
|
||||
300
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
@@ -0,0 +1,432 @@
|
||||
<template>
|
||||
<div class="statistical-page" ref="container">
|
||||
<div class="navs">
|
||||
<div class="list">
|
||||
<div class="item" :class="time == 'today' ? 'on' : ''" @click="setTime('today')">今天</div>
|
||||
<div class="item" :class="time == 'yesterday' ? 'on' : ''" @click="setTime('yesterday')">昨天</div>
|
||||
<div class="item" :class="time == 'seven' ? 'on' : ''" @click="setTime('seven')">最近7天</div>
|
||||
<div class="item" :class="time == 'month' ? 'on' : ''" @click="setTime('month')">本月</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
<div class="title">{{ title }}{{ this.where.type == 1 ? "营业额(元)" : "订单量(份)" }}</div>
|
||||
<div class="money">{{ time_price }}</div>
|
||||
</div>
|
||||
<!-- <div class="chart">
|
||||
<div class="company">{{ where.type === 1 ? "单位(元)" : "单位(份)" }}</div>
|
||||
<ECharts :options="polar"></ECharts>
|
||||
</div> -->
|
||||
<div class="public-wrapper">
|
||||
<div class="title">
|
||||
<span class="iconfont icon-xiangxishuju"></span>详细数据
|
||||
</div>
|
||||
<div class="nav acea-row row-between-wrapper">
|
||||
<div class="data">日期</div>
|
||||
<div class="browse">订单量</div>
|
||||
<div class="turnover">成交额</div>
|
||||
</div>
|
||||
<div class="conter">
|
||||
<div
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(item, statisticalIndex) in list"
|
||||
:key="statisticalIndex"
|
||||
>
|
||||
<div class="data">{{ item.time }}</div>
|
||||
<div class="browse">{{ item.count }}</div>
|
||||
<div class="turnover">{{ item.price }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="calendar-wrapper" :class="current === true ? 'on' : ''">
|
||||
<div class="calendar">
|
||||
<Calendar
|
||||
:clean="clean"
|
||||
:lunar="lunar"
|
||||
ref="calendar"
|
||||
:range="isrange"
|
||||
:multi="ismulti"
|
||||
@select="select"
|
||||
@next="next"
|
||||
@prev="prev"
|
||||
:value="value"
|
||||
:weekSwitch="weekSwitch"
|
||||
:monthRange="monthRange"
|
||||
rangeMonthFormat="yyyy年MM月"
|
||||
monFirst
|
||||
responsive
|
||||
:begin="[1992, 5, 20]"
|
||||
:end="[2049, 5, 20]"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="mask" @touchmove.prevent v-show="current === true" @click="close"></div>
|
||||
<Loading :loaded="loaded" :loading="loading"></Loading>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import ECharts from "vue-echarts";
|
||||
// import "echarts/lib/chart/line";
|
||||
// import "echarts/lib/component/polar";
|
||||
// import Calendar from "mpvue-calendar";
|
||||
// import "mpvue-calendar/src/browser-style.css";
|
||||
import { getStatisticsMonth, getStatisticsTime } from "@/api/admin";
|
||||
import Loading from "@/components/Loading";
|
||||
const year = new Date().getFullYear();
|
||||
const month = new Date().getMonth() + 1;
|
||||
const day = new Date().getDate();
|
||||
export default {
|
||||
name: "Statistics",
|
||||
components: {
|
||||
// ECharts,
|
||||
// Calendar,
|
||||
Loading
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
polar: {
|
||||
tooltip: {
|
||||
trigger: "axis"
|
||||
},
|
||||
legend: {
|
||||
data: [""]
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
feature: {
|
||||
mark: { show: true },
|
||||
dataView: { show: true, readOnly: false },
|
||||
magicType: { show: true, type: ["line"] },
|
||||
restore: { show: true },
|
||||
saveAsImage: { show: true }
|
||||
}
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#999",
|
||||
width: 1 //这里是为了突出显示加上的
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: ["#f5f5f5"],
|
||||
width: 1,
|
||||
type: "solid"
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#999",
|
||||
width: 1 //这里是为了突出显示加上的
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "邮件营销",
|
||||
type: "line",
|
||||
stack: "总量",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#2291f8", //折点颜色
|
||||
lineStyle: {
|
||||
color: "#2291f8" //折线颜色
|
||||
}
|
||||
}
|
||||
},
|
||||
data: [120, 132.5, 101, 134, 90, 150, 30]
|
||||
}
|
||||
],
|
||||
grid: {
|
||||
x: 30,
|
||||
x2: 10,
|
||||
y: 20,
|
||||
y2: 110
|
||||
},
|
||||
animationDuration: 2000
|
||||
},
|
||||
value: [[year, month, day - 1], [year, month, day]],
|
||||
isrange: true,
|
||||
weekSwitch: false,
|
||||
ismulti: false,
|
||||
monFirst: true,
|
||||
clean: false, //简洁模式
|
||||
lunar: false, //显示农历
|
||||
renderValues: [],
|
||||
monthRange: [],
|
||||
current: false,
|
||||
where: {
|
||||
start: "",
|
||||
stop: "",
|
||||
type: "",
|
||||
cate: 1
|
||||
},
|
||||
types: "", //类型|order=订单数|price=营业额
|
||||
time: "", //时间|today=今天|yesterday=昨天|month=本月
|
||||
title: "", //时间|today=今天|yesterday=昨天|month=本月
|
||||
growth_rate: "", //增长率
|
||||
increase_time: "", //增长率
|
||||
increase_time_status: "", //增长率
|
||||
time_price: "", //增长率
|
||||
loaded: false,
|
||||
loading: false,
|
||||
filter: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
list: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"$yroute.params": function(newVal) {
|
||||
var that = this;
|
||||
if (newVal != undefined) {
|
||||
that.setType(newVal.type);
|
||||
that.setTime(newVal.time);
|
||||
that.getIndex();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
this.handelRenderValues();
|
||||
this.setTime(this.$yroute.query.time);
|
||||
this.setType(this.$yroute.query.type);
|
||||
// this.getIndex();
|
||||
this.getInfo();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loading && this.getInfo();
|
||||
},
|
||||
computed: {
|
||||
monthRangeText() {
|
||||
return this.monthRange.length ? "固定" : "指定范围";
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
var that = this;
|
||||
getStatisticsTime(that.where).then(
|
||||
res => {
|
||||
var _info = res.data.chart,
|
||||
day = [],
|
||||
num = [];
|
||||
_info.forEach(function(item) {
|
||||
day.push(item.time);
|
||||
num.push(item.num);
|
||||
});
|
||||
that.polar.xAxis[0].data = day;
|
||||
that.polar.series[0].data = num;
|
||||
that.growth_rate = res.data.growth_rate;
|
||||
that.increase_time = res.data.increase_time;
|
||||
that.increase_time_status = res.data.increase_time_status;
|
||||
that.time_price = res.data.time;
|
||||
},
|
||||
error => {
|
||||
wx.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});;
|
||||
}
|
||||
);
|
||||
},
|
||||
setTime: function(time) {
|
||||
this.time = time;
|
||||
var year = new Date().getFullYear(),
|
||||
month = new Date().getMonth() + 1,
|
||||
day = new Date().getDate();
|
||||
switch (time) {
|
||||
case "today":
|
||||
this.where.cate = 1;
|
||||
this.title = "今日";
|
||||
this.getIndex();
|
||||
break;
|
||||
case "yesterday":
|
||||
this.where.cate = 2;
|
||||
this.title = "昨日";
|
||||
this.getIndex();
|
||||
break;
|
||||
case "month":
|
||||
this.where.cate = 4;
|
||||
this.title = "本月";
|
||||
this.getIndex();
|
||||
break;
|
||||
case "seven":
|
||||
this.where.cate = 3;
|
||||
this.title = "七日";
|
||||
this.getIndex();
|
||||
break;
|
||||
}
|
||||
},
|
||||
setType: function(type) {
|
||||
switch (type) {
|
||||
case "price":
|
||||
this.where.type = 1;
|
||||
break;
|
||||
case "order":
|
||||
this.where.type = 2;
|
||||
break;
|
||||
}
|
||||
},
|
||||
clickSomeThing(data) {
|
||||
this.value = [[2019, 4, 1], [2019, 4, 8]];
|
||||
},
|
||||
setMonthRange() {
|
||||
this.monthRange = this.monthRange.length ? [] : ["2019-4", "2020-1"];
|
||||
},
|
||||
switchMode() {
|
||||
this.weekSwitch = !this.weekSwitch;
|
||||
setTimeout(() => {
|
||||
// this.$refs.calendar.renderer(2019, 1); //渲染2018年8月份
|
||||
}, 0);
|
||||
},
|
||||
handelRenderValues(data) {
|
||||
if (this.ismulti) {
|
||||
this.renderValues = this.value.map(v => v.join("-"));
|
||||
} else if (this.isrange) {
|
||||
const values = [];
|
||||
data || this.value;
|
||||
this.value.forEach((v, i) => {
|
||||
values.push(v.join("-"));
|
||||
if (!i) {
|
||||
values.push("~");
|
||||
}
|
||||
});
|
||||
this.renderValues = values;
|
||||
} else {
|
||||
this.renderValues = [this.value.join("-")];
|
||||
}
|
||||
},
|
||||
multiMode() {
|
||||
this.ismulti = true;
|
||||
this.isrange = false;
|
||||
this.value = [[year, month, 16], [year, month, 18]];
|
||||
this.handelRenderValues();
|
||||
// this.$refs.calendar.renderer(year, month);
|
||||
},
|
||||
rangeMode() {
|
||||
this.ismulti = false;
|
||||
this.isrange = true;
|
||||
this.value = [[year, month, 16], [year, month, 22]];
|
||||
this.handelRenderValues();
|
||||
// this.$refs.calendar.renderer(year, month);
|
||||
},
|
||||
valueMode() {
|
||||
this.ismulti = false;
|
||||
this.isrange = false;
|
||||
this.value = [year, month, 16];
|
||||
this.handelRenderValues();
|
||||
// this.$refs.calendar.renderer(year, month);
|
||||
},
|
||||
selectMonth(month, year) {
|
||||
},
|
||||
prev(y, m, w) {
|
||||
},
|
||||
next(year, month, week) {
|
||||
},
|
||||
selectYear(year) {
|
||||
},
|
||||
setToday() {
|
||||
// this.$refs.calendar.setToday();
|
||||
},
|
||||
dateInfo() {
|
||||
// const info = this.$refs.calendar.dateInfo(2018, 8, 23);
|
||||
},
|
||||
renderer() {
|
||||
if (this.monthRange.length) {
|
||||
this.monthRange = ["2018-8", "2018-8"];
|
||||
}
|
||||
// this.$refs.calendar.renderer(2018, 8); //渲染2018年8月份
|
||||
},
|
||||
select(val, val2) {
|
||||
if (this.isrange) {
|
||||
this.handelRenderValues([val, val2]);
|
||||
} else if (this.ismulti) {
|
||||
this.handelRenderValues(val);
|
||||
} else {
|
||||
this.handelRenderValues([val]);
|
||||
}
|
||||
if (
|
||||
this.where.start != new Date(val) / 1000 ||
|
||||
this.where.stop != new Date(val2) / 1000 + 24 * 60 * 60 - 1
|
||||
) {
|
||||
this.time = "date";
|
||||
this.title = "";
|
||||
this.where.start =
|
||||
new Date(Date.parse(val[0] + "/" + val[1] + "/" + val[2])).getTime() /
|
||||
1000;
|
||||
this.where.stop =
|
||||
new Date(
|
||||
Date.parse(val2[0] + "/" + val2[1] + "/" + val2[2])
|
||||
).getTime() /
|
||||
1000 +
|
||||
24 * 60 * 60 -
|
||||
1;
|
||||
this.getIndex();
|
||||
}
|
||||
},
|
||||
dateTitle: function() {
|
||||
this.current = true;
|
||||
},
|
||||
close: function() {
|
||||
this.current = false;
|
||||
},
|
||||
getInfo: function() {
|
||||
var that = this;
|
||||
if (that.loading || that.loaded) return;
|
||||
that.loading = true;
|
||||
getStatisticsMonth(that.filter).then(
|
||||
res => {
|
||||
that.loading = false;
|
||||
that.loaded = res.data.length < that.filter.limit;
|
||||
that.list.push.apply(that.list, res.data);
|
||||
that.filter.page = that.filter.page + 1;
|
||||
},
|
||||
error => {
|
||||
that.$dialog.message(error.msg);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.echarts {
|
||||
width: 100%;
|
||||
height: 5.5rem;
|
||||
}
|
||||
.calendar-wrapper {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 66;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||
}
|
||||
.calendar-wrapper.on {
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
.statistical-page .wrapper .increase {
|
||||
font-size: 0.26rem;
|
||||
}
|
||||
.statistical-page .wrapper .increase .iconfont {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import App from './index'
|
||||
|
||||
const app = new Vue(App)
|
||||
app.$mount()
|
||||
Reference in New Issue
Block a user