新功能开发
This commit is contained in:
parent
e0249bf1f0
commit
13d065abcd
|
|
@ -10,6 +10,16 @@ export function getAdvanceOrderStallApi(data) {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 是否领导
|
||||
*/
|
||||
export function ifLeaderApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/custInfo/ifLeader',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @data 移动端-查询预订日期
|
||||
|
|
|
|||
|
|
@ -2,18 +2,10 @@
|
|||
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
|
||||
<view class="page-container">
|
||||
<view class="merchant-list">
|
||||
<view
|
||||
class="merchant-box"
|
||||
v-for="(item, index) in merchantList"
|
||||
:key="index"
|
||||
>
|
||||
<view class="merchant-box" v-for="(item, index) in merchantList" :key="index" v-if="item.stallId!='525115050604630016'||(item.stallId=='525115050604630016'&&isLeader)">
|
||||
<view class="merchant-item" @click="goToMenu(item)">
|
||||
<view class="merchant-info">
|
||||
<image
|
||||
:src="item.stallImgUrl"
|
||||
class="merchant-avatar"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<image :src="item.stallImgUrl" class="merchant-avatar" mode="aspectFill"></image>
|
||||
<view class="merchant-detail">
|
||||
<view class="merchant-name">{{ item.stallName }}</view>
|
||||
<view class="merchant-stats">
|
||||
|
|
@ -32,7 +24,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAdvanceOrderStallApi,getlistReserveDateAPI } from '@/api/advanceOrder/index.js'
|
||||
import { getAdvanceOrderStallApi,getlistReserveDateAPI,ifLeaderApi } from '@/api/advanceOrder/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -42,13 +34,28 @@ export default {
|
|||
canteenId:"",
|
||||
canteenName:"",
|
||||
merchantList: [
|
||||
]
|
||||
],
|
||||
isLeader:false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAdvanceOrderStallList()
|
||||
this.ifLeader()
|
||||
},
|
||||
methods: {
|
||||
|
||||
async ifLeader() {
|
||||
try {
|
||||
let param = {
|
||||
"custId":uni.getStorageSync('custId'),
|
||||
}
|
||||
const res = await ifLeaderApi(param)
|
||||
console.log('res:', res)
|
||||
this.isLeader = res
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
async getAdvanceOrderStallList() {
|
||||
try {
|
||||
let param = {
|
||||
|
|
|
|||
|
|
@ -66,11 +66,12 @@
|
|||
<script>
|
||||
import { getCodeImg } from '@/api/login'
|
||||
import AES from '@/utils/aes'
|
||||
import { encryptWithSM4,decryptWithSM4 } from '@/utils/sm'
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fontValue:Cookies.get('fontSize') || 8,
|
||||
fontValue:uni.getStorageSync('fontSize') || 8,
|
||||
codeUrl: '',
|
||||
captchaEnabled: true,
|
||||
// 用户注册开关
|
||||
|
|
@ -96,9 +97,10 @@ export default {
|
|||
if(uni.getStorageSync('remember')){
|
||||
this.remember = [uni.getStorageSync('remember')] || [];
|
||||
}
|
||||
this.loginForm.username = Cookies.get('username') || uni.getStorageSync('username')
|
||||
|
||||
this.loginForm.username = decryptWithSM4(Cookies.get('username')) || uni.getStorageSync('username')
|
||||
if(this.remember.length>0){
|
||||
this.loginForm.password = Cookies.get('password') || uni.getStorageSync('password')
|
||||
this.loginForm.password = decryptWithSM4(Cookies.get('password')) || uni.getStorageSync('password')
|
||||
}
|
||||
if(Cookies.get('token')||uni.getStorageSync('token')){
|
||||
if(this.loginForm.username&&this.loginForm.password){
|
||||
|
|
@ -158,8 +160,8 @@ export default {
|
|||
if(this.remember.length>0){
|
||||
uni.setStorageSync('username',this.loginForm.username)
|
||||
uni.setStorageSync('password',this.loginForm.password)
|
||||
Cookies.set('username', this.loginForm.username,{expires:90})
|
||||
Cookies.set('password', this.loginForm.password,{expires:90})
|
||||
Cookies.set('username', encryptWithSM4(this.loginForm.username),{expires:90})
|
||||
Cookies.set('password', encryptWithSM4(this.loginForm.password),{expires:90})
|
||||
}else{
|
||||
uni.removeStorageSync('remember')
|
||||
uni.removeStorageSync('password')
|
||||
|
|
@ -187,8 +189,8 @@ export default {
|
|||
uni.setStorageSync('password',this.loginForm.password)
|
||||
|
||||
Cookies.set('remember', e[0],{expires:90})
|
||||
Cookies.set('username', this.loginForm.username,{expires:90})
|
||||
Cookies.set('password', this.loginForm.password,{expires:90})
|
||||
Cookies.set('username', encryptWithSM4(this.loginForm.username),{expires:90})
|
||||
Cookies.set('password', encryptWithSM4(this.loginForm.password),{expires:90})
|
||||
} else {
|
||||
uni.removeStorageSync('remember')
|
||||
uni.removeStorageSync('password')
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default {
|
|||
components: { UModal },
|
||||
data() {
|
||||
return {
|
||||
fontValue:Cookies.get('fontSize') || 8,
|
||||
fontValue:uni.getStorageSync('fontSize') || 8,
|
||||
menuItems: [
|
||||
{
|
||||
title: '基本信息',
|
||||
|
|
|
|||
107
pages/system.vue
107
pages/system.vue
|
|
@ -19,6 +19,36 @@
|
|||
<image :src="item.icon" style="width: 120rpx;height: 120rpx;margin-bottom: 20rpx;"></image>
|
||||
<view class="main_menu_name">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="codeBtn" v-if="!isShowBtn" @click="isShowBtn=true">
|
||||
<view style="font-size: 36rpx;font-weight: 600;">出示二维码支付</view>
|
||||
</view>
|
||||
<view class="card-box" v-if="isShowBtn">
|
||||
<!-- 标题 -->
|
||||
<view class="title">
|
||||
<view style="font-size: 44rpx;color: #333;font-weight: 600;">出示二维码支付</view>
|
||||
<!-- <view @click="isShowBtn=false" style="position: absolute;right: 30rpx;">X</view> -->
|
||||
<view @click="isShowBtn=false" style="position: absolute;right: 40rpx;top: 10rpx;">
|
||||
<image src="../static/images/arrow2.png" style="width: 60rpx;height: 60rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 副标题 -->
|
||||
<view class="subtitle">{{custName}}</view>
|
||||
<view style="border: 1px dashed #e9a765;width: 90%;margin: 0 auto;"></view>
|
||||
<!-- 二维码 -->
|
||||
<ikun-qrcode
|
||||
class="qr-code"
|
||||
width="500"
|
||||
height="500"
|
||||
unit="rpx"
|
||||
color="#000000"
|
||||
:data="qrCodeUrl"
|
||||
></ikun-qrcode>
|
||||
<!-- 有效期 -->
|
||||
<!-- <view class="valid-time">有效时间15分钟</view> -->
|
||||
<view class="refresh-button">
|
||||
<button @click="refreshQrCode" class="login-btn cu-btn block bg-blue lg round" style="width: 70%;">刷新二维码</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="width: 92%;margin: 40rpx auto;">
|
||||
<image src="../static/images/system/banner2.png" style="width: 100%;height: 300rpx;"></image>
|
||||
|
|
@ -32,6 +62,7 @@
|
|||
<script>
|
||||
import { getInfoNewAPI } from '@/api/login'
|
||||
import { decryptWithSM4 } from '@/utils/sm'
|
||||
import { getOrderQRCodeAPI } from '@/api/index/index'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -52,7 +83,10 @@ export default {
|
|||
icon: require('../static/images/system/server.png')
|
||||
}
|
||||
],
|
||||
userInfo:{}
|
||||
userInfo:{},
|
||||
custName:uni.getStorageSync('custName'),
|
||||
isShowBtn:false,
|
||||
qrCodeUrl:`xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`// 替换为实际的二维码URL
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -114,6 +148,18 @@ export default {
|
|||
} else if (index === 2) {
|
||||
this.$router.push({ path: '/pages/index' })
|
||||
}
|
||||
},
|
||||
// 获取二维码
|
||||
async getOrderQRCodeData() {
|
||||
const res = await getOrderQRCodeAPI({ "custId":uni.getStorageSync('custId') })
|
||||
uni.setStorageSync("codeTime",res);
|
||||
this.qrCodeUrl = `xnzn{\"s\":1,\"y\":3,\"p\":\"${uni.getStorageSync('custId')}\",\"t\":\"${uni.getStorageSync('codeTime')}\"}`
|
||||
// console.log(res, '二维码信息--')
|
||||
|
||||
},
|
||||
refreshQrCode() {
|
||||
// 模拟刷新二维码
|
||||
this.getOrderQRCodeData()
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
|
|
@ -269,4 +315,63 @@ page {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.codeBtn{
|
||||
width: 94%;margin: 40rpx auto;background: #FFF;height: 80rpx;border-radius: 10rpx;display: flex;align-items: center;justify-content: center;
|
||||
}
|
||||
.card-box{
|
||||
margin: 40rpx;
|
||||
/* border: 1px solid #000; */
|
||||
border-radius: 10rpx;
|
||||
background: #FFF;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
/* font-weight: 600; */
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
margin: 0 auto;
|
||||
margin-bottom: 10px;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.valid-time {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.refresh-button {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
margin: 0 auto;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
background-color: #e97c3d;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -222,10 +222,12 @@ export default {
|
|||
methods: {
|
||||
//退单
|
||||
refundOrder() {
|
||||
if(this.detailData.stallId==379068538876334080||this.detailData.stallId==380563438063063040){//外卖档口两点后不可退单/捡漏档口两点后不可退单
|
||||
if(this.detailData.payState==3||this.detailData.payState==6){
|
||||
let orderTime = this.detailData.orderDate+" 14:00:00" //
|
||||
let nowTime = new Date().getTime();//拿到当前时间
|
||||
if(nowTime>orderTime){
|
||||
let checkTime = new Date(orderTime).getTime();//拿到限制时间时间
|
||||
if(nowTime>checkTime){
|
||||
uni.showToast({
|
||||
title: "14点以后无法退单!",
|
||||
icon: 'none'
|
||||
|
|
@ -257,6 +259,81 @@ export default {
|
|||
})
|
||||
}
|
||||
}
|
||||
}else if(this.detailData.stallId==379074929284354048){//晚餐档口5点10分后不可退单
|
||||
if(this.detailData.payState==3||this.detailData.payState==6){
|
||||
let orderTime = this.detailData.orderDate+" 17:10:00" //
|
||||
let nowTime = new Date().getTime();//拿到当前时间
|
||||
let checkTime = new Date(orderTime).getTime();//拿到限制时间时间
|
||||
if(nowTime>checkTime){
|
||||
uni.showToast({
|
||||
title: "17:10以后无法退单!",
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
let param = {
|
||||
"macOrderId": this.detailData.macOrderId,
|
||||
"orderId": this.detailData.orderId,
|
||||
"remark": ""
|
||||
}
|
||||
this.$modal.confirm('确定退单吗?').then(() => {
|
||||
refundOrderApi(param).then((res) => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: "操作成功",
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.getOrderDetail()
|
||||
},500)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(this.detailData.payState==3||this.detailData.payState==6){
|
||||
let orderTime = this.detailData.orderDate+" 18:00:00" //
|
||||
let nowTime = new Date().getTime();//拿到当前时间
|
||||
let checkTime = new Date(orderTime).getTime();//拿到限制时间时间
|
||||
if(nowTime>checkTime){
|
||||
uni.showToast({
|
||||
title: "18:00以后无法退单!",
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
let param = {
|
||||
"macOrderId": this.detailData.macOrderId,
|
||||
"orderId": this.detailData.orderId,
|
||||
"remark": ""
|
||||
}
|
||||
this.$modal.confirm('确定退单吗?').then(() => {
|
||||
refundOrderApi(param).then((res) => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: "操作成功",
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.getOrderDetail()
|
||||
},500)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//评价按钮
|
||||
goEvaluate() {
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
|
@ -1,3 +1,3 @@
|
|||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>智慧后勤</title><script src=https://res.wx.qq.com/open/js/jweixin-1.1.0.js></script><script>document.addEventListener('DOMContentLoaded', function() {
|
||||
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
|
||||
})</script><link rel=stylesheet href=./static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.0f4c3ff6.js></script><script src=./static/js/index.77e92431.js></script></body></html>
|
||||
})</script><link rel=stylesheet href=./static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.0f4c3ff6.js></script><script src=./static/js/index.fe1d844a.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue