Browse Source

'2.2第二天联调'

hfll
hflllll 5 months ago
parent
commit
444f7a2145
18 changed files with 483 additions and 323 deletions
  1. +34
    -0
      api/model/my.js
  2. +56
    -0
      api/model/order.js
  3. +8
    -16
      components/order/OrderItem.vue
  4. +1
    -1
      config.js
  5. +22
    -11
      pages/index/cart.vue
  6. +2
    -2
      pages/index/center.vue
  7. +50
    -32
      pages/index/order.vue
  8. +1
    -0
      pages_order/auth/wxUserInfo.vue
  9. +44
    -42
      pages_order/components/order/MemberFoodItem.vue
  10. +25
    -12
      pages_order/components/order/placeOrder.vue
  11. +54
    -47
      pages_order/location/pickupPoint.vue
  12. +30
    -18
      pages_order/mine/assets.vue
  13. +8
    -4
      pages_order/mine/unbindTeam.vue
  14. +35
    -29
      pages_order/mine/wallet.vue
  15. +55
    -16
      pages_order/order/groupMealDetail.vue
  16. +47
    -91
      pages_order/order/newOrderDetail.vue
  17. +7
    -1
      store/store.js
  18. +4
    -1
      utils/index.js

+ 34
- 0
api/model/my.js View File

@ -56,6 +56,40 @@ const api = {
limit: '500'
},
// 我的-查询团长列表
queryLeaderList : {
url: '/teambuy/leader/queryLeaderList',
method: 'POST',
limit: 500
},
// 我的-查询团长列表(下单选择地址)
queryLeaderList: {
url: '/teambuy/leader/queryLeaderList',
method: 'GET',
limit: 500
},
// 钱包-充值回调
CashNotify: {
url: '/teambuy/amount/CashNotify',
method: 'POST',
limit: 500
},
// 钱包-充值
cashIn: {
url: '/teambuy/amount/cashIn',
method: 'POST',
limit: 500
},
// 钱包- 收支明细
queryAmountLog: {
url: '/teambuy/amount/queryAmountLog',
method: 'POST',
limit: 500
}
}

+ 56
- 0
api/model/order.js View File

@ -54,6 +54,62 @@ const api = {
url: '/teambuy/order/createOrder',
method: 'POST',
limit: 500
},
// 订单-创建订单2
createOrder2: {
url: '/teambuy/order/createOrder2',
method: 'POST',
limit: 500
},
// 订单-修改团员订单状态
updateMemberOrderById: {
url: '/teambuy/order/updateMemberOrderById',
method: 'POST',
limit: 500
},
// 订单- 修改团长订单状态
updateLeaderOrderById : {
url: '/teambuy/order/updateLeaderOrderById',
method: 'POST',
limit: 500
},
// 订单-根据团餐id查询团团员订单列表
queryLeaderOrderListById: {
url: '/teambuy/order/queryLeaderOrderListById',
method: 'GET',
limit: 500
},
// 订单-团长完成全体取餐
finishOrderAll: {
url: '/teambuy/order/finishOrderAll',
method: 'POST',
limit: 500
},
// 订单-团长完成单体取餐
finishOrderOne: {
url: '/teambuy/order/finishOrderOne',
method: 'POST',
limit: 500
},
// 订单-团长通知全体取餐
informOrderAll: {
url: '/teambuy/order/informOrderAll',
method: 'POST',
limit: 500
},
// 订单-团长通知单个团员取餐
informOrderOne: {
url: '/teambuy/order/informOrderOne',
method: 'POST',
limit: 500
}
}

+ 8
- 16
components/order/OrderItem.vue View File

@ -3,8 +3,8 @@
<!-- 订单头部 - 商家信息 -->
<view class="order-header">
<view class="shop-info">
<image class="shop-logo" :src="order.shopLogo" mode="aspectFill"></image>
<text class="shop-name">{{ order.shopName }}</text>
<image class="shop-logo" :src="order.hanHaiMember.headImage" mode="aspectFill"></image>
<text class="shop-name">{{ order.title }}</text>
</view>
</view>
@ -12,20 +12,20 @@
<view class="order-content">
<view class="food-list">
<view class="food-scroll">
<view class="food-item" v-for="(food, index) in fourImage" :key="index">
<image class="food-image" :src="food.image" mode="aspectFill"></image>
<view class="food-item" v-for="(food, index) in order.goodsList" :key="index">
<image class="food-image" :src="food.goods.image" mode="aspectFill"></image>
</view>
</view>
<view class="food-count" v-if="order.foodCount > 4">{{ order.foodCount }}</view>
<view class="food-count" v-if="order.foodCount > 4">{{ order.goodsList.length }}</view>
</view>
</view>
<!-- 订单信息 - 下单时间和价格 -->
<view class="order-info">
<view class="order-time">下单时间{{ order.orderTime }}</view>
<view class="order-time">下单时间{{ order.updateTime }}</view>
<view class="order-price">
<text>合计:</text>
<text class="price">{{ order.totalPrice.toFixed(2) }}</text>
<text class="price">{{ order.priceAll }}</text>
</view>
</view>
@ -52,7 +52,7 @@
<view class="action-btn confirm" v-show="order.status === 'completed'" @click.stop="gotoSale">
订单售后
</view>
<view class="action-btn confirm" v-show="order.status === 'delivered'" @click.stop="pickOrder">
<view class="action-btn confirm" v-show="order.status_dictText === '待取餐'" @click.stop="pickOrder">
取餐完成
</view>
</view>
@ -68,14 +68,6 @@ export default {
type: Object,
required: true,
default: () => ({
id: '',
shopName: '',
shopLogo: '',
foods: [],
foodCount: 0,
orderTime: '',
totalPrice: 0,
status: 'pending' // pending, processing, shipping, completed, delivered, canceled
})
}
},


