Compare commits

...

3 Commits

Author SHA1 Message Date
tianyi ba89afe8d0 11 1 week ago
tianyi 461ccf2cd7 11 1 week ago
tianyi 3689b561d6 11 1 week ago
  1. 2
      common/httpRequest.js
  2. 55
      components/tab-bar/myCenter.vue
  3. 27
      package1/myCenter/merchantCenter.vue
  4. 159
      package1/myCenter/shopOrderList.vue

2
common/httpRequest.js

@ -2,7 +2,7 @@ const tui = {
//接口地址 //接口地址
interfaceUrl: function() { interfaceUrl: function() {
// return 'https://hbkuaishi.com/hiver' //正式 // return 'https://hbkuaishi.com/hiver' //正式
return 'http://192.168.100.42:8888/hiver' //测试 return 'http://192.168.100.54:8888/hiver' //测试
}, },
toast: function(text, duration, success) { toast: function(text, duration, success) {
uni.showToast({ uni.showToast({

55
components/tab-bar/myCenter.vue

@ -13,6 +13,17 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 多个商家选择弹窗 -->
<uni-popup ref="shopPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
<view class="shop-content">
<view class="popup-pay-title">
<text>您有多个店铺</text>
</view>
<view class="popup-list" @tap="clickShop(item)" v-for="(item,index) in schoolShop" :key="index">
{{item.shopName}}
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -20,7 +31,7 @@
export default { export default {
data() { data() {
return { return {
schoolShop:[]
} }
}, },
props:{ props:{
@ -32,13 +43,30 @@
methods: { methods: {
init(){ init(){
console.log("我的初始化") console.log("我的初始化")
this.schoolShop = uni.getStorageSync('schoolShop')
},
clickShop(item){
uni.setStorageSync('shopId',item.id)
uni.setStorageSync('shopName',item.shopName)
uni.setStorageSync('shopIcon',item.shopIcon)
uni.navigateTo({
url: '/package1/myCenter/merchantCenter'
})
}, },
navigatorTo(e){ navigatorTo(e){
let url = "" let url = ""
if(e=='addgoods'){ if(e=='addgoods'){
url = '/package1/myCenter/addGoods' url = '/package1/myCenter/addGoods'
}else if(e=='merchantCenter'){ }else if(e=='merchantCenter'){
if(this.schoolShop.length>1){
this.$refs.shopPopup.open()
return
}else if(this.schoolShop != ''){
uni.setStorageSync('shopId',this.schoolShop[0].id)
uni.setStorageSync('shopName',this.schoolShop[0].shopName)
uni.setStorageSync('shopIcon',this.schoolShop[0].shopIcon)
url = '/package1/myCenter/merchantCenter' url = '/package1/myCenter/merchantCenter'
}
}else if(e=='addType'){ }else if(e=='addType'){
url = '/package1/myCenter/addType' url = '/package1/myCenter/addType'
}else if(e=='goodsList'){ }else if(e=='goodsList'){
@ -100,4 +128,29 @@
height: 350px; height: 350px;
position: relative; position: relative;
} }
.shop-content{
width: 300px;
height: auto;
position: relative;
background: #fff;
border-radius: 10px;
padding: 10px;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
margin-bottom: 10px;
}
.popup-list{
height: 30px;
text-align: center;
font-size: 14px;
font-weight: 700;
border-bottom: 1px solid #eee;
line-height: 30px;
}
</style> </style>

27
package1/myCenter/merchantCenter.vue

@ -12,11 +12,11 @@
</view> </view>
<view class="shop-title"> <view class="shop-title">
<view class="title1"> <view class="title1">
<img src="/static/images/img/shangpintu.png" alt="" /> <img :src="shop.shopIcon" alt="" />
</view> </view>
<view class="title2"> <view class="title2">
<view class="title22"> <view class="title22">
老王的店 {{shop.shopName}}
</view> </view>
<view class="title33" @tap="updateStatus"> <view class="title33" @tap="updateStatus">
{{businessStatus == '1'?'暂停营业':'正常营业'}} {{businessStatus == '1'?'暂停营业':'正常营业'}}
@ -30,7 +30,7 @@
</view> </view>
<view class="order2"> <view class="order2">
<view class="order22"> <view class="order22">
<view class="order33" @tap="goDetail('db',0)"> <view class="order33" @tap="goDetail('db',3)">
<view class="order44"> <view class="order44">
0 0
</view> </view>
@ -38,33 +38,33 @@
待接单 待接单
</view> </view>
</view> </view>
<view class="order33" @tap="goDetail('db',1)"> <view class="order33" @tap="goDetail('db',4)">
<view class="order44"> <view class="order44">
0 0
</view> </view>
<view class="order55"> <view class="order55">
</view> </view>
</view> </view>
<view class="order33" @tap="goDetail('db',2)"> <view class="order33" @tap="goDetail('db',5)">
<view class="order44"> <view class="order44">
0 0
</view> </view>
<view class="order55"> <view class="order55">
商家送达 待送达
</view> </view>
</view> </view>
</view> </view>
<view class="order22"> <view class="order22">
<view class="order33" @tap="goDetail('db',3)"> <view class="order33" @tap="goDetail('db',2)">
<view class="order44"> <view class="order44">
0 0
</view> </view>
<view class="order55"> <view class="order55">
顾客自取 消费
</view> </view>
</view> </view>
<view class="order33" @tap="goDetail('db',4)"> <view class="order33" @tap="goDetail('db',11)">
<view class="order44"> <view class="order44">
0 0
</view> </view>
@ -176,6 +176,7 @@
return { return {
menuButtonInfo: {}, menuButtonInfo: {},
businessStatus:1, businessStatus:1,
shop:{}
} }
}, },
onShow() { onShow() {
@ -191,6 +192,8 @@
shopId: uni.getStorageSync('shopId') shopId: uni.getStorageSync('shopId')
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.shop = res.result
this.shop.shopIcon = uni.getStorageSync('shopIcon')
this.businessStatus = res.result.status this.businessStatus = res.result.status
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
@ -223,14 +226,14 @@
}); });
}, },
goDetail(type) { goDetail(type,index) {
let url = '' let url = ''
switch (type) { switch (type) {
case 'tj': case 'tj':
url = '/package1/myCenter/dataStatistics' url = '/package1/myCenter/dataStatistics'
break; break;
case 'db': case 'db':
url = '/package1/order/orderDetail' url = '/package1/myCenter/shopOrderList?index=' + index
break; break;
case 'sp': case 'sp':
url = '/package1/myCenter/goodsList' url = '/package1/myCenter/goodsList'

159
package1/myCenter/shopOrderList.vue

@ -15,66 +15,38 @@
:scroll-with-animation="true"> :scroll-with-animation="true">
<view class="status-list"> <view class="status-list">
<view v-for="(item, index) in statusList" :key="index" class="status-item" <view v-for="(item, index) in statusList" :key="index" class="status-item"
:class="{ 'active': currentIndex === index }" @click="handleStatusClick(index)"> :class="{ 'active': currentIndex === index }" @click="handleStatusClick(index,item.value)">
<text class="status-text">{{ item.name }}</text> <text class="status-text">{{ item.name }}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="box1" @tap="goDetail"> <view class="box1" @tap="goDetail(item.id)" v-for="(item,index) in orderList" :key="index">
<view style="display: flex;height: 50rpx;border-bottom: 1px solid #eee;"> <view style="display: flex;height: 50rpx;border-bottom: 1px solid #eee;">
<view> <view>
#0001 {{'#' + item.numberCode}}
</view> </view>
<view style="flex: 1;display: flex;padding-left: 20rpx;"> <view style="flex: 1;display: flex;padding-left: 20rpx;">
2026-02-28 16:08 <text>已退款</text> {{item.createTime | formatISOTime}}
<!-- <text>已退款</text> -->
</view> </view>
<view> <view>
已关闭 {{item.status == 0?'待支付':item.status == 1?' 待成团':item.status == 2?'待消费':item.status == 3?'待接单':item.status == 4?'待取货':item.status == 5?'待送达':item.status == 6?'已完成':item.status == 7?'待退款':item.status == 8?'已退款':item.status == 9?'已取消':item.status == 11?'售后中':item.status == 12?'已售后':""}}
</view> </view>
</view> </view>
<view style="height: 120rpx;padding-top: 20rpx;"> <view style="height: 120rpx;padding-top: 20rpx;">
<view style="height: 50rpx;line-height: 50rpx;font-size: 28rpx;font-weight: 700;"> <view style="height: 50rpx;line-height: 50rpx;font-size: 28rpx;font-weight: 700;">
商品 <text><text>1</text></text> <text style="color: red;">已出餐</text> 商品 <text><text>{{item.goodsNum}}</text></text> <text style="color: red;">已出餐</text>
</view> </view>
<view style="display: flex;"> <view style="display: flex;" v-for="(item1,index1) in item.goodsList" :key="index">
<view style="flex: 1;"> <view style="flex: 1;">
鱼香肉丝 {{item1.productName}}
</view> </view>
<view style="width: 100rpx;"> <view style="width: 100rpx;">
X1 {{'X' + item1.quantity}}
</view> </view>
<view> <view>
5.00 {{'¥'+ item1.price}}
</view>
</view>
</view>
</view>
<view class="box1" @tap="goDetail">
<view style="display: flex;height: 50rpx;border-bottom: 1px solid #eee;">
<view>
#0001
</view>
<view style="flex: 1;display: flex;padding-left: 20rpx;">
2026-02-28 16:08 <text>已退款</text>
</view>
<view>
已关闭
</view>
</view>
<view style="height: 120rpx;padding-top: 20rpx;">
<view style="height: 50rpx;line-height: 50rpx;font-size: 28rpx;font-weight: 700;">
商品 <text><text>1</text></text>
</view>
<view style="display: flex;">
<view style="flex: 1;">
鱼香肉丝
</view>
<view style="width: 100rpx;">
X1
</view>
<view>
5.00
</view> </view>
</view> </view>
</view> </view>
@ -86,66 +58,151 @@
export default { export default {
data() { data() {
return { return {
loadStatus: 'more',
searchForm:{
pageNum:1,
pageSize:10,
shopName:'',
searchStatus:10,
shopId:uni.getStorageSync('shopId'),
regionId:JSON.parse(uni.getStorageSync('area')).id
},
totalPages: 1,
orderList:[],
currentIndex: 0, currentIndex: 0,
menuButtonInfo: {}, menuButtonInfo: {},
statusList: [{ statusList: [{
name: '待接单', name: '全部',
value: 10,
checked: true
},{
name: '待支付',
value: 0, value: 0,
checked: true checked: true
}, },
{ {
name: '待发货', name: '待成团',
value: 1, value: 1,
checked: false checked: false
}, },
{ {
name: '待退款', name: '待消费',
value: 2, value: 2,
checked: false checked: false
}, },
{ {
name: '待售后', name: '待接单',
value: 3, value: 3,
checked: false checked: false
}, },
{ {
name: '已发货', name: '待取货',
value: 4, value: 4,
checked: false checked: false
}, },
{ {
name: '已完成', name: '待送达',
value: 5, value: 5,
checked: false checked: false
}, },
{ {
name: '已取消', name: '已完成',
value: 6, value: 6,
checked: false checked: false
}, },
{ {
name: '已售后', name: '待退款',
value: 7, value: 7,
checked: false checked: false
},
{
name: '已退款',
value: 8,
checked: false
},
{
name: '已取消',
value: 9,
checked: false
},
{
name: '售后中',
value: 11,
checked: false
},
{
name: '已售后',
value: 12,
checked: false
} }
] ]
} }
}, },
onReachBottom() {
if (this.searchForm.pageNum >= this.totalPages) return;
// this.status = 'loading';
this.searchForm.pageNum++;
this.getOrderList();
},
filters:{
formatISOTime(isoString) {
const date = new Date(isoString);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
},
onShow() { onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
}, },
onLoad(option) { onLoad(option) {
if(option.index){
this.searchForm.searchStatus = option.index
this.currentIndex = option.index
}
this.getList()
}, },
methods: { methods: {
goDetail(){ getList(){
this.loadStatus = 'loading'
let that = this
that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
if (that.searchForm.pageNum == 1) {
that.orderList = res.result.records;
} else {
that.orderList = [...that.orderList, ...res.result.records]
}
for(let i=0;i<that.orderList.length;i++){
that.orderList[i].goodsNum = 0
for(let m=0;m<that.orderList[i].goodsList.length;m++){
that.orderList[i].goodsNum += that.orderList[i].goodsList[m].quantity
}
}
that.totalPages = res.result.pages; // pages =
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
goDetail(id){
uni.navigateTo({ uni.navigateTo({
url:'/package1/order/orderDetail' url:'/package1/order/orderDetail?id=' + id
}) })
}, },
handleStatusClick(index) { handleStatusClick(index,value) {
if (this.currentIndex === index) return; if (this.currentIndex === index) return;
this.currentIndex = index; this.currentIndex = index;
this.searchForm.searchStatus = value
this.getList()
}, },
back() { back() {
uni.navigateBack() uni.navigateBack()

Loading…
Cancel
Save