2 Commits

Author SHA1 Message Date
  hflllll 2acd41ec43 'test到了最后几个阶段' 2 weeks ago
  hflllll 781f3c9625 '最后的优惠卷BUG' 2 weeks ago
17 changed files with 601 additions and 548 deletions
Split View
  1. +27
    -5
      api/model/order.js
  2. +9
    -3
      components/couponPopup/couponPopup.vue
  3. +170
    -42
      components/couponPopup/newCouponPopup.vue
  4. +1
    -1
      components/order/OrderItem.vue
  5. +102
    -51
      mixins/order.js
  6. +58
    -64
      pages/index/cart.vue
  7. +8
    -2
      pages/index/index.vue
  8. +38
    -187
      pages/index/order.vue
  9. +76
    -58
      pages_order/components/order/placeOrder.vue
  10. +17
    -8
      pages_order/mine/coupon.vue
  11. +27
    -4
      pages_order/mine/unbindTeam.vue
  12. +3
    -3
      pages_order/mine/wallet.vue
  13. +29
    -49
      pages_order/order/cartOrder.vue
  14. +22
    -28
      pages_order/order/groupMealDetail.vue
  15. +13
    -3
      pages_order/order/newOrderDetail.vue
  16. +1
    -37
      pages_order/order/orderDetail.vue
  17. +0
    -3
      pages_order/product/productDetail.vue

+ 27
- 5
api/model/order.js View File

@ -5,22 +5,44 @@ const api = {
queryLeaderOrderList: {
url: '/teambuy/order/queryLeaderOrderList',
method: 'GET',
limit: 500,
limit: 200,
},
// 订单-查看优惠券列表-详情
queryCouponList: {
url: '/teambuy/coupon/queryCouponList',
method: 'GET',
limit: 200
},
// 优惠券-领取优惠券
fetchCoupon: {
url: '/teambuy/coupon/fetchCoupon',
method: 'POST',
limit: 500
},
// 订单- 查询团餐订单列表 - 详情
queryLeaderOrderList: {
url: '/teambuy/order/queryLeaderOrderList',
// 优惠券-查看可领取的优惠券
queryFetchCouponList: {
url: '/teambuy/coupon/queryFetchCouponList',
method: 'GET',
limit: 500
},
// 优惠券-使用优惠券
// useCoupon: {
// url: '/teambuy/coupon/useCoupon',
// method: 'POST',
// limit: 500
// },
// 订单- 查询团餐订单列表 - 详情
// queryLeaderOrderList: {
// url: '/teambuy/order/queryLeaderOrderList',
// method: 'GET',
// limit: 500
// },
// 订单-查看团员订单列表-详情
queryMemberOrderList: {
url: '/teambuy/order/queryMemberOrderList',
@ -32,7 +54,7 @@ const api = {
queryShopcarList: {
url: '/teambuy/shopcar/queryShopcarList',
method: 'GET',
limit: 500
limit: 500
},
// 订单-购物车-添加购物车


+ 9
- 3
components/couponPopup/couponPopup.vue View File

@ -19,11 +19,11 @@
</view>
</view>
<image :src="configList.qd_image" mode="widthFix" class="register-success"></image>
<view class="shopping">购物即可抵扣</view>
<view class="shopping">下单即可抵扣</view>
</view>
<image
:src="configList.down_image" mode="widthFix"
class="examine"></image>
class="examine" />
</view>
</view>
</uv-popup>
@ -41,6 +41,11 @@
},
mounted() {
this.$refs.couponPopup.open()
this.$api('queryFetchCouponList', res => {
if(res.code == 200){
this.couponList = res.result.records
}
})
},
computed: {
...mapState(['riceInfo'])
@ -74,9 +79,10 @@
align-items: center;
.main-container {
// background-color: red;
.body {
position: relative;
background-color: red;
.coupon-bg {
}


+ 170
- 42
components/couponPopup/newCouponPopup.vue View File

@ -1,20 +1,27 @@
<template>
<view class="new-coupon-popup">
<uv-popup ref="popup" @change="change" min-height="400rpx" closeable>
<uv-popup ref="popup" @change="change" min-height="400rpx" closeable :z-index="999999">
<view class="coupon-content">
<text class="coupon-title">恭喜获得</text>
<text class="coupon-title">优惠券列表</text>
<view class="coupon-list">
<view class="coupon-item">
<text class="coupon-name">优惠券名称</text>
<text class="coupon-desc">优惠券描述</text>
<view class="coupon-item" v-for="item in couponList" :key="item.id">
<view class="coupon-left">
<view class="coupon-amount">
<text class="amount-symbol">¥</text>
<text class="amount-value">{{item.amount}}</text>
</view>
<view class="coupon-info">
<text class="coupon-name">{{item.title}}</text>
<text class="coupon-type">{{item.type_dictText}}</text>
<text class="coupon-desc">{{item.remark}}</text>
</view>
</view>
<view class="coupon-right">
<view class="fetch-btn" hover-class="fetch-btn-hover" @click="fetchCoupon(item.id)">
<text class="fetch-btn-text">领取</text>
</view>
</view>
</view>
<view class="coupon-item">
<text class="coupon-name">优惠券名称</text>
<text class="coupon-desc">优惠券描述</text>
</view>
</view>
<view class="coupon-btn" hover-class="coupon-btn-hover" @click="getCoupon">
<text class="coupon-btn-text">立即领取</text>
</view>
</view>
</uv-popup>
@ -23,28 +30,42 @@
<script>
export default {
name: 'newCouponPopup',
name: 'NewCouponPopup',
data() {
return {
couponList: []
}
},
mounted() {
// this.getCouponList()
// this.$refs.popup.open()
if (uni.getStorageSync('token')){
this.getCouponList()
}
},
methods: {
getCouponList() {
this.$api.getCouponList().then(res => {
this.couponList = res.data
this.$api('queryFetchCouponList', {}, res => {
if (res.code === 200 && res.result.length > 0){
this.couponList = res.result
this.$refs.popup.open()
}
})
},
getCoupon() {
uni.showToast({
title: '领取成功~',
icon: 'success'
fetchCoupon(id) {
this.$api('fetchCoupon', {
couponId: id
}, res => {
uni.showToast({
title: `${res.message}`,
icon: 'success'
})
this.$refs.popup.close();
})
this.$refs.popup.close()
},
change(e) {
if(!e) {
this.$emit('close')
}
}
}
}
@ -63,35 +84,142 @@ export default {
.coupon-title{
color: black;
text-align: center;
font-size: 32rpx;
font-size: 36rpx;
font-weight: 600;
margin-bottom: 10rpx;
}
.coupon-list{
display: flex;
flex-direction: column;
align-items: center;
gap: 20rpx;
width: 100%;
.coupon-item{
width: 660rpx;
width: 80vw;
height: 180rpx;
background-color: $uni-color;
border-radius: 10rpx;
}
}
.coupon-btn-hover{
opacity: 0.7;
}
.coupon-btn{
width: 570rpx;
height: 110rpx;
background-color: $uni-color;
border-radius: 55rpx;
display: flex;
align-items: center;
justify-content: center;
.coupon-btn-text{
color: #fff;
font-size: 30rpx;
background: linear-gradient(135deg, $uni-color, #ff8a8a);
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx;
position: relative;
box-shadow: 0 6rpx 12rpx rgba(255, 99, 99, 0.2);
overflow: hidden;
&::before {
content: '';
position: absolute;
left: -15rpx;
top: 50%;
transform: translateY(-50%);
width: 30rpx;
height: 30rpx;
background-color: #fff;
border-radius: 50%;
}
&::after {
content: '';
position: absolute;
right: -15rpx;
top: 50%;
transform: translateY(-50%);
width: 30rpx;
height: 30rpx;
background-color: #fff;
border-radius: 50%;
}
.coupon-left {
display: flex;
align-items: center;
gap: 20rpx;
.coupon-amount {
display: flex;
align-items: baseline;
color: #fff;
.amount-symbol {
font-size: 28rpx;
font-weight: bold;
}
.amount-value {
font-size: 48rpx;
font-weight: bold;
}
}
.coupon-info {
display: flex;
flex-direction: column;
.coupon-name {
font-size: 32rpx;
color: #fff;
font-weight: 600;
margin-bottom: 4rpx;
}
.coupon-type {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.9);
background-color: rgba(255, 255, 255, 0.2);
padding: 2rpx 10rpx;
border-radius: 10rpx;
display: inline-block;
margin-bottom: 6rpx;
}
.coupon-desc {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
}
}
.coupon-right {
.fetch-btn {
width: 120rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.9);
border-radius: 30rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
transform: translateX(-100%);
transition: transform 0.6s;
}
&:active::before {
transform: translateX(100%);
}
.fetch-btn-text {
color: $uni-color;
font-size: 26rpx;
font-weight: bold;
}
}
.fetch-btn-hover {
transform: scale(0.95);
opacity: 0.9;
}
}
}
}
}


+ 1
- 1
components/order/OrderItem.vue View File

@ -25,7 +25,7 @@
<view class="order-time">下单时间{{ order.createTime }}</view>
<view class="order-price">
<text>合计:</text>
<text class="price">{{ order.priceAll }}</text>
<text class="price">{{ order.pricePay }}</text>
</view>
</view>


+ 102
- 51
mixins/order.js View File

@ -1,4 +1,4 @@
import { mapMutations } from 'vuex'
export default {
data() {
@ -8,63 +8,114 @@ export default {
computed: {
},
methods: {
// 立即支付
toPayOrder(item){
let api = ''
// if([0, 1].includes(item.shopState)){
// api = 'createOrderTwo'
// }else{
api = 'createSumOrderAgain'
// }
this.$api(api, {
orderId : item.id,
addressId : item.addressId
...mapMutations(['clearCouponData']),
// 支付接口
handlePay(orderParams) {
uni.showLoading({
title: '支付处理中...'
})
if (!orderParams.userCouponId) {
// 没有优惠卷 则不传
delete orderParams.userCouponId
}
if (orderParams.remark == '') {
delete orderParams.remark
}
this.$api('createOrder', {
...orderParams
}, res => {
if(res.code == 200){
uni.requestPaymentWxPay(res)
.then(res => {
uni.hideLoading()
if (res.code === 200) {
if (orderParams.payType == '0') {
uni.requestPaymentWxPay(res)
.then(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
})
.catch(err => {
uni.showToast({
title: '支付失败',
icon: 'error'
})
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=0'
})
})
} else {
uni.showToast({
title: '支付成功',
icon: 'none'
title: '下单成功',
icon: 'success'
})
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()
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
}
}
})
},
// 立即支付
// 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();
}
}

+ 58
- 64
pages/index/cart.vue View File

@ -1,11 +1,16 @@
<template>
<view class="page">
<navbar></navbar>
<text class="control-text" @tap="isManaged = !isManaged">{{ isManaged ? '退出管理' : '管理' }}</text>
<!-- 白色字体 -->
<navbar title="购物车" color="#fff" />
<!-- 悬浮管理按钮 -->
<view class="float-manage-btn" @tap="isManaged = !isManaged" v-if="cartList && cartList.length">
<text>{{ isManaged ? '完成' : '管理' }}</text>
</view>
<view class="cart-items">
<uv-checkbox-group shape="circle" v-model="checkboxValue">
<view v-for="(item, index) in cartData.records" :key="item.id" class="cart-item">
<view v-for="(item, index) in cartList" :key="item.id" class="cart-item">
<view class="checkbox">
<uv-checkbox :key="index" :name="item.id" size="40rpx" iconSize="35rpx" activeColor="#019245" />
</view>
@ -37,11 +42,11 @@
</view>
</uv-checkbox-group>
<view style="padding-top: 300rpx;">
<uv-empty mode="car" v-if="!cartData.records || !cartData.records.length" text="购物车空空如也~" />
<uv-empty mode="car" v-if="!cartList || !cartList.length" text="购物车空空如也~" />
</view>
</view>
<view class="cart-footer" v-if="cartData.records && cartData.records.length">
<view class="cart-footer" v-if="cartList && cartList.length">
<view class="select-all">
<uv-checkbox-group v-model="allCheckbox">
<uv-checkbox size="40rpx" iconSize="35rpx" activeColor="#019245" shape="circle" name="all"
@ -53,10 +58,6 @@
<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">¥{{ (totalPrice).toFixed(2) }}</text>
<!-- <view v-if="isManaged" class="checkout-btn checkbox-collect" @tap="addCollect">
<text>添加收藏</text>
</view> -->
</view>
<view v-if="!isManaged" class="checkout-btn checkbox-primary" @tap="checkout">
<text>去下单</text>
@ -72,9 +73,12 @@
<script>
import tabber from '@/components/base/tabbar.vue'
import navbar from '@/components/base/navbar.vue'
import { mapActions } from 'vuex'
import mixinsList from '@/mixins/list.js'
import { mapMutations } from 'vuex'
export default {
mixins: [mixinsList],
components: {
tabber,
navbar
@ -84,20 +88,23 @@ export default {
cartData: {
records: []
},
cartList: [],
mixinsListKey: 'cartList',
mixinsListApi: 'queryShopcarList',
checkboxValue: [],
isManaged: false,
}
},
computed: {
allSelected() {
return this.cartData.records.every(item => this.checkboxValue.includes(item.id))
return this.cartList.every(item => this.checkboxValue.includes(item.id))
},
//
allCheckbox(){
return this.allSelected ? ['all'] : []
},
totalPrice(){
return this.cartData.records.reduce((total, item) => {
return this.cartList.reduce((total, item) => {
if (this.checkboxValue.includes(item.id)){
total += item.goods.price * item.num
}
@ -105,19 +112,11 @@ export default {
}, 0)
},
deleteCartIds(){
return this.checkboxValue.join(';')
return this.checkboxValue.join(',')
}
},
methods: {
...mapActions(['setCartData']),
//
getCartData(){
this.$api('queryShopcarList', {}, res => {
if (res.code == 200){
this.cartData = res.result
}
})
},
...mapMutations(['setCartData']),
//
modifyCart(item, type){
this.$api('addShopcar', {
@ -132,14 +131,12 @@ export default {
if (this.allSelected){
this.checkboxValue = []
}else{
this.checkboxValue = this.cartData.records.map(item => item.id)
this.checkboxValue = this.cartList.map(item => item.id)
}
// this.updateCart();
},
increaseQuantity(item) {
item.num += 1;
this.modifyCart(item, 1)
// this.updateCart();
},
decreaseQuantity(item) {
if (item.num > 1) {
@ -157,7 +154,7 @@ export default {
return;
}
const sendData = this.cartData.records.filter(item => this.checkboxValue.includes(item.id))
const sendData = this.cartList.filter(item => this.checkboxValue.includes(item.id))
this.$store.commit('setCartData', { sendData, priceAll: this.totalPrice } )
//
@ -165,31 +162,20 @@ export default {
url: '/pages_order/order/cartOrder'
});
},
// //
// addCollect(){
// if (!this.checkboxValue.length) {
// uni.showToast({
// title: '',
// icon: 'none'
// });
// return;
// }
// uni.showLoading({
// title: '...'
// })
// setTimeout(() => {
// uni.hideLoading()
// uni.showToast({
// title: '',
// })
// //
// }, 800)
// },
//
deleteCart(){
if (!this.checkboxValue.length) {
uni.showToast({
title: '请选择商品',
icon: 'error'
});
return;
}
uni.showModal({
title: '提示',
content: '确定删除购物车?',
content: '确定删除所选商品?',
confirmColor: '#019245',
success: (res) => {
if (res.confirm) {
this.$api('deleteShopcar', {
@ -199,9 +185,10 @@ export default {
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 1000
duration: 1000,
})
this.getCartData()
this.getData()
this.checkboxValue = []
}
})
}
@ -209,17 +196,14 @@ export default {
})
}
},
onShow(){
this.getCartData()
}
// onShow(){
// this.getData()
// }
}
</script>
<style lang="scss" scoped>
.page {
// background-color: #f5f5f5;
// padding-bottom: 120rpx;
// background-color: red;
position: relative;
.cart-items {
.cart-item {
@ -338,7 +322,7 @@ export default {
justify-content: flex-end;
font-size: 28rpx;
margin-right: 20rpx;
// background-color: red;
.total-price {
color: $uni-color-second;
font-size: 32rpx;
@ -365,14 +349,24 @@ export default {
background-color: $uni-color-fourth;
}
}
.control-text{
position: absolute;
right: 150rpx;
top: calc(env(safe-area-inset-bottom) + 40rpx);
font-size: 26rpx;
color: #fff;
z-index: 10000;
/* 悬浮管理按钮 */
.float-manage-btn {
position: fixed;
right: 30rpx;
top: 200rpx;
padding: 15rpx 30rpx;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 40rpx;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
z-index: 100;
border: 2rpx solid #019245;
text {
font-size: 28rpx;
color: #019245;
font-weight: 500;
}
}
}
</style>

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

@ -98,6 +98,7 @@
</view>
<tabbar select="index" />
<NewCouponPopup />
</view>
</template>
@ -105,11 +106,13 @@
import navbar from '@/components/base/navbar.vue'
import tabbar from '@/components/base/tabbar.vue'
import { homeData } from '@/static/js/mockHomeData.js'
import NewCouponPopup from '@/components/couponPopup/newCouponPopup.vue'
export default {
components: {
navbar,
tabbar
tabbar,
NewCouponPopup
},
data() {
return {
@ -182,7 +185,10 @@ export default {
})
},
getGoodsList() {
this.$api('queryGoodsList', { }, res => {
this.$api('queryGoodsList', {
pageNo: 1,
pageSize: 5
}, res => {
if (res.code == 200) {
this.$set(this.homeData, 'goodsList', res.result.records)
}


+ 38
- 187
pages/index/order.vue View File

@ -6,144 +6,66 @@
<!-- 搜索框 -->
<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"></uv-search>
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="current"
:inactiveStyle="{color: 'black'}" lineHeight="6rpx" lineWidth="55rpx" :current="status"
@click="clickTabs" />
</view>
<!-- 团餐列表 -->
<view class="group-meal-list" v-if="identity">
<view class="meal-item" v-for="(meal, index) in mealList" :key="meal.id">
<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 class="meal-price">本单佣金合计: <text class="price-value">¥{{ (meal.commission || 0).toFixed(2) || 0.00 }}</text>
</view>
<view class="meal-action">
<button class="order-btn" @tap="viewOrder(meal)">查看订单</button>
</view>
</view>
<view style="margin-top: 200rpx; min-width: 700rpx;">
<uv-empty mode="order" v-if="mealList.length == 0" />
<uv-empty mode="order" v-if="leaderOrderList.length == 0" />
</view>
</view>
<!-- 订单列表 -->
<view class="order-list" v-else>
<OrderItem v-for="(order, index) in orderList" :key="order.id" :order="order" @cancel="handleCancelOrder(order.id)"
@pick="handlePickOrder(order.id)" @pay="goToOrderDetail(order)" @click="goToOrderDetail(order)" />
<OrderItem v-for="(order, index) in memberOrderList" :key="order.id" :order="order"
@cancel="handleCancelOrder(order.id)" @pick="handlePickOrder(order.id)" @pay="goToOrderDetail(order)"
@click="goToOrderDetail(order)" />
<view style="margin-top: 200rpx; min-width: 700rpx;">
<uv-empty mode="order" v-if="orderList.length == 0" />
<uv-empty mode="order" v-if="memberOrderList.length == 0" />
</view>
</view>
<!-- <view class="list">
<view class="item" v-for="(item, index) in list" @tap="toOrderDetail(item.id)" :key="index">
<view class="content" :key="index" v-for="(good, index) in item.commonOrderSkuList">
<view class="top">
<view class="service">
{{ good.title }}
</view>
<view class="status">
<text> {{ tabs[Number(item.state) + 1].name }}</text>
</view>
</view>
<view class="main">
<view class="left">
<image mode="aspectFill" :src="good.image && good.image.split(',')[0]"></image>
</view>
<view class="right">
<view class="text-hidden-1">
客户姓名{{item.name}}
</view>
<view class="text-hidden-1">
下单时间{{item.createTime}}
</view>
<view class="text-hidden-1">
联系电话{{item.phone}}
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="price">
<text class="total-title">总价格</text>
<text class="unit"></text>
<text class="num">{{item.price}}</text>
<text class="c-unit"></text>
</view>
<view @tap.stop="toPayOrder(item)" class="btn" v-if="item.state == 0">
立即付款
</view>
<view @tap.stop="cancelOrder(item)" class="btn" v-if="item.state == 0">
取消订单
</view>
<view class="btn" @tap.stop="confirmOrder(item)" v-if="item.state == 2">
确认收货
</view>
<view @tap.stop="$refs.customerServicePopup.open()" class="btn" v-if="item.state > 0">
联系客服
</view>
</view>
</view>
<view style="
margin-top: 20rpx;
min-width: 700rpx;">
<uv-empty mode="list" v-if="list.length == 0"></uv-empty>
</view>
</view> -->
<customerServicePopup ref="customerServicePopup" />
<tabber select="order" />
</view>
</template>
<script>
import {
mapGetters
} from 'vuex'
import mixinsList from '@/mixins/list.js'
import mixinsOrder from '@/mixins/order.js'
import tabber from '@/components/base/tabbar.vue'
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import OrderItem from '@/components/order/OrderItem.vue'
export default {
mixins: [mixinsList, mixinsOrder],
mixins: [mixinsList],
components: {
tabber,
customerServicePopup,
OrderItem
},
computed: {
orderList() {
return this.memberOrderList.filter(order => order.status == this.current)
},
mealList() {
return this.leaderOrderList.filter(order => order.status == this.current)
},
tabs() {
return this.identity ? this.tabMeal : this.tabOrder
}
},
},
data() {
return {
keyword: '',
title: '',
tabOrder: [{
name: '待支付'
},
@ -173,97 +95,61 @@
name: '已完成'
}
],
current: 0,
status: 0,
memberOrderList: [],
leaderOrderList: [],
identity: uni.getStorageSync('identity')
identity: uni.getStorageSync('identity'),
mixinsListApi: '',
mixinsListKey: '',
}
},
onLoad(args) {
this.getData()
onLoad(args) {
//
this.mixinsListApi = this.identity ? 'queryLeaderOrderList' : 'queryMemberOrderList',
this.mixinsListKey = this.identity ? 'leaderOrderList' : 'memberOrderList'
// tabIndextab
if (args.tabIndex !== undefined) {
const index = parseInt(args.tabIndex)
if (!isNaN(index) && index >= 0 && index < this.tabs.length) {
this.current = index
//
// if (index == 0) {
// delete this.queryParams.state
// } else {
// this.queryParams.state = index - 1
// }
this.status = index
}
}
},
methods: {
handleSearch(value) {
this.$api('queryMemberOrderList', {
title: value
}, res => {
if (res.code == 200) {
this.memberOrderList = res.result.records
}
})
handleSearch() {
this.title = this.keyword
this.getData()
this.keyword = ''
this.title = ''
},
getData() {
uni.showLoading({
title: '加载中'
})
if (!this.identity) {
this.$api('queryMemberOrderList', {}, res => {
uni.hideLoading()
if (res.code == 200) {
this.memberOrderList = res.result.records
}
})
}
else {
this.$api('queryLeaderOrderList', {}, res => {
uni.hideLoading()
if (res.code == 200) {
this.leaderOrderList = res.result.records
}
})
beforeGetData() {
const params = {
status: this.status,
title: this.title || ''
}
return params
},
//tab
clickTabs({
index
}) {
this.current = index
this.status = index
this.getData()
},
//
goToOrderDetail(order) {
if (order.status === 'completed') {
this.$utils.navigateTo({
url: '/pages_order/order/newOrderDetail?id=' + order.id + '&status=' + order.status
})
} else {
this.$utils.navigateTo({
url: '/pages_order/order/newOrderDetail?id=' + order.id + '&status=' + order.status_dictText
})
}
this.$utils.navigateTo({
url: '/pages_order/order/newOrderDetail?id=' + order.id
})
},
//
viewOrder(meal) {
this.$utils.navigateTo({
url: '/pages_order/order/groupMealDetail?id=' + meal.id + '&status=' + meal.status
url: '/pages_order/order/groupMealDetail?id=' + meal.id
})
},
//
// filterOrdersByStatus(index) {
// this.loadMockOrders() //
// // if (index === 0) return //
// const targetStatus = this.statusMap[index]
// if (targetStatus) {
// this.orderList = this.orderList.filter(order => order.status === targetStatus)
// this.groupMeals = this.groupMeals.filter(meal => meal.status === targetStatus)
// }
// },
// //
handleCancelOrder(orderId) {
uni.showModal({
@ -289,41 +175,6 @@
}
})
},
//
// handlePayOrder(orderId) {
// uni.showToast({
// title: '...',
// icon: 'loading'
// })
// // API
// setTimeout(() => {
// uni.hideToast()
// this.$api('payOrder', {
// orderId: orderId,
// payType: 0
// }, res => {
// if (res.code == 200) {
// uni.showToast({
// title: '',
// icon: 'success'
// })
// }
// })
// //
// const orderIndex = this.orderList.findIndex(item => item.id === orderId)
// if (orderIndex !== -1) {
// this.orderList[orderIndex].status = 'processing'
// //
// if (this.current !== 0 && this.current !== 2) {
// this.orderList.splice(orderIndex, 1)
// }
// }
// }, 1500)
// },
//
handlePickOrder(orderId) {
uni.showModal( {


+ 76
- 58
pages_order/components/order/placeOrder.vue View File

@ -7,14 +7,13 @@
<image src="@/static/image/多人下单.webp" mode="aspectFit" class="place-order-title-image" />
<text class="number">{{ item.sales }}</text><text class="text">人下单</text>
<view class="place-order-title-close" @click="close">
<uv-icon name="close" size="40rpx"></uv-icon>
<uv-icon name="close" size="40rpx" />
</view>
</view>
<!-- 选择取餐地点 -->
<view class="place-order-address" @click="gotoPickupPoint">
<uv-icon name="map-fill" color="#019245" size="55rpx">
</uv-icon>
<uv-icon name="map-fill" color="#019245" size="55rpx" />
<text style="font-size: 42rpx;" v-show="!pickupPoint">
请选择取餐地点
@ -23,11 +22,11 @@
<view class="place-order-address-content-name">
{{ pickupPoint.name }}{{ pickupPoint.phone }}
</view>
<view class="place-order-address-content-address"> {{ pickupPoint.area }} {{ 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">
</uv-icon>
<uv-icon name="arrow-right" size="40rpx" />
</view>
</view>
@ -37,8 +36,8 @@
<view class="item">
<image :src="item.image" mode="aspectFill" class="item-image"></image>
<view style="font-size: 36rpx;">
<view>{{ item.name }}</view>
<view style="color: red; ">{{ item.price }}</view>
<view>{{ item.title }}</view>
<view style="color: red; ">{{ (priceAll || 0).toFixed(2) }}</view>
<view style="margin-top: 30rpx;">
<uv-number-box v-model="value" button-size="36"></uv-number-box>
</view>
@ -47,7 +46,7 @@
<!-- 选项框 -->
<uv-radio-group v-model="payMethod">
<view class="option-box" >
<view class="option-box">
<view class="option-box-item">
<uv-icon name="weixin-circle-fill" size="70rpx" color="#019245" />
<text style="flex: 1;">
@ -59,9 +58,9 @@
<uv-icon name="red-packet" size="70rpx" color="#019245" />
<text style="flex: 1;">
账户余额
<text style="color: gray; margin-left: 20rpx;">(余额: {{ userInfo.balance ? userInfo.balance.toFixed(2) : 0 }})</text>
<text style="color: gray; margin-left: 20rpx;">(余额: {{ (userInfo.balance || 0).toFixed(2) }})</text>
</text>
<uv-radio activeColor="#019245" size="40rpx" name="1" />
<uv-radio activeColor="#019245" size="40rpx" name="1" :disabled="userInfo.balance < pricePay" />
</view>
</view>
</uv-radio-group>
@ -72,9 +71,11 @@
<view class="discount">
<text style="font-size: 35rpx;">优惠</text>
<view style="display: flex; align-items: center; gap: 20rpx" @click="gotoCoupon">
<image src="@/static/image/券.webp" mode="aspectFill" class="discount-image" />
<text>{{ couponData.couponId_dictText || '请选择您的优惠卷' }}</text>
<text style="color: red;">-{{ couponData.discount || 0 }}</text>
<image src="@/static/image/券.webp" mode="aspectFill" class="discount-image"
v-if="couponData.id" />
<text v-if="couponData.id">{{ couponData.couponId_dictText || '优惠卷' }}</text>
<text v-else style="color: gray;">请选择您的优惠卷</text>
<text style="color: red;" v-if="couponData.discount">-{{ couponData.discount || 0 }}</text>
</view>
</view>
@ -92,6 +93,10 @@
<uv-icon name="shopping-cart-fill" size="60rpx" color="#019245" label="加入购物车" labelPos="bottom"
labelSize="25rpx" />
</view>
<view class="total-section">
<text>合计</text>
<text class="total-price">{{ (pricePay || 0).toFixed(2) }}</text>
</view>
<view class="pay" @tap="createOrder">
立即支付
</view>
@ -103,7 +108,9 @@
<script>
import { mapState } from 'vuex'
import order from '@/mixins/order'
export default {
mixins: [order],
name: 'placeOrder',
data() {
@ -122,16 +129,33 @@ export default {
},
computed: {
...mapState(['userInfo']),
...mapState(['couponData']),
...mapState(['userInfo', 'couponData']),
priceAll () {
return this.item.price * this.value
return this.item?.price * this.value || 0
},
goodss () {
return `${this.item.id},${this.value},${this.priceAll};`
return this.item?.id ? `${this.item.id},${this.value},${this.priceAll};` : ''
},
pricePay () {
const discount = this.couponData?.discount || 0
return (this.priceAll - discount) > 0.01 ? (this.priceAll - discount) : 0.01
},
orderParams () {
return {
priceAll: this.priceAll,
pricePay: this.pricePay,
pricePreferential: this.couponData?.discount || 0,
payType: this.payMethod,
leaderId: this.pickupPoint?.id || '',
userCouponId: this.couponData?.id || '',
goodss: this.goodss,
remark: this.remark
}
}
},
methods: {
// ...mapMutations(['clearCouponData']),
//
gotoCoupon() {
this.$utils.navigateTo('/pages_order/mine/coupon?usein=1')
@ -168,52 +192,30 @@ export default {
//
createOrder(){
if (!this.pickupPoint) {
uni.showToast({
title: '请选择取餐地点',
icon: 'error'
uni.showModal({
title: '提示',
content: '请选择取餐地点',
showCancel: false,
confirmColor: '#019245',
success: () => {
this.gotoPickupPoint()
}
})
return
}
if (this.payMethod == '1' && this.userInfo.balance < this.priceAll) {
uni.showToast({
if (this.payMethod == '1' && this.userInfo && this.userInfo.balance < this.pricePay) {
uni.showModal({
title: '余额不足',
icon: 'error'
showCancel: false,
content: '前往充值',
confirmColor: '#019245',
success: () => {
this.$utils.navigateTo('/pages_order/mine/wallet')
}
})
return
}
uni.showLoading({
title: '下单中...'
})
this.$api('createOrder', {
priceAll: this.priceAll,
pricePay: this.priceAll - ( this.couponData.discount || 0 ),
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.pickupPoint.id,
couponId: this.couponData.id || '',
goodss: this.goodss,
remark: this.remark
}, res => {
uni.hideLoading()
if (res.code === 200) {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.then(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
})
}else {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
}
}
})
this.handlePay(this.orderParams)
}
},
mounted(){
@ -221,6 +223,7 @@ export default {
},
beforeDestroy() {
uni.$off('updatePickupPoint');
// this.clearCouponData();
}
}
</script>
@ -356,8 +359,23 @@ export default {
align-items: center;
justify-content: center;
}
.total-section{
width: 30%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text{
font-size: 28rpx;
&.total-price{
color: #ff0000;
font-size: 32rpx;
font-weight: 500;
}
}
}
.pay{
width: 70%;
width: 40%;
background-color: $uni-color;
color: #fff;
text-align: center;


+ 17
- 8
pages_order/mine/coupon.vue View File

@ -4,7 +4,7 @@
<navbar title="优惠券" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
<!-- 标签页 -->
<uv-sticky bgColor="#fff">
<uv-sticky bgColor="#fff" v-if="!usein">
<uv-tabs :list="tabs" @change="changeTab" :scrollable="false" lineColor="#019245"
:activeStyle="{color: '#019245' }" lineWidth="80" lineHeight="6" :inactiveStyle="{color: '#333'}"
:itemStyle="{height: '90rpx'}" />
@ -14,21 +14,27 @@
<view class="coupon-list">
<template v-if="currentTab === 0">
<coupon-item v-for="coupon in unusedCoupons" :key="coupon.id" :coupon="coupon" @use="useCoupon" />
<uv-empty v-if="unusedCoupons.length == 0" text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
<view v-if="unusedCoupons.length == 0" style="padding-top: 200rpx;">
<uv-empty text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
</view>
</template>
<template v-if="currentTab === 1">
<coupon-item v-for="coupon in usedCoupons" :key="coupon.id" :coupon="coupon" />
<uv-empty v-if="usedCoupons.length == 0" text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
<view v-if="usedCoupons.length == 0" style="padding-top: 200rpx;">
<uv-empty text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
</view>
</template>
<template v-if="currentTab === 2">
<coupon-item v-for="coupon in expiredCoupons" :key="coupon.id" :coupon="coupon" />
<uv-empty v-if="expiredCoupons.length == 0" text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
<view v-if="expiredCoupons.length == 0" style="padding-top: 200rpx;">
<uv-empty text="暂无优惠卷" textSize="30rpx" iconSize="200rpx"
style="padding-top: 200rpx;" icon="list" />
</view>
</template>
</view>
</view>
@ -78,6 +84,7 @@ export default {
//
changeTab(item) {
this.currentTab = item.index
this.getCoupon()
},
// 使
@ -86,6 +93,7 @@ export default {
uni.showModal({
title: '提示',
content: `确定使用面值${coupon.discount}元的优惠券吗?`,
confirmColor: '#019245',
success: (res) => {
// 使
uni.showLoading({
@ -115,7 +123,8 @@ export default {
getCoupon() {
this.$api('queryCouponList', {
pageNo: 1,
pageSize: 10000
pageSize: 10000,
status: this.currentTab
}, res => {
if (res.code === 200){
this.allCoupons = res.result.records


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

@ -23,7 +23,10 @@
<text>{{ currentPickupPoint.phone }}</text>
</view>
</view>
<view class="select-btn" @click="deleteLeader">
<view v-if="currentPickupPoint.bindStatus == '0'" class="cancel-btn" disabled>
<text>解绑中...</text>
</view>
<view v-else class="select-btn" @click="deleteLeader">
<text>解绑</text>
</view>
@ -107,8 +110,9 @@ export default {
uni.showToast({
title: `${res.message}`
})
this.getLeaderList()
}
this.getLeaderList()
})
}
}
@ -133,6 +137,7 @@ export default {
title: `${res.message}`,
icon: 'success',
})
this.getLeaderList()
}
})
}
@ -142,15 +147,18 @@ export default {
},
getLeaderList() {
// this.currentPickupPoint = currentPickupPoint
// this.nearbyPickupPoints = []
// this.currentPickupPoint = {}
this.isBind = true
this.$api('queryLeaderList', {}, res => {
if (res.code == 200) {
this.nearbyPickupPoints = res.result.records
}
})
this.$api('queryMyLeader', {}, res => {
if (res.code == 200) {
if (res.code == 200 && res.result.bindStatus !== '2') {
this.currentPickupPoint = res.result
} else if (res.code == 500 || !res.result) {
} else if (res.code == 500 || !res.result || res.result.bindStatus == '2') {
this.isBind = false
}
})
@ -241,6 +249,21 @@ export default {
transform: translateY(-50%);
}
//
.cancel-btn {
background-color: $uni-color-second;
color: #fff;
width: 120rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 10rpx;
align-self: center;
font-size: 24rpx;
opacity: 0.7;
}
.select-btn {
background-color: $uni-color;
color: #fff;


+ 3
- 3
pages_order/mine/wallet.vue View File

@ -67,7 +67,7 @@
<script>
import navbar from '@/components/base/navbar.vue'
import { walletData } from '@/static/js/mockWallet.js'
// import { walletData } from '@/static/js/mockWallet.js'
export default {
components: {
@ -87,7 +87,7 @@ export default {
},
onLoad() {
this.walletData = walletData
// this.walletData = walletData
},
methods: {
//
@ -216,7 +216,7 @@ export default {
if (res.code === 200) {
uni.requestPaymentWxPay(res)
.then(() => {
this.userInfo.balance += parseFloat(this.rechargeAmount)
this.$store.commit('getUserInfo')
this.rechargeAmount = ''
this.isRecharge = false
})


+ 29
- 49
pages_order/order/cartOrder.vue View File

@ -4,7 +4,7 @@
<navbar title="购物车支付 " leftClick @leftClick="navigateBack" bgColor="#019245" color="#fff" />
<!-- 店铺信息 -->
<view class="shop-info">
<view class="shop-info" v-show="hasLeader">
<view class="shop-header">
<image class="shop-logo" :src="teamLeader.spotImage" mode="aspectFill"></image>
<view class="shop-name-container">
@ -68,7 +68,7 @@
<view class="discount-item" @click="gotoCoupon">
<view class="discount-left">
<image src="@/static/image/券.webp" mode="aspectFill" class="coupon-icon" v-if="couponData.couponId" />
<view :style="{ color: couponData.couponId ? 'inherit' : '#ccc' }">{{ couponData.couponId_dictText || '点击选择优惠卷->' }}
<view :style="{ color: couponData.couponId ? 'inherit' : 'gray' }">{{ couponData.couponId_dictText || '请选择优惠卷' }}
</view>
<text class="discount-amount">{{ couponData.discount ? ('-' + couponData.discount) : '' }}</text>
</view>
@ -81,7 +81,7 @@
<text>备注</text>
</view>
<view class="remark-content">
<input type="text" v-model="orderDetail.remark"
<input type="text" v-model="remark"
placeholder="请输入您要备注的内容" placeholder-style="font-size: 28rpx" />
</view>
</view>
@ -94,11 +94,10 @@
<text class="payment-name">微信支付</text>
<uv-radio activeColor="#019245" size="40rpx" name="0" />
</view>
<view class="payment-item">
<view class="payment-item" >
<uv-icon name="red-packet" size="70rpx" color="#019245" />
<text class="payment-name">账户余额<text class="balance-text">(余额: {{ userInfo.balance
}})</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="1" />
<text class="payment-name">账户余额<text class="balance-text">(余额: {{ (userInfo.balance || 0).toFixed(2) || 0 }})</text></text>
<uv-radio activeColor="#019245" size="40rpx" name="1" :disabled="userInfo.balance < pricePay"/>
</view>
</view>
</uv-radio-group>
@ -112,7 +111,7 @@
</text>
<text class="total-price">{{ (pricePay || 0).toFixed(2) || 0 }}</text>
</view>
<view class="pay-button" @tap="handlePay">立即下单</view>
<view class="pay-button" @tap="handlePay(orderParams)">立即下单</view>
</view>
</view>
</view>
@ -120,8 +119,10 @@
<script>
import navbar from '@/components/base/navbar.vue'
import { mapState, mapMutations } from 'vuex'
import order from '@/mixins/order.js'
import { mapState } from 'vuex'
export default {
mixins: [order],
components: {
navbar
},
@ -131,6 +132,8 @@ export default {
showAllFoods: false,
teamLeader: {},
thePriceAll: 0,
remark: '',
hasLeader: false
}
},
computed: {
@ -140,13 +143,27 @@ export default {
},
pricePay() {
return this.cartData.priceAll - (this.couponData.discount || 0)
return (this.cartData.priceAll - (this.couponData.discount || 0)) > 0.01 ? (this.cartData.priceAll - (this.couponData.discount || 0)) : 0.01
},
// goodId,goodNum;goodId2,goodsNum
goodss() {
return this.cartData.sendData.map(item => {
return `${item.goodsId},${item.num},${item.goods.price * item.num}`
}).join(';')
},
//
orderParams() {
return {
priceAll: this.cartData.priceAll,
pricePay: this.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.teamLeader.id,
goodss: this.goodss,
userCouponId: this.couponData.couponId || '',
remark: this.remark || ''
}
}
},
@ -154,11 +171,7 @@ export default {
this.getLeaderData()
},
onHide() {
this.clearCouponData()
},
methods: {
...mapMutations(['clearCouponData']),
//
navigateBack() {
uni.navigateBack()
@ -167,8 +180,9 @@ export default {
//
getLeaderData() {
this.$api('queryMyLeader', {}, res => {
if (res.code === 200) {
if (res.code === 200 && res.result.bindStatus !== '2') {
this.teamLeader = res.result
this.hasLeader = true
}else {
uni.showModal({
title: '提示',
@ -193,41 +207,7 @@ export default {
}
})
},
//
handlePay() {
uni.showLoading({
title: '支付处理中...'
})
this.$api('createOrder', {
priceAll: this.cartData.priceAll,
pricePay: this.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.teamLeader.id,
goodss: this.goodss
}, res => {
uni.hideLoading()
if (res.code === 200) {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.then(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
})
} else {
uni.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order?tabIndex=1'
})
}
}
})
},
//
gotoCoupon() {
//


+ 22
- 28
pages_order/order/groupMealDetail.vue View File

@ -1,25 +1,27 @@
<template>
<view class="page">
<!-- 导航栏 -->
<navbar :title="'团餐' + (mealInfo ? mealInfo.id : '')" leftClick @leftClick="$utils.navigateBack"
bgColor="#019245" color="#fff" />
<navbar title="详情页" leftClick @leftClick="navigateBack" bgColor="#019245" color="#fff" />
<view class="container">
<!-- 修改后 -->
<view class="top-btn-group" v-if="status == '2'">
<view class="top-btn-group" v-if="memberRes.status == '2'">
<button class="top-action-btn" @click="test1">通知所有人取餐</button>
<button class="top-action-btn" @click="test2">通知所有人完成订单</button>
</view>
<!-- 成员列表 -->
<view class="member-list">
<!-- 使用封装的成员项组件 -->
<member-food-item v-for="(member, index) in members" :key="index" :member="member" :status="status"
:default-expanded="index === defaultExpandedIndex" @toggle="handleMemberToggle"
@sendNotice="handleSend(member)" @completeOrder="handleComplete(member)" />
<member-food-item v-for="(member, index) in memberRes.orderMemberList" :key="index" :member="member"
:status="memberRes.status" :default-expanded="index === defaultExpandedIndex"
@toggle="handleMemberToggle" @sendNotice="handleSend(member)"
@completeOrder="handleComplete(member)" />
</view>
<!-- 空数据提示 -->
<uv-empty v-if="members.length === 0" text="暂无成员" mode="list" style="padding-top: 200rpx;" />
<uv-empty v-if="memberRes.orderMemberList.length === 0" text="暂无成员" mode="list"
style="padding-top: 200rpx;" />
</view>
</view>
</template>
@ -27,9 +29,11 @@
<script>
import navbar from '@/components/base/navbar.vue'
import MemberFoodItem from '../components/order/MemberFoodItem.vue'
import mixinsList from '@/mixins/list'
// status
// 0 1 2 3
export default {
mixins: [mixinsList],
components: {
navbar,
MemberFoodItem
@ -37,36 +41,26 @@ export default {
data() {
return {
mealId: null,
mealInfo: null,
defaultExpandedIndex: -1, //
members: [],
status: ''
mixinsListApi: 'queryLeaderOrderListById',
mixinsListKey: 'memberRes',
memberRes: null,
}
},
onLoad(options) {
if (options.id) {
this.mealId = options.id
this.status = options.status
uni.showLoading({
title: '加载中'
})
//
// this.getMealInfo(options.status)
this.$api('queryLeaderOrderListById', {
teambuyOrderLeaderId: this.mealId
}, res => {
uni.hideLoading()
if (res.code === 200 ){
this.members = res.result.orderMemberList
}
})
}
// console.log(options.status);
// this.members = mockFoodMember
},
methods: {
navigateBack(){
this.$utils.navigateBack()
},
beforeGetData(){
return {
teambuyOrderLeaderId: this.mealId
}
},
//
test1 () {
this.$api('informOrderAll', { leaderOrderId: this.mealId }, res => {


+ 13
- 3
pages_order/order/newOrderDetail.vue View File

@ -77,7 +77,7 @@
<image src="@/static/image/券.webp" mode="aspectFill" class="coupon-icon" />
<view>新用户立减</view>
</view>
<text v-if="orderDetail.pricePreferential" class="discount-amount">{{orderDetail.pricePreferential}}</text>
<text v-if="orderDetail.pricePreferential" class="discount-amount"> - {{orderDetail.pricePreferential}}</text>
<text v-else class="none-discount-amount">未使用优惠卷</text>
</view>
@ -167,6 +167,7 @@
this.getOrderDetail(options.id)
}
},
methods: {
...mapMutations([ 'clearCouponData']),
//
@ -200,11 +201,20 @@
if (res.code === 200) {
if (this.payMethod == '0') {
uni.requestPaymentWxPay(res)
.then(( ) => {
setTimeout(uni.redirectTo, 700, {
.then(n => {
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=1'
})
})
.catch(err => {
uni.showToast({
title: '支付失败',
icon: 'error'
})
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=0'
})
})
} else {
uni.showModal({
title: '提示',


+ 1
- 37
pages_order/order/orderDetail.vue View File

@ -2,35 +2,6 @@
<view>
<navbar title="订单详情" leftClick @leftClick="$utils.navigateBack" />
<!-- <view class="">
<view class="controls">
<view class="title">
<image src="../static/order/icon.png" mode=""></image>
服务完成
</view>
<view class="tips">
待送回
</view>
<view class="btns">
<view class="btn1">
快递寄回
</view>
<view class="btn2">
线下配送
</view>
</view>
</view>
<view class="steps">
<uv-steps
activeColor="#FD5100"
:current="stepsCurrent" dot>
<uv-steps-item :title="item"
:key="index"
v-for="(item, index) in steps"></uv-steps-item>
</uv-steps>
</view>
</view> -->
<view class="info">
<view class="flex" style="display: flex;">
<view style="width: 8rpx;height: 30rpx;
@ -51,14 +22,7 @@
{{good.title}}
<!-- <view class="coupon">领券立减</view> -->
</view>
<!-- <view class="current-price">
<text class="unit"></text>{{good.price}}
</view>
<view class="sales-volume" style="margin-top: 5px;">
<view class="desc">规格{{good.sku}}</view>
</view> -->
>
<view class="texture">
产品材质{{ good.subText }}


+ 0
- 3
pages_order/product/productDetail.vue View File

@ -119,7 +119,6 @@
<!-- 联系客服 -->
<customerServicePopup ref="customerServicePopup" />
<newCouponPopup ref="newCouponPopup" />
<placeOrder ref="placeOrder" :item="productDetail" @addCart="addCart" />
<uv-safe-bottom />
</view>
@ -129,7 +128,6 @@
import submit from '../components/product/submit.vue'
import submitUnitSelect from '../components/product/submitUnitSelect.vue'
import customerServicePopup from '@/components/config/customerServicePopup.vue'
import newCouponPopup from '@/components/couponPopup/newCouponPopup.vue'
import placeOrder from '../components/order/placeOrder.vue'
import { mapMutations } from 'vuex'
export default {
@ -137,7 +135,6 @@
submit,
submitUnitSelect,
customerServicePopup,
newCouponPopup,
placeOrder
},
data() {


Loading…
Cancel
Save