Init project

This commit is contained in:
lifizer
2023-09-20 21:49:33 +08:00
parent 85a5989c96
commit c9ceac9f37
710 changed files with 125705 additions and 0 deletions
+354
View File
@@ -0,0 +1,354 @@
<template>
<view class="order-details pos-order-details">
<view class="header acea-row row-middle">
<view class="state">{{ title }}</view>
<view class="data">
<view class="order-num">订单{{ orderInfo.orderId }}</view>
<view>
<text class="time">
<data-format :date="orderInfo.addTime"></data-format>
</text>
</view>
</view>
</view>
<view class="orderingUser acea-row row-middle">{{ orderInfo.nickname }}</view>
<view class="address">
<view class="name">
{{ orderInfo.realName}}
<text class="phone">{{ orderInfo.userPhone }}</text>
</view>
<view>{{ orderInfo.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
<view class="pos-order-goods">
<view
class="goods acea-row row-between-wrapper"
v-for="(item, orderInfoIndex) in orderInfo.cartInfo"
:key="orderInfoIndex"
>
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ item.productInfo.storeName }}</view>
<view class="attr">{{ item.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ item.productInfo.price }}</view>
<view class="num">x{{ item.cartNum }}</view>
<view class="y-money">{{ item.productInfo.otPrice ? item.productInfo.otPrice : 0 }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ orderInfo.totalNum }}件商品应支付
<text class="money">{{ orderInfo.payPrice }}</text>
( 邮费 ¥{{
orderInfo.payPostage
}}
)
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>订单编号</view>
<view class="conter acea-row row-middle row-right">
{{ orderInfo.orderId
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.orderId)"
>复制</text>
</view>
</view>
<view class="item acea-row row-between">
<view>下单时间</view>
<view class="conter">
<data-format :date="orderInfo.addTime"></data-format>
</view>
</view>
<view class="item acea-row row-between">
<view>支付状态</view>
<view class="conter">{{ orderInfo.paid == 1 ? "已支付" : "未支付" }}</view>
</view>
<view class="item acea-row row-between">
<view>支付方式</view>
<view class="conter">{{ payType }}</view>
</view>
<view class="item acea-row row-between">
<view>买家留言</view>
<view class="conter">{{ orderInfo.mark }}</view>
</view>
</view>
<view class="wrapper">
<view class="item acea-row row-between">
<view>支付金额</view>
<view class="conter">{{ orderInfo.totalPrice }}</view>
</view>
<view class="item acea-row row-between">
<view>优惠券抵扣</view>
<view class="conter">-{{ orderInfo.couponPrice }}</view>
</view>
<view class="actualPay acea-row row-right">
实付款
<text class="money font-color-red">{{ orderInfo.payPrice }}</text>
</view>
</view>
<view
class="wrapper"
v-if="orderInfo.delivery_type != 'fictitious' && orderInfo._status._type === 2"
>
<view class="item acea-row row-between">
<view>配送方式</view>
<view class="conter" v-if="orderInfo.delivery_type === 'express'">快递</view>
<view class="conter" v-if="orderInfo.delivery_type === 'send'">送货</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递公司</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人</view>
<view class="conter">{{ orderInfo.delivery_name }}</view>
</view>
<view class="item acea-row row-between">
<view v-if="orderInfo.delivery_type === 'express'">快递单号</view>
<view v-if="orderInfo.delivery_type === 'send'">送货人电话</view>
<view class="conter">
{{ orderInfo.delivery_id
}}
<text
class="copy copy-data"
@click="copyClipboard(orderInfo.delivery_id)"
>复制</text>
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="footer acea-row row-right row-middle">
<view class="more"></view>
<view class="bnt cancel" @click="modify(0)" v-if="types == 0">一键改价</view>
<view class="bnt cancel" @click="modify(0)" v-if="types == -1">立即退款</view>
<view
class="bnt cancel"
v-if="orderInfo.pay_type === 'offline' && orderInfo.paid === 0"
@click="offlinePay"
>确认付款</view>
<view class="bnt delivery" v-if="types == 1" @click="goGoodsDeliver(orderInfo)">去发货</view>
</view>
<PriceChange
:change="change"
:orderInfo="orderInfo"
v-on:closechange="changeclose($event)"
v-on:savePrice="savePrice"
:status="status"
></PriceChange>
</view>
</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: {
goGoodsDeliver(orderInfo) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: { oid: orderInfo.orderId }
});
},
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 => {
uni.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;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.getIndex();
},
function() {
that.change = false;
uni.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;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.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;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.getIndex();
},
err => {
that.change = false;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
}
);
}
},
offlinePay: function() {
setOfflinePay({ order_id: this.orderInfo.order_id }).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.getIndex();
},
err => {
uni.showToast({
title: err.msg,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
+330
View File
@@ -0,0 +1,330 @@
<template>
<view class="pos-order-list" ref="container">
<view class="nav acea-row row-around row-middle">
<view class="item" :class="where.status == 0 ? 'on' : ''" @click="changeStatus(0)">待付款</view>
<view class="item" :class="where.status == 1 ? 'on' : ''" @click="changeStatus(1)">待发货</view>
<view class="item" :class="where.status == 2 ? 'on' : ''" @click="changeStatus(2)">待收货</view>
<view class="item" :class="where.status == 3 ? 'on' : ''" @click="changeStatus(3)">待评价</view>
<view class="item" :class="where.status == 4 ? 'on' : ''" @click="changeStatus(4)">已完成</view>
<view class="item" :class="where.status == -3 ? 'on' : ''" @click="changeStatus(-3)">退款</view>
</view>
<view class="list">
<view class="item" v-for="(item, listIndex) in list" :key="listIndex">
<view class="order-num acea-row row-middle" @click="toDetail(item)">
<text>订单号{{ item.orderId }}</text>
<text class="time">
<text>下单时间</text>
<data-format :date="item.addTime"></data-format>
</text>
</view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
<view class="goods acea-row row-between-wrapper" @click="toDetail(item)">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="val.productInfo.image" />
</view>
<view class="text acea-row row-between row-column">
<view class="info line2">{{ val.productInfo.storeName }}</view>
<view class="attr" v-if="val.productInfo.sku">{{ val.productInfo.sku }}</view>
</view>
</view>
<view class="money">
<view class="x-money">{{ val.productInfo.price }}</view>
<view class="num">x{{ val.cartNum }}</view>
<view class="y-money">{{ val.productInfo.otPrice }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ item.totalNum }}件商品应支付
<text class="money">{{ item.payPrice }}</text>
( 邮费 ¥{{
item.totalPostage
}}
)
</view>
<view class="operation acea-row row-between-wrapper">
<view class="more">
<!-- <view class="iconfont icon-gengduo" @click="more(index)"></view>-->
<!-- <view class="order" v-show="current === index">-->
<!-- <view class="items">-->
<!-- {{ where.status > 0 ? "删除" : "取消" }}订单-->
<!-- </view>-->
<!-- <view class="arrow"></view>-->
<!-- </view>-->
</view>
<view class="acea-row row-middle">
<view class="bnt" @click="modify(item, 0)" v-if="where.status == 0">一键改价</view>
<view class="bnt" @click="modify(item, 0)" v-if="where.status == -3 && item.refundStatus === 1">立即退款</view>
<view class="bnt cancel" v-if="item.pay_type === 'offline' && item.paid === 0" @click="offlinePay(item)">确认付款</view>
<view class="bnt" v-if="where.status == 1" @click="goGoodsDeliver(item)">去发货</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
<PriceChange :change="change" :orderInfo="orderInfo" v-on:closechange="changeclose($event)" v-on:savePrice="savePrice"
:status="status"></PriceChange>
</view>
</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() {
!this.loading && this.getIndex();
},
methods: {
goGoodsDeliver(item) {
this.$yrouter.push({
path: "/pages/orderAdmin/GoodsDeliver/index",
query: {
oid: item.orderId
}
});
},
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;
uni.showToast({
title: "改价成功",
icon: "success",
duration: 2000
});
that.init();
},
function() {
that.change = false;
uni.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;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.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;
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.init();
},
err => {
that.change = false;
uni.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 => {
uni.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/index",
query: {
oid: item.orderId
}
});
},
offlinePay: function(item) {
setOfflinePay({
order_id: item.order_id
}).then(
res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.init();
},
error => {
uni.showToast({
title: error.msg,
icon: 'none',
duration: 2000
});
}
);
}
}
};
</script>
<style lang="less">
</style>
+231
View File
@@ -0,0 +1,231 @@
<template>
<view class="deliver-goods">
<header>
<view class="order-num acea-row row-between-wrapper">
<view class="num line1">订单号{{ delivery.orderId }}</view>
<view class="name line1">{{ delivery.nickname }}</view>
</view>
<view class="address">
<view class="name">
{{ delivery.realName }}
<text class="phone">{{ delivery.userPhone }}</text>
</view>
<view>{{ delivery.userAddress }}</view>
</view>
<view class="line">
<image :src="webUrl+'/20230304135025917856.png'" />
</view>
</header>
<view class="wrapper">
<view class="item acea-row row-between-wrapper">
<view>发货方式</view>
<view class="mode acea-row row-middle row-right">
<view
class="goods"
:class="active === typesIndex ? 'on' : ''"
v-for="(item, typesIndex) in types"
:key="typesIndex"
@click="changeType(item, typesIndex)"
>
{{ item.title }}
<text class="iconfont icon-xuanzhong2"></text>
</view>
</view>
</view>
<view class="list" v-show="active === 0">
<picker
mode="selector"
:range="logistics"
class="mode"
range-key="name"
@change="changeLog"
>
<view class="item acea-row row-between-wrapper">
<view>快递公司</view>
<input
type="text"
placeholder="填写快递公司"
disabled="disabled"
v-model="deliveryNames"
class="mode"
/>
<!-- <input type="text" placeholder="填写快递公司" v-model="deliveryName" class="mode" /> -->
</view>
</picker>
<view class="item acea-row row-between-wrapper">
<view>快递单号</view>
<input type="text" placeholder="填写快递单号" v-model="deliveryId" class="mode" />
</view>
</view>
<view class="list" v-show="active === 1">
<view class="item acea-row row-between-wrapper">
<view>送货人</view>
<input type="text" placeholder="填写送货人" v-model="deliveryName" class="mode" />
</view>
<view class="item acea-row row-between-wrapper">
<view>送货电话</view>
<input type="text" placeholder="填写送货电话" v-model="deliveryId" class="mode" />
</view>
</view>
</view>
<view style="height:100rpx;"></view>
<view class="confirm" @click="saveInfo">确认提交</view>
</view>
</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 {
webUrl: this.$VUE_APP_RESOURCES_URL,
types: [
{
type: "express",
title: "发货"
}
// {
// type: "send",
// title: "送货"
// },
// {
// type: "fictitious",
// title: "无需发货"
// }
],
active: 0,
order_id: "",
delivery: [],
logistics: [],
delivery_type: "express",
deliveryName: "",
deliveryId: "",
deliveryNames: "请选择"
};
},
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: {
changeLog: function(value) {
this.deliveryNames = this.logistics[value.detail.value].name;
this.deliveryName = this.logistics[value.detail.value].id;
},
changeType: function(item, index) {
this.active = index;
this.delivery_type = item.type;
this.deliveryName = "";
this.deliveryId = "";
},
getIndex: function() {
let that = this;
getAdminOrderDelivery(that.order_id).then(
res => {
that.delivery = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
getLogistics: function() {
let that = this;
getLogistics().then(
res => {
console.log(res.data);
that.logistics = res.data;
},
error => {
uni.showToast({
title: error.msg,
icon: "none",
duration: 2000
});
}
);
},
async saveInfo() {
let that = this,
delivery_type = that.delivery_type,
deliveryName = that.deliveryName.toString(),
deliveryId = that.deliveryId,
save = {};
console.log(deliveryName);
save.orderId = that.order_id;
save.deliveryType = that.delivery_type;
switch (delivery_type) {
case "express":
try {
await this.$validator({
deliveryName: [required(required.message("快递公司"))],
deliveryId: [required(required.message("快递单号"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
case "send":
try {
await this.$validator({
deliveryName: [required(required.message("发货人姓名"))],
deliveryId: [required(required.message("发货人电话"))]
}).validate({ deliveryName, deliveryId });
} catch (e) {
return validatorDefaultCatch(e);
}
save.deliveryName = deliveryName;
save.deliveryId = deliveryId;
that.setInfo(save);
break;
}
},
setInfo: function(item) {
let that = this;
console.log(item);
setAdminOrderDelivery(item)
.then(res => {
console.log(res);
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
that.$yrouter.go(-1);
})
.catch(err => {
console.log(err);
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
}
}
};
</script>
@@ -0,0 +1,184 @@
<template>
<view class="OrderCancellation">
<view class="header">
<image mode="aspectFit" :src="`${staticUrl}/writeOffBg.jpg`" @click="openQRCode" />
</view>
<view class="whiteBg">
<view class="input">
<input type="number" placeholder="0" v-model="verify_code" />
</view>
<view class="bnt" @click="storeCancellation">立即核销</view>
</view>
<view class="scan" v-if="iswechat">
<image :src="webUrl+'/20200729154546061002.gif'" @click="openQRCode" />
</view>
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff>
</view>
</template>
<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 {
staticUrl:this.$STATIC_RESOURCE_URL,
webUrl: VUE_APP_RESOURCES_URL,
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 = "";
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
},
storeCancellation: function() {
let ref = /[0-9]{12}/;
if (!this.verify_code) {
uni.showToast({
title: "请输入核销码",
icon: "none",
duration: 2000
});
return;
}
if (!ref.test(this.verify_code)) {
uni.showToast({
title: "请输入正确的核销码",
icon: "none",
duration: 2000
});
return;
}
uni.showLoading({
title: "查询中"
});
orderVerific(this.verify_code, 0)
.then(res => {
uni.hideLoading();
this.orderInfo = res.data;
this.iShidden = false;
uni.showToast({
title: res.msg,
icon: "success",
duration: 2000
});
})
.catch(error => {
uni.hideLoading();
uni.showToast({
title: error.msg ||
error.response.data.msg ||
error.response.data.message,
icon: "none",
duration: 2000
});
});
},
openQRCode: function() {
let that = this;
// 这里需要调用扫码功能
}
}
};
</script>
<style scoped lang="less">
.OrderCancellation .header {
width: 100%;
height: 3 * 100rpx;
background-size: 100% 100%;
image {
width: 100%;
height: 3 * 100rpx;
}
}
.OrderCancellation .whiteBg {
width: 6.9 * 100rpx;
background-color: #fff;
margin: -0.93 * 100rpx auto 0 auto;
padding-top: 0.8 * 100rpx;
padding-bottom: 30rpx;
z-index: 99;
position: relative;
border-radius: 0.06 * 100rpx 0.06 * 100rpx 0 0;
}
.OrderCancellation .whiteBg .input {
width: 5.8 * 100rpx;
margin: 0 auto;
border-bottom: 0.01 * 100rpx solid #eee;
}
.OrderCancellation .whiteBg .input input {
padding-bottom: 0.25 * 100rpx;
font-size: 0.6 * 100rpx;
height: auto;
color: #282828;
width: 100%;
text-align: center;
}
.OrderCancellation .whiteBg .bnt {
font-size: 0.32 * 100rpx;
color: #fff;
width: 5.8 * 100rpx;
height: 0.86 * 100rpx;
border-radius: 0.43 * 100rpx;
background-image: linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -webkit-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
background-image: -moz-linear-gradient(to right, #eb3729 0%, #eb3729 100%);
text-align: center;
line-height: 0.86 * 100rpx;
margin: 0.55 * 100rpx auto 0 auto;
}
.OrderCancellation .scan {
width: 3 * 100rpx;
height: 3 * 100rpx;
margin: 1.1 * 100rpx auto 0 auto;
}
.OrderCancellation .scan image {
width: 100%;
height: 100%;
display: block;
}
</style>
+167
View File
@@ -0,0 +1,167 @@
<template>
<view class="order-index" ref="container">
<image :src="webUrl+'/20230304202119869348.png'" mode="widthFix" class="image" />
<view class="header acea-row">
<view class="item" @click="goAdminOrderList(0)">
<view class="num">{{ census.orderCount.unpaidCount }}</view>
<view>待付款</view>
</view>
<view class="item" @click="goAdminOrderList(1)">
<view class="num">{{ census.orderCount.unshippedCount }}</view>
<view>待发货</view>
</view>
<view class="item" @click="goAdminOrderList(2)">
<view class="num">{{ census.orderCount.receivedCount }}</view>
<view>待收货</view>
</view>
<view class="item" @click="goAdminOrderList(3)">
<view class="num">{{ census.orderCount.evaluatedCount }}</view>
<view>待评价</view>
</view>
<view class="item" @click="goAdminOrderList(4)">
<view class="num">{{ census.orderCount.refundCount }}</view>
<view>退款</view>
</view>
</view>
<view class="wrapper">
<view class="title">
<text class="iconfont icon-shujutongji"></text>数据统计
</view>
<view class="list acea-row">
<view class="item" @click="goStatistics({type:'price',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayPrice }}</view>
<view>今日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proPrice }}</view>
<view>昨日成交额</view>
</view>
<view class="item" @click="goStatistics({type:'price',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthPrice }}</view>
<view>本月成交额</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'today'})">
<view class="num">{{ census.orderTimeCount.todayCount }}</view>
<view>今日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'yesterday'})">
<view class="num">{{ census.orderTimeCount.proCount }}</view>
<view>昨日订单数</view>
</view>
<view class="item" @click="goStatistics({type:'order',time:'month'})">
<view class="num">{{ census.orderTimeCount.monthCount }}</view>
<view>本月订单数</view>
</view>
</view>
</view>
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单数</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, orderListIndex) in list"
:key="orderListIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import { getStatisticsInfo, getStatisticsMonth } from "@/api/admin";
import Loading from "@/components/Loading";
export default {
name: "OrderIndex",
components: {
Loading
},
props: {},
data: function() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
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: {
goStatistics(query) {
this.$yrouter.push({
path: "/pages/orderAdmin/Statistics/index",
query
});
},
goAdminOrderList(types) {
this.$yrouter.push({
path: "/pages/orderAdmin/AdminOrderList/index",
query: { types }
});
},
getIndex: function() {
var that = this;
getStatisticsInfo().then(
res => {
that.census = res.data;
that.census.unpaidCount = that.census.orderCount.unpaidCount;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
},
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;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
},
300
);
}
}
};
</script>
+446
View File
@@ -0,0 +1,446 @@
<template>
<view class="statistical-page" ref="container">
<view class="navs">
<view class="list">
<view class="item" :class="time == 'today' ? 'on' : ''" @click="setTime('today')">今天</view>
<view class="item" :class="time == 'yesterday' ? 'on' : ''" @click="setTime('yesterday')">昨天</view>
<view class="item" :class="time == 'seven' ? 'on' : ''" @click="setTime('seven')">最近7天</view>
<view class="item" :class="time == 'month' ? 'on' : ''" @click="setTime('month')">本月</view>
</view>
</view>
<view class="wrapper">
<view class="title">{{ title }}{{ this.where.type == 1 ? "营业额(元)" : "订单量(份)" }}</view>
<view class="money">{{ time_price }}</view>
</view>
<!-- <view class="chart">
<view class="company">{{ where.type === 1 ? "单位(元)" : "单位(份)" }}</view>
<ECharts :options="polar"></ECharts>
</view>-->
<view class="public-wrapper">
<view class="title">
<text class="iconfont icon-xiangxishuju"></text>详细数据
</view>
<view class="nav acea-row row-between-wrapper">
<view class="data">日期</view>
<view class="browse">订单量</view>
<view class="turnover">成交额</view>
</view>
<view class="conter">
<view
class="item acea-row row-between-wrapper"
v-for="(item, statisticalIndex) in list"
:key="statisticalIndex"
>
<view class="data">{{ item.time }}</view>
<view class="browse">{{ item.count }}</view>
<view class="turnover">{{ item.price }}</view>
</view>
</view>
</view>
<!-- <view class="calendar-wrapper" :class="current === true ? 'on' : ''">
<view 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]"
/>
</view>
</view>-->
<view class="mask" @touchmove.prevent v-show="current === true" @click="close"></view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</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 => {
uni.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.list = res.data;
that.filter.page = that.filter.page + 1;
},
err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
}
);
}
}
};
</script>
<style scoped lang="less">
.echarts {
width: 100%;
height: 5.5 * 100rpx;
}
.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.26 * 100rpx;
}
.statistical-page .wrapper .increase .iconfont {
margin-left: 0;
}
</style>