Browse Source

'test'

hfll
hflllll 1 month ago
parent
commit
08a564113c
10 changed files with 462 additions and 154 deletions
  1. +13
    -1
      api/model/order.js
  2. +0
    -59
      mixins/order.js
  3. +7
    -0
      pages.json
  4. +1
    -1
      pages/index/cart.vue
  5. +19
    -1
      pages/index/center.vue
  6. +2
    -2
      pages/index/index.vue
  7. +379
    -0
      pages/index/orderManage.vue
  8. +27
    -23
      pages_order/components/order/placeOrder.vue
  9. +13
    -2
      pages_order/order/afterSale.vue
  10. +1
    -65
      pages_order/product/productDetail.vue

+ 13
- 1
api/model/order.js View File

@ -162,7 +162,19 @@ const api = {
limit: 500
},
// 批量修改团长订单
updateOrders: {
url: '/teambuy/order/updateOrders',
method: 'POST',
limit: 500
},
// 获取管理员订单
managerOrderList: {
url: '/teambuy/order/managerOrderList',
method: 'GET',
limit: 200
}
}
export default api

+ 0
- 59
mixins/order.js View File

@ -55,65 +55,6 @@ export default {
})
},
// 立即支付
// toPayOrder(item){
// let api = ''
// // if([0, 1].includes(item.shopState)){
// // api = 'createOrderTwo'
// // }else{
// api = 'createSumOrderAgain'
// // }
// this.$api(api, {
// orderId : item.id,
// addressId : item.addressId
// }, res => {
// if(res.code == 200){
// uni.requestPaymentWxPay(res)
// .then(res => {
// uni.showToast({
// title: '支付成功',
// icon: 'none'
// })
// this.getData()
// }).catch(n => {
// this.getData()
// })
// }
// })
// },
// 确认收货
// confirmOrder(item){
// uni.showModal({
// title: '您收到货了吗?',
// success : e => {
// if(e.confirm){
// this.$api('confirmOrder', {
// orderId : item.id,
// }, res => {
// this.getData()
// })
// }
// }
// })
// },
// // 取消订单
// cancelOrder(item){
// uni.showModal({
// title: '确认取消订单吗?',
// success : e => {
// if(e.confirm){
// this.$api('cancelOrder', {
// orderId : item.id,
// }, res => {
// this.getData()
// })
// }
// }
// })
// },
},
beforeDestroy() {
this.clearCouponData();


+ 7
- 0
pages.json View File

@ -21,6 +21,13 @@
"enablePullDownRefresh": true
}
},
{
"path": "pages/index/orderManage",
"style": {
"navigationBarTitleText": "订单管理",
"enablePullDownRefresh": true
}
},
{
"path": "pages/index/center",
"style": {


+ 1
- 1
pages/index/cart.vue View File

@ -112,7 +112,7 @@ export default {
}, 0)
},
deleteCartIds(){
return this.checkboxValue.join(',')
return this.checkboxValue.join(';')
}
},
methods: {


+ 19
- 1
pages/index/center.vue View File

@ -89,7 +89,7 @@
<!-- 团员功能区域 -->
<view class="member-functions">
<view class="section-header">
<text class="section-title">团员功能</text>
<text class="section-title">{{ identity === 0 ? '团员功能' : '团长功能' }}</text>
</view>
<view class="function-grid" v-if="identity === 0">
@ -159,6 +159,13 @@
<text class="function-text">团长信息</text>
</view>
<view class="function-item" v-if="userInfo.isManager === '1'" @tap="gotoManage">
<view class="function-icon">
<uv-icon name="list" size="94rpx" color="#019245" />
</view>
<text class="function-text">订单管理</text>
</view>
<view class="function-item" @tap="navigateTo('/pages_order/mine/share')">
<view class="function-icon">
<uv-icon name="chat" size="94rpx" color="#019245" />
@ -192,6 +199,17 @@ export default {
}
},
methods: {
gotoManage(){
//
if(this.userInfo && this.userInfo.isManager === '1'){
this.navigateTo('/pages/index/orderManage?tabIndex=0')
}else{
uni.showToast({
title: '您不是管理员身份',
icon: 'error'
})
}
},
navigateTo(url) {
this.$utils.navigateTo({
url


+ 2
- 2
pages/index/index.vue View File

@ -81,8 +81,8 @@
<text class="order-time">
{{
order.updateTime ?
$timeUtils.formatTime($dayjs(order.updateTime).unix()) :
$timeUtils.formatTime($dayjs(order.createTime).unix())
$timeUtils.formatTime($dayjs(order.updateTime).valueOf()) :
$timeUtils.formatTime($dayjs(order.createTime).valueOf())
}}
</text>
</view>


+ 379
- 0
pages/index/orderManage.vue View File

@ -0,0 +1,379 @@
<template>
<view class="page">
<!-- 导航栏 -->
<navbar title="订单管理" bgColor="#019245" color="#fff" />
<!-- 搜索框 -->
<view style="background-color: #fff; padding: 12rpx 20rpx 0rpx; ">
<uv-search placeholder="搜索商品名" v-model="keyword" :showAction="false" actionText="" height="80rpx" animation
bgColor="#F5F5F5" inputAlign="center" color="#000" placeholderColor="#979797" searchIconSize="50rpx"
@search="handleSearch" @clickIcon="handleSearch" />
</view>
<!-- 订单筛选 -->
<view class="tabs">
<uv-tabs :list="tabs" :activeStyle="{ color: '#019245'}" lineColor="#019245" :scrollable="false"
:inactiveStyle="{color: 'black'}" lineHeight="6rpx" lineWidth="55rpx" :current="status"
@click="clickTabs" />
</view>
<!-- 批量操作区域 -->
<view class="batch-actions" v-if="leaderOrderList.length > 0">
<checkbox-group @change="handleCheckAllChange">
<label class="checkbox-all">
<checkbox :checked="isAllChecked" color="#019245" />
<text>全选</text>
</label>
</checkbox-group>
<view class="batch-btns">
<button class="batch-btn" @tap="handleBatchAction('出餐')" v-if="status === 0">批量出餐</button>
<button class="batch-btn" @tap="handleBatchAction('取餐')" v-if="status === 1">批量待取餐</button>
<button class="batch-btn" @tap="handleBatchAction('完成')" v-if="status === 2">批量完成</button>
</view>
</view>
<!-- 团餐列表 -->
<view class="group-meal-list">
<view class="meal-item" v-for="(meal, index) in leaderOrderList" :key="meal.id">
<view class="meal-checkbox">
<checkbox :checked="checkedOrders.includes(meal.id)" :value="meal.id" color="#019245" @tap.stop="toggleCheckOrder(meal.id)" />
</view>
<view class="meal-content" @tap="viewOrder(meal)">
<view class="meal-name">{{ meal.title }}</view>
<view class="meal-price">本单佣金合计: <text class="price-value">¥{{ (meal.commission || 0).toFixed(2) || 0.00 }}</text>
</view>
</view>
<view class="meal-action">
<button class="action-btn" @tap.stop="handleSingleAction(meal, '出餐')" v-if="status === 0">出餐</button>
<button class="action-btn" @tap.stop="handleSingleAction(meal, '取餐')" v-if="status === 2">取餐</button>
<button class="action-btn" @tap.stop="handleSingleAction(meal, '完成')" v-if="status === 2">完成</button>
<button class="order-btn" @tap.stop="viewOrder(meal)">查看</button>
</view>
</view>
<view style="margin-top: 200rpx; min-width: 700rpx;">
<uv-empty mode="order" v-if="leaderOrderList.length == 0" />
</view>
</view>
<tabber select="order" />
</view>
</template>
<script>
import mixinsList from '@/mixins/list.js'
import tabber from '@/components/base/tabbar.vue'
export default {
mixins: [mixinsList],
components: {
tabber
},
data() {
return {
keyword: '',
title: '',
tabs: [
{ name: '待出餐' },
{ name: '已出餐' },
{ name: '待取餐' },
{ name: '已完成' }
],
status: 0,
leaderOrderList: [],
mixinsListApi: 'managerOrderList',
mixinsListKey: 'leaderOrderList',
checkedOrders: [], // ID
isAllChecked: false
}
},
onLoad(args) {
// tabIndextab
if (args.tabIndex !== undefined) {
const index = parseInt(args.tabIndex)
if (!isNaN(index) && index >= 0 && index < this.tabs.length) {
this.status = index
}
}
},
methods: {
handleSearch() {
this.title = this.keyword
this.getData()
this.keyword = ''
this.title = ''
},
beforeGetData() {
const params = {
status: this.status,
title: this.title || ''
}
return params
},
//tab
clickTabs({ index }) {
this.status = index
this.getData()
this.checkedOrders = [] //
this.isAllChecked = false
},
//
viewOrder(meal) {
this.$utils.navigateTo({
url: '/pages_order/order/groupMealDetail?id=' + meal.id
})
},
//
toggleCheckOrder(id) {
const index = this.checkedOrders.indexOf(id)
if (index === -1) {
this.checkedOrders.push(id)
} else {
this.checkedOrders.splice(index, 1)
}
//
this.isAllChecked = this.checkedOrders.length === this.leaderOrderList.length
},
// /
handleCheckAllChange(e) {
this.isAllChecked = !this.isAllChecked
if (this.isAllChecked) {
this.checkedOrders = this.leaderOrderList.map(item => item.id)
} else {
this.checkedOrders = []
}
},
//
handleSingleAction(meal, action) {
const actionMap = {
'出餐': {
status: 1,
confirmText: '确定将该订单标记为已出餐吗?',
successText: '已出餐'
},
'取餐': {
status: 2,
confirmText: '确定将该订单标记为待取餐吗?',
successText: '待取餐'
},
'完成': {
status: 3,
confirmText: '确定将该订单标记为已完成吗?',
successText: '已完成'
}
}
const currentAction = actionMap[action]
uni.showModal({
title: '提示',
content: currentAction.confirmText,
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
// 使updateOrders
uni.showLoading({
title: '处理中...'
})
this.$api('updateOrders', {
orderIds: meal.id, // ID
status: currentAction.status
}, res => {
uni.hideLoading()
if (res.code === 200) {
uni.showToast({
title: currentAction.successText,
icon: 'success'
})
this.getData()
} else {
uni.showToast({
title: '操作失败',
icon: 'none'
})
}
})
}
}
})
},
//
handleBatchAction(action) {
if (this.checkedOrders.length === 0) {
uni.showToast({
title: '请先选择订单',
icon: 'none'
})
return
}
const actionMap = {
'出餐': {
status: 1,
confirmText: `确定将选中的${this.checkedOrders.length}个订单标记为已出餐吗?`,
successText: '批量操作成功'
},
'取餐': {
status: 2,
confirmText: `确定将选中的${this.checkedOrders.length}个订单标记为待取餐餐吗?`,
successText: '批量操作成功'
},
'完成': {
status: 3,
confirmText: `确定将选中的${this.checkedOrders.length}个订单标记为已完成吗?`,
successText: '批量操作成功'
}
}
const currentAction = actionMap[action]
uni.showModal({
title: '批量操作',
content: currentAction.confirmText,
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
//
uni.showLoading({
title: '处理中...'
})
// 使ID
const orderIds = this.checkedOrders.join(';')
this.$api('updateOrders', {
orderIds: orderIds,
status: currentAction.status
}, res => {
uni.hideLoading()
if (res.code === 200) {
uni.showToast({
title: currentAction.successText,
icon: 'success'
})
this.checkedOrders = []
this.isAllChecked = false
this.getData()
} else {
uni.showToast({
title: '操作失败',
icon: 'none'
})
}
})
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.page {}
.tabs {
background: #fff;
padding-bottom: 4rpx;
}
/* 批量操作区域 */
.batch-actions {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
padding: 20rpx;
margin-bottom: 10rpx;
border-bottom: 1px solid #f5f5f5;
}
.checkbox-all {
display: flex;
align-items: center;
font-size: 28rpx;
}
.batch-btns {
display: flex;
gap: 20rpx;
}
.batch-btn {
background-color: $uni-color;
color: #fff;
font-size: 26rpx;
padding: 10rpx 30rpx;
border-radius: 30rpx;
line-height: 1.5;
margin: 0;
}
/* 团餐列表样式 */
.group-meal-list {
padding: 20rpx;
}
.meal-item {
display: flex;
align-items: center;
padding: 30rpx 20rpx;
background-color: #fff;
margin-bottom: 20rpx;
border-radius: 10rpx;
}
.meal-checkbox {
margin-right: 20rpx;
}
.meal-content {
flex: 1;
}
.meal-name {
font-size: 32rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.meal-price {
font-size: 28rpx;
color: $uni-color;
background-color: #ECFEF4;
padding: 10rpx 20rpx;
border-radius: 10rpx;
display: inline-block;
}
.price-value {
margin-left: 10rpx;
font-weight: 500;
}
.meal-action {
display: flex;
gap: 15rpx;
margin-left: 20rpx;
}
.action-btn {
background-color: #f0f0f0;
color: #333;
font-size: 26rpx;
padding: 10rpx 25rpx;
border-radius: 30rpx;
line-height: 1.5;
margin: 0;
}
.order-btn {
background-color: $uni-color;
color: #fff;
font-size: 26rpx;
padding: 10rpx 25rpx;
border-radius: 30rpx;
line-height: 1.5;
margin: 0;
}
</style>

+ 27
- 23
pages_order/components/order/placeOrder.vue View File

@ -58,9 +58,11 @@
<uv-icon name="red-packet" size="70rpx" color="#019245" />
<text style="flex: 1;">
账户余额
<text style="color: gray; margin-left: 20rpx;">(余额: {{ (userInfo.balance || 0).toFixed(2) }})</text>
<text style="color: gray; margin-left: 20rpx;">(余额: {{ (userInfo.balance ||
0).toFixed(2) }})</text>
</text>
<uv-radio activeColor="#019245" size="40rpx" name="1" :disabled="userInfo.balance < pricePay" />
<uv-radio activeColor="#019245" size="40rpx" name="1"
:disabled="userInfo.balance < pricePay" />
</view>
</view>
</uv-radio-group>
@ -162,7 +164,25 @@ export default {
},
// open
open() {
this.$refs.popup.open();
//
this.$api('queryMyLeader', {}, res => {
this.$refs.popup.open();
if (res.code == 200 && res.result.bindStatus != '2') {
this.pickupPoint = res.result
} else {
uni.showModal({
title: '提示',
content: '您还没有绑定团长,请先绑定团长',
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
this.$utils.navigateTo('/pages_order/mine/unbindTeam')
}
this.$refs.popup.close()
},
})
}
})
},
// close
close(){
@ -173,20 +193,10 @@ export default {
console.log('弹窗状态变化:', e);
//
},
//
gotoPickupPoint() {
this.$utils.navigateTo('/pages_order/location/pickupPoint')
},
//
listenPickupPoint() {
const pickupPointStr = uni.getStorageSync('selectedPickupPoint');
if (pickupPointStr) {
this.pickupPoint = JSON.parse(pickupPointStr);
}
uni.$on('updatePickupPoint', (point) => {
this.pickupPoint = point;
})
this.$utils.navigateTo('/pages_order/mine/unbindTeam')
},
//
@ -194,7 +204,7 @@ export default {
if (!this.pickupPoint) {
uni.showModal({
title: '提示',
content: '请选择取餐地点',
content: '请绑定团长',
showCancel: false,
confirmColor: '#019245',
success: () => {
@ -218,13 +228,6 @@ export default {
this.handlePay(this.orderParams)
}
},
mounted(){
this.listenPickupPoint();
},
beforeDestroy() {
uni.$off('updatePickupPoint');
// this.clearCouponData();
}
}
</script>
@ -254,6 +257,7 @@ export default {
color: $uni-color-third;
}
}
.place-order-address{
display: flex;
height: 80rpx;


+ 13
- 2
pages_order/order/afterSale.vue View File

@ -66,6 +66,11 @@
components: {
navbar
},
computed: {
images(){
return this.uploadedImages.join(',')
}
},
data() {
return {
orderId: '',
@ -148,7 +153,13 @@
})
return
}
if (!this.$utils.verificationPhone(this.contactInfo)) {
uni.showToast({
title: '请输入正确号码',
icon: 'error'
})
return
}
//
uni.showLoading({
title: '正在提交...'
@ -158,7 +169,7 @@
...this.idObject,
phone: this.contactInfo,
content: this.problemDescription,
images: this.uploadedImages
image: this.images
}, res => {
uni.hideLoading()
if (res.code == 200) {


+ 1
- 65
pages_order/product/productDetail.vue View File

@ -3,13 +3,6 @@
<!-- 导航栏 -->
<navbar title="详情页" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<!-- <view class="leftClick"
@click="$utils.navigateBack">
<uv-icon
size="30rpx"
color="#fff"
name="arrow-left"></uv-icon>
</view> -->
<view class="swipe">
<uv-swiper :list="productDetail.image
@ -34,63 +27,9 @@
{{ productDetail.title }}
</view>
<!-- <view class="price">
<view class="money">
<text>{{ productDetail.price }}</text>
<text class="unit">/元每件</text>
</view>
<view class="oldPrice">
<text>{{ productDetail.oldPrice }}</text>
<text class="unit">/</text>
</view>
</view> -->
<!-- <view class="price">
<view class="money">
<text>{{ productDetail.goldPrice }}</text>
<text class="unit">/元每件</text>
</view>
<view class="price-imgs">
<image :src="configList.vip_money_one" mode="aspectFill" class="price-img"></image>
</view>
</view> -->
<!-- <view class="price">
<view class="money">
<text>{{ productDetail.silverPrice }}</text>
<text class="unit">/元每件</text>
</view>
<view class="price-imgs">
<image :src="configList.vip_money_two" mode="aspectFill" class="price-img">
</image>
</view>
</view> -->
<!-- <view class="price">
<view class="money">
<text>{{ productDetail.diamondPrice }}</text>
<text class="unit">/元每件</text>
</view>
<view class="price-imgs">
<image :src="configList.vip_money_three" mode="aspectFill" class="price-img">
</image>
</view>
</view> -->
</view>
<!-- 服务 -->
<!-- <view class="server">
<view class="setver-main">
<view class="title">服务</view>
<view class="descript">
免费上门退·7天无理由退货·快递发货
</view>
</view>
<view class="server-arraw">
<uv-icon name="arrow-right"></uv-icon>
</view>
</view> -->
<!-- 参数 -->
<view v-if="productDetail.sku" class="params">
@ -189,10 +128,7 @@
return
}
this.$refs.placeOrder.open()
// this.$store.commit('setPayOrderProduct', [
// this.productDetail
// ])
// this.$utils.navigateTo('/pages_order/order/createOrder')
},
toSend(){
this.$store.commit('setPayOrderProduct', [


Loading…
Cancel
Save