From d42832f80ecbc7265a39a81ff987a337edcee08e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com>
Date: Thu, 23 Sep 2021 15:17:12 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=95=86=E5=AE=B6=E4=B8=AD?=
=?UTF-8?q?=E5=BF=83=E4=BD=99=E9=A2=9D=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=EF=BC=8C=E5=AF=B9=E6=8E=A5=E5=95=86=E5=AE=B6=E4=B8=AD=E5=BF=83?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/config.js | 2 +-
common/styles/iconfont.css | 10 +-
pages/business/balance/balance.vue | 114 +++++++++++++----
pages/business/center/center.vue | 27 ++--
pages/business/login/login.vue | 6 +-
pages/business/order/list.vue | 196 +++++++++++++++++++++++++----
6 files changed, 284 insertions(+), 71 deletions(-)
diff --git a/common/js/config.js b/common/js/config.js
index 0d601a8..8c40c53 100644
--- a/common/js/config.js
+++ b/common/js/config.js
@@ -16,7 +16,7 @@ export default {
//https://demo-guojiang-ec-api.guojiang.club/
baseUrl: process.env.NODE_ENV === 'development' ?
- 'http://192.168.3.165/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
+ 'http://192.168.3.29/' : 'https://v3-ec-admin-dev.guojiang.club/', // 运行时自动替换变量
},
PACKAGES: {
activity: false,
diff --git a/common/styles/iconfont.css b/common/styles/iconfont.css
index b75ff59..4682435 100644
--- a/common/styles/iconfont.css
+++ b/common/styles/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "lf-iconfont"; /* Project id 2779107 */
- src: url('//at.alicdn.com/t/font_2779107_g6issu2jkr.woff2?t=1631610243868') format('woff2'),
- url('//at.alicdn.com/t/font_2779107_g6issu2jkr.woff?t=1631610243868') format('woff'),
- url('//at.alicdn.com/t/font_2779107_g6issu2jkr.ttf?t=1631610243868') format('truetype');
+ src: url('//at.alicdn.com/t/font_2779107_e1lp09zkffc.woff2?t=1632308314645') format('woff2'),
+ url('//at.alicdn.com/t/font_2779107_e1lp09zkffc.woff?t=1632308314645') format('woff'),
+ url('//at.alicdn.com/t/font_2779107_e1lp09zkffc.ttf?t=1632308314645') format('truetype');
}
.lf-iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-jiazai:before {
+ content: "\e7ba";
+}
+
.icon-daifahuo:before {
content: "\e642";
}
diff --git a/pages/business/balance/balance.vue b/pages/business/balance/balance.vue
index 225fa11..beb954f 100644
--- a/pages/business/balance/balance.vue
+++ b/pages/business/balance/balance.vue
@@ -9,7 +9,7 @@
- 78326478
+ {{ balance }}
(元)
@@ -17,39 +17,33 @@
- 余额明细
- 提现明细
+ {{ item.name }}
+
- {{ date || '2021-09-01' }}
+ {{ date || getDay }}
-
-
-
- +¥80
- 扫码收款
-
-
- ¥374.38
- 2021-09-01 18:27:58
-
-
-
-
-
+
+
- -¥80
- 提现到支付宝[18203835380]
+ +¥{{ item.balance }}
+ {{ item.balance }}
+ {{ item.note }}
- ¥374.38
- 2021-09-01 18:27:58
+ ¥{{ item.current }}
+ {{ item.created_at }}
+
@@ -60,15 +54,87 @@
data(){
return {
date: '',
- current: 0
+ current: 0,
+ tab_list: [{
+ name: '余额明细',
+ page: 1,
+ isPage: true,
+ list: []
+ },{
+ name: '提现明细',
+ page: 1,
+ isPage: true,
+ list: []
+ }],
+ balance: 0
+ }
+ },
+ computed: {
+ getDay(){
+ return this.$shared.recordTime(new Date(), '-', 'date');
}
},
onLoad(){
-
+ this.getBalance();
},
methods: {
+ // 时间筛选
dateChange(event){
this.date = event.detail.value;
+ let tabItem = this.tab_list[this.current];
+ tabItem.page = 1;
+ tabItem.isPage = true;
+ this.getBalance();
+ },
+ // 切换tab
+ switchTab(index){
+ this.current = index;
+ if(this.tab_list[index].list.length <= 0){
+ this.getBalance();
+ }
+ },
+ getBalance(){
+ uni.showLoading({
+ title: '正在查询中'
+ })
+ let token = this.$cookieStorage.get('store_token');
+ let tabItem = this.tab_list[this.current];
+ let par = {
+ cash: this.current,
+ page: tabItem.page
+ }
+ if(this.date){
+ par.date = this.date;
+ }
+ this.$http.get({
+ api: 'api/supplier/balance',
+ data: par,
+ header: {
+ token: token
+ }
+ }).then(res => {
+ if(res.data.code == 200){
+ let balance = res.data.data.balance;
+ let list = res.data.data.list;
+ this.balance = balance;
+ tabItem.isPage = this.$shared.isRight(list.next_page_url);
+ if(tabItem.page == 1){
+ tabItem.list = list.data;
+ }else{
+ tabItem.list.push(...list.data);
+ }
+ }
+ uni.hideLoading();
+ }).catch(err => uni.hideLoading());
+ }
+ },
+ onReachBottom(){
+ let tabItem = this.tab_list[this.current];
+ if(tabItem.isPage){
+ tabItem.page = tabItem.page+1;
+ this.getBalance();
+ }else{
+ this.$msg('没有更多啦~')
}
}
}
diff --git a/pages/business/center/center.vue b/pages/business/center/center.vue
index 1ee391f..bcf0334 100644
--- a/pages/business/center/center.vue
+++ b/pages/business/center/center.vue
@@ -7,8 +7,8 @@
-
- 雅诗兰黛专卖店
+
+ {{ detail.brand.name }}
-
-
+
+
@@ -35,15 +35,15 @@
- 0
+ {{ detail.todo.new }}
待付款
- 0
+ {{ detail.todo.send }}
待发货
- 0
+ {{ detail.todo.pick }}
待提货
@@ -56,21 +56,21 @@
- 0
+ {{ detail.today.pay }}
(笔)
支付金额
- 0
+ {{ detail.today.online }}
(笔)
线上订单
- 0
+ {{ detail.today.offline }}
(笔)
线下订单
@@ -83,15 +83,15 @@
- 0
+ {{ detail.goods.del }}
销售中
- 0
+ {{ detail.goods.on_sell }}
待上架
- 0
+ {{ detail.goods.off_sell }}
已下架
@@ -104,7 +104,6 @@
export default {
data(){
return {
- list: ['我有一只小毛驴,但我从来也不骑', '天苍苍野茫茫'],
token: '',
detail: {}
}
diff --git a/pages/business/login/login.vue b/pages/business/login/login.vue
index ad88326..1da880a 100644
--- a/pages/business/login/login.vue
+++ b/pages/business/login/login.vue
@@ -109,7 +109,7 @@
.next-btn{
width: 550rpx;
height: 100rpx;
- background: #15716E;
+ background: #0D2E9A;
border-radius: 50rpx;
line-height: 100rpx;
color: #FFFFFF;
@@ -139,12 +139,12 @@
height: 64rpx;
padding: 0 4rpx;
font-size: 24rpx;
- color: #15716E;
+ color: #0D2E9A;
display: flex;
justify-content: center;
align-items: center;
border-radius: 32rpx;
- border: 2rpx solid #15716E;
+ border: 2rpx solid #0D2E9A;
}
.active-bg{
background: #efefef;
diff --git a/pages/business/order/list.vue b/pages/business/order/list.vue
index 44d5e76..bb974e7 100644
--- a/pages/business/order/list.vue
+++ b/pages/business/order/list.vue
@@ -7,40 +7,48 @@
-
+
-
+
-
+
- 爱他美较大婴儿配方奶粉较大配方奶粉较2段
+ {{ item.items[0].item_name }}
- 1件;900g
- ¥385
+ {{ item.payment.amount }}件;{{ item.items[0].item_meta.specs_text }}
+ ¥{{ item.payment.amount_yuan }}
- 发货
- 待付款
- 删除订单
+ 发货
+ {{ item.status_text }}
+ 删除订单
+
+
@@ -54,7 +62,8 @@
page: 1,
isPage: true,
loadingClass: true,
- loadingText: '正在加载中'
+ loadingText: '正在加载中',
+ isRefresher: false
}
return {
tab_current: 0,
@@ -78,13 +87,13 @@
scrollH: 0,
nav_height: 0,
show_deliver: false,
- columns: [
- '中通快递', '申通快递', '圆通快递', '国通快递', '百世汇通快递',
- '顺丰快递', '京东快递', '天猫快递', 'EMS特快'
- ],
+ columns: [],
show_logistics: false,
select_index: null,
- orderNum: ''
+ expressNum: '',
+ token: '',
+ logistics_load: true,
+ click_order_no: ''
}
},
computed: {
@@ -95,30 +104,155 @@
onLoad(){
let info = uni.getSystemInfoSync();
this.scrollH = info.screenHeight;
+ this.token = this.$cookieStorage.get('store_token');
+ this.getOrderList();
},
methods: {
+ getOrderList(options = {}){
+ let tabItem = this.tab_list[this.tab_current];
+ this.$http.get({
+ api: 'api/supplier/order',
+ data: {
+ status: String(this.tab_current)
+ },
+ header: {
+ token: this.token
+ }
+ }).then(res => {
+ console.log("getOrderList", res);
+
+ tabItem.isPage = this.$isRight(res.data.next_page_url);
+ if(options.refresher){
+ tabItem.isRefresher = false;
+ this.$msg('刷新成功', {icon: 'success'});
+ }
+ if(!tabItem.isPage){
+ tabItem.loadingClass = false;
+ tabItem.loadingText = '已加载全部数据~'
+ }
+ if(tabItem.page == 1){
+ tabItem.list = res.data.data.data;
+ }else{
+ tabItem.list.push(...res.data.data.data);
+ }
+ console.log("this.tab_list", this.tab_list)
+ })
+ },
tabChange(event){
this.tab_current = event;
+ if(this.tab_list[this.tab_current].list.length <= 0){
+ this.getOrderList();
+ }
},
swiperChange(event){
this.tab_current = event.detail.current;
+ if(event.detail.source){
+ if(this.tab_list[this.tab_current].list.length <= 0){
+ this.getOrderList();
+ }
+ }
+ },
+ // 物流
+ getLogistics(){
+ this.logistics_load = true;
+ this.$http.get({
+ api: 'api/supplier/order/send_list',
+ data: {
+ order_no: this.click_order_no
+ },
+ header: {
+ token: this.token
+ }
+ }).then(res => {
+ if(res.data.code == 200){
+ this.logistics_load = false;
+ this.columns = res.data.data;
+ }
+ })
},
- deliver(){
+ deliver(order_no){
console.log("1111111");
this.show_deliver = true;
+ this.click_order_no = order_no;
+ this.getLogistics();
},
selectChange(event){
this.select_index = event.detail.value;
+ console.log("event",event)
},
// 确认发货
confirm(){
- console.log("选择的物流:", this.columns[this.select_index] || '未选择');
- console.log("订单号:", this.orderNum || '未输入');
- if(this.columns[this.select_index] && this.orderNum){
- this.show_deliver = false;
+ if(this.columns[this.select_index] && this.expressNum){
+ uni.showLoading({
+ title: '正在提交'
+ })
+ let method_id = this.columns[this.select_index].id;
+ let express_no = this.expressNum;
+ let order_no = this.click_order_no;
+ this.$http.get({
+ api: 'api/supplier/order/send',
+ data: {
+ distribution_id: 0,
+ method_id: method_id,
+ express_no: express_no,
+ order_no: order_no
+ },
+ header: {
+ token: this.token
+ }
+ }).then(res => {
+ uni.hideLoading();
+ this.$msg('发货成功', {icon: 'success'});
+ this.show_deliver = false;
+ }).catch(err => uni.hideLoading());
}else{
this.$msg('请将信息补充完整')
}
+ },
+ // 删除订单
+ removeOrder(order_no, parentIndex, childIndex){
+ uni.showModal({
+ title: '温馨提示',
+ content: '确定删除该订单吗?',
+ success: result => {
+ if(result.confirm){
+ this.$http.post({
+ api: 'api/supplier/order/delete',
+ data: {
+ order_no: order_no
+ },
+ header: {
+ token: this.token
+ }
+ }).then(res => {
+ if(res.data.code == 200){
+ this.$msg(res.data.data);
+ this.tab_list[parentIndex].list.splice(childIndex, 1);
+ }
+ })
+ }
+ }
+ })
+ },
+ // scroll-view 滚到底
+ scrolltolower(){
+ let tabItem = this.tab_list[this.tab_current];
+ if(tabItem.isPage){
+ tabItem.page = tabItem.page+1;
+ this.getOrderList();
+ }else{
+ this.$msg('没有更多啦~')
+ }
+ },
+ // 自定义下拉刷新
+ refresherrefresh(){
+ let tabItem = this.tab_list[this.tab_current];
+ tabItem.isRefresher = true;
+ tabItem.page = 1;
+ tabItem.isPage = true;
+ tabItem.loadingClass = true;
+ tabItem.loadingText = '正在加载中';
+ this.getOrderList({refresher: true});
}
}
}
@@ -228,6 +362,16 @@
color: #FFFFFF;
}
}
+ .load-a{
+ animation: my-load-a 2.5s infinite;
+ }
+ @keyframes my-load-a{
+ 0%{transform: rotate(0deg);}
+ 25%{transform: rotate(90deg);}
+ 50%{transform: rotate(180deg);}
+ 75%{transform: rotate(270deg);}
+ 100%{transform: rotate(360deg);}
+ }
// tabs 样式修改
/deep/.u-scroll-box {