+ 1
- 1
config.js View File

@ -6,7 +6,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'test'
const type = 'local'
// 环境配置


+ 22
- 11
pages/index/cart.vue View File

@ -49,9 +49,9 @@
<text>全选</text>
</view>
<view class="cart-total">
<text v-if="!isManaged" style="font-size: 24rpx; color: #999;">已选{{ cartData.selectedCount }}</text>
<text v-if="!isManaged" style="font-size: 24rpx; color: #999;">已选{{ checkboxValue.length }}</text>
<text v-if="!isManaged">合计</text>
<text v-if="!isManaged" class="total-price">¥{{ (cartData.totalPrice).toFixed(1) }}</text>
<text v-if="!isManaged" class="total-price">¥{{ (totalPrice).toFixed(2) }}</text>
<view v-if="isManaged" class="checkout-btn checkbox-collect" @tap="addCollect">
<text>添加收藏</text>
@ -84,7 +84,8 @@ export default {
records: []
},
checkboxValue: [],
isManaged: false
isManaged: false,
}
},
computed: {
@ -94,6 +95,14 @@ export default {
//
allCheckbox(){
return this.allSelected ? ['all'] : []
},
totalPrice(){
return this.cartData.records.reduce((total, item) => {
if (this.checkboxValue.includes(item.id)){
total += item.goods.price * item.num
}
return total
}, 0)
}
},
methods: {
@ -119,14 +128,16 @@ export default {
// toggleSelect(item) {
// this.updateCart();
// },
// toggleSelectAll() {
// if (this.allSelected){
// this.checkboxValue = []
// }else{
// this.checkboxValue = this.cartData.items.map(item => item.id)
// }
// this.updateCart();
// },
toggleSelectAll() {
console.log(111);
if (this.allSelected){
this.checkboxValue = []
}else{
this.checkboxValue = this.cartData.records.map(item => item.id)
}
// this.updateCart();
},
increaseQuantity(item) {
item.num += 1;
this.modifyCart(item)


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

@ -230,8 +230,8 @@ export default {
}
},
onLoad (){
//
this.$store.commit('getUserInfo')
this.$store.commit('getUserInfo')
uni.setStorageSync('identity', 0) //
this.identity = uni.getStorageSync('identity') //
}


+ 50
- 32
pages/index/order.vue View File

@ -19,9 +19,9 @@
<!-- 团餐列表 -->
<view class="group-meal-list" v-if="identity">
<view class="meal-item" v-for="(meal, index) in groupMeals" :key="index+meal.id">
<view class="meal-name">{{ meal.name }}</view>
<view class="meal-price">本单佣金合计: <text class="price-value">¥{{meal.price}}</text></view>
<view class="meal-item" v-for="(meal, index) in leaderOrderList" :key="meal.id">
<view class="meal-name">{{ meal.title }}</view>
<view class="meal-price">本单佣金合计: <text class="price-value">¥{{ levelInfo.amount || '0.00' }}</text></view>
<view class="meal-action">
<button class="order-btn" @tap="viewOrder(meal)">查看订单</button>
</view>
@ -30,11 +30,11 @@
<!-- 订单列表 -->
<view class="order-list" v-else>
<OrderItem v-for="(order, index) in orderList" :key="order.id" :order="order" @cancel="handleCancelOrder"
<OrderItem v-for="(order, index) in memberOrderList" :key="order.id" :order="order" @cancel="handleCancelOrder"
@pick="handlePickOrder"
@pay="handlePayOrder" @click="goToOrderDetail" />
@pay="handlePayOrder" @click="goToOrderDetail(order)" />
<view style="margin-top: 200rpx; min-width: 700rpx;">
<uv-empty mode="order" v-if="orderList.length == 0"></uv-empty>
<uv-empty mode="order" v-if="memberOrderList.length == 0"></uv-empty>
</view>
</view>
@ -119,7 +119,7 @@
import tabber from '@/components/base/tabbar.vue'
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import OrderItem from '@/components/order/OrderItem.vue'
import { mockOrders, mockGroupMeals} from '@/static/js/mockOrders.js'
// import { mockOrders, mockGroupMeals} from '@/static/js/mockOrders.js'
export default {
mixins: [mixinsList, mixinsOrder],
components: {
@ -155,32 +155,51 @@
4: 'completed' //
},
current: 0,
mixinsListApi: 'queryLeaderOrderList',
// mixinsListApi: 'queryLeaderOrderList',
orderList: [],
memberOrderList: [],
leaderOrderList: [],
groupMeals: [],
identity: uni.getStorageSync('identity')
}
},
onLoad(args) {
// console.log(6666);
if (args.status) {
// Map
for (const key in this.statusMap) {
if (this.statusMap[key] === args.status) {
this.current = Number(key)
break
}
}
this.clickTabs({
index: this.current
})
}
// console.log('222',this.$store.state.levelInfo);
// if (args.status) {
// // Map
// for (const key in this.statusMap) {
// if (this.statusMap[key] === args.status) {
// this.current = Number(key)
// break
// }
// }
// this.clickTabs({
// index: this.current
// })
// }
//
this.loadMockOrders()
this.filterOrdersByStatus(this.current)
// this.loadMockOrders()
// this.filterOrdersByStatus(this.current)
this.getData()
},
methods: {
getData() {
this.$api('queryMemberOrderList', {}, res => {
if (res.code == 200) {
this.memberOrderList = res.result.records
}
})
this.$api('queryLeaderOrderList', {}, res => {
if (res.code == 200) {
this.leaderOrderList = res.result.records
}
})
},
//tab
clickTabs({
index
@ -192,7 +211,7 @@
}
//
// this.getData()
console.log('点击了tab栏', index);
// console.log('tab', index);
//
this.filterOrdersByStatus(index)
@ -205,7 +224,7 @@
})
} else {
this.$utils.navigateTo({
url: '/pages_order/order/newOrderDetail?id=' + order.id + '&status=' + order.status
url: '/pages_order/order/newOrderDetail?id=' + order.id + '&status=' + order.status_dictText
})
}
},
@ -215,11 +234,6 @@
url: '/pages_order/order/groupMealDetail?id=' + meal.id + '&status=' + meal.status
})
},
//
loadMockOrders() {
this.orderList = mockOrders
this.groupMeals = mockGroupMeals
},
//
filterOrdersByStatus(index) {
this.loadMockOrders() //
@ -304,9 +318,13 @@
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
order.status = 'completed',
this.clickTabs({
index: 3
// order.status_dictText = '',
this.$api('updateMemberOrderStatus', { id: order.id, status: 3 }, res => {
if (res.code === 200) {
this.clickTabs({
index: 3
})
}
})
uni.showToast({
title: '取餐完成',


+ 1
- 0
pages_order/auth/wxUserInfo.vue View File

@ -143,6 +143,7 @@
phone : self.userInfoForm.phone,
}, res => {
if (res.code == 200) {
this.$store.commit('getUserInfo')
uni.reLaunch({
url:'/pages/index/category'
})


+ 44
- 42
pages_order/components/order/MemberFoodItem.vue View File

@ -3,19 +3,19 @@
<!-- 成员基本信息 -->
<view class="member-item">
<view class="member-avatar">
<image :src="member.avatar" mode="aspectFill" />
<image :src="member.hanHaiMember.headImage" mode="aspectFill" />
</view>
<view class="member-info">
<text class="member-name">{{ member.name }}</text>
<text class="member-name">{{ member.hanHaiMember.nickName }}</text>
</view>
<view class="check-food-btn check-btn" @click="toggleExpand">
<text>{{ isExpanded ? '收起餐点' : '查看餐点' }}</text>
<uv-icon :name="isExpanded ? 'arrow-up' : 'arrow-down'" color="#019245" size="30rpx"></uv-icon>
</view>
<view v-if="status === 'shipping'" class="check-notice-btn check-btn" @click="sendNotice">
<view v-if="status === '1'" class="check-notice-btn check-btn" @click="sendNotice">
<text>通知取餐</text>
</view>
<view v-if="status === 'delivered'" class="check-notice-btn check-btn" @click="completeSend">
<view v-if="status === '2'" class="check-notice-btn check-btn" @click="completeOrder">
<text>完成取餐</text>
</view>
</view>
@ -23,20 +23,20 @@
<!-- 餐点列表展开区域 - 使用v-if替代uv-transition -->
<view class="food-detail" v-if="isExpanded">
<view class="food-list">
<view class="food-item" v-for="(food, index) in member.food" :key="index">
<view class="food-item" v-for="(food, index) in member.goodsList" :key="index">
<view class="food-left">
<image class="food-image" :src="food.image" mode="aspectFill" />
<image class="food-image" :src="food.goods.image" mode="aspectFill" />
<view class="food-info">
<text class="food-name">{{ food.name }}</text>
<text class="food-name">{{ food.goods.title }}</text>
<view class="food-sold">
<uv-icon name="checkmark-circle" color="#ccc" size="24rpx"></uv-icon>
<text>已售出 {{ food.sold }}</text>
<text>已售出 {{ food.goods.sales }}</text>
</view>
<text class="food-price"> <text style="font-size: 20rpx; margin-right: 5rpx;">¥</text> {{ food.price.toFixed(1) }}</text>
<text class="food-price"> <text style="font-size: 20rpx; margin-right: 5rpx;">¥</text> {{ food.goods.price.toFixed(2) }}</text>
</view>
</view>
<view class="food-right">
<text class="food-quantity">×{{ food.quantity }}</text>
<text class="food-quantity">×{{ food.num }}</text>
</view>
</view>
</view>
@ -61,7 +61,7 @@ export default {
//
status: {
type: String,
default: 'processing'
default: '0'
}
},
data() {
@ -84,41 +84,43 @@ export default {
});
},
sendNotice() {
this.$emit('sendNotice')
//
setTimeout(() => {
uni.showLoading({
title: '通知中...',
icon: 'loading',
duration: 2000
})
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '通知成功',
icon: 'success',
duration: 2000
})
}, 1200)
}, 200)
// setTimeout(() => {
// uni.showLoading({
// title: '...',
// icon: 'loading',
// duration: 2000
// })
// setTimeout(() => {
// uni.hideLoading()
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000
// })
// }, 1200)
// }, 200)
// ....
},
completeSend() {
completeOrder() {
this.$emit('completeOrder')
//
setTimeout(() => {
uni.showLoading({
title: '请稍等...',
icon: 'loading',
duration: 2000
})
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '已完成',
icon: 'success',
duration: 2000
})
}, 1200)
}, 200)
// setTimeout(() => {
// uni.showLoading({
// title: '...',
// icon: 'loading',
// duration: 2000
// })
// setTimeout(() => {
// uni.hideLoading()
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000
// })
// }, 1200)
// }, 200)
//
}
}


+ 25
- 12
pages_order/components/order/placeOrder.vue View File

@ -23,7 +23,7 @@
<view class="place-order-address-content-name">
{{ pickupPoint.name }}{{ pickupPoint.phone }}
</view>
<view class="place-order-address-content-address"> {{ pickupPoint.address }}</view>
<view class="place-order-address-content-address"> {{ pickupPoint.area }} {{ pickupPoint.address }} </view>
</view>
<view class="place-order-address-arrow">
<uv-icon name="arrow-right" size="40rpx">
@ -120,8 +120,11 @@ export default {
}
},
computed: {
priceAll(){
priceAll () {
return this.item.price * this.value
},
goodss () {
return `${this.item.id},${this.value},${this.priceAll};`
}
},
methods: {
@ -157,33 +160,43 @@ export default {
//
createOrder(){
uni.showLoading({
title: '下单中...'
})
this.$api('createOrder', {
priceAll: this.priceAll,
pricePay: this.priceAll - 0,
pricePreferential: 0,
payType: this.payMethod,
leaderId: this.pickupPoint.id,
goodss: this.goodss
}, res => {
uni.hideLoading()
if (res.code === 200) {
uni.requestPaymentWxPay(res)
.then(e => {
uni.showToast({
title: '下单成功',
icon: 'none'
})
// this.paySuccess(res)
}).catch(n => {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.catch(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
})
}else {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
}
}
})
}
},
mounted(){
this.listenPickupPoint();
// console.log(props.item);
},
beforeDestroy() {
uni.$off('updatePickupPoint');


+ 54
- 47
pages_order/location/pickupPoint.vue View File

@ -1,40 +1,40 @@
<template>
<view class="page">
<!-- 导航栏 -->
<navbar title="取餐点" leftClick @leftClick="$utils.navigateBack" color="#fff" />
<view class="page">
<!-- 导航栏 -->
<navbar title="取餐点" leftClick @leftClick="$utils.navigateBack" color="#fff" />
<view class="container">
<view class="header">
<view class="title">附近取餐点</view>
</view>
<view class="container">
<view class="header">
<view class="title">附近取餐点</view>
</view>
<!-- 取餐点列表 -->
<view class="pickup-list">
<view class="pickup-item" v-for="(item, index) in pickupPoints" :key="index">
<view class="left">
<image :src="item.image" class="shop-image" mode="aspectFill"></image>
</view>
<view class="center">
<view class="shop-name">{{item.name}}</view>
<view class="shop-address">
<uv-icon name="map-fill" color="#019245" size="34rpx"></uv-icon>
<text class="address-text">{{item.address}}</text>
</view>
<view class="shop-phone">
<uv-icon name="phone-fill" color="#019245" size="34rpx"></uv-icon>
<text class="phone-text">{{item.phone}}</text>
</view>
</view>
<view class="right">
<button class="select-btn" hover-class="select-btn-active" @tap="selectPoint(item)">选择</button>
</view>
</view>
</view>
<!-- 取餐点列表 -->
<view class="pickup-list">
<view class="pickup-item" v-for="(item, index) in pickupPoints" :key="index">
<view class="left">
<image :src="item.spotImage" class="shop-image" mode="aspectFill"></image>
</view>
<view class="center">
<view class="shop-name">{{item.spotName}}</view>
<view class="shop-address">
<uv-icon name="map-fill" color="#019245" size="34rpx"></uv-icon>
<text class="address-text"> {{ item.area }} {{ item.address }}{{item.area }}</text>
</view>
<view class="shop-phone">
<uv-icon name="phone-fill" color="#019245" size="34rpx"></uv-icon>
<text class="phone-text">{{item.phone}}</text>
</view>
</view>
<view class="right">
<button class="select-btn" hover-class="select-btn-active" @tap="selectPoint(item)">选择</button>
</view>
</view>
</view>
<!-- 无数据提示 -->
<uv-empty v-if="pickupPoints.length === 0" text="暂无取餐点" mode="list"></uv-empty>
</view>
</view>
<!-- 无数据提示 -->
<uv-empty v-if="pickupPoints.length === 0" text="暂无取餐点" mode="list"></uv-empty>
</view>
</view>
</template>
<script>
@ -47,20 +47,20 @@
data() {
return {
pickupPoints: [
{
id: '1',
name: '轻奢时代芙蓉兴盛',
address: '长沙市雨花区时代阳光大道轻奢时代芙蓉兴盛',
phone: '15070023168',
image: '/static/image/古茗店面.webp'
},
{
id: '2',
name: '芙蓉兴盛小文轩便利店',
address: '长沙市芙蓉区牛津街7栋102',
phone: '15070023168',
image: '/static/image/古茗店面.webp'
}
// {
// id: '1',
// spotName: '',
// area: '',
// phone: '15070023168',
// spotImage: '/static/image/.webp'
// },
// {
// id: '2',
// spotName: '便',
// area: '7102',
// phone: '15070023168',
// spotImage: '/static/image/.webp'
// }
]
}
},
@ -92,6 +92,13 @@
this.$utils.navigateBack()
}, 800);
}
},
onLoad() {
this.$api('queryLeaderList', {}, res => {
if (res.code == 200) {
this.pickupPoints = res.result.records
}
})
}
}
</script>


