@@ -3,13 +3,16 @@
< view class = "order-container" >
< view class = "order-container" >
< view class = "cate-search" >
< view class = "cate-search" >
< view class = "search-box" >
< view class = "search-box" >
< input class = "uni-input" maxlength = "50" v-model = "searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()" @click.stop="search()" @tap.stop="search()" / >
< input class = "uni-input" maxlength = "50" v-model = "searchText" confirm-type="search"
placeholder = "请输入商品名称/订单编号" @confirm ="search()" @click.stop ="search()" @tap.stop ="search()" / >
< text class = "iconfont icon-sousuo3" @click.stop ="search()" @tap.stop ="search()" > < / text >
< text class = "iconfont icon-sousuo3" @click.stop ="search()" @tap.stop ="search()" > < / text >
< / view >
< / view >
< / view >
< / view >
< view class = "order-nav" v-if = "storeToken" >
< view class = "order-nav" v-if = "storeToken" >
< view v-for = "(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap" >
< view v-for = "(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item"
< text class = "uni-tab-item-title" : class = "statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''" >
:id = "statusItem.id" :data-current = "statusIndex" @click ="ontabtap" >
< text class = "uni-tab-item-title"
: class = "statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''" >
{ { statusItem . name } }
{ { statusItem . name } }
< / text >
< / text >
< / view >
< / view >
@@ -17,14 +20,15 @@
<!-- # ifdef MP -- >
<!-- # ifdef MP -- >
< mescroll-uni ref = "mescroll" @getData ="getListData" top = "176rpx" v-if = "storeToken" >
< mescroll-uni ref = "mescroll" @getData ="getListData" top = "176rpx" v-if = "storeToken" >
< ! - - # endif - - >
< ! - - # endif - - >
<!-- # ifndef MP -- >
<!-- # ifndef MP -- >
< mescroll-uni ref = "mescroll" @getData ="getListData" top = "196rpx" v-if = "storeToken" >
< mescroll-uni ref = "mescroll" @getData ="getListData" top = "196rpx" v-if = "storeToken" >
< ! - - # endif - - >
< ! - - # endif - - >
< block slot = "list" >
< block slot = "list" >
< view class = "order-list" v-if = "orderList.length > 0" >
< view class = "order-list" v-if = "orderList.length > 0" >
< view class = "order-item" v-for = "(orderItem, orderIndex) in orderList" :key="orderIndex" >
< view class = "order-item" v-for = "(orderItem, orderIndex) in orderList" :key="orderIndex" >
< view class = "order-header" : class = "{ waitpay: orderStatus == 'waitpay' && orderItem.order_status == 0 }" >
< view class = "order-header"
: class = "{ waitpay: orderStatus == 'waitpay' && orderItem.order_status == 0 }" >
<!-- < view class = "iconfont"
<!-- < view class = "iconfont"
: class = "$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
: class = "$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
@click ="selectOrder(orderItem.order_id, orderItem.pay_money)"
@click ="selectOrder(orderItem.order_id, orderItem.pay_money)"
@@ -35,20 +39,24 @@
< / view >
< / view >
< view class = "order-body" @click ="orderDetail(orderItem)" >
< view class = "order-body" @click ="orderDetail(orderItem)" >
< block v-if = "orderItem.order_goods.length == 1" >
< block v-if = "orderItem.order_goods.length == 1" >
< view class = "goods-wrap" v-for = "(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex" >
< view class = "goods-wrap" v-for = "(goodsItem, goodsIndex) in orderItem.order_goods"
:key = "goodsIndex" >
< view class = "goods-img" >
< view class = "goods-img" >
< image : src = "$util.img(goodsItem.sku_image, { size: 'mid' })" @error ="imageError(orderIndex, goodsIndex)" mode = "aspectFill" :lazy-load = "true" / >
< image : src = "$util.img(goodsItem.sku_image, { size: 'mid' })"
@error ="imageError(orderIndex, goodsIndex)" mode = "aspectFill"
:lazy-load = "true" / >
< / view >
< / view >
< view class = "goods-info" >
< view class = "goods-info" >
< view class = "pro-info" >
< view class = "pro-info" >
< view class = "goods-name" v-if = "goodsItem.goods_class == 2" > {{ goodsItem.goods_name }} < / view >
< view class = "goods-name" v-if = "goodsItem.goods_class == 2" > {{
goodsItem.goods_name }} < / view >
< view class = "goods-name" v-else > {{ goodsItem.sku_name }} < / view >
< view class = "goods-name" v-else > {{ goodsItem.sku_name }} < / view >
< view class = "sku" v-if = "goodsItem.sku_spec_format" >
< view class = "sku" v-if = "goodsItem.sku_spec_format" >
< view class = "goods-spec" >
< view class = "goods-spec" >
< block v-for = "(x, i) in goodsItem.sku_spec_format" :key="i" >
< block v-for = "(x, i) in goodsItem.sku_spec_format" :key="i" >
{{ x.spec_value_name }}
{{ x.spec_value_name }}
{{ i < goodsItem.sku_spec_format.length - 1 ? ' ; ' : ' ' }}
{{ i < goodsItem.sku_spec_format.length - 1 ? ' ; ' : ' ' }}
< / block >
< / block >
< / view >
< / view >
< / view >
< / view >
< / view >
< / view >
@@ -73,8 +81,12 @@
< view class = "multi-order-goods" >
< view class = "multi-order-goods" >
< scroll-view scroll -x = " true " class = "scroll-view" >
< scroll-view scroll -x = " true " class = "scroll-view" >
< view class = "goods-wrap" >
< view class = "goods-wrap" >
< view class = "goods-img" v-for = "(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex" >
< view class = "goods-img"
< image : src = "$util.img(goodsItem.sku_image, { size: 'mid' })" @error ="imageError(orderIndex, goodsIndex)" mode = "aspectFill" :lazy-load = "true" / >
v-for = "(goodsItem, goodsIndex) in orderItem.order_goods"
:key = "goodsIndex" >
< image : src = "$util.img(goodsItem.sku_image, { size: 'mid' })"
@error ="imageError(orderIndex, goodsIndex)" mode = "aspectFill"
:lazy-load = "true" / >
< / view >
< / view >
< / view >
< / view >
< / scroll-view >
< / scroll-view >
@@ -90,7 +102,8 @@
< text class = "font-size-sub" > 共 { { orderItem . goods _num } } 件商品 < / text >
< text class = "font-size-sub" > 共 { { orderItem . goods _num } } 件商品 < / text >
< text class = "align-right font-size-base" >
< text class = "align-right font-size-base" >
实付款 :
实付款 :
< text class = "font-size-base price-font" > { { $lang ( 'common.currencySymbol' ) } } { { orderItem . order _money } } < / text >
< text class = "font-size-base price-font" > { { $lang ( 'common.currencySymbol' )
} } { { orderItem . order _money } } < / text >
< / text >
< / text >
< / view >
< / view >
< / view >
< / view >
@@ -117,8 +130,10 @@
{{ operationItem.title }}
{{ operationItem.title }}
< / view >
< / view >
< / view >
< / view >
< view class = "order-action" v-else-if = "orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1" >
< view class = "order-action"
< view class = "order-box-btn" v-if = "orderItem.is_evaluate == 1" @click="operation('memberOrderEvaluation', orderItem) ">
v-else-if = "orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1 ">
< view class = "order-box-btn" v-if = "orderItem.is_evaluate == 1"
@click ="operation('memberOrderEvaluation', orderItem)" >
< text v-if = "orderItem.evaluate_status == 0" > 评价 < / text >
< text v-if = "orderItem.evaluate_status == 0" > 评价 < / text >
< text v-else-if = "orderItem.evaluate_status == 1" > 追评 < / text >
< text v-else-if = "orderItem.evaluate_status == 1" > 追评 < / text >
< / view >
< / view >
@@ -131,8 +146,9 @@
< / view >
< / view >
< view v-else > < ns -empty :isIndex = "false" :text = "$lang('emptyTips')" > < / ns-empty > < / view >
< view v-else > < ns -empty :isIndex = "false" :text = "$lang('emptyTips')" > < / ns-empty > < / view >
< / block >
< / block >
<!-- # ifndef MP -- >
< / mescroll-uni >
< / mescroll-uni >
<!-- # endif -- >
<!-- < view class = "order-batch-action" : class = "{ 'bottom-safe-area': isIphoneX }" v-if = "mergePayOrder.length" >
<!-- < view class = "order-batch-action" : class = "{ 'bottom-safe-area': isIphoneX }" v-if = "mergePayOrder.length" >
< view class = "action-btn color-base-text color-base-border" @click ="mergePay()" > 合并付款 < / view >
< view class = "action-btn color-base-text color-base-border" @click ="mergePay()" > 合并付款 < / view >
< / view > - - >
< / view > - - >
@@ -143,320 +159,324 @@
< ns-login ref = "login" > < / ns-login >
< ns-login ref = "login" > < / ns-login >
< loading-cover ref = "loadingCover" > < / loading-cover >
< loading-cover ref = "loadingCover" > < / loading-cover >
<!-- # ifdef MP -- >
< / mescroll-uni >
<!-- # endif -- >
< / view >
< / view >
< / template >
< / template >
< script >
< script >
import orderMethod from './public/js/orderMethod.js' ;
import orderMethod from './public/js/orderMethod.js' ;
import nsPayment from '@/components/payment/payment.vue' ;
import nsPayment from '@/components/payment/payment.vue' ;
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue" ;
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue" ;
import nsLogin from '@/components/ns-login/ns-login.vue' ;
import nsLogin from '@/components/ns-login/ns-login.vue' ;
import loadingCover from '@/components/loading-cover/loading-cover.vue' ;
import loadingCover from '@/components/loading-cover/loading-cover.vue' ;
import nsEmpty from '@/components/ns-empty/ns-empty.vue' ;
import nsEmpty from '@/components/ns-empty/ns-empty.vue' ;
export default {
export default {
components : {
components : {
nsPayment ,
nsPayment ,
MescrollUni ,
MescrollUni ,
nsLogin ,
nsLogin ,
loadingCover ,
loadingCover ,
nsEmpty
nsEmpty
} ,
data ( ) {
return {
scrollInto : '' ,
orderStatus : 'all' ,
statusList : [ ] ,
orderList : [ ] ,
contentText : { } ,
mergePayOrder : [ ] ,
isIphoneX : false ,
evaluateConfig : {
evaluate _audit : 1 ,
evaluate _show : 0 ,
evaluate _status : 1
} ,
orderData : { } ,
payMoney : 0 ,
payMoneyMerge : 0 ,
order _id : 0 ,
searchText : "" ,
pageText : "" ,
payConfig : null ,
isTradeManaged : false // 检测微信小程序是否已开通发货信息管理服务
} ;
} ,
mixins : [ orderMethod ] ,
onLoad ( option ) {
if ( option . status ) this . orderStatus = option . status ;
if ( option . order _id ) this . order _id = option . order _id ;
} ,
onShow ( ) {
this . isIphoneX = this . $util . uniappIsIPhoneX ( ) ;
this . getEvaluateConfig ( ) ;
this . getOrderStatus ( ) ;
if ( this . storeToken ) {
if ( this . $refs . mescroll ) this . $refs . mescroll . refresh ( ) ;
} else {
this . $nextTick ( ( ) => {
this . $refs . login . open ( '/pages_order/list?status=' + this . orderStatus ) ;
} )
}
} ,
onUnload ( ) {
if ( ! this . storeToken && this . $refs . login ) this . $refs . login . cancelCompleteInfo ( ) ;
} ,
methods : {
ontabtap ( e ) {
let index = e . target . dataset . current || e . currentTarget . dataset . current ;
this . orderStatus = this . statusList [ index ] . status ;
if ( this . orderStatus == '' ) this . mergePayOrder = [ ] ;
this . $refs . loadingCover . show ( ) ;
this . $refs . mescroll . refresh ( ) ;
} ,
} ,
data ( ) {
getListData ( mescroll ) {
return {
scrollInto : '' ,
this . $api . sendRequest ( {
orderStatus : 'all ',
url : '/api/order/lists ',
statusList : [ ] ,
data : {
orderList : [ ] ,
page : mescroll . num ,
contentText : { } ,
page _size : mescroll . size ,
mergePayOrder : [ ] ,
order _status : this . orderStatus ,
isIphoneX : false ,
order _id : this . order _id ,
evaluateConfig : {
searchText : this . pageText
evaluate _audit : 1 ,
evaluate _show : 0 ,
evaluate _status : 1
} ,
} ,
orderData : { } ,
success : res => {
payMoney : 0 ,
let newArr = [ ] ;
payMoneyMerge : 0 ,
let msg = res . message ;
order _id : 0 ,
let auto _close = 0
searchText : "" ,
if ( res . code == 0 && res . data ) {
pageText : "" ,
newArr = res . data . list ;
payConfig : null ,
auto _close = res . data . auto _close ;
isTradeManaged : false // 检测微信小程序是否已开通发货信息管理服务
this . payConfig = res . data . pay _config ;
} ;
this . isTradeManaged = res . data . is _trade _managed ;
} else {
this . $util . showToast ( {
title : msg
} ) ;
}
mescroll . endSuccess ( newArr . length ) ;
//设置列表数据
if ( mescroll . num == 1 ) {
this . orderList = [ ] ; //如果是第一页需手动制空列表
this . order _id = 0
}
this . orderList = this . orderList . concat ( newArr ) ; //追加新数据
let date = ( Date . parse ( new Date ( ) ) ) / 1000
this . orderList . forEach ( v => {
v . discountTimeMachine = this . $util . countDown ( ( v . create _time + auto _close ) - date ) ;
v . order _goods . forEach ( vo => {
if ( vo . sku _spec _format ) {
try {
vo . sku _spec _format = JSON . parse ( vo . sku _spec _format ) ;
} catch ( e ) {
vo . sku _spec _format = vo . sku _spec _format ;
}
} else {
vo . sku _spec _format = [ ] ;
}
} ) ;
} ) ;
if ( this . $refs . loadingCover ) this . $refs . loadingCover . hide ( ) ;
} ,
fail : res => {
mescroll . endErr ( ) ;
if ( this . $refs . loadingCover ) this . $refs . loadingCover . hide ( ) ;
}
} ) ;
} ,
} ,
/**
mixins : [ orderMethod ] ,
* 获取订单状态
onLoad ( option ) {
*/
if ( option . status ) this . orderStatus = option . status ;
getOrderStatus ( ) {
if ( option . order _id ) this . order _id = option . order _id ;
this . statusList = [ {
status : 'all' ,
name : '全部' ,
id : 'status_0'
} ,
{
status : 'waitpay' ,
name : '待付款' ,
id : 'status_1'
} ,
{
status : 'waitsend' ,
name : '待发货' ,
id : 'status_2'
} ,
{
status : 'waitconfirm' ,
name : '待收货' ,
id : 'status_3'
} ,
{
status : 'waitrate' ,
name : '已完成' ,
id : 'status_4'
} ,
/*{
status: 'wait_use',
name: '待使用',
id: 'status_4'
}*/
] ;
} ,
} ,
onShow ( ) {
operation ( action , orderData ) {
this . isIphoneX = this . $util . uniappIsIPhoneX ( ) ;
let index = this . status ;
this . getEvaluateConfig ( ) ;
switch ( action ) {
this . getOrderStatus ( ) ;
case 'orderPay' : // 支付
this . orderData = orderData ;
if ( this . storeToken ) {
this . payMoney = parseFloat ( orderData . pay _money ) ;
if ( this . $refs . mescroll ) this . $refs . mescroll . refresh ( ) ;
this . orderPay ( orderData ) ;
} else {
break ;
this . $nextTick ( ( ) => {
case 'orderClose' : //关闭
this . $refs . login . open ( '/pages_order/list?status=' + this . orderStatus ) ;
this . orderClose ( orderData . order _id , ( ) => {
} )
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
case 'memberTakeDelivery' : //收货
this . orderData = orderData ;
this . orderData . pay _config = { } ;
this . orderData . pay _config . mch _id = this . payConfig . mch _id ;
this . orderData . is _trade _managed = this . isTradeManaged ;
this . orderDelivery ( this . orderData , ( ) => {
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
case 'trace' : //查看物流
this . $util . redirectTo ( '/pages_tool/order/logistics' , {
order _id : orderData . order _id
} ) ;
break ;
case 'memberOrderEvaluation' : //评价
this . $util . redirectTo ( '/pages_tool/order/evaluate' , {
order _id : orderData . order _id
} ) ;
break ;
case 'memberVirtualTakeDelivery' :
this . orderData = orderData ;
this . orderData . pay _config = { } ;
this . orderData . pay _config . mch _id = this . payConfig . mch _id ;
this . orderData . is _trade _managed = this . isTradeManaged ;
this . orderVirtualDelivery ( this . orderData , ( ) => {
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
}
}
} ,
} ,
onUnload ( ) {
orderDetail ( data ) {
if ( ! this . storeToken && this . $refs . login ) this . $refs . login . cancelCompleteInfo ( ) ;
switch ( parseInt ( data . order _type ) ) {
case 2 :
// 自提订单
this . $util . redirectTo ( '/pages_order/detail_pickup' , {
order _id : data . order _id
} ) ;
break ;
case 3 :
// 本地配送订单
this . $util . redirectTo ( '/pages_order/detail_local_delivery' , {
order _id : data . order _id
} ) ;
break ;
case 4 :
// 虚拟订单
this . $util . redirectTo ( '/pages_tool/order/detail_virtual' , {
order _id : data . order _id
} ) ;
break ;
default :
this . $util . redirectTo ( '/pages_order/detail' , {
order _id : data . order _id
} ) ;
break ;
}
} ,
} ,
methods : {
/**
ontabtap ( e ) {
* 选择订单
let index = e . target . dataset . current || e . currentTarget . dataset . current ;
* @param {Object} orderId
this . orderStatus = this . statusList [ index ] . status ;
*/
if ( this . orderStatus == '' ) this . mergePayOrder = [ ] ;
selectOrder ( orderId , pay _money ) {
this . $refs . loadingCover . show ( ) ;
if ( this . $util . inArray ( orderId , this . mergePayOrder ) != - 1 ) {
this . $refs . mescroll . refresh ( ) ;
this . mergePayOrder . splice ( this . $util . inArray ( orderId , this . mergePayOrder ) , 1 ) ;
} ,
this . payMoneyMerge -= parseFloat ( pay _money ) ;
getListData ( mescroll ) {
} else {
this . payMoneyMerge += parseFloat ( pay _money ) ;
this . mergePayOrder . push ( orderId ) ;
}
} ,
/**
* 合并支付
*/
mergePay ( ) {
if ( this . mergePayOrder . length ) {
this . $api . sendRequest ( {
this . $api . sendRequest ( {
url : '/api/order/lists ' ,
url : '/api/order/pay ' ,
data : {
data : {
page : mescroll . num ,
order _ids : this . mergePayOrder . toString ( )
page _size : mescroll . size ,
order _status : this . orderStatus ,
order _id : this . order _id ,
searchText : this . pageText
} ,
} ,
success : res => {
success : res => {
let newArr = [ ] ;
if ( res . code > = 0 ) {
let msg = res . message ;
this . $refs . choosePaymentMergePopup . getPayInfo ( res . data ) ;
let auto _close = 0
if ( res . code == 0 && res . data ) {
newArr = res . data . list ;
auto _close = res . data . auto _close ;
this . payConfig = res . data . pay _config ;
this . isTradeManaged = res . data . is _trade _managed ;
} else {
} else {
this . $util . showToast ( {
this . $util . showToast ( {
title : msg
title : res . message
} ) ;
} ) ;
}
}
mescroll . endSuccess ( newArr . length ) ;
//设置列表数据
if ( mescroll . num == 1 ) {
this . orderList = [ ] ; //如果是第一页需手动制空列表
this . order _id = 0
}
this . orderList = this . orderList . concat ( newArr ) ; //追加新数据
let date = ( Date . parse ( new Date ( ) ) ) / 1000
this . orderList . forEach ( v => {
v . discountTimeMachine = this . $util . countDown ( ( v . create _time + auto _close ) - date ) ;
v . order _goods . forEach ( vo => {
if ( vo . sku _spec _format ) {
try {
vo . sku _spec _format = JSON . parse ( vo . sku _spec _format ) ;
} catch ( e ) {
vo . sku _spec _format = vo . sku _spec _format ;
}
} else {
vo . sku _spec _format = [ ] ;
}
} ) ;
} ) ;
if ( this . $refs . loadingCover ) this . $refs . loadingCover . hide ( ) ;
} ,
fail : res => {
mescroll . endErr ( ) ;
if ( this . $refs . loadingCover ) this . $refs . loadingCover . hide ( ) ;
}
} ) ;
} ,
/**
* 获取订单状态
*/
getOrderStatus ( ) {
this . statusList = [ {
status : 'all' ,
name : '全部' ,
id : 'status_0'
} ,
{
status : 'waitpay' ,
name : '待付款' ,
id : 'status_1'
} ,
{
status : 'waitsend' ,
name : '待发货' ,
id : 'status_2'
} ,
{
status : 'waitconfirm' ,
name : '待收货' ,
id : 'status_3'
} ,
{
status : 'waitrate' ,
name : '已完成' ,
id : 'status_4'
} ,
/*{
status: 'wait_use',
name: '待使用',
id: 'status_4'
}*/
] ;
} ,
operation ( action , orderData ) {
let index = this . status ;
switch ( action ) {
case 'orderPay' : // 支付
this . orderData = orderData ;
this . payMoney = parseFloat ( orderData . pay _money ) ;
this . orderPay ( orderData ) ;
break ;
case 'orderClose' : //关闭
this . orderClose ( orderData . order _id , ( ) => {
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
case 'memberTakeDelivery' : //收货
this . orderData = orderData ;
this . orderData . pay _config = { } ;
this . orderData . pay _config . mch _id = this . payConfig . mch _id ;
this . orderData . is _trade _managed = this . isTradeManaged ;
this . orderDelivery ( this . orderData , ( ) => {
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
case 'trace' : //查看物流
this . $util . redirectTo ( '/pages_tool/order/logistics' , {
order _id : orderData . order _id
} ) ;
break ;
case 'memberOrderEvaluation' : //评价
this . $util . redirectTo ( '/pages_tool/order/evaluate' , {
order _id : orderData . order _id
} ) ;
break ;
case 'memberVirtualTakeDelivery' :
this . orderData = orderData ;
this . orderData . pay _config = { } ;
this . orderData . pay _config . mch _id = this . payConfig . mch _id ;
this . orderData . is _trade _managed = this . isTradeManaged ;
this . orderVirtualDelivery ( this . orderData , ( ) => {
this . $refs . mescroll . refresh ( ) ;
} ) ;
break ;
}
} ,
orderDetail ( data ) {
switch ( parseInt ( data . order _type ) ) {
case 2 :
// 自提订单
this . $util . redirectTo ( '/pages_order/detail_pickup' , {
order _id : data . order _id
} ) ;
break ;
case 3 :
// 本地配送订单
this . $util . redirectTo ( '/pages_order/detail_local_delivery' , {
order _id : data . order _id
} ) ;
break ;
case 4 :
// 虚拟订单
this . $util . redirectTo ( '/pages_tool/order/detail_virtual' , {
order _id : data . order _id
} ) ;
break ;
default :
this . $util . redirectTo ( '/pages_order/detail' , {
order _id : data . order _id
} ) ;
break ;
}
} ,
/**
* 选择订单
* @param {Object} orderId
*/
selectOrder ( orderId , pay _money ) {
if ( this . $util . inArray ( orderId , this . mergePayOrder ) != - 1 ) {
this . mergePayOrder . splice ( this . $util . inArray ( orderId , this . mergePayOrder ) , 1 ) ;
this . payMoneyMerge -= parseFloat ( pay _money ) ;
} else {
this . payMoneyMerge += parseFloat ( pay _money ) ;
this . mergePayOrder . push ( orderId ) ;
}
} ,
/**
* 合并支付
*/
mergePay ( ) {
if ( this . mergePayOrder . length ) {
this . $api . sendRequest ( {
url : '/api/order/pay' ,
data : {
order _ids : this . mergePayOrder . toString ( )
} ,
success : res => {
if ( res . code >= 0 ) {
this . $refs . choosePaymentMergePopup . getPayInfo ( res . data ) ;
} else {
this . $util . showToast ( {
title : res . message
} ) ;
}
}
} ) ;
}
} ,
imageError ( orderIndex , goodsIndex ) {
this . orderList [ orderIndex ] . order _goods [ goodsIndex ] . sku _image = this . $util . getDefaultImage ( ) . goods ;
this . $forceUpdate ( ) ;
} ,
getEvaluateConfig ( ) {
this . $api . sendRequest ( {
url : '/api/goodsevaluate/config' ,
success : res => {
if ( res . code == 0 ) {
var data = res . data ;
this . evaluateConfig = data ;
}
}
}
} ) ;
} ) ;
} ,
}
search ( ) {
} ,
this . pageText = this . searchT ext ;
imageError ( orderIndex , goodsInd ex) {
this . orderList [ orderIndex ] . order _goods [ goodsIndex ] . sku _image = this . $util . getDefaultImage ( ) . goods ;
this . $forceUpdate ( ) ;
} ,
getEvaluateConfig ( ) {
this . $api . sendRequest ( {
url : '/api/goodsevaluate/config' ,
success : res => {
if ( res . code == 0 ) {
var data = res . data ;
this . evaluateConfig = data ;
}
}
} ) ;
} ,
search ( ) {
this . pageText = this . searchText ;
this . $refs . mescroll . refresh ( ) ;
}
} ,
computed : {
mpOrderList ( ) {
if ( ! this . orderList [ this . status ] ) return ;
return this . orderList [ this . status ] . list || [ ] ;
}
} ,
watch : {
storeToken : function ( nVal , oVal ) {
if ( nVal ) {
this . $refs . mescroll . refresh ( ) ;
this . $refs . mescroll . refresh ( ) ;
}
}
} ,
computed : {
mpOrderList ( ) {
if ( ! this . orderList [ this . status ] ) return ;
return this . orderList [ this . status ] . list || [ ] ;
}
} ,
watch : {
storeToken : function ( nVal , oVal ) {
if ( nVal ) {
this . $refs . mescroll . refresh ( ) ;
}
}
}
}
} ;
}
} ;
< / script >
< / script >
< style lang = "scss" >
< style lang = "scss" >
@ import './public/css/list.scss' ;
@ import './public/css/list.scss' ;
< / style >
< / style >
< style scoped >
/ deep / . uni - page {
overflow : hidden ;
}
/ deep / . mescroll - upwarp {
< style lang = "scss" scoped >
padding - bottom : 100 rpx ;
/deep/ . uni - page {
}
overflow : hidden ;
}
/deep/ . mescroll - upwarp {
padding - bottom : 100 rpx ;
}
< / style >
< / style >