123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489 |
- <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
- <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div member-order-list">
- <view class="div common-header-wrap">
- <view class="status-holder"></view>
- <view :style="'height:'+navHeight+'px'"></view>
- <view class="common-header-holder"></view>
- <view class="common-header-fixed">
- <title-header />
- <view class="common-header">
- <view class="div slot" >
- <view class="div" style="text-align: left"><text class="span iconfont" @click="goBack()"></text></view>
- </view>
- <view class="common-search">
- <input type="text" v-model="keyword" placeholder="请输入您要搜索的订单商品名称" @click="goOrderSearch()">
- </view>
- </view>
- </view>
- </view>
- <!-- header -->
- <view class="div order-header">
- <view class="ul">
- <view
- class="li item"
- v-for="item in orderNav"
- v-bind:key="item.id"
- v-bind:class="{ active: stateType == item.id }"
- v-on:click="setOrderNavActive(item.id)"
- >
- {{ item.name }}
- </view>
- </view>
- </view>
- <view class="scroll-view div" style="position:relative">
- <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
- <view class="div order-body" v-if="order_group_list && order_group_list.length">
- <view class="div" v-for="(order_group, index) in order_group_list" v-bind:key="index">
- <view class="div list" v-for="item in order_group.order_list" :key="item.order_id">
- <navigator :url="'/pages/member/order/OrderDetail?order_id='+item.order_id">
- <view class="div tips-body">
- <text class="span tips"> 订单编号: {{ item.order_sn }} </text>
- <text class="span title tips statusTips" >{{ item.state_desc }}</text>
- </view>
- <view class="div order-image multiple" v-if="item.extend_order_goods.length > 1">
- <view class="div imagebox">
- <image mode="aspectFit" class="img" v-for="(image,index) in item.extend_order_goods" :key="index" v-bind:src="image.goods_image_url" />
- </view>
- </view>
- <view class="div order-image" v-else-if="item.extend_order_goods.length == 1" >
- <view class="div goods_info clearfix" v-for="(image,index) in item.extend_order_goods" :key="index" >
- <view class="div img-wrapper">
- <image mode="aspectFit" class="img" v-bind:src="image.goods_image_url" />
- </view>
- <view class="p goods_name">{{image.goods_name}}</view>
- <view class="p goods_price">
- <view class="price">¥{{image.goods_price}}</view>
- <view class="num">X{{image.goods_num}}</view>
- </view>
- </view>
- </view>
- <view class="div order-image" v-if="item.zengpin_list" >
- <view class="div goods_info clearfix" v-for="(image,index) in item.zengpin_list" :key="index" >
- <view class="div img-wrapper">
- <image mode="aspectFit" class="img" v-bind:src="image.image_url" />
- </view>
- <view class="p goods_name"><text class="span tag-icon">赠品</text>{{image.goods_name}}</view>
- <view class="p goods_price">
- <view class="price">¥{{image.goods_price}}</view>
- <view class="num">X{{image.goods_num}}</view>
- </view>
- </view>
- </view>
- <view class="div order_amount">
- (共计{{ item.extend_order_goods.length }}种商品) 合计 : <text class="order_amount_icon">¥</text><text class="i">{{ item.order_amount }}</text><text class="i freight">(运费:¥{{ item.shipping_fee }})</text>
- </view>
- </navigator>
- <view class="div order-list-opratio">
- <!-- 锁定-->
- <text class="button" v-if="item.if_lock && item.extend_refund" v-on:click="goRefund(item.extend_refund.refund_id)">退款中</text>
- <!-- 取消订单 -->
- <text class="button" v-if="item.if_cancel" v-on:click="cancel(item)">取消订单</text>
- <!-- 退款取消订单 -->
- <text v-if="item.if_refund_cancel" v-on:click="refund(item.order_id)" class="button line_red">退款</text>
- <!-- 物流跟踪 -->
- <text class="button" v-if="item.if_deliver" v-on:click="deliver(item.order_id)">物流跟踪</text>
- <!-- 收货 -->
- <text class="button" v-if="item.if_receive" v-on:click="receive(item.order_id)">收货</text>
- <!-- 评价 -->
- <text class="button" v-if="item.if_evaluation" v-on:click="evaluate(item.order_id)">评价</text>
- <!-- 删除 -->
- <text class="button" v-if="item.if_delete" v-on:click="deleteOrder(item)">删除</text>
- </view>
- </view>
- <!-- 独立按钮 涉及多个店铺合并 付款 -->
- <view v-if="order_group.pay_amount && order_group.pay_amount>0" class="div common-btn ds-button-large mt-5 mb-5" @click="pay(order_group.pay_sn)">付款</view>
- </view>
- </view>
- <empty-record v-else-if="order_group_list && !order_group_list.length"></empty-record>
- </scroll-view>
- </view>
- </view>
- <uni-popup background-color="#fff" ref="confirm" type="dialog">
- <uni-popup-dialog :mode="dialog.mode" :title="dialog.title" :content="dialog.content" :placeholder="dialog.content" @confirm="confirmDialog" @close="closeDialog"></uni-popup-dialog>
- </uni-popup>
- </member-base>
- </template>
- <script>
- import {getFontSize} from '@/util/common'
- import TitleHeader from '../../TitleHeader'
- import { urlencode } from '@/util/common'
- import MemberBase from '../MemberBase'
- import { getOrderList, cancelOrder, receiveOrder, deleteOrder } from '../../../api/memberOrder'
- import { mapState } from 'vuex'
- import EmptyRecord from '../../EmptyRecord'
- export default {
- components:{
- TitleHeader,
- MemberBase,
- EmptyRecord
- },
- name:'MemberOrderList',
- data(){
- return {
- if_pay:0,
- navHeight: 0,
- dialog:{},
- order_id: 0,
- orderNav: [
- {
- 'name': '全部',
- 'id': ''
- },
- {
- 'name': '待付款',
- 'id': 'state_new'
- },
- {
- 'name': '待发货',
- 'id': 'state_pay'
- },
- {
- 'name': '待收货',
- 'id': 'state_send'
- },
- {
- 'name': '待评价',
- 'id': 'state_noeval'
- }
- ],
- stateType: '',
- orderDetailVisible: false,
- wrapperHeight: 0,
- params: { 'page': 0, 'per_page': 10 },
- loading: false, // 是否加载更多
- isMore: true, // 是否有更多
- order_group_list: false
- }
- },
- mounted(){
- // #ifdef MP-WEIXIN
- this.navHeight = uni.getMenuButtonBoundingClientRect().top
- // #endif
- this.wrapperHeight = uni.getSystemInfoSync().windowHeight - 180
- },
- computed:{
- fontSize(){
- return getFontSize()
- },
- ...mapState({
- user: state => state.member.info
- })
- },
- onLoad: function (option) {
- this.if_pay=option.if_pay
- this.stateType=option.state ? option.state : ''
- this.keyword=option.keyword ? option.keyword : ''
- },
- onShow(){
- this.reload()
- },
- methods:{
- closeDialog(){
- },
- confirmDialog(value){
- switch(this.dialog.condition){
- case 1:
- deleteOrder(this.dialog.data.order_id).then(res => {
- this.getOrderList(true)
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- break
- case 2:
- cancelOrder(this.dialog.data.order_id).then(res => {
- this.getOrderList(true)
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- break
- case 3:
- receiveOrder(this.dialog.data).then(res => {
- this.getOrderList(true)
- }).catch(function (error) {
- uni.showToast({icon:'none',title: error.message})
- })
- break
- }
- },
- goOrderSearch () {
- uni.navigateTo({ url: '/pages/member/order/OrderSearch'})
- },
- goBack(){
- if(this.if_pay){
- uni.reLaunch({
- url:'/pages/member/index/Index'
- })
- }else{
- uni.navigateBack({delta:1})
- }
- },
- setOrderNavActive (index) {
- this.stateType = index
- this.getOrderList(true)
- },
- deleteOrder (orderInfo) {
- this.dialog={condition:1,content:'确定要删除该订单吗?',data:orderInfo}
- this.$refs.confirm.open()
- },
- cancel (orderInfo) {
- this.dialog={condition:2,content:'确定要取消该订单吗?',data:orderInfo}
- this.$refs.confirm.open()
- },
- receive (orderId) {
- this.dialog={condition:3,content:'确定该订单已收货吗?',data:orderId}
- this.$refs.confirm.open()
- },
- deliver (orderId) {
- uni.navigateTo({ url: '/pages/member/order/OrderDeliver'+'?'+urlencode( { order_id: orderId } )})
- },
- goRefund(refundId){
- uni.navigateTo({ url: '/pages/member/refund/RefundView'+'?'+urlencode( { refund_id: refundId } )})
- },
- refund (orderId) {
- uni.navigateTo({ url: '/pages/member/refund/RefundForm'+'?'+urlencode( { order_id: orderId } )})
- },
- evaluate (orderId) {
- uni.navigateTo({ url: '/pages/member/order/OrderEvaluate'+'?'+urlencode( { order_id: orderId } )})
- },
- pay (paySn) {
- uni.navigateTo({ url: '/pages/member/buy/pay'+'?'+urlencode( { pay_sn: paySn, pay_type: 'pay_new' } )})
- },
- getOrderInfo (orderId) {
- this.orderDetailVisible = true
- this.order_id = orderId
- },
- loadMore () {
- this.loading = true
- this.params.page = ++this.params.page
- if (this.isMore) {
- this.loading = false
- this.getOrderList(false)
- }
- },
- reload () {
- // 重新加载数据
- this.params.page = 0
- this.isMore = true
- this.order_group_list = false
- this.loadMore()
- },
- getOrderList (ifReplace) {
- uni.showLoading({ title: '加载中' })
- if (ifReplace) {
- this.loading = false
- this.params.page = 1
- this.isMore = true
- }
- getOrderList(this.params, this.stateType, '',this.keyword).then(res => {
- uni.hideLoading()
- if (res.result.hasmore) {
- this.isMore = true
- } else {
- this.isMore = false
- }
- let tOrderGroup = res.result.order_group_list
- if (tOrderGroup) {
- if (ifReplace || !this.order_group_list) {
- this.order_group_list = tOrderGroup
- } else {
- this.order_group_list = this.order_group_list.concat(tOrderGroup)
- }
- }
- }).catch(function (error) {
- uni.hideLoading()
- uni.showToast({icon:'none',title: error.message})
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .scroll-view-wrapper{display: flex;flex-direction: column;}
- .scroll-view{flex:1}
- .member-order-list {
- .common-header{display: flex;height: 2rem;padding: 0.25rem .6rem;justify-content: space-between;align-items: center;box-shadow: 0px 4px 4px #f7f7f7;box-sizing: border-box;}
- .slot{width:2.5rem;height: 1.6rem;text-align:center;line-height:1.6rem;font-size: .8rem;}
- .common-search{
- padding:0;
- padding-left: $pageSpace;
- padding-right: $pageSpace;
- flex:1;
- input {
- box-sizing: border-box;
- width: 100%;
- height: 1.6rem;
- border-radius: 1.6rem;
- background: #F4F4F4 url(../../../static/image/home/icon_search.png) no-repeat 0.6rem center;
- background-size:0.55rem;
- font-size:$fontSize;
- color: #999;
- padding-left:1.6rem;
- border: 0;
- }
- }
- .order-header {
- height: 2.2rem;
- .ul {
- list-style: none;
- width: auto;
- display: flex;
- justify-content: space-around;
- align-content: center;
- align-items: center;
- height: 100%;
- background: rgba(255, 255, 255, 1);
- border-bottom: 1px solid #e8eaed;
- .li {
- font-size:$subFontSize;
- color: #333;
- height: 100%;
- text-align: center;
- line-height: 2.2rem;
- border-bottom: 0.1rem solid transparent;
- &.active {
- color: $primaryColor;
- border-bottom-color: $primaryColor;
- }
- }
- }
- }
- .order-body {
- position:relative;
- .list {
- width: 100%;
- margin-top:0.5rem;
- .tips-body {
- height: 2.2rem;
- background: rgba(255, 255, 255, 1);
- box-shadow: 0 0.5px 0 0 rgba(232, 234, 237, 1);
- display: flex;
- justify-content: space-between;
- padding: 0 0.75rem 0 0.5rem;
- .tips {
- font-size:$subFontSize;
- color: #333;
- line-height: 2.2rem;
- }
- .statusTips {
- color: $primaryColor;
- }
- .img {
- width: 3.8rem;
- height: 3rem;
- }
- }
- .order-image {
- height: 4.55rem;
- background: rgba(250, 250, 250, 1);
- width: 100%;
- overflow:hidden;
- overflow-x: auto;
- white-space: nowrap;
- .goods_info{
- height:4rem;
- margin-bottom: .5rem;
- display: flex;
- align-items: center;
- padding-right: $pageSpace;
- .img-wrapper{
- width: 3rem;
- height: 3rem;
- margin: .85rem .6rem .5rem .3rem;
- .img{
- width: 3rem;
- height: 3rem;
- border-radius: 1px;
- }
- }
- .goods_name{
- white-space: normal;
- overflow: hidden;
- height: 2rem;
- width: 10rem;
- font-size: .7rem;
- }
- .goods_price{
- margin-left: auto;
- padding-right: .75rem;
- text-align: right;
- .price{
- font-size:$subFontSize;
- color: rgba(78, 84, 93, 1);
- }
- .num{
- font-size: .6rem;
- color: #999;
- padding-top: .3rem;
- }
- }
- }
- }
- .multiple{
- .imagebox{
- width: 100%;
- overflow-x: auto;
- white-space: nowrap;
- .img{
- width: 3rem;
- height:3rem;
- margin: .85rem .3rem .5rem;
- display: inline-block;
- }
- }
- }
- .order_amount {
- font-size:$subFontSize;
- color: rgba(78, 84, 93, 1);
- line-height: 2.2rem;
- height: 2.2rem;
- background-color: #fff;
- padding: 0 0.75rem 0 0;
- border-bottom: 1px solid #e8eaed;
- box-sizing: border-box;
- text-align: right;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- .order_amount_icon{
- font-size:$subFontSize;
- color: $primaryColor;
- }
- .i {
- font-size:$h2;
- color:$primaryColor;
- padding-left:0.15rem;
- font-style: normal;
- &.freight {
- color: #333;
- font-size:$fontSize;
- }
- }
- }
- }
- .loading-wrapper {
- text-align: center;
- .p {
- color: #c3c3c3;
- font-size:$fontSize;
- margin: 0.5rem auto;
- }
- }
- }
- .mint-popup {
- width: 100%;
- height: 11.75rem;
- }
- }
- .order-list-opratio{height: 2.2rem;display: flex;justify-content: flex-end;background: rgba(255, 255, 255, 1);border-radius: 0.1rem;}
- .order-list-opratio .button{width: 4.5rem;height: 1.5rem;font-size:$subFontSize;border-radius: 0.7rem;margin: 0.35rem 0.75rem 0.35rem 0;background-color: #fff;border: 1px solid #ccc;box-shadow: 0 3px 6px 0 rgba(0,0,0,.05);display:flex;align-items:center;justify-content:center;}
- .order-list-opratio .line_red{background-color: #fff;color: #f2270c;border: 1px solid #f2270c;box-shadow: 0 3px 6px 0 rgba(242,39,12,.1);}
- .ds-button-large{margin:0 $pageSpace;}
- </style>
|