+ 30
- 18
pages_order/mine/assets.vue View File

@ -24,15 +24,15 @@
<!-- 交易记录列表 -->
<view class="transaction-list">
<view class="transaction-item" v-for="item in incomeList" :key="item.id">
<view class="transaction-item" v-for="item in comeList" :key="item.id">
<!-- 左侧图标和类型 -->
<view class="item-left">
<view class="icon-container">
<uv-icon name="empty-coupon" color="#019245" size="44"></uv-icon>
</view>
<view class="item-info">
<view class="item-type">{{ item.type }}</view>
<view class="item-time">{{ item.time }}</view>
<view class="item-type">{{ item.title }}</view>
<view class="item-time">{{ item.createTime }}</view>
</view>
</view>
@ -45,7 +45,7 @@
<script>
import navbar from '@/components/base/navbar.vue'
import { assetsData, assetsDataForHead } from '@/static/js/mockAssets.js'
// import { assetsData, assetsDataForHead } from '@/static/js/mockAssets.js'
export default {
components: {
@ -54,8 +54,7 @@ export default {
data() {
return {
currentTab: 0, // 0- 1-
incomeList: [],
expenseList: [],
comeList: [],
list: [
{
name: '收入明细',
@ -67,16 +66,18 @@ export default {
Data: []
}
},
computed: {
incomeList() {
return this.Data.filter(item => item.cashType == "0")
},
expenseList() {
return this.Data.filter(item => item.cashType == "1")
}
},
onLoad() {
const identity = uni.getStorageSync('identity')
if (identity) {
// mock
this.Data = assetsDataForHead
} else {
// mock
this.Data = assetsData
}
this.switchTab(0)
this.getData()
},
methods: {
//
@ -84,12 +85,23 @@ export default {
this.currentTab = index
//
if (index === 0) {
this.incomeList = this.Data.incomeList
} else {
this.incomeList = this.Data.expenseList
this.comeList = this.incomeList
} else if(index === 1) {
console.log(this.expenseList, '支出', this.Data);
this.comeList = this.expenseList
}
},
getData() {
this.$api('queryAmountLog', {}, res => {
if (res.code === 200) {
this.Data = res.result.records
this.switchTab(0)
}
})
}
}
},
}
</script>


+ 8
- 4
pages_order/mine/unbindTeam.vue View File

@ -44,15 +44,15 @@
<view class="pickup-list">
<view class="pickup-item" v-for="(item, index) in nearbyPickupPoints" :key="index">
<view class="pickup-image">
<image :src="item.image" mode="aspectFill"></image>
<image :src="item.spotImage" mode="aspectFill"></image>
</view>
<view class="pickup-info">
<view class="pickup-name">{{ item.name }}</view>
<view class="pickup-name">{{ item.spotName }}</view>
<view class="pickup-address">
<view class="pickup-address-icon">
<uv-icon name="map-fill" color="#019245" size="24"></uv-icon>
</view>
<text>{{ item.address }}</text>
<text>{{ item.area }}</text>
</view>
<view class="pickup-phone">
<uv-icon name="phone-fill" color="#019245" size="24"></uv-icon>
@ -114,7 +114,11 @@ export default {
},
onLoad() {
this.currentPickupPoint = currentPickupPoint
this.nearbyPickupPoints = nearbyPickupPoints
this.$api('queryLeaderList', {}, res => {
if (res.code == 200){
this.nearbyPickupPoints = res.result.records
}
})
}
}
</script>


+ 35
- 29
pages_order/mine/wallet.vue View File

@ -7,7 +7,7 @@
<view class="balance-card" :style="{ backgroundImage: 'url(/static/image/红烧肉.webp)' }">
<view class="balance-info">
<view class="balance-title">总余额</view>
<view class="balance-amount">{{ walletData.balance.toFixed(2) }}</view>
<view class="balance-amount">{{ userInfo.balance.toFixed(2) }}</view>
<view class="balance-actions">
<view class="action-btn recharge-btn" v-if="!isRecharge" @tap="navigateToRecharge">
<text>去充值</text>
@ -29,7 +29,7 @@
<!-- 提现金额输入框 -->
<view class="input-item">
<text class="currency-symbol">¥</text>
<input v-if="!isRecharge" class="amount-input" type="digit" v-model="withdrawAmount" placeholder="请输入提现金额"
<input v-if="!isRecharge" class="amount-input" type="digit" v-model="withdrawAmount" placeholder="请输入提现金额"
@blur="validateAmount" />
<input v-else class="amount-input" type="digit" v-model="rechargeAmount" placeholder="请输入充值金额"
@blur="validateAmount" />
@ -180,21 +180,21 @@ export default {
})
//
setTimeout(() => {
uni.hideLoading()
uni.showToast({
title: '提现申请已提交',
icon: 'success'
})
//
this.walletData.balance -= parseFloat(this.withdrawAmount)
//
this.withdrawAmount = ''
this.realName = ''
// setTimeout(() => {
// uni.hideLoading()
// uni.showToast({
// title: '',
// icon: 'success'
// })
// //
// this.walletData.balance -= parseFloat(this.withdrawAmount)
// //
// this.withdrawAmount = ''
// this.realName = ''
this.isFormValid = true
}, 1500)
// this.isFormValid = true
// }, 1500)
},
recharge() {
@ -208,21 +208,27 @@ export default {
uni.showLoading({
title: '充值中...'
})
//
//
setTimeout(() => {
this.$api('cashIn', { amount: this.rechargeAmount } , res => {
uni.hideLoading()
uni.showToast({
title: '充值成功',
icon: 'success'
})
//
this.walletData.balance += parseFloat(this.rechargeAmount)
//
this.rechargeAmount = ''
this.isRecharge = false
}, 1500)
if (res.code === 200) {
uni.requestPaymentWxPay(res)
.catch(() => {
this.userInfo.balance += parseFloat(this.rechargeAmount)
this.rechargeAmount = ''
this.isRecharge = false
})
}
})
//
// setTimeout(() => {
// //
// this.walletData.balance += parseFloat(this.rechargeAmount)
// //
// this.rechargeAmount = ''
// this.isRecharge = false
// }, 1500)
}
},
fail: (err) => {


+ 55
- 16
pages_order/order/groupMealDetail.vue View File

@ -5,6 +5,9 @@
bgColor="#019245" color="#fff" />
<view class="container">
<!-- test按钮 -->
<button @click="test1">通知所有人取餐</button>
<button @click="test1">通知所有人完成订单</button>
<!-- 成员列表 -->
<view class="member-list">
<!-- 使用封装的成员项组件 -->
@ -12,14 +15,16 @@
v-for="(member, index) in members"
:key="index"
:member="member"
:status="mealInfo.status"
:status="status"
:default-expanded="index === defaultExpandedIndex"
@toggle="handleMemberToggle"
@sendNotice="handleSend(member)"
@completeOrder="handleComplete(member)"
/>
</view>
<!-- 空数据提示 -->
<uv-empty v-if="members.length === 0" text="暂无成员" mode="list"></uv-empty>
<uv-empty v-if="members.length === 0" text="暂无成员" mode="list" style="padding-top: 200rpx;" />
</view>
</view>
</template>
@ -27,8 +32,8 @@
<script>
import navbar from '@/components/base/navbar.vue'
import MemberFoodItem from '../components/order/MemberFoodItem.vue'
import { mockFoodMember } from '@/static/js/mockOrders'
// status
// 0 1 2 3
export default {
components: {
navbar,
@ -39,34 +44,68 @@ export default {
mealId: null,
mealInfo: null,
defaultExpandedIndex: -1, //
members: []
members: [],
status: ''
}
},
onLoad(options) {
if (options.id) {
this.mealId = options.id
this.status = options.status
//
this.getMealInfo(options.status)
// this.getMealInfo(options.status)
this.$api('queryLeaderOrderListById', {
teambuyOrderLeaderId: this.mealId
}, res => {
if (res.code === 200 ){
this.members = res.result.orderMemberList
}
})
}
console.log(options.status);
// console.log(options.status);
this.members = mockFoodMember
// this.members = mockFoodMember
},
methods: {
//
getMealInfo(status) {
//
this.mealInfo = {
id: this.mealId,
name: '团餐' + this.mealId,
price: 18.00,
status: status
}
//
test1 () {
this.$api('informOrderAll', { leaderOrderId: this.mealId }, res => {
if (res.code === 200) {
this.$utils.showToast('通知成功')
}
})
},
//
test2 () {
this.$api('finishOrderAll', { leaderOrderId: this.mealId }, res => {
if (res.code === 200) {
this.$utils.showToast('通知成功')
}
})
},
// /
handleMemberToggle(data) {
console.log(`成员 ${data.member.name} ${data.expanded ? '展开' : '收起'} 了餐点列表`);
//
},
//
handleSend(member) {
this.$api('informOrderOne', { memberOrderId: member.id }, res => {
if (res.code === 200) {
// this.$utils.showToast('')
}
})
},
//
handleComplete(member) {
this.$api('finishOrderOne', { memberOrderId: member.id }, res => {
if (res.code === 200) {
// this.$utils.showToast('')
}
})
}
}
}


+ 47
- 91
pages_order/order/newOrderDetail.vue View File

@ -1,27 +1,28 @@
<template>
<view class="page">
<!-- 导航栏 -->
<navbar :title="orderStatus === 'pending' ? '待支付订单' : '订单详情' " leftClick @leftClick="navigateBack" bgColor="#019245" color="#fff" />
<navbar :title="orderStatus === 'pending' ? '待支付订单' : '订单详情' " leftClick @leftClick="navigateBack" bgColor="#019245"
color="#fff" />
<!-- 店铺信息 -->
<view class="shop-info">
<view class="shop-header">
<image class="shop-logo" :src="orderDetail.shopLogo" mode="aspectFill"></image>
<image class="shop-logo" :src="teamLeader.spotImage" mode="aspectFill"></image>
<view class="shop-name-container">
<text class="shop-name">{{orderDetail.shopName}}</text>
<text class="shop-name"> {{ teamLeader.spotName }} </text>
<view class="shop-address">
<view style="padding-top: 7rpx;">
<!-- 需要置顶 -->
<uv-icon name="map-fill" color="#019245" size="28rpx"></uv-icon>
</view>
<text class="address-text">{{orderDetail.shopAddress}}</text>
<text class="address-text">{{ teamLeader.area }} {{ teamLeader.address }}</text>
</view>
<view class="shop-phone">
<view style="padding-top: 7rpx;">
<!-- 需要置顶 -->
<uv-icon name="phone-fill" color="#019245" size="28rpx"></uv-icon>
</view>
<text class="phone-text">{{orderDetail.shopPhone}}</text>
<text class="phone-text">{{teamLeader.phone}}</text>
</view>
</view>
</view>
@ -30,20 +31,20 @@
<view class="order-status">
<!-- 商品列表 -->
<view class="food-list">
<view class="food-item" v-for="(food, index) in showedFoods" :key="index">
<image class="food-image" :src="food.image" mode="aspectFill" />
<view class="food-item" v-for="(food, index) in showedFoods" :key="food.id">
<image class="food-image" :src="food.goods.image" mode="aspectFill" />
<view class="food-info">
<text class="food-name">{{food.name}}</text>
<text class="food-name">{{food.goods.title}}</text>
<view class="food-sold">
<uv-icon name="bag" size="28rpx"></uv-icon>
<text>已售出 {{food.soldCount}}</text>
<text>已售出 {{ food.goods.sales }}</text>
</view>
<text class="food-price"> <text style="font-size: 20rpx;"></text> {{food.price.toFixed(1)}}</text>
<text class="food-count">×{{food.count}}</text>
<text class="food-price"> <text style="font-size: 20rpx;"></text> {{food.goods.price}}</text>
<text class="food-count">×{{food.num}}</text>
</view>
</view>
<view class="expand-more" @tap="showAllFoods = !showAllFoods" v-if="orderDetail.foods.length > 3">
<text>{{showAllFoods ? '收起' : '展开'}} ({{orderDetail.foodCount}})</text>
<view class="expand-more" @tap="showAllFoods = !showAllFoods" v-if="orderDetail.goodsList.length > 3">
<text>{{showAllFoods ? '收起' : '展开'}} ({{orderDetail.goodsList.length}})</text>
<uv-icon :name="showAllFoods ? 'arrow-up' : 'arrow-down'" size="28rpx"></uv-icon>
</view>
</view>
@ -53,11 +54,11 @@
<view class="order-info">
<view class="info-item">
<text class="info-label">合计:</text>
<text class="info-value price">{{orderDetail.totalPrice.toFixed(2)}}</text>
<text class="info-value price">{{ orderDetail.priceAll }}</text>
</view>
<view class="info-item">
<text class="info-label">创建时间:</text>
<text class="info-value">{{orderDetail.orderTime}}</text>
<text class="info-value">{{ orderDetail.createTime }}</text>
</view>
<view class="info-item">
<text class="info-label">订单编号:</text>
@ -76,7 +77,7 @@
<image src="@/static/image/券.webp" mode="aspectFill" class="coupon-icon" />
<view>新用户立减</view>
</view>
<text class="discount-amount">-2</text>
<text class="discount-amount">-{{ orderDetail.pricePreferential }}</text>
</view>
</view>
@ -86,15 +87,15 @@
<text>备注</text>
</view>
<view class="remark-content">
<input type="text" v-model="orderDetail.remark" placeholder="请输入您要备注的内容"
placeholder-style="font-size: 28rpx" />
<!-- <text>{{orderDetail.remark || '无备注信息'}}</text> -->
<input v-if="orderDetail.status_dictText === '待支付'" type="text" v-model="orderDetail.remark"
placeholder="请输入您要备注的内容" placeholder-style="font-size: 28rpx" />
<text v-else>{{orderDetail.remark || '无备注信息'}}</text>
</view>
</view>
</view>
<!-- 支付方式 -->
<uv-radio-group v-model="payMethod" v-if="orderStatus === 'pending'">
<uv-radio-group v-model="payMethod" v-if="orderDetail.status_dictText === '待支付'">
<view class="payment-methods">
<view class="payment-item">
<uv-icon name="weixin-circle-fill" size="70rpx" color="#019245"></uv-icon>
@ -103,8 +104,8 @@
</view>
<view class="payment-item">
<uv-icon name="red-packet" size="70rpx" color="#019245"></uv-icon>
<text class="payment-name">账户余额<text class="balance-text">(余额: 0)</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="account"></uv-radio>
<text class="payment-name">账户余额<text class="balance-text">(余额: {{ userInfo.balance }})</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="account" />
</view>
</view>
</uv-radio-group>
@ -112,11 +113,11 @@
<!-- 底部支付栏 -->
<view class="bottom-bar">
<view class="total-section">
<text class="total-label">{{orderDetail.foodCount}}<text style="color: black;">合计</text> </text>
<text class="total-price">{{(orderDetail.totalPrice - 2).toFixed(1)}}</text>
<text class="total-label">{{ orderDetail.goodsList.length || 0 }}<text style="color: black;">合计</text> </text>
<text class="total-price">{{ orderDetail.pricePay }}</text>
</view>
<view class="pay-button" @tap="handlePay" v-if="orderStatus === 'pending'">立即下单</view>
<view class="pay-button" @tap="handlePay" v-if="orderStatus === 'delivered'">立即取餐</view>
<view class="pay-button" @tap="handlePay" v-if="orderStatus === '待支付'">立即下单</view>
<view class="pay-button" @tap="handlePay" v-if="orderStatus === '已送达'">立即取餐</view>
</view>
</view>
</template>
@ -134,60 +135,7 @@
payMethod: 'weixin',
showAllFoods: false,
orderStatus: '',
orderDetail: {
id: '324563256386532',
status: 'pending',
shopName: '轻奢时代芙蓉兴盛',
shopLogo: '/static/image/古茗店面.webp',
shopAddress: '长沙市雨花区时代阳光大道轻奢时代芙蓉兴盛',
shopPhone: '15070023168',
foods: [
{
id: 1,
name: '茄子肉沫',
image: '/static/image/红烧肉.webp',
price: 9.9,
count: 1,
soldCount: 100
},
{
id: 2,
name: '豆角炒鸡蛋',
image: '/static/image/红烧肉.webp',
price: 9.9,
count: 1,
soldCount: 100
},
{
id: 3,
name: '酸辣土豆丝',
image: '/static/image/红烧肉.webp',
price: 9.9,
count: 1,
soldCount: 100
},
{
id: 3,
name: '酸辣土豆丝',
image: '/static/image/红烧肉.webp',
price: 9.9,
count: 1,
soldCount: 100
},
{
id: 3,
name: '酸辣土豆丝',
image: '/static/image/红烧肉.webp',
price: 9.9,
count: 1,
soldCount: 100
}
],
foodCount: 10,
orderTime: '2025-04-09 14:32:46',
totalPrice: 88.00,
remark: ''
}
orderDetail: { }
}
},
computed: {
@ -203,16 +151,16 @@
return statusMap[this.orderDetail.status] || '等待支付'
},
showedFoods() {
return this.showAllFoods ? this.orderDetail.foods : this.orderDetail.foods.slice(0, 3)
return this.showAllFoods ? this.orderDetail.goodsList : this.orderDetail.goodsList.slice(0, 3)
},
teamLeader() {
return this.orderDetail.teamLeader
}
},
onLoad(options) {
// ID
if (options.id) {
this.id = options.id
// ID
// this.getOrderDetail(this.id)
//
this.getOrderDetail(options.id)
}
this.orderStatus = options.status
},
@ -224,8 +172,17 @@
//
getOrderDetail(id) {
// API
// 使
this.id = id
this.$api('queryMemberOrderList', {
id: this.id
}, res => {
if (res.code === 200) {
this.orderDetail = res.result.records[0]
// console.log('111', this.orderDetail);
console.log('222', this.showedFoods);
}
})
},
//
@ -292,7 +249,7 @@
.shop-logo {
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
// border-radius: 10rpx;
margin-right: 20rpx;
}
@ -348,9 +305,8 @@
.food-image {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx;
// border-radius: 10rpx;
margin-right: 20rpx;
}
.food-info {


+ 7
- 1
store/store.js View File

@ -11,6 +11,7 @@ const store = new Vuex.Store({
state: {
configList: {}, //配置列表
userInfo: {}, //用户信息
levelInfo: {}, //团员等级信息
riceInfo: {}, //用户相关信息
category: [], //分类信息
payOrderProduct: [], //支付订单中的商品
@ -98,6 +99,8 @@ const store = new Vuex.Store({
url: '/pages_order/auth/wxUserInfo'
})
} else {
// 直接登录成功
store.commit('getUserInfo')
utils.navigateBack(-1)
}
})
@ -108,7 +111,9 @@ const store = new Vuex.Store({
api('getUserCenterData', res => {
if (res.code == 200) {
state.userInfo = res.result.member
console.log('state.userInfo', state.userInfo);
state.levelInfo = res.result.level
// console.log(state.levelInfo);
if (!state.userInfo.nickName ||
!state.userInfo.headImage ||
!state.userInfo.phone
@ -154,6 +159,7 @@ const store = new Vuex.Store({
// })
state.userInfo = {}
state.levelInfo = {}
uni.removeStorageSync('token')
if(reLaunch){


+ 4
- 1
utils/index.js View File

@ -60,7 +60,10 @@ uni.requestPaymentWxPay = function(res){
signType: res.result.signType, // 签名算法
paySign: res.result.paySign, // 签名
success: function (res) {
console.log('支付成功',res);
uni.showToast({
title: '支付成功',
icon: 'success'
})
success(res)
},
fail: function (err) {


Loading…
Cancel
Save