Browse Source

'test到了最后几个阶段'

hfll
hflllll 1 week ago
parent
commit
2acd41ec43
14 changed files with 364 additions and 446 deletions
  1. +8
    -8
      api/model/order.js
  2. +9
    -3
      components/couponPopup/couponPopup.vue
  3. +170
    -42
      components/couponPopup/newCouponPopup.vue
  4. +9
    -2
      mixins/order.js
  5. +20
    -22
      pages/index/cart.vue
  6. +8
    -2
      pages/index/index.vue
  7. +33
    -183
      pages/index/order.vue
  8. +62
    -60
      pages_order/components/order/placeOrder.vue
  9. +12
    -6
      pages_order/mine/coupon.vue
  10. +3
    -3
      pages_order/mine/wallet.vue
  11. +7
    -47
      pages_order/order/cartOrder.vue
  12. +22
    -28
      pages_order/order/groupMealDetail.vue
  13. +1
    -37
      pages_order/order/orderDetail.vue
  14. +0
    -3
      pages_order/product/productDetail.vue

+ 8
- 8
api/model/order.js View File

@ -5,14 +5,14 @@ const api = {
queryLeaderOrderList: {
url: '/teambuy/order/queryLeaderOrderList',
method: 'GET',
limit: 500,
limit: 200,
},
// 订单-查看优惠券列表-详情
queryCouponList: {
url: '/teambuy/coupon/queryCouponList',
method: 'GET',
limit: 500
limit: 200
},
// 优惠券-领取优惠券
@ -37,11 +37,11 @@ const api = {
// },
// 订单- 查询团餐订单列表 - 详情
queryLeaderOrderList: {
url: '/teambuy/order/queryLeaderOrderList',
method: 'GET',
limit: 500
},
// queryLeaderOrderList: {
// url: '/teambuy/order/queryLeaderOrderList',
// method: 'GET',
// limit: 500
// },
// 订单-查看团员订单列表-详情
queryMemberOrderList: {
@ -54,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;
}
}
}
}
}


+ 9
- 2
mixins/order.js View File

@ -1,4 +1,4 @@
import { mapMutations } from 'vuex'
export default {
data() {
@ -8,6 +8,7 @@ export default {
computed: {
},
methods: {
...mapMutations(['clearCouponData']),
// 支付接口
handlePay(orderParams) {
uni.showLoading({
@ -17,12 +18,15 @@ export default {
// 没有优惠卷 则不传
delete orderParams.userCouponId
}
if (orderParams.remark == '') {
delete orderParams.remark
}
this.$api('createOrder', {
...orderParams
}, res => {
uni.hideLoading()
if (res.code === 200) {
if (this.payMethod == '0') {
if (orderParams.payType == '0') {
uni.requestPaymentWxPay(res)
.then(n => {
setTimeout(uni.redirectTo, 700, {
@ -110,5 +114,8 @@ export default {
// }
// })
// },
},
beforeDestroy() {
this.clearCouponData();
}
}

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

@ -4,13 +4,13 @@
<navbar title="购物车" color="#fff" />
<!-- 悬浮管理按钮 -->
<view class="float-manage-btn" @tap="isManaged = !isManaged" v-if="cartData.records && cartData.records.length">
<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>
@ -42,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"
@ -73,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
@ -85,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
}
@ -110,15 +116,7 @@ export default {
}
},
methods: {
...mapActions(['setCartData']),
//
getCartData(){
this.$api('queryShopcarList', {}, res => {
if (res.code == 200){
this.cartData = res.result
}
})
},
...mapMutations(['setCartData']),
//
modifyCart(item, type){
this.$api('addShopcar', {
@ -133,7 +131,7 @@ 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)
}
},
increaseQuantity(item) {
@ -156,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 } )
//
@ -189,7 +187,7 @@ export default {
icon: 'success',
duration: 1000,
})
this.getCartData()
this.getData()
this.checkboxValue = []
}
})
@ -198,9 +196,9 @@ export default {
})
}
},
onShow(){
this.getCartData()
}
// onShow(){
// this.getData()
// }
}
</script>


+ 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)
}


+ 33
- 183
pages/index/order.vue View File

@ -13,138 +13,59 @@
<!-- 订单筛选 -->
<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"
<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: '待支付'
},
@ -174,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() {
this.$api('queryMemberOrderList', {
title: this.keyword
}, res => {
if (res.code == 200) {
this.memberOrderList = res.result.records
}
})
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({
@ -290,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( {


+ 62
- 60
pages_order/components/order/placeOrder.vue View File

@ -36,9 +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; ">{{ priceAll }}</view>
<view style="color: red; ">实付{{ pricePay }}</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>
@ -59,8 +58,7 @@
<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" :disabled="userInfo.balance < pricePay" />
</view>
@ -95,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>
@ -105,8 +107,10 @@
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import { mapState } from 'vuex'
import order from '@/mixins/order'
export default {
mixins: [order],
name: 'placeOrder',
data() {
@ -127,17 +131,31 @@ export default {
computed: {
...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 () {
return (this.priceAll - ( this.couponData.discount || 0 )) > 0 ? (this.priceAll - ( this.couponData.discount || 0 )) : 0.01
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']),
// ...mapMutations(['clearCouponData']),
//
gotoCoupon() {
this.$utils.navigateTo('/pages_order/mine/coupon?usein=1')
@ -174,61 +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.pricePay,
pricePreferential: this.couponData.discount || 0,
payType: this.payMethod,
leaderId: this.pickupPoint.id,
userCouponId: 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, 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.showToast({
title: '下单成功',
icon: 'success'
})
setTimeout(uni.redirectTo, 500, {
url: '/pages/index/order?tabIndex=1'
})
}
}
})
this.handlePay(this.orderParams)
}
},
mounted(){
@ -236,7 +223,7 @@ export default {
},
beforeDestroy() {
uni.$off('updatePickupPoint');
this.clearCouponData();
// this.clearCouponData();
}
}
</script>
@ -372,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;


+ 12
- 6
pages_order/mine/coupon.vue View File

@ -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>


+ 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
})


+ 7
- 47
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">
@ -120,7 +120,7 @@
<script>
import navbar from '@/components/base/navbar.vue'
import order from '@/mixins/order.js'
import { mapState, mapMutations } from 'vuex'
import { mapState } from 'vuex'
export default {
mixins: [order],
components: {
@ -132,7 +132,8 @@ export default {
showAllFoods: false,
teamLeader: {},
thePriceAll: 0,
remark: ''
remark: '',
hasLeader: false
}
},
computed: {
@ -170,11 +171,7 @@ export default {
this.getLeaderData()
},
beforeDestroy() {
this.clearCouponData()
},
methods: {
...mapMutations(['clearCouponData']),
//
navigateBack() {
uni.navigateBack()
@ -183,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: '提示',
@ -209,45 +207,7 @@ export default {
}
})
},
//
// handlePay() {
// uni.showLoading({
// title: '...'
// })
// this.$api('createOrder', {
// ...this.orderParams
// }, 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'
// })
// })
// .catch(err => {
// uni.showToast({
// title: '',
// icon: 'error'
// })
// setTimeout(uni.redirectTo, 700, {
// url: '/pages/index/order?tabIndex=0'
// })
// })
// } 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 => {


+ 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