Commit daeed0f2 by wwh

update

1 parent ba4d0f36
...@@ -12,7 +12,7 @@ export default class order extends base { ...@@ -12,7 +12,7 @@ export default class order extends base {
* 分页方法 * 分页方法
*/ */
static hisPage() { static hisPage() {
const url = `${this.baseUrl}/customers/order_list`; const url = `${base.gtBaseUrl()}/customers/order_list`;
return new Page(url, this._processOrderListItem.bind(this)); return new Page(url, this._processOrderListItem.bind(this));
} }
...@@ -20,14 +20,14 @@ export default class order extends base { ...@@ -20,14 +20,14 @@ export default class order extends base {
* 分页方法 * 分页方法
*/ */
static page() { static page() {
const url = `${this.baseUrl}/orders/orderBusiness/list`; const url = `${base.gtBaseUrl()}/orders/orderBusiness/list`;
return new Page(url, this._processOrderListItem.bind(this)); return new Page(url, this._processOrderListItem.bind(this));
} }
/** /**
* 获取订单列表 * 获取订单列表
*/ */
static async getOrderList(data){ static async getOrderList(data){
const url = `${this.baseUrl}/orders/orderBusiness/list`; const url = `${base.gtBaseUrl()}/orders/orderBusiness/list`;
return await this.post(url, data); return await this.post(url, data);
} }
/** /**
...@@ -41,6 +41,15 @@ export default class order extends base { ...@@ -41,6 +41,15 @@ export default class order extends base {
data.token = wepy.$instance.globalData.siteToken; data.token = wepy.$instance.globalData.siteToken;
return await this.post(url, data); return await this.post(url, data);
} }
//获取订单列表
static async getHotOrderList(data){
let baseUrl = base.gtBaseUrl();
const url = `${baseUrl}/orders/api/businessOrdersList`;
data.mtoken = wepy.$instance.globalData.siteMtoken;
data.token = wepy.$instance.globalData.siteToken;
data.business_id = wepy.$instance.globalData.siteBusinessId;
return await this.post(url, data);
}
/** /**
* 订单详情 * 订单详情
*/ */
...@@ -92,7 +101,7 @@ export default class order extends base { ...@@ -92,7 +101,7 @@ export default class order extends base {
* 发货详情 * 发货详情
*/ */
static async detail1(orderId) { static async detail1(orderId) {
const url = `${this.baseUrl}/orders/Orders/sendOff`; const url = `${base.gtBaseUrl()}/orders/Orders/sendOff`;
return await this.get(url, {main_no: orderId}); return await this.get(url, {main_no: orderId});
// return this._processOrderDetail(data); // return this._processOrderDetail(data);
} }
...@@ -101,7 +110,8 @@ export default class order extends base { ...@@ -101,7 +110,8 @@ export default class order extends base {
* 物流发货 * 物流发货
*/ */
static async send(param) { static async send(param) {
const url = `${this.baseUrl}/orders/Orders/sendOff`; const url = `${base.gtBaseUrl()}/orders/Orders/sendOff`;
param.merchants_id = wepy.$instance.globalData.siteBusinessId;
return await this.post(url, param); return await this.post(url, param);
} }
...@@ -109,7 +119,9 @@ export default class order extends base { ...@@ -109,7 +119,9 @@ export default class order extends base {
* 同意退款 * 同意退款
*/ */
static async tuikuan(param) { static async tuikuan(param) {
const url = `${this.baseUrl}/orders/OrderPayment/orderRefund`; const url = `${base.gtBaseUrl()}/orders/OrderPayment/orderRefund`;
param.mtoken = wepy.$instance.globalData.siteMtoken;
param.token = wepy.$instance.globalData.siteToken;
return await this.post(url, param); return await this.post(url, param);
} }
...@@ -117,7 +129,7 @@ export default class order extends base { ...@@ -117,7 +129,7 @@ export default class order extends base {
* 订单备注 * 订单备注
*/ */
static async note(orderId, sellerNote) { static async note(orderId, sellerNote) {
const url = `${this.baseUrl}/orders/Orders/mallRemark`; const url = `${base.gtBaseUrl()}/orders/Orders/mallRemark`;
const param = { const param = {
main_no: orderId, main_no: orderId,
remark: sellerNote remark: sellerNote
...@@ -129,7 +141,7 @@ export default class order extends base { ...@@ -129,7 +141,7 @@ export default class order extends base {
* 订单打印 * 订单打印
*/ */
static async print(orderId) { static async print(orderId) {
const url = `${this.baseUrl}/orders/${orderId}/print`; const url = `${base.gtBaseUrl()}/orders/${orderId}/print`;
return await this.put(url); return await this.put(url);
} }
...@@ -137,7 +149,7 @@ export default class order extends base { ...@@ -137,7 +149,7 @@ export default class order extends base {
* 关闭订单 * 关闭订单
*/ */
static async close(orderId, note) { static async close(orderId, note) {
const url = `${this.baseUrl}/orders/${orderId}/status/close`; const url = `${base.gtBaseUrl()}/orders/${orderId}/status/close`;
const param = {orderId, note}; const param = {orderId, note};
return await this.put(url, param); return await this.put(url, param);
} }
...@@ -146,7 +158,7 @@ export default class order extends base { ...@@ -146,7 +158,7 @@ export default class order extends base {
* 确认收货 * 确认收货
*/ */
static confirmOrder(orderId) { static confirmOrder(orderId) {
const url = `${this.baseUrl}/orders/${orderId}/status/comments` const url = `${base.gtBaseUrl()}/orders/${orderId}/status/comments`
return this.put(url) return this.put(url)
} }
...@@ -154,7 +166,7 @@ export default class order extends base { ...@@ -154,7 +166,7 @@ export default class order extends base {
* 发货 * 发货
*/ */
static take(orderId) { static take(orderId) {
const url = `${this.baseUrl}/orders/${orderId}/take_food_order` const url = `${base.gtBaseUrl()}/orders/${orderId}/take_food_order`
return this.put(url) return this.put(url)
} }
...@@ -163,7 +175,7 @@ export default class order extends base { ...@@ -163,7 +175,7 @@ export default class order extends base {
* 订单改价 * 订单改价
*/ */
static async reprice(orderId, param) { static async reprice(orderId, param) {
const url = `${this.baseUrl}/orders/${orderId}/modify_money`; const url = `${base.gtBaseUrl()}/orders/${orderId}/modify_money`;
return await this.put(url, param); return await this.put(url, param);
} }
...@@ -171,7 +183,7 @@ export default class order extends base { ...@@ -171,7 +183,7 @@ export default class order extends base {
* 同意退款 * 同意退款
*/ */
static async agreeRefund(orderId) { static async agreeRefund(orderId) {
const url = `${this.baseUrl}/orders/${orderId}/refund_money`; const url = `${base.gtBaseUrl()}/orders/${orderId}/refund_money`;
const param = { const param = {
isAgree: 1 isAgree: 1
}; };
...@@ -182,7 +194,7 @@ export default class order extends base { ...@@ -182,7 +194,7 @@ export default class order extends base {
* 拒绝退款 * 拒绝退款
*/ */
static async rejectRefund(orderId, note) { static async rejectRefund(orderId, note) {
const url = `${this.baseUrl}/orders/${orderId}/refund_money`; const url = `${base.gtBaseUrl()}/orders/${orderId}/refund_money`;
const param = { const param = {
isAgree: 2, isAgree: 2,
disagreeCause: note disagreeCause: note
......
...@@ -48,17 +48,34 @@ ...@@ -48,17 +48,34 @@
<!--汇总信息--> <!--汇总信息-->
<view class="order-footer-container row-end"> <view class="order-footer-container row-end">
<view class="hx-time" wx:if="{{entry !== 'scan'}}">核销时间:{{order.check_time}}</view> <view></view>
<!-- <view class="hx-time" wx:if="{{entry !== 'scan'}}">核销时间:{{order.check_time}}</view> -->
<view class="{{entry === 'scan' &&'site-right'}}" > <view class="{{entry === 'scan' &&'site-right'}}" >
<text class="mr20">共{{order.product_info.length}}件商品</text> <text class="mr20">共{{order.product_info.length}}件商品</text>
<!-- <text>合计:</text>--> <!-- <text>合计:</text>-->
<!-- <text class="major xl mr20">¥{{order.order_actual_payment / 100}}</text>--> <!-- <text class="major xl mr20">¥{{order.order_actual_payment / 100}}</text>-->
<text> 总结算价:</text> <text> 总结算价:</text>
<text class="major xl mr20">¥{{(order.order_price_cost ? order.order_price_cost : order.order_actual_payment) / 100}}</text> <text class="major xl mr20">¥{{order.order_actual_payment / 100}}</text>
<text wx:if="{{order.courier_fee}}">(含运费¥{{order.courier_fee / 100}})</text> <text wx:if="{{order.courier_fee}}">(含运费¥{{order.courier_fee / 100}})</text>
</view> </view>
</view> </view>
<!--操作栏/可以抽取为组件-->
<view class="order-action-bar row-between" wx:if="{{remarksss == 0}}">
<view></view>
<view>
<form report-submit="true" @submit="remark({{order.main_no}},{{order.mall_remarks}})">
<button class="zan-btn zan-btn--small" formType='submit'>备注{{remark}}</button>
</form>
<form report-submit="true" @submit="send({{order.main_no}})">
<button wx:if="{{order.state == 3}}" class="zan-btn zan-btn--small" formType="submit">发货</button>
</form>
<form report-submit="true" @submit="action({{order.main_no}})">
<button wx:if="{{order.state == 7}}" class="zan-btn zan-btn--small" formType="submit">同意退款</button>
</form>
</view>
</view>
</view> </view>
</template> </template>
...@@ -99,15 +116,15 @@ ...@@ -99,15 +116,15 @@
methods = { methods = {
async action(orderId,e) { async action(orderId,e) {
let openid = wx.getStorageSync('openid'),formid = e.detail.formId; // let openid = wx.getStorageSync('openid'),formid = e.detail.formId;
let mtoken = wx.getStorageSync('mtoken'); // let mtoken = wx.getStorageSync('mtoken');
Open.sendFormid({ // Open.sendFormid({
btoken: 'LESTORE_BUSINESS_LITE', // btoken: 'LESTORE_BUSINESS_LITE',
mtoken: 'LESTORE_BUSINESS_LITE', // mtoken: 'LESTORE_BUSINESS_LITE',
utoken: mtoken, // utoken: mtoken,
form_id: formid, // form_id: formid,
openid: openid // openid: openid
}).then(res => {}) // }).then(res => {})
this.$root.$navigate('refund', {orderId}); this.$root.$navigate('refund', {orderId});
}, },
expand(orderId) { expand(orderId) {
...@@ -119,27 +136,18 @@ ...@@ -119,27 +136,18 @@
}, },
remark(orderId, remarks,e) { remark(orderId, remarks,e) {
let openid = wx.getStorageSync('openid'),formid = e.detail.formId;
let mtoken = wx.getStorageSync('mtoken');
Open.sendFormid({
btoken: 'LESTORE_BUSINESS_LITE',
mtoken: 'LESTORE_BUSINESS_LITE',
utoken: mtoken,
form_id: formid,
openid: openid
}).then(res => {})
this.$root.$navigate('remark', {orderId,remarks}); this.$root.$navigate('remark', {orderId,remarks});
}, },
send(orderId,e) { send(orderId,e) {
let openid = wx.getStorageSync('openid'),formid = e.detail.formId; // let openid = wx.getStorageSync('openid'),formid = e.detail.formId;
let mtoken = wx.getStorageSync('mtoken'); // let mtoken = wx.getStorageSync('mtoken');
Open.sendFormid({ // Open.sendFormid({
btoken: 'LESTORE_BUSINESS_LITE', // btoken: 'LESTORE_BUSINESS_LITE',
mtoken: 'LESTORE_BUSINESS_LITE', // mtoken: 'LESTORE_BUSINESS_LITE',
utoken: mtoken, // utoken: mtoken,
form_id: formid, // form_id: formid,
openid: openid // openid: openid
}).then(res => {}) // }).then(res => {})
this.$root.$navigate('send', {orderId}); this.$root.$navigate('send', {orderId});
} }
}; };
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<template> <template>
<view class="container"> <view class="container">
<view> <view>
<ZanTab :tab.sync="tab" @change.user="switchTap"/>
<repeat for="{{list}}" key="index" index="index" item="item"> <repeat for="{{list}}" key="index" index="index" item="item">
<OrderItem :order.sync="item" @tap.user="detail" @receive.user="receive"></OrderItem> <OrderItem :order.sync="item" @tap.user="detail" @receive.user="receive"></OrderItem>
</repeat> </repeat>
...@@ -21,6 +22,8 @@ ...@@ -21,6 +22,8 @@
import OrderItem from './components/item'; import OrderItem from './components/item';
import OrderItemTang from './components/itemCaterTang'; import OrderItemTang from './components/itemCaterTang';
import Placeholder from '../../components/common/placeholder'; import Placeholder from '../../components/common/placeholder';
import ZanTab from '../../components/zanui/expand-tab';
import Event from '../../utils/Event';
export default class OrderIndex extends wepy.page { export default class OrderIndex extends wepy.page {
config = { config = {
...@@ -32,24 +35,41 @@ ...@@ -32,24 +35,41 @@
data = { data = {
list: [], list: [],
pages: 1, pages: 1,
isPageEmpty: false isPageEmpty: false,
tab:{
list: [
{id: '0', title: '全部'},
{id: '3', title: '待发货'},
{id: '5', title: '已完成'},
{id: '7', title: '退款订单'}
],
expand: [],
expandDefaultText: '',
selectedId: '0',
scroll: false
},
status:0
}; };
async onLoad() { async onLoad() {
this.getList(); this.getList(true);
Event.listen(Event.ORDER_LIST_UPDATE, this.getList.bind(this,true), this);
Event.listen(Event.ORDER_TAB_UPDATE, this.updateStatus.bind(this), this);
}; };
onUnload() {
Event.remove(Event.ORDER_LIST_UPDATE, this);
Event.remove(Event.ORDER_TAB_UPDATE, this);
}
getList(refresh=false) { getList(refresh=false) {
console.log(123) console.log(123)
if(refresh) { if(refresh) {
this.pages = 1; this.pages = 1;
this.list = []; this.list = [];
} }
order.getCheckerOrderList({ order.getHotOrderList({
page: this.pages, page: this.pages,
page_size: 10, page_size: 10,
state: 0 state: this.status
}).then(res => { }).then(res => {
if (res.error === 0 && res.data.info) { if (res.error === 0 && res.data.info) {
if(res.data.info.length>0){ if(res.data.info.length>0){
...@@ -61,6 +81,14 @@ ...@@ -61,6 +81,14 @@
this.$apply(); this.$apply();
}) })
} }
// 切换状态
updateStatus(status) {
this.tab.selectedId = status;
this.status = status;
this.getList(true);
}
async onPullDownRefresh() { async onPullDownRefresh() {
await this.getList(true); await this.getList(true);
...@@ -75,12 +103,19 @@ ...@@ -75,12 +103,19 @@
detail(orderId) { detail(orderId) {
this.$navigate('detail', {orderId}); this.$navigate('detail', {orderId});
}, },
//切换tab
switchTap(data) {
this.status = data.selectedId;
this.getList(true);
},
}; };
components = { components = {
OrderItem: OrderItem, OrderItem: OrderItem,
Placeholder: Placeholder, Placeholder: Placeholder,
OrderItemTang: OrderItemTang, OrderItemTang: OrderItemTang,
ZanTab: ZanTab,
}; };
mixins = [pagination, base]; mixins = [pagination, base];
} }
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
</view> </view>
<view class="form-group"> <view class="form-group">
<view>退款金额:</view> <view>退款金额:</view>
<input class="" @input="getRefundMoney" placeholder="请输入退款金额"> <input class="" @input="getRefundMoney" placeholder="请输入退款金额"/>
</view> </view>
<view class="form-group"> <view class="form-group">
<view>退款原因:</view> <view>退款原因:</view>
<input class="" @input="getRefundReason" placeholder="请输入退款原因"> <input class="" @input="getRefundReason" placeholder="请输入退款原因"/>
</view> </view>
</view> </view>
...@@ -96,7 +96,9 @@ ...@@ -96,7 +96,9 @@
money: this.money, money: this.money,
reason: this.reason, reason: this.reason,
from: 2, from: 2,
payment_type: 1 payment_type: 1,
accept: 1,
is_active:1
} }
await order.tuikuan(params).then(async res => { await order.tuikuan(params).then(async res => {
if (res.error == 0) { if (res.error == 0) {
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
await order.note(this.orderId, this.input.sellerNote) await order.note(this.orderId, this.input.sellerNote)
await Tips.success('保存成功'); await Tips.success('保存成功');
Event.emit(Event.ORDER_LIST_UPDATE); Event.emit(Event.ORDER_LIST_UPDATE);
this.$switch('index'); wepy.navigateBack();
} }
}; };
config = { config = {
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<!--发货表单--> <!--发货表单-->
<view class="weui-cells weui-cells_after-title form"> <view class="weui-cells weui-cells_after-title form">
<view class="weui-cell weui-cell_switch"> <!-- <view class="weui-cell weui-cell_switch"> -->
<!--<view class="weui-cell__bd">{{input.isMail ? '物流发货' : '同城配送'}}</view>--> <!--<view class="weui-cell__bd">{{input.isMail ? '物流发货' : '同城配送'}}</view>-->
<!--<view class="weui-cell__ft">--> <!--<view class="weui-cell__ft">-->
<!--<switch checked="{{input.isMail}}" id="isMail" @change="input" />--> <!--<switch checked="{{input.isMail}}" id="isMail" @change="input" />-->
<!--</view>--> <!--</view>-->
</view> <!-- </view> -->
<view class="weui-cell weui-cell_input" @tap="select"> <view class="weui-cell weui-cell_input" @tap="select">
<view class="weui-cell__hd"> <view class="weui-cell__hd">
<view class="weui-label">快递公司</view> <view class="weui-label">快递公司</view>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
await order.note(this.orderId, this.input.sellerNote) await order.note(this.orderId, this.input.sellerNote)
await Tips.success('保存成功'); await Tips.success('保存成功');
Event.emit(Event.ORDER_LIST_UPDATE); Event.emit(Event.ORDER_LIST_UPDATE);
this.$switch('index'); wepy.navigateBack();
} }
}; };
config = { config = {
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<!--发货表单--> <!--发货表单-->
<view class="weui-cells weui-cells_after-title form"> <view class="weui-cells weui-cells_after-title form">
<view class="weui-cell weui-cell_switch"> <!-- <view class="weui-cell weui-cell_switch"> -->
<!--<view class="weui-cell__bd">{{input.isMail ? '物流发货' : '同城配送'}}</view>--> <!--<view class="weui-cell__bd">{{input.isMail ? '物流发货' : '同城配送'}}</view>-->
<!--<view class="weui-cell__ft">--> <!--<view class="weui-cell__ft">-->
<!--<switch checked="{{input.isMail}}" id="isMail" @change="input" />--> <!--<switch checked="{{input.isMail}}" id="isMail" @change="input" />-->
<!--</view>--> <!--</view>-->
</view> <!-- </view> -->
<view class="weui-cell weui-cell_input" @tap="select"> <view class="weui-cell weui-cell_input" @tap="select">
<view class="weui-cell__hd"> <view class="weui-cell__hd">
<view class="weui-label">快递公司</view> <view class="weui-label">快递公司</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!