订单列表完成

This commit is contained in:
wuhui_zzw 2023-03-03 14:17:35 +08:00
parent d5bdf7c2b9
commit 162e031f7c
4 changed files with 443 additions and 21 deletions

View File

@ -1022,14 +1022,22 @@
"navigationBarTitleText": "我的小店"
}
},
//****************** ******************
{
"path": "message/index",
"path": "futures/order",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "消息中心"
"navigationBarTitleText": "我的订单"
}
},
{
"path": "futures/order_details",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "订单详情"
}
},
{
@ -1040,6 +1048,16 @@
// #endif
"navigationBarTitleText": "交易下单"
}
},
//****************** ******************
{
"path": "message/index",
"style": {
// #ifdef H5
"navigationStyle": "custom",
// #endif
"navigationBarTitleText": "消息中心"
}
}
]
},

View File

@ -5,9 +5,9 @@
<view class="top">
<image class="top-image" :src="$util.img('public/static/img/futures/my_shop_top_bg.png')" mode="widthFix"></image>
<view class="top-content">
<image class="avatar" :src="$util.img('upload/1/headimg/20230222/20230222053005167705820555566.png')" mode="widthFix"></image>
<view class="nickname">187****4859的小店</view>
<view class="link-button">
<image class="avatar" :src="$util.img(info.headimg)" mode="widthFix"></image>
<view class="nickname">{{ info.nickname || info.username }}的小店</view>
<view class="link-button" @click="$util.redirectTo('/pages_tool/member/info')">
点击完善信息<i class="icondiy icon-system-arrow-right-s-line"></i>
</view>
</view>
@ -16,7 +16,7 @@
<view class="menu-list">
<view class="title">小店订单</view>
<view class="menu-list-content">
<view class="menu-block" v-for="(item,index) in menu" :key="index">
<view class="menu-block" v-for="(item,index) in menu" :key="index" @click="$util.redirectTo('/pages_promotion/futures/order',{ status: item.status })">
<view class="left" :style="{ background: item.background}">
<image class="top-image" :src="$util.img(item.image)" mode="widthFix"></image>
</view>
@ -41,27 +41,30 @@
export default {
data() {
return {
// all:stock:release:sold:
menu: [
{
image: 'public/static/img/futures/my_shop_order_sell.png',
title: '小店销售订单',
desc: '显示当前全部正在出售中的订单',
background: '#eaebff',
status: 'release',
},{
image: 'public/static/img/futures/my_shop_order_buy.png',
title: '小店采购订单',
desc: '显示当前全部已采购的订单',
background: '#fbebeb',
status: 'all',
},{
image: 'public/static/img/futures/my_shop_order_stock.png',
title: '小店库存订单',
desc: '显示当前全部正在库存中的订单',
background: '#e2fdf8',
status: 'stock',
}
],
//
info: {}
};
},
components: {},
@ -71,20 +74,26 @@ export default {
onReady(){
//
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/seckill');
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
this.getMemberInfo();
},
methods: {
//
getMemberInfo() {
this.$api.sendRequest({
url: '/api/member/info',
success: res => {
if(parseInt(res.code) === 0){
this.info = res.data;
console.log(this.info);
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
},
onBackPress(options) {
if (options.from === 'navigateBack') return false;

View File

@ -0,0 +1,322 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="order">
<!--搜索-->
<view v-if="false" class="cate-search">
<view class="search-box">
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()"/>
<text class="iconfont icon-sousuo3" @click="search()"></text>
</view>
</view>
<!--选项卡-->
<view class="tabs">
<view
v-for="(item,index) in tabs" :key="index"
:class="['tabs-item',{'tabs-item-active': (item.status === tabs_active)}]"
@click="tabs_active = item.status"
>
{{ item.title }}
</view>
</view>
<!--订单列表-->
<mescroll-uni ref="mescroll" @getData="getList" top="70">
<block slot="list">
<view class="list" v-if="list.length > 0">
<view class="list-block" v-for="(item,index) in list" :key="index">
<view class="block-top">
<view class="left">订单号{{ item.order_no }}</view>
<view class="right">{{ status_text[item.status] }}</view>
</view>
<view class="block-content">
<view class="left">
<image class="top-image" :src="$util.img(item.goods_image)" mode="widthFix"></image>
</view>
<view class="right">
<view class="goods-name">{{ item.goods_name }}</view>
<view class="goods-num">数量{{ item.total }}</view>
<view class="goods-info">
总计<view class="goods-info-price"><text class="goods-info-unit"></text>{{ item.unit_price }}</view>
</view>
</view>
</view>
<view class="buttons">
<view class="button-item" @click="$util.redirectTo('/pages_promotion/futures/order_details',{ futures_id: item.id })">查看详情</view>
</view>
</view>
</view>
<view v-else>
<ns-empty :isIndex="false" text="无订单信息!"></ns-empty>
</view>
</block>
</mescroll-uni>
<!--登录弹框-->
<ns-login ref="login"></ns-login>
<!--加载动画-->
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {
searchText: '',
// all:stock:release:sold:
tabs_active: 'all',
tabs: [
{title: '全部', status: 'all'},
{title: '库存', status: 'stock'},
{title: '已上架', status: 'release'},
{title: '已售卖', status: 'sold'}
],
list: [],
status_text: {
1 : '库存',
2 : '正在销售',
3 : '已售出',
4 : '提货中',
5 : '提货完成',
6 : '待支付',
7 : '捡漏',
}
};
},
components: {},
mixins: [],
onLoad(option) {
this.tabs_active = option.status || 'all';
},
onShow() {},
onReady(){
//
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/list');
},
watch:{
tabs_active: {
handler(newStatus) {
if(this.$refs.mescroll) this.$refs.mescroll.refresh();
},
immediate: true
}
},
methods: {
//
search(){},
//
getList(mescroll) {
this.$api.sendRequest({
url: '/futures/api/futures/myList',
data: {
page: mescroll.num || 1,
page_size: mescroll.size || 10,
status: this.tabs_active,
},
success: res => {
if(parseInt(res.code) === 0){
mescroll.endSuccess(Object.keys(res.data.list).length);
//
if (parseInt(mescroll.num) === 1){
this.list = []; //
}
this.list = this.list.concat(res.data.list); //
}else {
this.msg = res.message;
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
},
onBackPress(options) {
if (options.from === 'navigateBack') return false;
this.$util.redirectTo('/pages/member/index');
return true;
}
};
</script>
<style lang="scss" scoped>
.order{
background-color: #f8f8f8;// #f8f8f8
min-height: 100vh;
.cate-search {
width: calc(100% - 48rpx);
background: #ffffff;
padding: 10rpx 24rpx 0 24rpx;
/* #ifdef H5 */
padding-top: 30rpx;
/* #endif */
position: relative;
z-index: 998;
input {
font-size: $font-size-base;
height: 76rpx;
padding: 0 25rpx 0 30rpx;
line-height: 60rpx;
width: calc(100% - 120rpx);
}
text {
font-size: 32rpx;
color: $color-tip;
width: 120rpx;
text-align: center;
}
.search-box {
width: 100%;
background: $color-bg;
display: flex;
justify-content: center;
align-items: center;
border-radius: 100rpx;
}
}
.tabs{
width: 100vw;
height: 70rpx;
background-color: #FFFFFF;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: space-around;
align-items: center;
.tabs-item{
max-width: max-content;
height: 70rpx;
line-height: 70rpx;
font-size: 30rpx;
color: #000000;
}
.tabs-item-active{
color: #d86351;
position: relative;
}
.tabs-item-active:after{
content: "";
position: absolute;
left: 0;
bottom: 0;
height: 6rpx;
width: 100%;
background-color: #d86351;
}
}
.list{
width: calc(100vw - (30rpx * 2));
padding: 30rpx;
.list-block{
padding: 20rpx;
margin-bottom: 30rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
.block-top{
width: 100%;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
height: 50rpx;
.left{
line-height: 50rpx;
font-size: 26rpx;
color: #000000;
}
.right{
line-height: 50rpx;
font-size: 26rpx;
color: #de6758;
}
}
.block-content{
--content-height--: 150rpx;
height: var(--content-height--);
width: 100%;
padding: 10rpx 0;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.left{
height: var(--content-height--);
width: var(--content-height--);
border-radius: 10rpx;
overflow: hidden;
.top-image{
width: 100% !important;
height: 100%!important;
}
}
.right{
height: var(--content-height--);
width: calc(100% - var(--content-height--) - 20rpx);
padding-left: 20rpx;
.goods-name{
font-size: 26rpx;
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: 50rpx;
}
.goods-num{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
width: 100%;
font-size: 26rpx;
height: 50rpx;
}
.goods-info{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: baseline;
width: 100%;
font-size: 26rpx;
height: 50rpx;
.goods-info-price{
color: #e05c3b;
.goods-info-unit{
font-size: 24rpx;
}
}
}
}
}
.buttons{
display: inline-flex;
justify-content: flex-end;
width: 100%;
.button-item{
height: 50rpx;
line-height: 50rpx;
color: #d74a2c;
border: 1rpx solid #d74a2c;
width: 160rpx;
text-align: center;
font-size: 26rpx;
border-radius: 10rpx;
}
}
}
}
}
</style>

View File

@ -0,0 +1,73 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="apply">
<!--登录弹框-->
<ns-login ref="login"></ns-login>
<!--加载动画-->
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
data() {
return {
};
},
components: {},
mixins: [],
onLoad(option) {},
onShow() {},
onReady(){
//
if (!uni.getStorageSync('token')) this.$refs.login.open('/pages_promotion/futures/list');
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
methods: {
},
onBackPress(options) {
if (options.from === 'navigateBack') return false;
this.$util.redirectTo('/pages/member/index');
return true;
}
};
</script>
<style lang="scss" scoped>
</style>