Compare commits
3 Commits
eec6abba36
...
67a2525624
| Author | SHA1 | Date |
|---|---|---|
|
|
67a2525624 | |
|
|
64c739bfb5 | |
|
|
aa45cb917b |
|
|
@ -54,7 +54,20 @@ export function updateAdvancehoppingCartAPI(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 移动端-预订餐(清空购物车)
|
||||
*/
|
||||
export function clearAdvancehoppingCartAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v2/mobile/order/shopping-cart/clear',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 移动端-获取订单详情
|
||||
*/
|
||||
|
|
@ -66,6 +79,35 @@ export function getShoppingCartListAPI(data) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 移动端-预订餐创建订单(获取餐卷)
|
||||
*/
|
||||
export function getListElectronMobileUsableAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v2/mkt/coupon/list-electron-mobile-usable',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @data 移动端-预订餐创建订单
|
||||
*/
|
||||
export function addReserveMealApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v2/mobile/order/reserve/meal/add',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"openid": uni.getStorageSync('openId'),
|
||||
"merchant-id":"378915229716713472",
|
||||
"source-type": 7,
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -85,8 +127,6 @@ export function getShoppingCartListAPI(data) {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,21 @@ export function getRechargeQueryResultApi(data) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 补贴钱包记录
|
||||
*/
|
||||
export function getSubsidyTradeListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v4/app/account/subsidy/trade/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"openid": uni.getStorageSync('openId'),
|
||||
"source-type": "7",
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ export function getUserHeaderPhoto(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
// 保存头像地址
|
||||
export function saveUserHeaderPhoto(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v4/app/custInfo/save/profile/photo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,14 @@ export function getMenuEvaluaorderAPI(data) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
//菜品评价数量
|
||||
export function getMenuEvaluaCountAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/api/v1/applet/menuevaluaorder/evaluate/count',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ module.exports = {
|
|||
// baseUrl: 'http://192.168.0.39:21995',
|
||||
// #ifdef H5
|
||||
// baseUrl: '/canteen/dev-api',
|
||||
// baseUrl: '/dev-api',
|
||||
baseUrl: '/dev-api',
|
||||
// baseUrl: 'http://192.168.0.244:38380',//测试
|
||||
// baseUrl: 'http://192.168.2.82:58080',//张天强
|
||||
baseUrl: 'http://192.168.2.55:58080',//董高文
|
||||
// baseUrl: 'http://192.168.2.55:58080',//董高文
|
||||
// baseUrl: 'http://192.168.1.69:58080',//董高文
|
||||
// baseUrl: 'http://192.168.2.83:58080',//盛旭
|
||||
// #endif
|
||||
|
|
|
|||
12
pages.json
12
pages.json
|
|
@ -216,6 +216,12 @@
|
|||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/remainingSum/subsidyList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "补贴钱包"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/post/index",
|
||||
"style": {
|
||||
|
|
@ -289,6 +295,12 @@
|
|||
"navigationBarTitleText": "订单结算"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/advanceOrder/payResult",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付结果"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/mine/me/changePassword",
|
||||
"style" :
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<template>
|
||||
<view>
|
||||
<div class="top-wrap">
|
||||
<div class="top-cont flex justify-between align-center">
|
||||
<div class="flex align-center">
|
||||
<view class="top-wrap">
|
||||
<view class="top-cont flex justify-between align-center">
|
||||
<view class="flex align-center">
|
||||
<u-icon name="../../static/images/time.png" size="16"></u-icon>
|
||||
<span style="margin-left: 5px">{{ newDate }}</span>
|
||||
</div>
|
||||
<!-- <div class="top-right-cont">
|
||||
</view>
|
||||
<!-- <view class="top-right-cont">
|
||||
<span class="right-item" :class="{ active: active == 1 }" @click="active = 1">自取</span>
|
||||
<span class="right-item" :class="{ active: active == 2 }" @click="active = 2">外卖</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="tab-navigation">
|
||||
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
||||
</view>
|
||||
|
|
@ -26,11 +26,11 @@
|
|||
<scroll-view class="content-right" scroll-y="true">
|
||||
<view class="scroll-right-item" v-for="(item,index) in dishesList" :key="index">
|
||||
<view style="width: 100%;display: flex;align-items: center;">
|
||||
<view style="width: 30%;height: 100%;">
|
||||
<view style="width: 30%;height: 100%;" @click="goMenuDetail(item)">
|
||||
<image class="image" :src="item.dishesImgUrl"></image>
|
||||
</view>
|
||||
<view style="width: 65%;height: 100%; display: flex;position: relative;">
|
||||
<view class="center-cont">
|
||||
<view class="center-cont" @click="goMenuDetail(item)">
|
||||
<view class="meal-name" style="margin-bottom: 10rpx;font-weight: bold;">{{ item.dishesName }}</view>
|
||||
<view class="sale-num" style="margin-bottom: 10rpx;">月销 {{ item.monthlySales||0 }}</view>
|
||||
<view class="num-cont" style="margin-bottom: 10rpx;">
|
||||
|
|
@ -64,81 +64,84 @@
|
|||
</view>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<div style="height: 60px"></div>
|
||||
<div class="shop-car">
|
||||
<div class="car-cont">
|
||||
<div class="flex align-center" @click="openCar">
|
||||
<view style="height: 60px"></view>
|
||||
<view class="shop-car">
|
||||
<view class="car-cont">
|
||||
<view class="flex align-center" @click="openCar">
|
||||
<u-icon name="../../static/images/shop-car.png" size="25"></u-icon>
|
||||
<span class="money">
|
||||
<span style="font-size: 11px">¥</span>
|
||||
{{ totalPrice }}
|
||||
</span>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<div>
|
||||
<view>
|
||||
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 购物车-pop -->
|
||||
<u-popup :show="showCar" position="bottom" :round="12" @close="showCar = false">
|
||||
<div class="popup-cont">
|
||||
<div class="flex justify-between align-center">
|
||||
<div style="font-weight: 500; font-size: 14px">已加购菜品</div>
|
||||
<div style="font-weight: 400; font-size: 12px; color: #ff6816" @click="showModal = true">清空</div>
|
||||
</div>
|
||||
<view class="popup-cont">
|
||||
<view class="flex justify-between align-center">
|
||||
<view style="font-weight: 500; font-size: 14px">已加购菜品</view>
|
||||
<view style="font-weight: 400; font-size: 12px; color: #ff6816" @click="showModal = true">清空</view>
|
||||
</view>
|
||||
|
||||
<div class="flex justify-between align-center" style="margin: 20.5px 0 12.5px">
|
||||
<div class="flex align-center">
|
||||
<view class="flex justify-between align-center" style="margin: 20.5px 0 12.5px">
|
||||
<view class="flex align-center">
|
||||
{{ canteenName }}/{{stallName}}
|
||||
<span class="name-type">{{ canteenType }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
</view>
|
||||
<view>
|
||||
{{ newDate2 }}
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<div class="list-wrap">
|
||||
<div class="cont-list" v-for="(food, foodIndex) in addFood">
|
||||
<div>
|
||||
<u-image :src="food.dishesImgUrl" showLoading width="80px" height="80px" />
|
||||
</div>
|
||||
|
||||
<div class="center-cont">
|
||||
<div class="meal-name">{{ food.dishesName }}</div>
|
||||
<div class="sale-num">月销 {{ food.monthlySales||0 }}</div>
|
||||
<div class="num-cont">
|
||||
<span style="margin-right: 5px">{{ '库存' + food.dishesDetailList[0].surplusNum }}</span>
|
||||
<span>{{ '限购' + food.dishesDetailList[0].restrictNum }}</span>
|
||||
</div>
|
||||
<div class="sale-price">
|
||||
<span style="font-size: 11px">¥</span>
|
||||
{{ (food.dishesDetailList[0].prefPrice/100).toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right-cont">
|
||||
<div class="num-wrap">
|
||||
<u-icon
|
||||
v-if="food.num > 0"
|
||||
name="../../static/images/del.png"
|
||||
size="16"
|
||||
@click="handleFoodNum(1, food)"
|
||||
/>
|
||||
<span class="cont-num">{{ food.num || 0 }}</span>
|
||||
<u-icon
|
||||
:disabled="food.num < food.restrictNum"
|
||||
name="../../static/images/add2.png"
|
||||
size="16"
|
||||
@click="handleFoodNum(2, food)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="list-wrap">
|
||||
<view class="cont-list" v-for="(food, foodIndex) in addFood">
|
||||
<u-swipe-action>
|
||||
<u-swipe-action-item :options="options" @click="delFood($event, food)">
|
||||
<view style="width: 100%;display: flex;height: auto;">
|
||||
<view>
|
||||
<u-image :src="food.dishesImgUrl" showLoading width="80px" height="80px" />
|
||||
</view>
|
||||
<view class="center-cont">
|
||||
<view class="meal-name">{{ food.dishesName }}</view>
|
||||
<view class="sale-num">月销 {{ food.monthlySales||0 }}</view>
|
||||
<view class="num-cont">
|
||||
<span style="margin-right: 5px">{{ '库存' + food.dishesDetailList[0].surplusNum }}</span>
|
||||
<span>{{ '限购' + food.dishesDetailList[0].restrictNum }}</span>
|
||||
</view>
|
||||
<view class="sale-price">
|
||||
<span style="font-size: 11px">¥</span>
|
||||
{{ (food.dishesDetailList[0].prefPrice/100).toFixed(2) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-cont">
|
||||
<view class="num-wrap">
|
||||
<u-icon
|
||||
v-if="food.num > 0"
|
||||
name="../../static/images/del.png"
|
||||
size="16"
|
||||
@click="handleFoodNum(1, food)"
|
||||
/>
|
||||
<span class="cont-num">{{ food.num || 0 }}</span>
|
||||
<u-icon
|
||||
:disabled="food.num < food.restrictNum"
|
||||
name="../../static/images/add2.png"
|
||||
size="16"
|
||||
@click="handleFoodNum(2, food)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-swipe-action-item>
|
||||
</u-swipe-action>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<u-modal :show="showModal" showCancelButton title="提示" @cancel="showModal = false" @confirm="clearCar">
|
||||
|
|
@ -150,7 +153,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getlistReserveDateAPI,getAdvanceDetailListAPI,addAdvancehoppingCartAPI,updateAdvancehoppingCartAPI,getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
||||
import { getlistReserveDateAPI,getAdvanceDetailListAPI,addAdvancehoppingCartAPI,updateAdvancehoppingCartAPI,clearAdvancehoppingCartAPI,getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
||||
import Tabs from '@/pages/components/Tabs.vue'
|
||||
export default {
|
||||
components: { Tabs },
|
||||
|
|
@ -176,6 +179,13 @@ export default {
|
|||
showModal: false, // 清空购物车
|
||||
// 添加的菜品
|
||||
addFood: [],
|
||||
options: [{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#f56c6c'
|
||||
}
|
||||
}],
|
||||
|
||||
|
||||
current: 0,
|
||||
active: 1, // 1 自取 2 外卖
|
||||
|
|
@ -330,8 +340,10 @@ export default {
|
|||
this.recipeId=options.recipeId;
|
||||
//获取预定日期
|
||||
this.getReserveDate()
|
||||
//获取预定餐菜谱
|
||||
this.getMenuListData()
|
||||
setTimeout(()=>{
|
||||
//获取预定餐菜谱
|
||||
this.getMenuListData()
|
||||
},1000)
|
||||
},
|
||||
methods: {
|
||||
//获取预定日期
|
||||
|
|
@ -363,12 +375,12 @@ export default {
|
|||
let day = date.getDate().toString().padStart(2, '0')
|
||||
this.newDate2 = `${year}-${month}-${day}`
|
||||
},
|
||||
|
||||
|
||||
// 获取菜谱
|
||||
async getMenuListData() {
|
||||
let param = {
|
||||
"recipeId":this.recipeId,
|
||||
// "applyDate":this.newDate2
|
||||
// "applyDate":this.newDate2,
|
||||
"applyDate":"2024-11-11"
|
||||
}
|
||||
const res = await getAdvanceDetailListAPI(param)
|
||||
|
|
@ -441,6 +453,11 @@ export default {
|
|||
return '夜宵'
|
||||
}
|
||||
},
|
||||
goMenuDetail(item){
|
||||
uni.navigateTo({
|
||||
url: `/pages/weeklyMenu/menuDetail?params=${JSON.stringify(item)}`
|
||||
})
|
||||
},
|
||||
//获取预定购物车(订单)
|
||||
async getShoppingCartList(){
|
||||
let param = {
|
||||
|
|
@ -463,6 +480,42 @@ export default {
|
|||
if(food.baseDishesId==cartItem.goodsDishesId){
|
||||
// food.num = food.num+1
|
||||
this.$set(food, 'num', cartItem.quantity)
|
||||
let obj = {
|
||||
"canteenId":this.canteenId,
|
||||
"canteenName":this.canteenName,
|
||||
"costModelList":food.costModelList,
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"detailType": food.detailType,
|
||||
"extParam": null,
|
||||
"goodsDishesId": cartItem.goodsDishesId,
|
||||
"goodsDishesImgUrl": food.dishesImgUrl,
|
||||
"goodsDishesName": cartItem.goodsDishesName,
|
||||
"ifExpired": cartItem.ifExpired,
|
||||
"inventoryId": cartItem.inventoryId,
|
||||
"mealtimeName": cartItem.mealtimeName,
|
||||
"mealtimeType": cartItem.mealtimeType,
|
||||
"menuDetailId": cartItem.menuDetailId,
|
||||
"menuId": cartItem.menuId,
|
||||
// "orderDate": cartItem.orderDate,
|
||||
"orderDate": this.newDate2,
|
||||
"orderType": cartItem.orderType,
|
||||
"dishesDetailList":food.dishesDetailList,
|
||||
"prefPrice": food.dishesDetailList[0].prefPrice,
|
||||
"quantity": cartItem.quantity,
|
||||
"restrictNum": cartItem.restrictNum,
|
||||
"salePrice": cartItem.salePrice,
|
||||
"salesMode": cartItem.salesMode,
|
||||
"shoppingCartId": cartItem.shoppingCartId,
|
||||
"sizeJson": cartItem.sizeJson,
|
||||
"sizeName": cartItem.sizeName,
|
||||
"sizeType": cartItem.sizeType,
|
||||
"stallId": this.stallId,
|
||||
"stallName": this.stallName,
|
||||
"surplusNum": cartItem.surplusNum,
|
||||
"unitName": null,
|
||||
"weightUnit": null
|
||||
}
|
||||
this.$set(cartItem, 'orderDetailList', [obj])
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -494,12 +547,43 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
//删除按钮
|
||||
async delFood(e,item){
|
||||
console.log(e)
|
||||
console.log(item)
|
||||
console.log(this.shoppingCartList)
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"shoppingCartId":"",
|
||||
"quantity":0
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.baseDishesId==cartItem.goodsDishesId){
|
||||
param.shoppingCartId=cartItem.shoppingCartId
|
||||
}
|
||||
})
|
||||
this.menuData.forEach(menuItem => {
|
||||
menuItem.typeList.forEach(detail => {
|
||||
detail.dishesList.forEach(food => {
|
||||
if(food.baseDishesId==item.baseDishesId){
|
||||
this.$set(food, 'num', 0)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
console.log(param)
|
||||
const res = await updateAdvancehoppingCartAPI(param)
|
||||
if(res.code==200){
|
||||
this.getShoppingCartList()
|
||||
}
|
||||
},
|
||||
|
||||
async addShopCart(item){
|
||||
console.log(item)
|
||||
let param = {
|
||||
"orderType": 2,
|
||||
// "orderDate":this.newDate2
|
||||
"orderDate":"2024-11-11",
|
||||
"orderDate":this.newDate2,
|
||||
// "orderDate":"2024-11-11",
|
||||
"mealtimeType":item.mealtimeType,
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"menuId":this.recipeId,
|
||||
|
|
@ -508,6 +592,7 @@ export default {
|
|||
"goodsDishesId":item.baseDishesId,
|
||||
"goodsDishesName":item.dishesName,
|
||||
"quantity":1,
|
||||
"prefPrice":item.prefPrice
|
||||
}
|
||||
const res = await addAdvancehoppingCartAPI(param)
|
||||
if(res.code==200){
|
||||
|
|
@ -542,7 +627,42 @@ export default {
|
|||
this.getShoppingCartList()
|
||||
}
|
||||
},
|
||||
// 打开购物车
|
||||
//购物车-清空按钮
|
||||
clearCar(){
|
||||
let arr = []
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
arr.push(cartItem.shoppingCartId)
|
||||
})
|
||||
try {
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"shoppingCartIds":arr,
|
||||
}
|
||||
console.log(param)
|
||||
clearAdvancehoppingCartAPI(param).then(res => {
|
||||
if(res.code==200){
|
||||
console.log(res)
|
||||
this.menuData.forEach(menuItem => {
|
||||
menuItem.typeList.forEach(detail => {
|
||||
detail.dishesList.forEach(food => {
|
||||
this.$set(food, 'num', 0)
|
||||
})
|
||||
})
|
||||
})
|
||||
this.getShoppingCartList()
|
||||
this.showModal = false
|
||||
}else{
|
||||
this.getShoppingCartList()
|
||||
this.showModal = false
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 打开购物车
|
||||
openCar() {
|
||||
if (this.totalPrice == 0) return
|
||||
this.showCar = true
|
||||
|
|
@ -550,7 +670,7 @@ export default {
|
|||
// 计算总价格与添加的菜品-购物车-每次添加删减菜品都得计算
|
||||
handleTotalPrice() {
|
||||
let total = 0
|
||||
let addFood = []
|
||||
let addFood = []
|
||||
this.menuData.forEach(item => {
|
||||
item.typeList.forEach(detail => {
|
||||
detail.dishesList.forEach(food => {
|
||||
|
|
@ -561,42 +681,13 @@ export default {
|
|||
})
|
||||
})
|
||||
})
|
||||
this.totalPrice = total.toFixed(1)
|
||||
this.totalPrice = total.toFixed(2)
|
||||
this.addFood = addFood
|
||||
if (this.addFood.length == 0) this.showCar = false
|
||||
console.log('🚀 ~ handleTotalPrice ~ total', this.totalPrice)
|
||||
console.log('🚀 ~ handleTotalPrice ~ addFood', this.addFood)
|
||||
},
|
||||
//购物车-清空按钮
|
||||
clearCar(){
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
try {
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"shoppingCartId":cartItem.shoppingCartId,
|
||||
"quantity":0
|
||||
}
|
||||
console.log(param)
|
||||
updateAdvancehoppingCartAPI(param).then(res => {
|
||||
if(res.code==200){
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
})
|
||||
this.menuData.forEach(menuItem => {
|
||||
menuItem.typeList.forEach(detail => {
|
||||
detail.dishesList.forEach(food => {
|
||||
this.$set(food, 'num', 0)
|
||||
})
|
||||
})
|
||||
})
|
||||
this.getShoppingCartList()
|
||||
this.showModal = false
|
||||
},
|
||||
|
||||
// 订单结算
|
||||
handleOrder() {
|
||||
console.log('结算')
|
||||
|
|
@ -609,7 +700,7 @@ export default {
|
|||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/advanceOrder/orderDetails?canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}`
|
||||
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(this.shoppingCartList)}&canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
|
||||
})
|
||||
},
|
||||
//垂直定位锚点
|
||||
|
|
@ -787,9 +878,9 @@ page {
|
|||
}
|
||||
}
|
||||
.cont-list {
|
||||
display: flex;
|
||||
// display: flex;
|
||||
padding: 8px;
|
||||
position: relative;
|
||||
// position: relative;
|
||||
/* border-bottom: 1px solid #f0f0f0; */
|
||||
}
|
||||
.center-cont {
|
||||
|
|
|
|||
|
|
@ -22,22 +22,22 @@
|
|||
<div class="img-cont m-8">
|
||||
<div class="img-list m-8" v-for="(item, index) in shoppingCartList" :key="index">
|
||||
<div class="flex align-center">
|
||||
<u-image :src="item.goodsDishesImgUrl" width="80px" height="80px" />
|
||||
<u-image :src="item.orderDetailList[0].goodsDishesImgUrl" width="80px" height="80px" />
|
||||
<div class="name-num">
|
||||
<div style="margin-bottom: 10px">{{ item.goodsDishesName }}</div>
|
||||
<div>x{{ item.quantity }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>¥{{ (item.salePrice/100).toFixed(2) }}</div>
|
||||
<div>¥{{ (item.orderDetailList[0].dishesDetailList[0].prefPrice/100).toFixed(2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
配送费
|
||||
<div>{{ detailData.deliveryFee }}</div>
|
||||
<div>{{ detailData.deliveryFee||"免配送费" }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
包装费
|
||||
<div>{{ detailData.packingFee }}</div>
|
||||
<div>{{ detailData.packingFee||"免包装费" }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between align-center m-8 bt">
|
||||
备注
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<u-line />
|
||||
<div class="flex justify-between m-8 realAmount">
|
||||
小计
|
||||
<div>¥{{ detailData.realAmount || 12 }}</div>
|
||||
<div>¥{{ totalPrice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order">
|
||||
|
|
@ -69,12 +69,12 @@
|
|||
<div class="flex align-center">
|
||||
<span class="money">
|
||||
<span style="font-size: 13px">实付款¥</span>
|
||||
{{ detailData.totalPrice }}
|
||||
{{ totalPrice }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">
|
||||
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder(1)">
|
||||
结算
|
||||
</u-button>
|
||||
</div>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getShoppingCartListAPI } from '@/api/advanceOrder/index.js'
|
||||
import { getListElectronMobileUsableAPI,addReserveMealApi } from '@/api/advanceOrder/index.js'
|
||||
export default {
|
||||
props: {},
|
||||
data() {
|
||||
|
|
@ -101,6 +101,8 @@ export default {
|
|||
canteenName:"",
|
||||
stallId:"",
|
||||
stallName:"",
|
||||
totalPrice:0,
|
||||
orderDate:"",
|
||||
shoppingCartList:[],
|
||||
// 详情页数据
|
||||
detailData: {
|
||||
|
|
@ -140,31 +142,268 @@ export default {
|
|||
this.canteenId = options.canteenId
|
||||
this.canteenName = options.canteenName
|
||||
this.stallId = options.stallId
|
||||
this.stallName = options.stallName
|
||||
this.getShoppingCartList()
|
||||
this.stallName = options.stallName
|
||||
this.totalPrice = Number(options.totalPrice).toFixed(2)
|
||||
this.orderDate = options.orderDate;
|
||||
this.shoppingCartList=JSON.parse(options.carList)
|
||||
console.log(this.shoppingCartList)
|
||||
this.getListElectronMobileUsable()
|
||||
},
|
||||
methods: {
|
||||
//获取预定购物车(订单)
|
||||
async getShoppingCartList(){
|
||||
//(获取餐卷)
|
||||
async getListElectronMobileUsable(){
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"canteenId":this.canteenId,
|
||||
"stallId":this.stallId,
|
||||
}
|
||||
const res = await getShoppingCartListAPI(param)
|
||||
console.log(res, '预订餐预定')
|
||||
if(res.code==200){
|
||||
this.shoppingCartList = res.data;
|
||||
console.log(this.shoppingCartList)
|
||||
}else{
|
||||
this.shoppingCartList = []
|
||||
"canteenIdSet":[this.canteenId],
|
||||
"shopstallIdSet":[this.stallId],
|
||||
"intervalIdSet":[this.shoppingCartList[0].mealtimeType]
|
||||
}
|
||||
const res = await getListElectronMobileUsableAPI(param)
|
||||
console.log(res, '获取餐卷')
|
||||
|
||||
},
|
||||
confirm(e) {
|
||||
console.log('🚀 ~ confirm ~ value:', e)
|
||||
this.showPicker = false
|
||||
this.detailData.orderState = e.value[0].label
|
||||
},
|
||||
getNowFormatDate() {
|
||||
let date = new Date()
|
||||
let year = date.getFullYear()
|
||||
let month = (date.getMonth() + 1).toString().padStart(2, '0')
|
||||
let day = date.getDate().toString().padStart(2, '0')
|
||||
let hours = date.getHours().toString().padStart(2, '0');
|
||||
let minutes = date.getMinutes().toString().padStart(2, '0');
|
||||
let seconds = date.getSeconds().toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
async handleOrder(){
|
||||
let orderDetailList = []
|
||||
console.log(this.shoppingCartList)
|
||||
this.shoppingCartList.forEach(item=>{
|
||||
orderDetailList.push(item.orderDetailList[0])
|
||||
})
|
||||
let param={
|
||||
"amount": this.totalPrice*100,
|
||||
"couponId": "",
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"ifTrial": 1,
|
||||
"ordTime": this.getNowFormatDate(),
|
||||
// "ordTime": "2025-02-20 13:57:21",
|
||||
"payType": 1,
|
||||
"reserveMealList":[
|
||||
{
|
||||
"canteenId": this.canteenId,
|
||||
"canteenName": this.canteenName,
|
||||
"stallId": this.stallId,
|
||||
"stallName": this.stallName,
|
||||
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||
"consigneeName": "dsf ",
|
||||
"costModelList": [
|
||||
{
|
||||
"deliveryAmount": null,
|
||||
"deliveryName": "自取堂食",
|
||||
"deliveryType": 1,
|
||||
"packingFee": null
|
||||
}
|
||||
],
|
||||
"counterId": "",
|
||||
"deliveryAddr": "自取堂食",
|
||||
"deliveryCosts": null,
|
||||
"deliveryFee": 0,
|
||||
"deliveryType": 1,
|
||||
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||
"orderDate": this.orderDate,
|
||||
"orderDetailList": orderDetailList,
|
||||
"packingFee": null,
|
||||
"payableAmount": this.totalPrice*100,
|
||||
"payType": 1,
|
||||
"placeOrdMobile": "",
|
||||
"placeOrdName": "",
|
||||
"remark": this.detailData.remark,
|
||||
"sxresult":[],
|
||||
"takeList":[],
|
||||
}
|
||||
]
|
||||
}
|
||||
console.log(param)
|
||||
const res = await addReserveMealApi(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data.code==10000){
|
||||
|
||||
setTimeout(()=>{
|
||||
// this.handleOrder2()
|
||||
},500)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||
// })
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
async handleOrder2(){
|
||||
let orderDetailList = []
|
||||
console.log(this.shoppingCartList)
|
||||
this.shoppingCartList.forEach(item=>{
|
||||
orderDetailList.push(item.orderDetailList[0])
|
||||
})
|
||||
let param={
|
||||
"amount": this.totalPrice*100,
|
||||
"couponId": "",
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"ifTrial": 1,
|
||||
"ordTime": this.getNowFormatDate(),
|
||||
// "ordTime": "2025-02-20 13:57:21",
|
||||
"payType": 1,
|
||||
"reserveMealList":[
|
||||
{
|
||||
"canteenId": this.canteenId,
|
||||
"canteenName": this.canteenName,
|
||||
"stallId": this.stallId,
|
||||
"stallName": this.stallName,
|
||||
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||
"consigneeName": "dsf ",
|
||||
"costModelList": [
|
||||
{
|
||||
"deliveryAmount": null,
|
||||
"deliveryName": "自取堂食",
|
||||
"deliveryType": 1,
|
||||
"packingFee": null
|
||||
}
|
||||
],
|
||||
"counterId": "",
|
||||
"deliveryAddr": "自取堂食",
|
||||
"deliveryCosts": null,
|
||||
"deliveryFee": 0,
|
||||
"deliveryType": 1,
|
||||
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||
"orderDate": this.orderDate,
|
||||
"orderDetailList": orderDetailList,
|
||||
"packingFee": null,
|
||||
"payableAmount": this.totalPrice*100,
|
||||
"payType": 1,
|
||||
"placeOrdMobile": "",
|
||||
"placeOrdName": "",
|
||||
"remark": this.detailData.remark,
|
||||
"sxresult":[],
|
||||
"takeList":[],
|
||||
}
|
||||
]
|
||||
}
|
||||
console.log(param)
|
||||
const res = await addReserveMealApi(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data.code==10000){
|
||||
setTimeout(()=>{
|
||||
// this.handleOrder3()
|
||||
},500)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||
// })
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async handleOrder3(){
|
||||
let orderDetailList = []
|
||||
console.log(this.shoppingCartList)
|
||||
this.shoppingCartList.forEach(item=>{
|
||||
orderDetailList.push(item.orderDetailList[0])
|
||||
})
|
||||
let param={
|
||||
"amount": this.totalPrice*100,
|
||||
"couponId": "",
|
||||
"custId": uni.getStorageSync('custId'),
|
||||
"ifTrial": 2,
|
||||
"ordTime": this.getNowFormatDate(),
|
||||
// "ordTime": "2025-02-20 13:57:21",
|
||||
"payType": 1,
|
||||
"reserveMealList":[
|
||||
{
|
||||
"canteenId": this.canteenId,
|
||||
"canteenName": this.canteenName,
|
||||
"stallId": this.stallId,
|
||||
"stallName": this.stallName,
|
||||
"consigneeMobile": "yyvwjetYVxeP1VW3vTv7nQ==",
|
||||
"consigneeName": "dsf ",
|
||||
"costModelList": [
|
||||
{
|
||||
"deliveryAmount": null,
|
||||
"deliveryName": "自取堂食",
|
||||
"deliveryType": 1,
|
||||
"packingFee": null
|
||||
}
|
||||
],
|
||||
"counterId": "",
|
||||
"deliveryAddr": "自取堂食",
|
||||
"deliveryCosts": null,
|
||||
"deliveryFee": 0,
|
||||
"deliveryType": 1,
|
||||
"mealtimeName": this.shoppingCartList[0].mealtimeName,
|
||||
"mealtimeType": this.shoppingCartList[0].mealtimeType,
|
||||
"orderDate": this.orderDate,
|
||||
"orderDetailList": orderDetailList,
|
||||
"packingFee": null,
|
||||
"payableAmount": this.totalPrice*100,
|
||||
"payType": 1,
|
||||
"placeOrdMobile": "",
|
||||
"placeOrdName": "",
|
||||
"remark": this.detailData.remark,
|
||||
"sxresult":[],
|
||||
"takeList":[],
|
||||
}
|
||||
]
|
||||
}
|
||||
console.log(param)
|
||||
const res = await addReserveMealApi(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data.code==10000){
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/advanceOrder/payResult?result=${JSON.stringify(res.data)}`
|
||||
// })
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.data.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
<template>
|
||||
<view>
|
||||
<div class="body"></div>
|
||||
<view style="width: 100%;height: 50vh;display: flex;flex-direction: column;align-items: center;">
|
||||
|
||||
<view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;">
|
||||
<u-icon name="checkmark-circle-fill" size="64" color="#00aa00"></u-icon>
|
||||
<view style="color: 00aa00;font-size: 18px;margin-top: 40rpx;color: #00aa00;">支付成功</view>
|
||||
|
||||
<view style="font-size: 24px;width: 100%;text-align: center;margin: 20rpx;font-weight: bold;">¥{{(resultData.payAmount/100).toFixed(2)}}</view>
|
||||
|
||||
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
|
||||
<view class="search-btn" @click="goIndex">返回首页</view>
|
||||
<view class="back-btn" @click="goDetail">查看订单</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view style="margin-top: 20vh;display: flex;flex-direction: column;align-items: center;width: 100%;" v-else>
|
||||
<u-icon name="error-circle-fill" size="64" color="#ff007f"></u-icon>
|
||||
<view style="color: 00aa00;font-size: 18px;margin-top: 40rpx;">支付失败</view>
|
||||
<view style="width: 80%;display: flex; justify-content: space-between;margin: 20rpx auto;">
|
||||
<view class="search-btn" @click="goBack">返回</view>
|
||||
<view class="back-btn" @click="goIndex">取消</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { getRechargeResultApi,getRechargeQueryResultApi } from '../../api/index/index'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
resultData:{},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.resultData = JSON.parse(option.result)
|
||||
this.$forceUpdate()
|
||||
console.log(this.resultData)
|
||||
console.log(this.resultData.orderList[0])
|
||||
|
||||
// this.resultData = {
|
||||
// "accBal": 1267,
|
||||
// "code": 10000,
|
||||
// "expireTime": null,
|
||||
// "extParam": null,
|
||||
// "goodIdSet": null,
|
||||
// "lessAmountForDelivery": 0,
|
||||
// "msg": "成功",
|
||||
// "orderAmountChangeList": [
|
||||
// ],
|
||||
// "orderList": [
|
||||
// {
|
||||
// "canteenId": "378928463446282240",
|
||||
// "canteenName": "宏源工业园",
|
||||
// "checkState": null,
|
||||
// "commentState": 2,
|
||||
// "couponAmount": 0,
|
||||
// "deductionType": 1,
|
||||
// "deliveryAmount": 0,
|
||||
// "discountsAmount": 0,
|
||||
// "dishesState": 1,
|
||||
// "expireTime": null,
|
||||
// "imgUrl": null,
|
||||
// "lessAmountForDelivery": null,
|
||||
// "machineName": null,
|
||||
// "machineNum": null,
|
||||
// "machineSn": null,
|
||||
// "macOrderId": "416036469958774785",
|
||||
// "mealCode": null,
|
||||
// "mealtimeName": "下午茶",
|
||||
// "mealtimeType": "3",
|
||||
// "needPayAmount": 70,
|
||||
// "orderDate": "2025-02-20",
|
||||
// "orderDetailList": [
|
||||
// {
|
||||
// "calcTotalAmount": 70,
|
||||
// "checkState": null,
|
||||
// "detailId": "416036470088798208",
|
||||
// "detailState": 1,
|
||||
// "detailType": 1,
|
||||
// "goodsDishesId": "385949065063436288",
|
||||
// "goodsDishesImgUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/8e3978b0f293495d91c12666633744a3.jpg",
|
||||
// "goodsDishesName": "萝卜包",
|
||||
// "goodsDishesTypeName": null,
|
||||
// "goodsRefundNum": 0,
|
||||
// "imageUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/8e3978b0f293495d91c12666633744a3.jpg",
|
||||
// "menuDetailId": "413945018588336132",
|
||||
// "orderId": "416036469958774786",
|
||||
// "prefPrice": 70,
|
||||
// "price": 70,
|
||||
// "quantity": 1,
|
||||
// "realAmount": 0,
|
||||
// "realPrice": 0.0,
|
||||
// "refundAmount": 0,
|
||||
// "salePrice": 70,
|
||||
// "salesMode": 1,
|
||||
// "shoppingCartId": "416036442989400064",
|
||||
// "tasteName": null,
|
||||
// "totalAmount": 70,
|
||||
// "unitName": null,
|
||||
// "weightUnit": 100
|
||||
// }
|
||||
// ],
|
||||
// "orderDetailSum": 1,
|
||||
// "orderId": "416036469958774786",
|
||||
// "orderRefundState": 1,
|
||||
// "orderState": 4,
|
||||
// "orderStateMixMobile": 22,
|
||||
// "orderTime": "2025-02-19 10:02:24",
|
||||
// "orderType": 2,
|
||||
// "packingAmount": 0,
|
||||
// "payableAmount": 70,
|
||||
// "payState": 1,
|
||||
// "payTime": null,
|
||||
// "payType": 1,
|
||||
// "plateNum": null,
|
||||
// "plateSerialNum": null,
|
||||
// "realAmount": 0,
|
||||
// "refundAmount": 0,
|
||||
// "refundTime": null,
|
||||
// "sourceType": 7,
|
||||
// "stallId": "379068538876334080",
|
||||
// "stallName": "外卖(提前一天预定,下午16:00截止订单;第二天下午16:30取货)"
|
||||
// }
|
||||
// ],
|
||||
// "payAmount": 70,
|
||||
// "payParamStr": null,
|
||||
// "redEnvelope": 0,
|
||||
// "subsidyBal": 0,
|
||||
// "tradeId": "416036469958774784",
|
||||
// "unpaidBalance": 0,
|
||||
// "walletBal": 1267,
|
||||
// }
|
||||
|
||||
},
|
||||
methods:{
|
||||
goIndex(){
|
||||
uni.switchTab({
|
||||
url: '/pages/index'
|
||||
})
|
||||
},
|
||||
goBack(){
|
||||
uni.navigateBack()
|
||||
},
|
||||
goDetail(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/details?params=${JSON.stringify(this.resultData.orderList[0])}`
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-btn{
|
||||
width: 40%;background: #fff;
|
||||
height: 40px;line-height: 40px;
|
||||
text-align: center;color: #000;
|
||||
border-radius: 10rpx;margin-top: 40rpx;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.back-btn{
|
||||
width: 40%;background: #ff6633;height: 40px;line-height: 40px;text-align: center;color: #fff;border-radius: 10rpx;margin-top: 40rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -31,42 +31,26 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAdvanceOrderStallApi } from '@/api/advanceOrder/index.js';
|
||||
|
||||
import { getAdvanceOrderStallApi,getlistReserveDateAPI } from '@/api/advanceOrder/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderDate:"",
|
||||
canteenId:"",
|
||||
canteenName:"",
|
||||
merchantList: [
|
||||
{
|
||||
id: 1,
|
||||
name: '宏雷大厨外卖',
|
||||
avatar: '/static/logo.png',
|
||||
monthlySales: 1984,
|
||||
businessHours: '00:00-23:59',
|
||||
isOpen: true
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '年货预订',
|
||||
avatar: '/static/logo.png',
|
||||
monthlySales: 2,
|
||||
businessHours: '00:00-14:59',
|
||||
isOpen: false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAdvanceOrderStallList()
|
||||
onLoad() {
|
||||
this.getAdvanceOrderStallList()
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
async getAdvanceOrderStallList() {
|
||||
try {
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
"applyDate":"2024-11-09"
|
||||
"applyDate":"2024-11-11"
|
||||
}
|
||||
const res = await getAdvanceOrderStallApi(param)
|
||||
console.log('🚀 ~ getList ~ res:', res)
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ export default {
|
|||
return new Promise((resolve, reject) => {
|
||||
this.imgToBase64(url).then(base64 => {
|
||||
let param = {
|
||||
"MERCHANT-ID":"10001",
|
||||
"MERCHANT-ID":"378915229716713472",
|
||||
"uploadKey":'system',
|
||||
"base64File":base64
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,12 +71,14 @@
|
|||
|
||||
<script>
|
||||
import {
|
||||
getUserHeaderPhoto,
|
||||
getUserHeaderPhoto,saveUserHeaderPhoto,
|
||||
uploadAvatar,
|
||||
} from "@/api/system/user"
|
||||
import config from '@/config'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { showConfirm } from '@/utils/common'
|
||||
import { uploadBase64 } from "@/api/upload"
|
||||
import { pathToBase64, base64ToPath } from 'image-tools';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -104,63 +106,80 @@
|
|||
|
||||
avatarSelect(e) {
|
||||
if (e.val == 1) {
|
||||
uni.chooseImage({
|
||||
//上传头像
|
||||
uni.chooseImage({//选择图片
|
||||
count: 1,
|
||||
success: chooseImageRes => {
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
})
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + '/system/user/profile/avatar',
|
||||
filePath: chooseImageRes.tempFilePaths[0],
|
||||
name: 'avatarfile',
|
||||
header: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
console.log(uploadFileRes);
|
||||
if(uploadFileRes.statusCode == 200) {
|
||||
let reslut = JSON.parse(uploadFileRes.data)
|
||||
console.log('reslut',reslut)
|
||||
if(reslut.code == 200) {
|
||||
uni.showToast({ title: reslut.msg,icon: 'none' });
|
||||
this.getUserInfo()
|
||||
}else{
|
||||
uni.showToast({ title: reslut.msg,icon: 'none' });
|
||||
}
|
||||
}else if(uploadFileRes.statusCode == 401) {
|
||||
showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({ url: '/pages/login/login' })
|
||||
}
|
||||
})
|
||||
}else{
|
||||
uni.showToast({ title: uploadFileRes.errMsg,icon: 'none' });
|
||||
}
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: (uploadFileErr) => {
|
||||
let { message } = uploadFileErr
|
||||
if (message == 'Network Error') {
|
||||
message = '后端接口连接异常'
|
||||
} else if (message.includes('timeout')) {
|
||||
message = '系统接口请求超时'
|
||||
} else if (message.includes('Request failed with status code')) {
|
||||
message = '系统接口' + message.substr(message.length - 3) + '异常'
|
||||
}
|
||||
uni.showToast({ title: message,icon: 'none' });
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
success: resImage => {
|
||||
console.log(resImage)
|
||||
// this.headPortraitUrl = resImage.tempFilePaths[0]
|
||||
//转base64
|
||||
this.imgToBase64(resImage.tempFilePaths[0]).then(base64 => {
|
||||
console.log(base64)
|
||||
//base64上传
|
||||
this.uploadHeadImg(base64)
|
||||
})
|
||||
}
|
||||
});
|
||||
}else if(e.val == 2) {
|
||||
//查看头像
|
||||
uni.previewImage({
|
||||
urls: [this.headPortraitUrl]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//base64上传
|
||||
uploadHeadImg(base64){
|
||||
let param = {
|
||||
"MERCHANT-ID":"378915229716713472",
|
||||
"uploadKey":'cust',
|
||||
"base64File":base64
|
||||
}
|
||||
uploadBase64(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.saveHeadImg(res.data)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//头像保存接口
|
||||
async saveHeadImg(data){
|
||||
console.log(data)
|
||||
let param = {
|
||||
"headPortraitUrl": data.fileNameUrl,
|
||||
"custId": uni.getStorageSync('custId')
|
||||
}
|
||||
console.log(param)
|
||||
const res = await saveUserHeaderPhoto(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: 'none'
|
||||
})
|
||||
this.getUserHeaderImg()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
imgToBase64(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
pathToBase64(data).then(base64 => {
|
||||
resolve(base64)
|
||||
}).catch(error => {
|
||||
console.error(error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
getUserHeaderImg() {
|
||||
getUserHeaderPhoto({"custId":uni.getStorageSync('custId'),"sourceType": "7"}).then(res => {
|
||||
console.log(res)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<view class="form-container">
|
||||
<!-- 头像区域 -->
|
||||
<view class="avatar-section" @click="handleUpdateAvatar">
|
||||
<image class="avatar" :src="userInfo.custPhotoUrl ? userInfo.custPhotoUrl : defaultFace" mode="aspectFill"></image>
|
||||
<image class="avatar" :src="userInfo.headPortraitUrl ? userInfo.headPortraitUrl : defaultFace" mode="aspectFill"></image>
|
||||
<view class="camera-icon">
|
||||
<image class="icon" :src="require('@/static/images/my/camera.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
<view class="info-item">
|
||||
<text class="label">身份证号码</text>
|
||||
<view class="value-wrapper">
|
||||
<u--input v-model="userInfo.idCard" border="none"></u--input>
|
||||
<u--input v-model="userInfo.idCard" border="none" maxlength="24"></u--input>
|
||||
<!-- <text class="value">{{userInfo.idCard}}</text> -->
|
||||
<!-- <image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image> -->
|
||||
</view>
|
||||
|
|
@ -78,15 +78,15 @@
|
|||
<view class="info-item">
|
||||
<text class="label">邮箱</text>
|
||||
<view class="value-wrapper">
|
||||
<u--input v-model="userInfo.email" border="none"></u--input>
|
||||
<u--input v-model="userInfo.email" border="none" maxlength="30"></u--input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 地址 -->
|
||||
<view class="info-item">
|
||||
<text class="label">地址</text>
|
||||
<view class="value-wrapper">
|
||||
<text class="value">{{userInfo.homeAddr}}</text>
|
||||
<image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image>
|
||||
<view class="value-wrapper">
|
||||
<u--input v-model="userInfo.homeAddr" border="none" maxlength="30"></u--input>
|
||||
<!-- <image class="arrow-icon" :src="require('@/static/images/my/enter.png')" mode="aspectFit"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -122,9 +122,12 @@
|
|||
import {
|
||||
getUserProfile,
|
||||
uploadAvatar,
|
||||
updateUserProfile
|
||||
updateUserProfile,
|
||||
saveUserHeaderPhoto
|
||||
} from "@/api/system/user"
|
||||
import config from '@/config'
|
||||
import { uploadBase64 } from "@/api/upload"
|
||||
import { pathToBase64, base64ToPath } from 'image-tools';
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth'
|
||||
|
|
@ -167,7 +170,8 @@
|
|||
//性别选中
|
||||
confirm(e) {
|
||||
console.log('confirm', e)
|
||||
this.userInfo.sex=e.indexs[0]
|
||||
this.userInfo.sex=e.indexs[0];
|
||||
this.userInfo.sexStr = e.value[0]
|
||||
this.sexShow = false
|
||||
},
|
||||
//出生年月选中
|
||||
|
|
@ -217,81 +221,80 @@
|
|||
(d.getMonth() == birthdays.getMonth() &&
|
||||
d.getDate() < birthdays.getDate())
|
||||
? 1
|
||||
: 0);
|
||||
|
||||
: 0);
|
||||
this.userInfo.age = age;
|
||||
}
|
||||
},
|
||||
|
||||
handleUpdateAvatar() {
|
||||
uni.chooseImage({
|
||||
//上传头像
|
||||
uni.chooseImage({//选择图片
|
||||
count: 1,
|
||||
success: chooseImageRes => {
|
||||
uni.showLoading({
|
||||
title: '上传中...'
|
||||
})
|
||||
uni.uploadFile({
|
||||
url: config.baseUrl + '/system/user/profile/avatar',
|
||||
filePath: chooseImageRes.tempFilePaths[0],
|
||||
name: 'avatarfile',
|
||||
header: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
console.log(uploadFileRes);
|
||||
if (uploadFileRes.statusCode == 200) {
|
||||
let reslut = JSON.parse(uploadFileRes.data)
|
||||
console.log('reslut', reslut)
|
||||
if (reslut.code == 200) {
|
||||
uni.showToast({
|
||||
title: reslut.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
this.getUserInfo()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: reslut.msg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
} else if (uploadFileRes.statusCode == 401) {
|
||||
showConfirm("登录状态已过期,您可以继续留在该页面,或者重新登录?").then(res => {
|
||||
if (res.confirm) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: uploadFileRes.errMsg,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
uni.hideLoading()
|
||||
},
|
||||
fail: (uploadFileErr) => {
|
||||
let {
|
||||
message
|
||||
} = uploadFileErr
|
||||
if (message == 'Network Error') {
|
||||
message = '后端接口连接异常'
|
||||
} else if (message.includes('timeout')) {
|
||||
message = '系统接口请求超时'
|
||||
} else if (message.includes('Request failed with status code')) {
|
||||
message = '系统接口' + message.substr(message.length - 3) + '异常'
|
||||
}
|
||||
uni.showToast({
|
||||
title: message,
|
||||
icon: 'none'
|
||||
});
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
success: resImage => {
|
||||
console.log(resImage)
|
||||
// this.headPortraitUrl = resImage.tempFilePaths[0]
|
||||
//转base64
|
||||
this.imgToBase64(resImage.tempFilePaths[0]).then(base64 => {
|
||||
console.log(base64)
|
||||
//base64上传
|
||||
this.uploadHeadImg(base64)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//base64上传
|
||||
uploadHeadImg(base64){
|
||||
let param = {
|
||||
"MERCHANT-ID":"378915229716713472",
|
||||
"uploadKey":'cust',
|
||||
"base64File":base64
|
||||
}
|
||||
uploadBase64(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.saveHeadImg(res.data)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//头像保存接口
|
||||
async saveHeadImg(data){
|
||||
console.log(data)
|
||||
let param = {
|
||||
"headPortraitUrl": data.fileNameUrl,
|
||||
"custId": uni.getStorageSync('custId')
|
||||
}
|
||||
console.log(param)
|
||||
const res = await saveUserHeaderPhoto(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: "上传成功",
|
||||
icon: 'none'
|
||||
})
|
||||
this.getUserInfo()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
imgToBase64(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
pathToBase64(data).then(base64 => {
|
||||
resolve(base64)
|
||||
}).catch(error => {
|
||||
console.error(error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
formatter(type, value) {
|
||||
if (type === 'year') {
|
||||
return `${value}年`
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
},
|
||||
uploadFaceImg(){
|
||||
let param = {
|
||||
"MERCHANT-ID":"10001",
|
||||
"MERCHANT-ID":"378915229716713472",
|
||||
"uploadKey":'face',
|
||||
"base64File":this.base64
|
||||
}
|
||||
|
|
@ -146,6 +146,17 @@
|
|||
}
|
||||
uploadPhotoGenCodeForAppApi(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success'
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'success'
|
||||
});
|
||||
}
|
||||
// if(res)
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ export default {
|
|||
title: '我的地址',
|
||||
path: '/pages/mine/me/myAddress'
|
||||
},
|
||||
{
|
||||
title: '健康信息',
|
||||
path: '/pages/mine/me/healthInformation'
|
||||
},
|
||||
// {
|
||||
// title: '健康信息',
|
||||
// path: '/pages/mine/me/healthInformation'
|
||||
// },
|
||||
{
|
||||
title: '人脸上传',
|
||||
path: '/pages/mine/me/faceUpload'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
{{ (balanceInfo.walletBal/100).toFixed(2) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="money-item">
|
||||
<div class="money-item" @click="goSubPage">
|
||||
<div>补贴钱包</div>
|
||||
<div class="item">
|
||||
<span style="font-size: 11px">¥</span>
|
||||
|
|
@ -271,7 +271,12 @@ export default {
|
|||
console.log(this.rechargeAmount)
|
||||
this.chosenShow = true
|
||||
},
|
||||
|
||||
goSubPage(){
|
||||
uni.navigateTo({
|
||||
url: `/pages/remainingSum/subsidyList?subsidyBal=${this.balanceInfo.subsidyBal}`
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,309 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="top-wrapper">
|
||||
<view style="margin-left: 20px;">补贴总额</view>
|
||||
<view style="margin-left: 20px;margin-top: 10px;font-size: 24px;font-weight: bold;">¥{{subsidyBal}}</view>
|
||||
</view>
|
||||
<!-- 明细 -->
|
||||
<view style="margin: 10px;font-size: 20px;font-weight: bold;">明细</view>
|
||||
<scroll-view style="width: 100%;height: 72vh;" @scrolltolower="onScrollTolower" scroll-y="true">
|
||||
<view v-for="(item,index) in tableList" :key="index" style="width: 96%;height: auto;background: #FFF;border-radius: 10rpx;margin: 10rpx auto;">
|
||||
<view style="width: 94%;margin: 10rpx auto;display: flex;align-items: center;justify-content: space-between;margin-bottom: 10rpx;padding-top: 10rpx;">
|
||||
<text>{{item.tradeTypeName}}</text>
|
||||
<text style="color: #ff9410;font-weight: bold;font-size: 28rpx;">{{item.amountTitle}}</text>
|
||||
</view>
|
||||
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;color: #999;">
|
||||
{{item.tradeTime}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Tabs from '@/pages/components/Tabs.vue'
|
||||
import { getDate } from '../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/util'
|
||||
import { getSubsidyTradeListApi } from '../../api/index/index.js'
|
||||
|
||||
export default {
|
||||
components: { Tabs },
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
subsidyBal:0,
|
||||
//待评价
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
tableList: [],
|
||||
status: 'loadmore',
|
||||
sourceTypeList:[],
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.subsidyBal = Number(options.subsidyBal/100).toFixed(2)
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
let param = {
|
||||
"current": 1,
|
||||
"size": 10,
|
||||
// "custId": uni.getStorageSync('custId'),
|
||||
"custId": "379162913954336768",
|
||||
}
|
||||
const res = await getSubsidyTradeListApi(param)
|
||||
this.total = res.total;
|
||||
console.log(res)
|
||||
if(this.pageNum==1){
|
||||
this.tableList = res.records
|
||||
}else{
|
||||
this.tableList.push(...res.records)
|
||||
}
|
||||
|
||||
},
|
||||
// 翻页
|
||||
onScrollTolower(){
|
||||
if(this.total>this.tableList.length){
|
||||
this.pageNum++
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
//翻页
|
||||
onReachBottom() {
|
||||
console.log('🚀 ~ onReachBottom ~ ')
|
||||
},
|
||||
formatDate(date) {
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
// 跳转订单详情
|
||||
goDetail(item) {
|
||||
// console.log('跳转订单详情', item)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/work/details?params=${JSON.stringify(item)}`
|
||||
// })
|
||||
},
|
||||
//评价按钮
|
||||
goEvaluate(item) {
|
||||
// console.log('跳转订单详情', item)
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/work/evaluate?params=${JSON.stringify(item)}`
|
||||
// })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
// background: #f9fbff;
|
||||
// height: 100%;
|
||||
height: 94vh;
|
||||
.top-wrapper {
|
||||
width: 96%;
|
||||
height: 90px;
|
||||
background: #ffaa00;
|
||||
color: #FFF;
|
||||
margin: 10px auto;
|
||||
border-radius: 10rpx;
|
||||
padding-top: 10px;
|
||||
// z-index: 999;
|
||||
}
|
||||
|
||||
.top-cont {
|
||||
padding: 0 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
.top-title {
|
||||
font-weight: 500;
|
||||
font-size: 20px;
|
||||
color: #0f274b;
|
||||
}
|
||||
.top-ipt {
|
||||
height: 31px;
|
||||
background: #fff;
|
||||
margin-left: 26px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.top-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.order-list {
|
||||
padding: 8px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
// margin-bottom: 12px;
|
||||
margin-top: 10px;
|
||||
|
||||
.order-source {
|
||||
margin-bottom: 12px;
|
||||
font-weight: 500;
|
||||
color: #0f274b;
|
||||
}
|
||||
|
||||
.intervalName {
|
||||
margin-left: 10px;
|
||||
color: #ff6816;
|
||||
border-radius: 1px 1px 1px 1px;
|
||||
border: 1px solid #ff6816;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.img-cont {
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
view {
|
||||
margin-top: 8px;
|
||||
color: #0f274b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.price {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #0f274b;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.btn-cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.evaluateCenter{
|
||||
height: 30px;width: 100%;display: flex;justify-content: space-between;align-items: center;
|
||||
.evaluateCenterLeft{
|
||||
width: 25%;display: flex;justify-content: space-between;align-items: center;margin-left: 20px;
|
||||
}
|
||||
.evaluateCenterRight{
|
||||
width: 60px;height: 24px;line-height:24px;border: 1px solid #ff6816;color: #ff6816;margin-right: 20px;font-size: 12px;text-align: center;border-radius: 8px;
|
||||
}
|
||||
}
|
||||
.filter-popup {
|
||||
padding: 30rpx;
|
||||
min-height: 60vh;
|
||||
max-height: 90vh;
|
||||
.section {
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.date-quick-select {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.date-option {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 100rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
|
||||
&.active {
|
||||
background-color: #fff2ef;
|
||||
color: #ff6633;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.date-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
|
||||
.date-input {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 100rpx;
|
||||
padding: 0 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
|
||||
.date-placeholder {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.selected-date {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.date-separator {
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-type-item {
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 25px;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin: 10rpx auto;
|
||||
|
||||
&.active {
|
||||
background-color: #fff2ef;
|
||||
color: #ff6633;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-buttons {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 28px 16rpx;
|
||||
background-color: #ffffff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="content">
|
||||
<view class="top-wrapper">
|
||||
<view style="padding: 0 16px;background: #fff;">
|
||||
<Tabs :tabList="tabList" @changeTab="changeTab" />
|
||||
<Tabs ref="tabs" :tabList="tabList" @changeTab="changeTab" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 待评价 -->
|
||||
|
|
@ -39,10 +39,8 @@
|
|||
|
||||
<script>
|
||||
import Tabs from '@/pages/components/Tabs.vue'
|
||||
import { getMenuEvaluaorderAPI } from '../../api/week-menu/index'
|
||||
import { getMenuEvaluaorderAPI,getMenuEvaluaCountAPI } from '../../api/week-menu/index'
|
||||
import { getDate } from '../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/util'
|
||||
import { getOrderInfoListAPI,getPageEvaluateListApi,getOrderSourceTypeListAPI } from '../../api/order/index'
|
||||
|
||||
export default {
|
||||
components: { Tabs },
|
||||
props: {
|
||||
|
|
@ -56,8 +54,7 @@ export default {
|
|||
menuData:{},
|
||||
tabIndex: 0,
|
||||
tabList: ['全部','有图','最新'],
|
||||
evaluaList:[],
|
||||
|
||||
evaluaList:[],
|
||||
//待评价
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -67,10 +64,11 @@ export default {
|
|||
sourceTypeList:[],
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.menuData = JSON.parse(options.params)
|
||||
this.getMenuEvaluaorderList()
|
||||
this.menuData = JSON.parse(options.params)
|
||||
this.getMenuEvaluaCount()
|
||||
this.getMenuEvaluaorderList()
|
||||
},
|
||||
methods: {
|
||||
//1-全部,2-有图,3-最新
|
||||
|
|
@ -79,6 +77,18 @@ export default {
|
|||
this.tabIndex = index+1;
|
||||
this.getMenuEvaluaorderList()
|
||||
},
|
||||
async getMenuEvaluaCount() {
|
||||
let param = {
|
||||
"dishesId": this.menuData.baseDishesId,
|
||||
}
|
||||
const res = await getMenuEvaluaCountAPI(param)
|
||||
console.log(res)
|
||||
this.tabList[0] = "全部"+res.totalCount;
|
||||
this.tabList[1] = "有图"+res.imageCount;
|
||||
this.tabList[2] = "最新";
|
||||
this.$refs.tabs.$forceUpdate()
|
||||
|
||||
},
|
||||
async getMenuEvaluaorderList() {
|
||||
let param = {
|
||||
// "current": 1,
|
||||
|
|
@ -91,7 +101,7 @@ export default {
|
|||
const res = await getMenuEvaluaorderAPI(param)
|
||||
console.log(res)
|
||||
this.evaluaList = res.data.evaluaList
|
||||
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 翻页
|
||||
onScrollTolower(){
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
<view style="color:#DD7D3C;font-size: 36rpx;font-weight: 600;margin-bottom: 10px;margin-left: 20px;">¥{{(menuData.dishesDetailList[0].dishesPrice/100).toFixed(2)}}</view>
|
||||
<view style="width: 100%;height: 30px;display: flex;align-items: center;justify-content: space-between;">
|
||||
<view style="font-size: 36rpx;font-weight: 600;margin-left: 20px;">{{dashesData.dishesName}}</view>
|
||||
<view class="star-icon" @click="addCollect" v-if="dashesData.isFavorites==2">
|
||||
<uni-icons type="star" size="24" color="#ff9900"></uni-icons><text style="font-size: 30rpx;">收藏</text>
|
||||
<view class="star-icon" style="display: flex;" @click="addCollect" v-if="dashesData.isFavorites==2">
|
||||
<u-icon name="star" size="22" color="#ccc"></u-icon><text style="font-size: 30rpx;">收藏</text>
|
||||
</view>
|
||||
<view class="star-icon" @click="cancelCollect" v-if="dashesData.isFavorites==1">
|
||||
<uni-icons type="star" size="24" color="#ff9900"></uni-icons><text style="font-size: 30rpx;">已收藏</text>
|
||||
<view class="star-icon" style="display: flex;" @click="cancelCollect" v-if="dashesData.isFavorites==1">
|
||||
<u-icon name="star-fill" size="22" color="#ff9900"></u-icon><text style="font-size: 30rpx;">已收藏</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -75,14 +75,14 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="evaluate-box" v-if="hIndex==2">
|
||||
<view style="width: 100%;height: 30vh;display: flex;justify-content: center;align-items: center;" v-if="evaluaList.length==0">
|
||||
<view style="width: 100%;height: 30vh;display: flex;justify-content: center;align-items: center;" v-if="totalCount==0">
|
||||
暂无评论...
|
||||
</view>
|
||||
<view style="width: 92%;height: 30px;margin: 10rpx auto; display: flex;justify-content: space-between;align-items: center;" v-if="evaluaList.length>0">
|
||||
<view style="width: 92%;height: 30px;margin: 10rpx auto; display: flex;justify-content: space-between;align-items: center;" v-if="totalCount>0">
|
||||
<text style="font-size: 28rpx;font-weight: bold;margin-left: 20rpx;">评价</text>
|
||||
<text style="font-size: 24rpx;margin-left: 20rpx;" @click="goAllEvaluate">查看全部></text>
|
||||
<text style="font-size: 24rpx;margin-left: 20rpx;" @click="goAllEvaluate">查看全部{{totalCount}}个></text>
|
||||
</view>
|
||||
<view style="width: 100%;height: 40vh;padding: 20rpx;" v-if="evaluaList.length>0">
|
||||
<view style="width: 100%;height: 40vh;padding: 20rpx;" v-if="totalCount>0">
|
||||
<view v-for="(item,index) in evaluaList" :key="index" style="width: 100%;height: auto;border-bottom: 1px solid #ccc;">
|
||||
<view style="width: 94%;margin: 10rpx auto;display: flex;">
|
||||
<view style="width: 100rpx;height: 100rpx;margin: 10rpx;">
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;display: flex;align-items: center;" v-if="item.pictureList.length>0">
|
||||
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;display: flex;align-items: center;" v-if="item.pictureList&&item.pictureList.length>0">
|
||||
<view v-for="(imgItem,imgIndex) in item.pictureList" :key="imgIndex" style="margin-bottom: 10rpx;">
|
||||
<image :src="item" mode="" style="width: 100rpx;height: 100rpx;"></image>
|
||||
</view>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getMenudishesDetailAPI,addCollectionDishesAPI,delCollectionDishesAPI,getMenuEvaluaorderAPI } from '../../api/week-menu/index'
|
||||
import { getMenudishesDetailAPI,addCollectionDishesAPI,delCollectionDishesAPI,getMenuEvaluaorderAPI,getMenuEvaluaCountAPI } from '../../api/week-menu/index'
|
||||
import Tabs from '@/pages/components/Tabs.vue'
|
||||
export default {
|
||||
components: { Tabs },
|
||||
|
|
@ -126,7 +126,8 @@ export default {
|
|||
dashesData:{},
|
||||
tabList: ["菜品信息","营养信息","评价"],//tab列表
|
||||
hIndex:0,
|
||||
evaluaList:[]
|
||||
evaluaList:[],
|
||||
totalCount:0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -135,6 +136,7 @@ export default {
|
|||
this.menuData = options
|
||||
this.getMenudishesDetail()
|
||||
this.getMenuEvaluaorderList()
|
||||
this.getMenuEvaluaCount()
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -154,6 +156,14 @@ export default {
|
|||
}
|
||||
console.log(res)
|
||||
},
|
||||
async getMenuEvaluaCount() {
|
||||
let param = {
|
||||
"dishesId": this.menuData.baseDishesId,
|
||||
}
|
||||
const res = await getMenuEvaluaCountAPI(param)
|
||||
console.log(res)
|
||||
this.totalCount = res.totalCount
|
||||
},
|
||||
//获取菜品评价
|
||||
async getMenuEvaluaorderList(){
|
||||
console.log(this.menuData)
|
||||
|
|
@ -161,13 +171,15 @@ export default {
|
|||
"current": 1,
|
||||
"size": 10,
|
||||
"mealId": this.menuData.baseDishesId,
|
||||
// "mealId": "383143288183459840",
|
||||
"shopstallId": this.menuData.stallId,
|
||||
// "shopstallId": "379082300370980864",
|
||||
"searchType": "3",
|
||||
"mealType": "1"
|
||||
}
|
||||
const res = await getMenuEvaluaorderAPI(param)
|
||||
if(res.code==200){
|
||||
this.evaluaList = res.data.evaluaList
|
||||
this.evaluaList = res.data.evaluaList||[]
|
||||
// this.dashesData = res.data;
|
||||
// this.$forceUpdate()
|
||||
}
|
||||
|
|
@ -181,6 +193,7 @@ export default {
|
|||
},
|
||||
changeTab(index) {
|
||||
this.hIndex=index
|
||||
console.log(this.hIndex)
|
||||
},
|
||||
//收藏
|
||||
async addCollect(){
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ export default {
|
|||
async getMenuListData() {
|
||||
let param = {
|
||||
"recipeId":this.recipeId,
|
||||
"date":this.daysList[this.hIndex].data
|
||||
// "date":"2024-11-11"
|
||||
"date":this.daysList[this.hIndex].data,
|
||||
// "date":"2024-11-11",
|
||||
}
|
||||
const res = await getWeekDetailListAPI(param)
|
||||
console.log(res, '周菜谱')
|
||||
|
|
@ -233,7 +233,7 @@ page {
|
|||
}
|
||||
.scroll-right-item{
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
height: auto;
|
||||
// background-color: #959FA4;
|
||||
}
|
||||
.image {
|
||||
|
|
|
|||
|
|
@ -3,84 +3,90 @@
|
|||
<h3 v-if="detailData.orderState==1">已下单</h3>
|
||||
<h3 v-if="detailData.orderState==2">已完成</h3>
|
||||
<h3 v-if="detailData.orderState==3">已取消</h3>
|
||||
<div class="appraise">
|
||||
<div>您对本单满意吗?</div>
|
||||
<div class="flex appraise-right" @click="goEvaluate">
|
||||
去评价
|
||||
<u-icon name="arrow-right" size="12" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cont">
|
||||
<div class="top-source m-8">订单来源: 双屏消费机</div>
|
||||
<!-- <div class="top-source m-8">订单来源: {{ detailData.sourceTypeStr }}</div> -->
|
||||
<div class="flex justify-between m-8">
|
||||
<div class="flex align-center">
|
||||
<!-- <div>{{ detailData.canteenName }}/{{detailData.stallName}}</div> -->
|
||||
<div>{{ detailData.canteenName }}</div>
|
||||
<div class="tag">{{ detailData.mealtimeName }}</div>
|
||||
</div>
|
||||
<div>就餐日期: {{ detailData.orderDate }}</div>
|
||||
</div>
|
||||
<div class="img-cont m-8">
|
||||
<div class="img-list m-8" v-for="(item, index) in detailData.orderDetailList" :key="index">
|
||||
<div class="flex align-center">
|
||||
<view class="appraise">
|
||||
<view>您对本单满意吗?</view>
|
||||
<view class="flex appraise-right" @click="" v-if="detailData.orderState==1">
|
||||
退单
|
||||
</view>
|
||||
<view class="flex appraise-right" @click="goEvaluate" v-if="detailData.orderState==2">
|
||||
去评价
|
||||
<u-icon name="arrow-right" size="12" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont">
|
||||
<view class="top-source m-8">订单来源: 双屏消费机</view>
|
||||
<!-- <view class="top-source m-8">订单来源: {{ detailData.sourceTypeStr }}</view> -->
|
||||
<view class="flex justify-between m-8">
|
||||
<view class="flex align-center">
|
||||
<!-- <view>{{ detailData.canteenName }}/{{detailData.stallName}}</view> -->
|
||||
<view>{{ detailData.canteenName }}</view>
|
||||
<view class="tag">{{ detailData.mealtimeName }}</view>
|
||||
</view>
|
||||
<view>就餐日期: {{ detailData.orderDate }}</view>
|
||||
</view>
|
||||
<view class="img-cont m-8">
|
||||
<view class="img-list m-8" v-for="(item, index) in detailData.orderDetailList" :key="index">
|
||||
<view class="flex align-center">
|
||||
<u-image :src="item.goodsDishesImgUrl" width="80px" height="80px" />
|
||||
<div class="name-num">
|
||||
<div style="margin-bottom: 10px">{{ item.goodsDishesName }}</div>
|
||||
<div>x{{ item.quantity }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>¥{{ (item.realPrice/100).toFixed(2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view class="name-num">
|
||||
<view style="margin-bottom: 10px">{{ item.goodsDishesName }}</view>
|
||||
<view>x{{ item.quantity }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<!-- <view style="color: red;">已退款</view> -->
|
||||
<view>¥{{ (item.realPrice/100).toFixed(2) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
配送费
|
||||
<div>{{ detailData.deliveryAmount>0? (detailData.deliveryAmount/100).toFixed(2):"免配送费" }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view>{{ detailData.deliveryAmount>0? (detailData.deliveryAmount/100).toFixed(2):"免配送费" }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
包装费
|
||||
<div>{{ detailData.packingAmount>0?(detailData.packingAmount/100).toFixed(2):"免包装费" }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view>{{ detailData.packingAmount>0?(detailData.packingAmount/100).toFixed(2):"免包装费" }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
餐券金额
|
||||
<div>{{ (detailData.couponAmount/100).toFixed(2) }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view>{{ (detailData.couponAmount/100).toFixed(2) }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
优惠金额
|
||||
<div>{{ (detailData.discountsAmount/100).toFixed(2) }}</div>
|
||||
</div>
|
||||
<view>{{ (detailData.discountsAmount/100).toFixed(2) }}</view>
|
||||
</view>
|
||||
<u-line />
|
||||
<div class="flex justify-between m-8 realAmount">
|
||||
<view class="flex justify-between m-8 realAmount">
|
||||
实付金额
|
||||
<div>¥{{ (detailData.realAmount/100).toFixed(2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order">
|
||||
<div class="m-8">订单二维码</div>
|
||||
<div class="qrcode">
|
||||
<view>¥{{ (detailData.realAmount/100).toFixed(2) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order">
|
||||
<view class="m-8">订单二维码</view>
|
||||
<view class="qrcode">
|
||||
<canvas id="qrcode" canvas-id="qrcode" style="width: 175px; height: 175px"/>
|
||||
</div>
|
||||
</view>
|
||||
<template >
|
||||
</template>
|
||||
<div class="flex justify-center">流水号: {{ detailData.mealCode }}</div>
|
||||
<view class="flex justify-center">流水号: {{ detailData.mealCode }}</view>
|
||||
<u-line style="margin: 20px 0;" />
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view class="flex justify-between m-8 bt">
|
||||
订单编号
|
||||
<div>{{ detailData.orderId }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view>{{ detailData.orderId }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
创建时间
|
||||
<div>{{ detailData.orderTime }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8 bt">
|
||||
<view>{{ detailData.orderTime }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8 bt">
|
||||
支付时间
|
||||
<div>{{ detailData.payTime }}</div>
|
||||
</div>
|
||||
<div class="flex justify-between m-8">
|
||||
<view>{{ detailData.payTime }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between m-8">
|
||||
支付方式
|
||||
<div>{{ detailData.payTypeStr }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<view>{{ detailData.payTypeStr }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ export default {
|
|||
return new Promise((resolve, reject) => {
|
||||
this.imgToBase64(url).then(base64 => {
|
||||
let param = {
|
||||
"MERCHANT-ID":"10001",
|
||||
"MERCHANT-ID":"378915229716713472",
|
||||
"uploadKey":'system',
|
||||
"base64File":base64
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue