代码优化
This commit is contained in:
parent
413222a5f0
commit
656793dae2
|
|
@ -1,4 +1,3 @@
|
|||
import { $hasPermission } from '@/http/yskApi/shop.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
const $PermissionObj = {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
* @date 2022/11/22 10:38
|
||||
*/
|
||||
|
||||
import { $parseQrCodeUrl } from '@/http/apiManager.js'
|
||||
|
||||
const model = {
|
||||
|
||||
|
|
@ -23,9 +22,9 @@ const model = {
|
|||
|
||||
// 解析 码牌
|
||||
parseQrc: (originQrVal) => {
|
||||
return $parseQrCodeUrl(originQrVal).then( ({bizData}) => {
|
||||
return model.returnFunc(model.QR_TYPE_QRC, bizData, originQrVal)
|
||||
})
|
||||
// return $parseQrCodeUrl(originQrVal).then( ({bizData}) => {
|
||||
// return model.returnFunc(model.QR_TYPE_QRC, bizData, originQrVal)
|
||||
// })
|
||||
},
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { $versionDetection } from '@/http/apiManager.js';
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
|
||||
// app更新
|
||||
|
|
@ -8,38 +7,38 @@ function appPlusUpdate(sign){
|
|||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
|
||||
// 调起接口查询
|
||||
$versionDetection({versionNumber: inf.versionCode})
|
||||
.then(({ bizData }) => {
|
||||
// $versionDetection({versionNumber: inf.versionCode})
|
||||
// .then(({ bizData }) => {
|
||||
|
||||
//返回data为空或者版本号一致
|
||||
if (!bizData || Object.keys(bizData).length == 0 || !bizData.versionSerialNumber || bizData.versionSerialNumber == inf.versionCode) {
|
||||
if(sign === 'checked') {
|
||||
uni.showToast({
|
||||
title: '已是最新版本'
|
||||
})
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// 是否强制更新
|
||||
let isForceUpdate = bizData.forceUpdate == 1
|
||||
uni.showModal({
|
||||
title: '发现新版本:' + bizData.versionName,
|
||||
showCancel: !isForceUpdate ,
|
||||
content: bizData.versionDesc,
|
||||
confirmText: '立即更新',
|
||||
confirmColor: '#108EE9',
|
||||
success: function(r) {
|
||||
if (r.confirm) {
|
||||
downLoad(bizData.downloadUrl);
|
||||
}else{
|
||||
// 强制更新也需要更新
|
||||
if(isForceUpdate){
|
||||
downLoad(bizData.downloadUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// //返回data为空或者版本号一致
|
||||
// if (!bizData || Object.keys(bizData).length == 0 || !bizData.versionSerialNumber || bizData.versionSerialNumber == inf.versionCode) {
|
||||
// if(sign === 'checked') {
|
||||
// uni.showToast({
|
||||
// title: '已是最新版本'
|
||||
// })
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
// // 是否强制更新
|
||||
// let isForceUpdate = bizData.forceUpdate == 1
|
||||
// uni.showModal({
|
||||
// title: '发现新版本:' + bizData.versionName,
|
||||
// showCancel: !isForceUpdate ,
|
||||
// content: bizData.versionDesc,
|
||||
// confirmText: '立即更新',
|
||||
// confirmColor: '#108EE9',
|
||||
// success: function(r) {
|
||||
// if (r.confirm) {
|
||||
// downLoad(bizData.downloadUrl);
|
||||
// }else{
|
||||
// // 强制更新也需要更新
|
||||
// if(isForceUpdate){
|
||||
// downLoad(bizData.downloadUrl);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,15 +80,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
$tbProductList
|
||||
} from '@/http/yskApi/goods.js';
|
||||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import { reactive, onMounted, ref, watch } from 'vue';
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
|
|
@ -176,19 +168,19 @@
|
|||
getGoods()
|
||||
function getGoods() {
|
||||
const arr=selArr
|
||||
$tbProductList(goods.query).then(res => {
|
||||
let selLen=0;
|
||||
goods.list = res.content.map(v => {
|
||||
const checked=$selGoodsMap[v.id]?true:false
|
||||
selLen+=(checked?1:0)
|
||||
return {
|
||||
...v,
|
||||
checked
|
||||
}
|
||||
})
|
||||
goods.allChecked = selLen==res.content.length?true:false
|
||||
goods.totalElements = res.totalElements
|
||||
})
|
||||
// $tbProductList(goods.query).then(res => {
|
||||
// let selLen=0;
|
||||
// goods.list = res.content.map(v => {
|
||||
// const checked=$selGoodsMap[v.id]?true:false
|
||||
// selLen+=(checked?1:0)
|
||||
// return {
|
||||
// ...v,
|
||||
// checked
|
||||
// }
|
||||
// })
|
||||
// goods.allChecked = selLen==res.content.length?true:false
|
||||
// goods.totalElements = res.totalElements
|
||||
// })
|
||||
}
|
||||
|
||||
function pageChange(page) {
|
||||
|
|
|
|||
|
|
@ -1,345 +0,0 @@
|
|||
<template>
|
||||
<up-popup customStyle="overflow: hidden;" :show="show" round="20" mode="bottom" @close="close" @open="open">
|
||||
<view class="reportDamage">
|
||||
<view class="reportDamage_head">
|
||||
<view class="reportDamage_title">{{title}}</view>
|
||||
<up-icon name="close-circle-fill" color="#333" size="25" @tap="close"></up-icon>
|
||||
</view>
|
||||
<view class="reportDamage_content">
|
||||
<view class="reportDamage_cell">
|
||||
<view class="cell_lable">
|
||||
<up-image v-if="type=='product'" class="thumbnail" radius="10" :show-loading="true" :src="item.coverImg"></up-image>
|
||||
<view>{{item.conName}}</view>
|
||||
</view>
|
||||
<view class="cell_value">
|
||||
<up-icon name="minus-circle" color="#999" size="25" @tap="minus"></up-icon>
|
||||
<view class="text">{{vdata.stockNumber}}</view>
|
||||
<up-icon name="plus-circle-fill" color="#318AFE" size="25" @tap="plus"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="reportDamage_cell">
|
||||
<view class="cell_lable">商品单位</view>
|
||||
<view class="cell_value"><view>{{item.conUnit}}</view> <up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
</view>
|
||||
<view class="reportDamage_cell">
|
||||
<view class="cell_lable">报损图片</view>
|
||||
<view class="cell_value file">
|
||||
|
||||
<view class="file_img" v-for="(item,index) in vdata.imgUrlList">
|
||||
<up-image class="file_img_item" :show-loading="true" :src="item"></up-image>
|
||||
<view class="del" @tap="del(index)">
|
||||
<up-icon name="trash" color="#fff" size="25" @tap="plus"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file" @tap="chooseAndUploadAvatar()">
|
||||
<up-icon name="camera-fill" color="#E5E5E5" size="35"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="reportDamage_footer">
|
||||
<view class="reportDamage_btn" @tap="affirm">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
watch
|
||||
} from 'vue';
|
||||
import { $uploadFile } from '@/http/yskApi/file.js'
|
||||
import { consumableBreakage , productBreakage} from '@/http/yskApi/breakage.js'
|
||||
|
||||
const props = defineProps({
|
||||
show:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
type:{
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
title:{
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
item:{
|
||||
type: Object,
|
||||
},
|
||||
|
||||
})
|
||||
const emits = defineEmits(['close','open',"affirm"])
|
||||
const vdata = reactive({
|
||||
stockNumber: 1,
|
||||
imgUrlList: [],
|
||||
})
|
||||
let show = ref(props.show)
|
||||
let type = ref(props.type)
|
||||
let itemData = ref(props.item)
|
||||
watch(()=>props.show,(newval)=>{
|
||||
show.value=newval
|
||||
})
|
||||
onMounted(() => {
|
||||
|
||||
})
|
||||
|
||||
function close() {
|
||||
show.value = false;
|
||||
vdata.imgUrlList = [];
|
||||
vdata.stockNumber = 1;
|
||||
emits('close')
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开报损弹窗
|
||||
*/
|
||||
function open() {
|
||||
show.value = true;
|
||||
emits('open')
|
||||
}
|
||||
|
||||
/**
|
||||
* 报损数量减少
|
||||
*/
|
||||
function minus() {
|
||||
if ( vdata.stockNumber <= 1) {
|
||||
return;
|
||||
}
|
||||
vdata.stockNumber--;
|
||||
}
|
||||
|
||||
/**
|
||||
* 报损数量增加
|
||||
*/
|
||||
function plus() {
|
||||
vdata.stockNumber++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除报损图片
|
||||
*/
|
||||
function del ( index ) {
|
||||
vdata.imgUrlList.splice(index,1)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传报损图片
|
||||
*/
|
||||
function chooseAndUploadAvatar () {
|
||||
if ( vdata.imgUrlList.length >= 6 ) {
|
||||
uni.showToast({
|
||||
title:'最多只可以上传六张',
|
||||
icon:'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
// 选择图片
|
||||
uni.chooseImage({
|
||||
count: 1, // 默认为1,只选择一张图片
|
||||
sizeType: ['original', 'compressed'], // 图片质量,原图或压缩
|
||||
sourceType: ['album', 'camera'], // 图片来源,相册或相机
|
||||
success: (res) => {
|
||||
let file = res.tempFiles[0];
|
||||
console.log(res)
|
||||
$uploadFile(file).then(res => {
|
||||
console.log(res);
|
||||
vdata.imgUrlList.push(res.data[0])
|
||||
|
||||
}).catch(res=>{
|
||||
console.log(res);
|
||||
if(res.errMsg){
|
||||
uni.showToast({
|
||||
title:'图片大小超出限制',
|
||||
icon:'error'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
fail: chooseImageError => {
|
||||
// 选择图片失败处理逻辑
|
||||
console.log('choose image fail:', chooseImageError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认
|
||||
*/
|
||||
function affirm () {
|
||||
// emits('affirm')
|
||||
if (vdata.imgUrlList.length <= 0) {
|
||||
uni.showToast({
|
||||
title:'请上传报损图片',
|
||||
icon:'none'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
coverImg: vdata.imgUrlList,
|
||||
}
|
||||
//商品报损
|
||||
if ( type.value == 'consumable') {
|
||||
params.consId = itemData.value.conIn;
|
||||
params.amount = vdata.stockNumber;
|
||||
}
|
||||
|
||||
consumableBreakage(params).then((res) => {
|
||||
show.value = false;
|
||||
vdata.imgUrlList = [];
|
||||
vdata.stockNumber = 1;
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
close,
|
||||
open,
|
||||
affirm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mask {
|
||||
background-color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
::v-deep .u-popup__content{
|
||||
// background-color: transparent;
|
||||
|
||||
}
|
||||
.reportDamage{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.reportDamage_head{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx;
|
||||
box-sizing: border-box;
|
||||
background: #F4F4F4;
|
||||
.reportDamage_title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.reportDamage_content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
|
||||
.reportDamage_cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 32rpx;
|
||||
box-sizing: border-box;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
.cell_lable{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
.thumbnail{
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
::v-deep .u-image,.u-image__loading,.u-image__image{
|
||||
width: 100%!important;
|
||||
height: 100%!important;
|
||||
}
|
||||
::v-deep uni-image{
|
||||
width: 112rpx!important;
|
||||
height: 112rpx!important;
|
||||
}
|
||||
}
|
||||
.cell_value{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
.text{
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.file{
|
||||
padding: 30rpx;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
box-sizing: border-box;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.file_img{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin-left: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
position: relative;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
.del{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.file_img_item{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
|
||||
}
|
||||
::v-deep .u-image,.u-image__loading,.u-image__image{
|
||||
width: 100%!important;
|
||||
height: 100%!important;
|
||||
}
|
||||
::v-deep uni-image{
|
||||
width: 120rpx!important;
|
||||
height: 120rpx!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cell_value.file{
|
||||
// flex-direction: row-reverse;
|
||||
// justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
.reportDamage_cell:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
.reportDamage_footer{
|
||||
background-color: #fff;
|
||||
padding: 32rpx;
|
||||
padding-bottom: 68rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.reportDamage_btn{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #318AFE;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,624 +0,0 @@
|
|||
/**
|
||||
* api接口管理, 全部以$开头
|
||||
* @author terrfly
|
||||
* @site https://www.jeequan.com
|
||||
* @date 2021/12/17 09:57
|
||||
*/
|
||||
|
||||
import http from './http.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
export const req = {
|
||||
list: (uri, params) => {
|
||||
return http.req(uri, params, 'GET', false)
|
||||
},
|
||||
|
||||
add: (uri, data) => {
|
||||
return http.req(uri, data, 'POST', false)
|
||||
},
|
||||
|
||||
getById: (uri, bizId) => {
|
||||
return http.req(`${uri}/${bizId}`, {}, 'GET', false)
|
||||
},
|
||||
|
||||
updateById: (uri, bizId, data) => {
|
||||
return http.req(`${uri}/${bizId}`, data, 'PUT', false)
|
||||
},
|
||||
|
||||
delById: (uri, bizId) => {
|
||||
return http.req(`${uri}/${bizId}`, {}, 'DELETE', false)
|
||||
},
|
||||
}
|
||||
|
||||
export const reqLoad = {
|
||||
list: (uri, params) => {
|
||||
return http.req(uri, params, 'GET')
|
||||
},
|
||||
|
||||
add: (uri, data) => {
|
||||
return http.req(uri, data, 'POST')
|
||||
},
|
||||
|
||||
getById: (uri, bizId) => {
|
||||
return http.req(`${uri}/${bizId}`, {}, 'GET')
|
||||
},
|
||||
|
||||
updateById: (uri, bizId, data) => {
|
||||
return http.req(`${uri}/${bizId}`, data, 'PUT')
|
||||
},
|
||||
|
||||
delById: (uri, bizId) => {
|
||||
return http.req(`${uri}/${bizId}`, {}, 'DELETE')
|
||||
},
|
||||
|
||||
// 通用 新增 or 更新
|
||||
addOrUpdate: (bizId, url, data, showMessage = true) => {
|
||||
//包含bizId 请求的是修改接口
|
||||
if (bizId) {
|
||||
return reqLoad.updateById(url, bizId, data).then((res) => {
|
||||
if (showMessage) {
|
||||
return infoBox.showSuccessToast('更新成功').then(() => res)
|
||||
}
|
||||
return Promise.resolve(res)
|
||||
})
|
||||
} else {
|
||||
return reqLoad.add(url, data).then((res) => {
|
||||
if (showMessage) {
|
||||
return infoBox.showSuccessToast('新增成功').then(() => res)
|
||||
}
|
||||
return Promise.resolve(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 上传文件 url **/
|
||||
export const API_URL_SINGLE_FILE_UPLOAD = '/api/ossFiles/singleFile'
|
||||
|
||||
/** 公告 **/
|
||||
export const API_URL_SYS_ARTICLES = '/api/sysArticles'
|
||||
|
||||
/** 支付订单列表 */
|
||||
export const API_URL_PAY_ORDER_LIST = '/api/payOrder'
|
||||
|
||||
/** 退款订单列表 */
|
||||
export const API_URL_REFUND_LIST = '/api/refundOrder'
|
||||
|
||||
/** 商户应用 */
|
||||
export const API_URL_MCH_APP_LIST = '/api/mchApps'
|
||||
|
||||
/** 门店列表 */
|
||||
export const API_URL_MCH_STORE_LIST = '/api/mchStore'
|
||||
|
||||
/** 通知接收人列表 */
|
||||
export const API_URL_WXMP_USER_LIST = '/api/wxmp'
|
||||
|
||||
/** 进件管理 */
|
||||
export const API_URL_MCH_APPLYMENT_LIST = '/api/mchApplyments'
|
||||
|
||||
/** 员工管理 */
|
||||
export const API_URL_SYS_USER_LIST = '/api/sysUsers'
|
||||
|
||||
/** 码牌管理 */
|
||||
export const API_URL_SYS_CODE_LIST = '/api/mchQrCodes'
|
||||
|
||||
/** 通用设备管理 deviceType 1-喇叭 2-打印机 3-扫码POS 4-智能POS 6-刷脸设备*/
|
||||
export const API_URL_SYS_DEVICE_LIST = '/api/store/device'
|
||||
|
||||
/** 辅助终端管理*/
|
||||
export const API_URL_SYS_TERMINALS = '/api/mchTerminals'
|
||||
|
||||
/** 用户绑定门店列表 */
|
||||
export const API_URL_USER_BIND_STORE_LIST = '/api/mchStore/userStoreRelas'
|
||||
|
||||
/** 商户支付通道列表 */
|
||||
export const API_URL_PAY_PASSAGE_LIST = '/api/mch/payPassages'
|
||||
/** 广告列表 */
|
||||
export const API_URI_PAY_AD_LIST = '/api/advert'
|
||||
/** 如意门店操作 */
|
||||
export const API_URI_DEV_RUYI = '/api/alipayShop'
|
||||
|
||||
/** 会员管理 */
|
||||
export const API_URL_MEMBERS = '/api/member'
|
||||
|
||||
/** 会员充值记录 */
|
||||
export const API_URL_MEMBER_RECHARGE_RECORDS = '/api/member/rechargeRecord'
|
||||
|
||||
/** 会员充值规则管理 */
|
||||
export const API_URL_MEMBER_RECHARGE_RULES = '/api/member/rechargeRule'
|
||||
|
||||
/** 会员账户流水 */
|
||||
export const API_URL_MEMBER_ACCOUNT_HISTORY = '/api/member/accountHistory'
|
||||
|
||||
//营销红包开始
|
||||
|
||||
//红包规则
|
||||
export const API_URL_MCH_REF_PACKET_RULE_LIST = '/api/redPacketRule'
|
||||
//新增红包规则
|
||||
export const API_URL_MCH_REF_PACKET_RULE_ADD = '/api/redPacketRule'
|
||||
|
||||
//顾客统计
|
||||
export const API_URL_MCH_REF_PACKET_RULE_COUNT = '/api/redPacketUser/count'
|
||||
//顾客列表
|
||||
export const API_URL_MCH_REF_PACKET_USER_LIST = '/api/redPacketUser'
|
||||
//顾客红包
|
||||
export const API_URL_MCH_REF_PACKET_INFO_LIST = '/api/redPacketInfo'
|
||||
//红包查询规则详情
|
||||
export const API_URL_MCH_REF_PACKET_RULE_QUERY = '/api/redPacketRule'
|
||||
//红包修改规则
|
||||
export const API_URL_MCH_REF_PACKET_RULE_EDIT = '/api/redPacketRule/edit'
|
||||
//红包余额变动明细列表
|
||||
export const API_URL_MCH_REF_PACKET_CHANGE = '/api/redPacketChange'
|
||||
//渠道列表
|
||||
export const API_URL_MCH_ISV_LIST = '/api/isvInfo/isvInfoList'
|
||||
|
||||
|
||||
|
||||
/* 密码登录 */
|
||||
export function $loginByPwd(username, pwd, safetyCode) {
|
||||
// 登录类型
|
||||
let lt = ''
|
||||
// #ifdef APP-PLUS
|
||||
lt = Base64.encode('APP')
|
||||
// #endif
|
||||
// #ifdef H5 || MP-WEIXIN
|
||||
lt = Base64.encode('LITE')
|
||||
// #endif
|
||||
|
||||
let data = {
|
||||
ia: Base64.encode(username),
|
||||
ip: Base64.encode(pwd),
|
||||
mc: safetyCode ? Base64.encode(safetyCode) : null,
|
||||
lt: lt,
|
||||
}
|
||||
return http.req('/api/anon/auth/validate', data, 'POST')
|
||||
}
|
||||
|
||||
/* 验证码登录 */
|
||||
export function $phoneCodeLogin(phone, code) {
|
||||
// 登录类型
|
||||
let lt = ''
|
||||
// #ifdef APP-PLUS
|
||||
lt = Base64.encode('APP')
|
||||
// #endif
|
||||
// #ifdef H5 || MP-WEIXIN
|
||||
lt = Base64.encode('LITE')
|
||||
// #endif
|
||||
|
||||
let data = {
|
||||
phone: Base64.encode(phone),
|
||||
code: Base64.encode(code),
|
||||
lt: lt,
|
||||
}
|
||||
|
||||
return http.req('/api/anon/auth/phoneCode', data, 'POST')
|
||||
}
|
||||
|
||||
// 找回密码
|
||||
export function $retrieve({
|
||||
phone,
|
||||
code,
|
||||
newPwd
|
||||
}) {
|
||||
let data = {
|
||||
phone: Base64.encode(phone),
|
||||
code: Base64.encode(code),
|
||||
newPwd: newPwd ? Base64.encode(newPwd) : ''
|
||||
}
|
||||
return http.req('/api/anon/cipher/retrieve', data, 'POST')
|
||||
}
|
||||
|
||||
/* 修改密码 */
|
||||
export function $modifyPwd({
|
||||
originalPwd,
|
||||
confirmPwd
|
||||
}) {
|
||||
let data = {
|
||||
originalPwd: Base64.encode(originalPwd),
|
||||
confirmPwd: Base64.encode(confirmPwd)
|
||||
}
|
||||
return http.req("/api/current/modifyPwd", data, "PUT")
|
||||
}
|
||||
|
||||
/* 注册新商户 */
|
||||
export function $mchRegister({
|
||||
mchName,
|
||||
confirmPwd,
|
||||
inviteCode,
|
||||
phone,
|
||||
code
|
||||
}) {
|
||||
let data = {
|
||||
mchName: mchName, // 用户名称
|
||||
confirmPwd: Base64.encode(confirmPwd), // 确认密码
|
||||
inviteCode, // 邀请码
|
||||
phone: Base64.encode(phone), // 手机号
|
||||
code: Base64.encode(code), // 短信验证码
|
||||
}
|
||||
return http.req('/api/anon/register/mchRegister', data, 'POST')
|
||||
}
|
||||
|
||||
/* 发送短信验证码 */
|
||||
export function $sendSms(data, smsType) {
|
||||
return http.req('/api/anon/sms/code', {
|
||||
phone: data.phone,
|
||||
vercode: data.vercode,
|
||||
vercodeToken: data.vercodeToken,
|
||||
smsType: smsType
|
||||
}, 'POST')
|
||||
}
|
||||
|
||||
/* 获取个人信息 */
|
||||
export function $userInfo(cid1, cid2) {
|
||||
return http.req('/api/current/user', {
|
||||
cid1,
|
||||
cid2
|
||||
}, 'GET')
|
||||
}
|
||||
|
||||
/* 获取公司信息 */
|
||||
export function $getSiteInfos() {
|
||||
return http.req('/api/anon/siteInfos', {}, 'GET')
|
||||
}
|
||||
|
||||
// 隐私政策与服务协议
|
||||
export function $getTreaty() {
|
||||
return http.req('/api/anon/treaty', {}, 'GET')
|
||||
}
|
||||
|
||||
/* 快捷收银 */
|
||||
export function $appPay(storeId, amount, sellerRemark, wayCode, authCode) {
|
||||
let data = {
|
||||
storeId,
|
||||
amount,
|
||||
sellerRemark,
|
||||
wayCode,
|
||||
authCode
|
||||
}
|
||||
|
||||
// 二维码, 返回结果为 图片地址
|
||||
if (wayCode == 'QR_CASHIER') {
|
||||
data.payDataType = 'codeImgUrl'
|
||||
}
|
||||
|
||||
return http.req('/api/pay/app', data, 'POST')
|
||||
}
|
||||
|
||||
/* 当前商户信息 */
|
||||
export function $getMchInfo() {
|
||||
return http.req('/api/mainChart', {}, 'GET')
|
||||
}
|
||||
|
||||
/* 订单打印 */
|
||||
export function $payOrderPrint(orderId) {
|
||||
return http.req('/api/payOrder/print/' + orderId, {}, 'GET')
|
||||
}
|
||||
|
||||
/* 订单退款 */
|
||||
export function $payOrderRefund(orderId, refundAmount, refundReason, refundPassword) {
|
||||
return http.req(
|
||||
'/api/payOrder/refunds/' + orderId, {
|
||||
refundAmount: refundAmount,
|
||||
refundReason: refundReason,
|
||||
refundPassword: Base64.encode(refundPassword),
|
||||
refundModel: 1
|
||||
},
|
||||
'POST'
|
||||
)
|
||||
}
|
||||
// // 首页统计信息
|
||||
// export function $indexStatistics (queryDateRange) {
|
||||
// return http.req('/api/mainChart/payDayCount', { queryDateRange }, 'GET')
|
||||
// }
|
||||
|
||||
// 首页统计信息
|
||||
export function $indexStatistics(queryDateRange) {
|
||||
return http.req('/api/payOrder/count?queryDateRange', {
|
||||
queryDateRange
|
||||
}, 'GET')
|
||||
}
|
||||
|
||||
// 统计报表
|
||||
export function $getStatInfo(data) {
|
||||
return http.req('/api/statistic/total', data, 'GET', false)
|
||||
}
|
||||
// 统计报表设备 门店 支付方式统计
|
||||
export function $getStatistic(data) {
|
||||
return http.req('/api/statistic', data, 'GET')
|
||||
}
|
||||
|
||||
/* 经纬度转换为areacode */
|
||||
export function $location2areacode(location) {
|
||||
return http.req('/api/mchStore/location2areacode/', {
|
||||
location: location
|
||||
}, 'GET')
|
||||
}
|
||||
|
||||
|
||||
/* 获取上传form信息 */
|
||||
export function $ossFilesForm(bizType, file) {
|
||||
let postData = {
|
||||
bizType: bizType,
|
||||
sourceFileName: file.name || file.path, // 如果没有name 则使用pach替换
|
||||
sourceFileSize: file.size,
|
||||
}
|
||||
|
||||
return http.req('/api/ossFiles/form', postData, 'POST')
|
||||
}
|
||||
|
||||
/* 系统设置 */
|
||||
// 获取语音播报开关信息
|
||||
export function $mchConfig(groupKey) {
|
||||
return http.req('/api/mchConfig', {
|
||||
groupKey: groupKey
|
||||
}, 'GET')
|
||||
}
|
||||
// 修改语音播报开关信息
|
||||
export function $orderConfig(configData, mchNo) {
|
||||
console.log('mchNo', mchNo);
|
||||
return http.req('/api/mchConfig/orderConfig', {
|
||||
configData: configData,
|
||||
mchNo: mchNo
|
||||
}, 'PUT')
|
||||
}
|
||||
|
||||
/* 修改个人信息 */
|
||||
export function $modifyUser({
|
||||
realname,
|
||||
avatarUrl
|
||||
}) {
|
||||
return http.req("/api/current/user", {
|
||||
realname,
|
||||
avatarUrl
|
||||
}, "PUT")
|
||||
}
|
||||
|
||||
/* 获取密码规则 */
|
||||
export function $getPasswordRules() {
|
||||
return http.req("/api/anon/cipher/pwdRulesRegexp", "GET")
|
||||
}
|
||||
|
||||
// 验证是否有密码
|
||||
export function $isSipw() {
|
||||
return http.req("/api/mchConfig/hasSipwValidate", "GET")
|
||||
}
|
||||
|
||||
// 验证原支付密码是否正确
|
||||
export function $isMchSipw(originalPwd) {
|
||||
return http.req("/api/mchConfig/mchSipwValidate", {
|
||||
originalPwd: Base64.encode(originalPwd)
|
||||
}, "POST")
|
||||
}
|
||||
|
||||
/* 更新支付密码 */
|
||||
export function $updateMchSipw({
|
||||
originalPwd,
|
||||
confirmPwd
|
||||
}) {
|
||||
let data = {
|
||||
originalPwd: Base64.encode(originalPwd),
|
||||
confirmPwd: Base64.encode(confirmPwd)
|
||||
}
|
||||
return http.req("/api/mchConfig/mchSipw", data, "PUT")
|
||||
}
|
||||
|
||||
/* 版本检测 */
|
||||
export function $versionDetection({
|
||||
versionNumber
|
||||
}) {
|
||||
return http.req("/api/anon/clientVersion/versionInfo", {
|
||||
versionNumber: versionNumber
|
||||
}, "GET")
|
||||
}
|
||||
|
||||
/* 查询用户权限 */
|
||||
export function $getUserEntRoles(sysUserId) {
|
||||
return http.req("/api/sysUsers/userEntRoles/" + sysUserId, {}, "GET")
|
||||
}
|
||||
|
||||
/* 更新用户权限 */
|
||||
export function $updateUserEntRoles(sysUserId, ruleName, state) {
|
||||
return http.req("/api/sysUsers/userEntRoles/" + sysUserId, {
|
||||
ruleName,
|
||||
state
|
||||
}, "PUT")
|
||||
}
|
||||
|
||||
|
||||
/* 根据支付方式查询可配置的支付接口 */
|
||||
export function $getAvailablePayInterface(appId, wayCode) {
|
||||
return http.req(`/api/mch/payPassages/availablePayInterface/${appId}/${wayCode}`, "GET")
|
||||
}
|
||||
|
||||
/* 支付方式配置支付接口 */
|
||||
export function $wayCodeConfigIfCode(appId, wayCode, ifCode) {
|
||||
|
||||
let reqData = {
|
||||
appId: appId,
|
||||
wayCode: wayCode,
|
||||
ifCode: ifCode,
|
||||
state: 1
|
||||
}
|
||||
return http.req(`/api/mch/payPassages/mchPassage`, reqData, "POST")
|
||||
}
|
||||
/*码牌扫码 二维码解析*/
|
||||
export function $parseQrCodeUrl(qrUrl) {
|
||||
return http.req('/api/mchQrCodes/parseQrCodeUrl', {
|
||||
qrUrl
|
||||
}, 'GET')
|
||||
}
|
||||
/*码牌绑定*/
|
||||
export function $bindEmptyQR(qrcInfo) {
|
||||
return http.req('/api/mchQrCodes/bindEmptyQR', qrcInfo, 'POST')
|
||||
}
|
||||
/*解绑码牌*/
|
||||
export function $unBindQrc(qrcId) {
|
||||
return http.req('/api/mchQrCodes/unbind/' + qrcId, {}, 'POST')
|
||||
}
|
||||
/*码牌查询受支持的云喇叭设备*/
|
||||
export function $getHornList(qrcId) {
|
||||
return http.req('/api/mchQrCodes/bindDevice/' + qrcId, 'GET')
|
||||
}
|
||||
/* 更新默认 */
|
||||
export function $updateTrmDefault(trmId, defaultFlag) {
|
||||
return http.req('/api/mchTerminals/trmDefaults', {
|
||||
trmId,
|
||||
defaultFlag
|
||||
}, 'PUT')
|
||||
}
|
||||
|
||||
/* 设备解绑 */
|
||||
export function $deviceUnbind(deviceId) {
|
||||
return http.req('/api/store/device/unbind/' + deviceId, {}, 'POST')
|
||||
}
|
||||
|
||||
|
||||
/* 渠道报备列表 */
|
||||
export function $terminalChannelBindList(trmId) {
|
||||
return http.req('/api/mchTerminals/channelBindInfos/' + trmId, {}, 'GET')
|
||||
}
|
||||
|
||||
/* 渠道报备 */
|
||||
export function $terminalChannelBindSend(trmId, ifCode) {
|
||||
return http.req('/api/mchTerminals/channelSendup/' + trmId, {
|
||||
ifCode: ifCode,
|
||||
state: 1
|
||||
}, 'POST')
|
||||
}
|
||||
|
||||
|
||||
// 扫码登录
|
||||
export function $scanCodeLogin(qrcodeNo, qrcodeStatus) {
|
||||
return http.req("/api/current/qrcode/login", {
|
||||
qrcodeNo,
|
||||
qrcodeStatus
|
||||
}, "POST")
|
||||
}
|
||||
|
||||
// 云喇叭 播报测试
|
||||
export function $speakTest(devId, amount) {
|
||||
return http.req("/api/store/device/speak/" + devId, amount, "POST")
|
||||
}
|
||||
|
||||
// 云打印 打印测试
|
||||
export function $printTest(devId, amount) {
|
||||
return http.req(`/api/store/device/print/${devId}`, {
|
||||
amount
|
||||
}, "POST")
|
||||
}
|
||||
|
||||
/* 获取百度语音播报token */
|
||||
export function $getBaiduToken() {
|
||||
return http.req("/api/pushinfo/getBaiduToken", {}, "GET")
|
||||
}
|
||||
// 获取通知接收人二维码图片
|
||||
export function $getWxMpInfo() {
|
||||
return http.req("/api/wxmp/getWxmpInfo", {}, "GET")
|
||||
}
|
||||
|
||||
/* 获取进件通道列表 */
|
||||
export function $getAllAllowApplymentIfCodeList() {
|
||||
return http.req("/api/payConfig/ifCodes", {
|
||||
infoId: 'CURRENT',
|
||||
configMode: 'mchApplyment'
|
||||
}, "GET")
|
||||
}
|
||||
/* 查询店长可以绑定的门店 */
|
||||
export function $getBindStoreList(params) {
|
||||
return http.req('/api/mchStore/bindStoreList', params, "GET")
|
||||
}
|
||||
|
||||
/* 提交unipush cid */
|
||||
export function $pushInfoRegister(data) {
|
||||
console.log('push cid', data);
|
||||
return http.req("/api/pushinfo/register", data, "POST")
|
||||
}
|
||||
/* 获取广告接口*/
|
||||
export function $adList(params) {
|
||||
return http.req('/api/advert/appAdvert', params, 'GET')
|
||||
}
|
||||
/** 如意Lite 绑定解绑接口 */
|
||||
export function $BindLite(data) {
|
||||
return http.req('/api/alipayIot/bind/' + data.deviceId, data, "POST")
|
||||
}
|
||||
|
||||
// 获取支付宝扫码授权
|
||||
export function $aliPayQrCodeOrApply(account = '', type = 'queryResult') {
|
||||
return http.req(`/api/alipaySpOperation/${type}`, {
|
||||
alipayAccount: account
|
||||
}, type == 'apply' ? 'POST' : 'GET')
|
||||
}
|
||||
// 获取支付宝授权信息
|
||||
export function $aliAccountInfo() {
|
||||
return http.req('/api/alipaySpOperation/authInfo', {}, 'GET')
|
||||
}
|
||||
|
||||
// 查询蚂蚁店铺状态
|
||||
export function $queryAliStore(storeId) {
|
||||
return req.getById('/api/alipayShop/createResult', storeId)
|
||||
}
|
||||
|
||||
|
||||
// 获取上传图片 大小
|
||||
export function $getUploadImgSize() {
|
||||
return http.req('/api/defaultConfig', {}, "GET")
|
||||
}
|
||||
|
||||
// 会员调账
|
||||
export function $memberManual(params) {
|
||||
return http.req('/api/member/manual/' + params.memberId, params, "POST")
|
||||
}
|
||||
|
||||
//查询或修改会员配置信息
|
||||
export function $findOrEditMemberConfig(data, mode = 'GET', uri = '') {
|
||||
return http.req('/api/mchConfig' + uri, data, mode)
|
||||
}
|
||||
/* 会员数据统计 */
|
||||
export function $memberInfoCount(params) {
|
||||
return http.req('/api/member/count', params, 'GET')
|
||||
}
|
||||
|
||||
/* 查询商户支付应用 费率参数是否配置 */
|
||||
export function $getMchPayPassage(appId, ifCode) {
|
||||
return http.req(`/api/payConfig/existPayParams/${appId}/${ifCode}`, {}, 'GET')
|
||||
}
|
||||
|
||||
/* 获取进件渠道列表 */
|
||||
export function $getAllIsvInfoList(ifCode, range = 0) {
|
||||
return http.req("/api/isvInfo/isvInfoList", {
|
||||
pageNumber: "-1",
|
||||
range: range,
|
||||
ifCode: ifCode
|
||||
}, "GET")
|
||||
}
|
||||
|
||||
|
||||
// 请求验证码
|
||||
export function $isCode() {
|
||||
return http.req("/api/anon/auth/vercode", "GET")
|
||||
}
|
||||
|
||||
export function $pmdfb(data) {
|
||||
return http.req("/api/store/device/setMarqueeInfo", data, "POST")
|
||||
}
|
||||
|
||||
export function $getImgWH(params) {
|
||||
return http.req(`/api/store/device/getMarketPoint/${params}`, "GET")
|
||||
}
|
||||
|
||||
export function $initializeImg(params) {
|
||||
return http.req(`/api/store/device/getMarketPic/${params}`, "GET")
|
||||
}
|
||||
|
||||
export function $uploadImg(data) {
|
||||
return http.req(`/api/store/device/setMarketPic`, data, "POST")
|
||||
}
|
||||
|
||||
/* 获取上传form信息 */
|
||||
export function $NewOssFilesForm(data) {
|
||||
return http.req("/api/ossFiles/form", data, "POST")
|
||||
}
|
||||
|
|
@ -1,415 +0,0 @@
|
|||
// 代课下单
|
||||
import http from './http.js'
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
const request = http.request
|
||||
|
||||
|
||||
//就餐形式,默认堂食后付费
|
||||
const useType = 'dine-in-after'
|
||||
|
||||
function getUseType() {
|
||||
const type = uni.getStorageSync("useType")
|
||||
return type ? type : useType
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前台桌订单信息
|
||||
* @returns
|
||||
*/
|
||||
export function getCart(params) {
|
||||
return request({
|
||||
url: `/api/place/cart`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 已上架商品列表
|
||||
* @returns
|
||||
*/
|
||||
export function getGoodsLists(params,showLoading=true) {
|
||||
return request({
|
||||
url: `/api/place/activate`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
},
|
||||
showLoading
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 点单
|
||||
* @returns
|
||||
*/
|
||||
export function addCart(data) {
|
||||
return request({
|
||||
url: `/api/place/addCart`,
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空购物车/支付订单
|
||||
* @returns
|
||||
*/
|
||||
export function $clearCart(data) {
|
||||
return request({
|
||||
url: `/api/place/clearCart`,
|
||||
method: "delete",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除购物车某个商品
|
||||
* @returns
|
||||
*/
|
||||
export function $removeCart(data) {
|
||||
return request({
|
||||
url: `/api/place/removeCart`,
|
||||
method: "delete",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 更新规格
|
||||
* @returns
|
||||
*/
|
||||
export function $updateCart(data) {
|
||||
return request({
|
||||
url: `/api/place/updateCart`,
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 批量打包
|
||||
* @returns
|
||||
*/
|
||||
export function $allPack(data) {
|
||||
return request({
|
||||
url: `/api/place/pack`,
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 获取取餐号
|
||||
* @returns
|
||||
*/
|
||||
export function $getMasterId(data) {
|
||||
return request({
|
||||
url: `/api/place/masterId`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 支付方式获取
|
||||
* @returns
|
||||
*/
|
||||
export function $getPayType(data) {
|
||||
return request({
|
||||
url: `/api/place/payType`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 创建订单
|
||||
* @returns
|
||||
*/
|
||||
export function $createOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/order`,
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 挂起订单
|
||||
* @returns
|
||||
*/
|
||||
export function $cacheOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/pending`,
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已挂起订单
|
||||
* @returns
|
||||
*/
|
||||
export function $getCacheOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/pending/cart`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 会员点单/取消会员点单
|
||||
export function $setUser(data) {
|
||||
return request({
|
||||
url: `/api/place/updateVip`,
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 删除订单
|
||||
export function $delOrder(data) {
|
||||
return request({
|
||||
url: `/api/place/order`,
|
||||
method: "delete",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 支付订单
|
||||
export function $payOrder(data) {
|
||||
return request({
|
||||
url: '/api/place/pay',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//退单
|
||||
|
||||
export function $returnCart(data) {
|
||||
return request({
|
||||
url: '/api/place/returnCart',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 选择台桌
|
||||
export function $choseTable(data) {
|
||||
return request({
|
||||
url: '/api/place/choseTable',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 用餐人数
|
||||
|
||||
export function $choseCount(data) {
|
||||
return request({
|
||||
url: '/api/place/choseCount',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
useType: getUseType(),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 批量生成台桌
|
||||
export function $fastCreateTable(data) {
|
||||
return request({
|
||||
url: '/api/tbShopTable/generate',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//打印当前台桌订单
|
||||
export function $printOrder(data) {
|
||||
return request({
|
||||
url: '/api/place/printOrder',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//打印当前台桌菜品
|
||||
|
||||
export function $printDishes(data) {
|
||||
return request({
|
||||
url: '/api/place/printDishes',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 就餐模式切换
|
||||
export function $changeUseType(data) {
|
||||
return request({
|
||||
url: '/api/place/choseModel',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 退款
|
||||
export function $returnOrder(data) {
|
||||
return request({
|
||||
url: '/api/place/returnOrder',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//获取订单可用优惠券
|
||||
export function $activateByOrderId(data) {
|
||||
return request({
|
||||
url: '/api/tbShopCoupon/activateByOrderId',
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//会员积分列表
|
||||
export function $returnMemberPointsList(data) {
|
||||
return request({
|
||||
url: '/api/points/memberPoints/page',
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 会员积分账户信息
|
||||
export function $returnMemberPoints(memberId) {
|
||||
return request({
|
||||
url: '/api/points/memberPoints/'+memberId,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//002-获取订单可用积分及抵扣金额(支付页面使用)
|
||||
export function $calcUsablePoints(data) {
|
||||
return request({
|
||||
url: '/api/points/memberPoints/calcUsablePoints',
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 003-根据积分计算可抵扣金额
|
||||
export function $calcDeDuctionPoints(data) {
|
||||
return request({
|
||||
url: '/api/points/memberPoints/calcDeductionAmount',
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//购物车-临时菜添加
|
||||
export function $temporaryDishes(data) {
|
||||
return request({
|
||||
url: '/api/place/temporaryDishes',
|
||||
method: "post",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//单品改价
|
||||
export function $updatePrice(data) {
|
||||
return request({
|
||||
url: '/api/place/updatePrice',
|
||||
method: "put",
|
||||
data:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 商品报损
|
||||
* @returns
|
||||
*/
|
||||
export function productBreakage(data) {
|
||||
return request({
|
||||
url: `/api/tbProductStockDetail/frmLoss`,
|
||||
method: 'post',
|
||||
data:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材报损
|
||||
* @returns
|
||||
*/
|
||||
export function consumableBreakage(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfoFlow/frmLoss`,
|
||||
method: 'post',
|
||||
data:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
|
||||
/**
|
||||
* 商品报损
|
||||
* @returns
|
||||
*/
|
||||
export function get(params) {
|
||||
return request({
|
||||
url: `/freeDine`,
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材报损
|
||||
* @returns
|
||||
*/
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: `/freeDine`,
|
||||
method: 'put',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
|
||||
/**
|
||||
* 查询耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsType(params) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改耗材类型
|
||||
* @returns
|
||||
*/
|
||||
export function puttbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfo(params) {
|
||||
// return request({
|
||||
// url: '/api/tbConsInfo',
|
||||
// method: "get",
|
||||
// params
|
||||
// });
|
||||
return request({
|
||||
url: "/api/tbConsInfo",
|
||||
method: "get",
|
||||
params: {
|
||||
...params,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 耗材入库
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfostockIn(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo/stockIn',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改单位耗材值耗材
|
||||
* @returns
|
||||
*/
|
||||
export function postapitbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbConsInfo(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询查询耗材规格信息
|
||||
* @returns
|
||||
*/
|
||||
export function getviewConSku(params) {
|
||||
return request({
|
||||
url: '/api/viewConSku',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询查询商品规格
|
||||
* @returns
|
||||
*/
|
||||
export function gettbProductSpec(params) {
|
||||
return request({
|
||||
url: '/api/viewProductSkuShop',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 新增商品规格耗材信息-修改后
|
||||
* @returns
|
||||
*/
|
||||
export function posttbProskuCons(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function puttbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑单位耗材值
|
||||
// export function puttbProskuCon(data) {
|
||||
// return request({
|
||||
// url: '/api/tbProskuCon',
|
||||
// method: "put",
|
||||
// data
|
||||
// });
|
||||
// }
|
||||
/**
|
||||
* 删除商品规格耗材信息状态
|
||||
* @returns
|
||||
*/
|
||||
export function deletetbProskuCon(data) {
|
||||
return request({
|
||||
url: '/api/tbProskuCon',
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询耗材流水信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfoFlow(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow',
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 分组查询获取耗材流水信息
|
||||
*/
|
||||
// export function viewConInfoFlow(data) {
|
||||
// return request({
|
||||
// url: "/api/viewConInfoFlow",
|
||||
// method: "get",
|
||||
// params: {
|
||||
// shopId: uni.getStorageSync("shopId"),
|
||||
// ...data
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询耗材单位列表
|
||||
*/
|
||||
export function queryTbConUnitInfo(data) {
|
||||
return request({
|
||||
url: "/api/tbConUnit/queryTbConUnitInfo",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增耗材单位
|
||||
*/
|
||||
export function addtbConUnit(data) {
|
||||
return request({
|
||||
url: '/api/tbConUnit',
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 修改耗材单位
|
||||
*/
|
||||
export function edittbConUnit(data) {
|
||||
return request({
|
||||
url: '/api/tbConUnit',
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取优惠券列表
|
||||
* @returns
|
||||
*/
|
||||
export function getTbShopCoupon(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCoupon`,
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取优惠券详情
|
||||
* @returns
|
||||
*/
|
||||
export function getTbShopCouponInfo(id) {
|
||||
return request({
|
||||
url: `/api/tbShopCoupon/${id}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加优惠券
|
||||
* @returns
|
||||
*/
|
||||
export function addTbShopCoupon(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCoupon`,
|
||||
method: 'post',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除优惠券
|
||||
* @returns
|
||||
*/
|
||||
export function delTbShopCoupon(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCoupon`,
|
||||
method: 'delete',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import http from './http.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 查询团购卷分类 */
|
||||
export function $tbCouponCategory(data, mehtod = 'GET') {
|
||||
return http.req('/api/tbCouponCategory', {
|
||||
...data,
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}, 'GET')
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
add: function(data) {
|
||||
return $tbCouponCategory(data, 'POST')
|
||||
},
|
||||
del: function(data) {
|
||||
return $tbCouponCategory(data, 'DELETE')
|
||||
},
|
||||
update: function(data) {
|
||||
return $tbCouponCategory(data, 'PUT')
|
||||
},
|
||||
get: function(data) {
|
||||
return $tbCouponCategory(data)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取挂账人列表
|
||||
* @returns
|
||||
*/
|
||||
export function getCreditBuyerList(data) {
|
||||
return request({
|
||||
url: `/api/credit/buyer/page`,
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function addCreditBuyer(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer',
|
||||
method: 'post',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function editCreditBuyer(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除挂账人
|
||||
* @returns
|
||||
*/
|
||||
export function delCreditBuyer(id) {
|
||||
return request({
|
||||
url: `/api/credit/buyer/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 还款
|
||||
* @returns
|
||||
*/
|
||||
export function creditRePayment(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer/repayment',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取还款记录
|
||||
* @returns
|
||||
*/
|
||||
export function creditRePaymentRecord(params) {
|
||||
return request({
|
||||
url: '/api/credit/payment-record/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细
|
||||
* @returns
|
||||
*/
|
||||
export function creditBuyerOrderList(params) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细-统计
|
||||
* @returns
|
||||
*/
|
||||
export function creditBuyerOrderSummary(params) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/summary',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂账人-查看明细-付款
|
||||
* @returns
|
||||
*/
|
||||
export function creditPayment(data) {
|
||||
return request({
|
||||
url: '/api/credit/buyer-order/pay',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
/**
|
||||
* 增加打印机
|
||||
* @returns
|
||||
*/
|
||||
export function tbPrintMachine(data, method = 'post') {
|
||||
return request({
|
||||
url: '/api/shop-config/printer',
|
||||
method: method,
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印机列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbPrintMachineGet(params) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
sort: '',
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 打印机部分
|
||||
export function tbShopCategoryget(params) {
|
||||
return request({
|
||||
url: '/api/tbShopCategory',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 修改打印机状态
|
||||
export function shopConfigprinter(data) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/update-status',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// * 打印机详情
|
||||
export function printerd(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function delTableHandle(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import http from './http.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 上传图片 */
|
||||
export function $uploadFile(file,data) {
|
||||
return http.upload('/api/qiNiuContent', data,file)
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
import http from './http.js'
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
function objectToUrlParams(obj) {
|
||||
let params = [];
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
let value = obj[key];
|
||||
let param = encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||
params.push(param);
|
||||
}
|
||||
}
|
||||
return params.join('&');
|
||||
}
|
||||
/* 商品列表 */
|
||||
export function $tbProduct(data) {
|
||||
return http.req('/api/tbProduct', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
|
||||
/* 添加商品 */
|
||||
export function $addProduct(data) {
|
||||
return http.req('/api/tbProduct', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
|
||||
/* 删除商品 */
|
||||
export function $delProduct(ids) {
|
||||
return http.req('/api/tbProduct', ids, 'DELETE')
|
||||
}
|
||||
|
||||
|
||||
/* 更新商品相关 */
|
||||
export function $updateProduct(data) {
|
||||
return http.req('/api/tbProduct', {...data,shopId:uni.getStorageSync('shopId')}, 'PUT')
|
||||
}
|
||||
/* 修改商品排序 */
|
||||
export function $upProSort(data) {
|
||||
return http.req('/api/tbProduct/upProSort', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
/* 商品详情(单个商品) */
|
||||
export function $getProductDetail(product,showLoading=true) {
|
||||
return http.req('/api/tbProduct/'+product, {shopId:uni.getStorageSync('shopId')}, 'GET',showLoading)
|
||||
}
|
||||
|
||||
/* 设置热销商品 */
|
||||
export function $goodsIsHot(data) {
|
||||
return http.req('/api/tbProduct/isHot', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品分类列表
|
||||
*/
|
||||
export function $tbShopCategory(data) {
|
||||
return http.req('/api/tbShopCategory', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export const $productCategory=new $API('/api/tbShopCategory',http.req)
|
||||
|
||||
|
||||
/**
|
||||
* 更新商品库存状态
|
||||
*/
|
||||
export function $updateProductStatus(data){
|
||||
return http.req('/api/stock/productStatus', {...data,shopId:uni.getStorageSync('shopId')}, 'PUT')
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存记录列表
|
||||
*/
|
||||
export function $getProductStockDetail(data){
|
||||
return http.req('/api/tbProductStockDetail/stock', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存记录变动数量
|
||||
*/
|
||||
export function $getProductStockDetailSum(data){
|
||||
return http.req('/api/tbProductStockDetail/sum', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
/**
|
||||
* 新增盘点
|
||||
*/
|
||||
export function $addStocktakin(data){
|
||||
return http.req('/api/tbProductStocktakin', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
/**
|
||||
* 盘点记录查询
|
||||
*/
|
||||
export function $getStocktakin(data){
|
||||
return http.req('/api/tbProductStocktakin', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上下架商品
|
||||
*/
|
||||
export function $updateGrounding(data){
|
||||
const ajaxData={...data,shopId:uni.getStorageSync('shopId')}
|
||||
return http.req('/api/stock/grounding'+`?${objectToUrlParams(ajaxData)}`, ajaxData, 'PUT')
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 商品单位列表 */
|
||||
export function $tbShopUnit(data) {
|
||||
return http.req('/api/tbShopUnit', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
|
||||
/* 商品规格 */
|
||||
export const $productSpec=new $API('/api/tbProductSpec',http.req)
|
||||
|
||||
|
||||
|
||||
// v2 api start
|
||||
// 商品列表 后台查询
|
||||
export function $tbProductList(data) {
|
||||
return http.req('/api/tbProduct/list', {...data,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
/* 商品列表 V2 */
|
||||
export function $tbProductV2(data) {
|
||||
return http.req('/api/tbProduct/list/v2', {...data,shopId:uni.getStorageSync('shopId')}, 'post')
|
||||
}
|
||||
/* 耗材与商品绑定关系 */
|
||||
export function $tbProskuConV2(data) {
|
||||
return http.req('/api/tbProskuCon/V2', data, 'POST')
|
||||
}
|
||||
|
||||
/* 修改商品相关(快捷接口) */
|
||||
export function $updateProductData(data) {
|
||||
return http.req('/api/stock/updateProductData', data, 'POST')
|
||||
}
|
||||
/* 商品报损 */
|
||||
export function $frmLoss(data) {
|
||||
return http.req('/api/tbProductStockDetail/frmLoss', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
// v2 api end
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
/**
|
||||
* HTTP的封装, 基于uni.request
|
||||
* 包括: 通用响应结果的处理 和 业务的增删改查函数
|
||||
*
|
||||
* @author terrfly
|
||||
* @site https://www.jeequan.com
|
||||
* @date 2021/12/16 18:35
|
||||
*/
|
||||
|
||||
// 导入全局属性
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import storageManage from '@/commons/utils/storageManage.js'
|
||||
import {
|
||||
sm4DecryptByResData
|
||||
} from '@/commons/utils/encryptUtil.js'
|
||||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { reject } from 'lodash';
|
||||
|
||||
// 测试服
|
||||
let baseUrl = 'https://tapi.cashier.sxczgkj.cn/'
|
||||
|
||||
//预发布
|
||||
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||
|
||||
//正式
|
||||
// let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
||||
|
||||
// 王伟本地测
|
||||
// let baseUrl = '/ww'
|
||||
// let baseUrl = 'http://192.168.1.15:8000'
|
||||
// 巩
|
||||
// let baseUrl = 'http://192.168.1.9:8000'
|
||||
// 多少 ms 以内, 不提示loading
|
||||
const loadingShowTime = 200
|
||||
|
||||
|
||||
function getHeader(){
|
||||
const headerObject={}
|
||||
headerObject["Authorization"] = storageManage.token()
|
||||
return headerObject
|
||||
}
|
||||
|
||||
// 通用处理逻辑
|
||||
function commonsProcess(showLoading, httpReqCallback) {
|
||||
|
||||
// 判断是否请求完成(用作 是否loading )
|
||||
// 包括: 'ing', 'ingLoading', 'finish'
|
||||
let reqState = 'ing'
|
||||
|
||||
// 是否已经提示的错误信息
|
||||
let isShowErrorToast = false
|
||||
|
||||
|
||||
// 请求完成, 需要处理的动作
|
||||
let reqFinishFunc = () => {
|
||||
|
||||
if (reqState == 'ingLoading') { // 关闭loading弹层
|
||||
infoBox.hideLoading()
|
||||
}
|
||||
reqState = 'finish' // 请求完毕
|
||||
}
|
||||
|
||||
// 明确显示loading
|
||||
if (showLoading) {
|
||||
// xx ms内响应完成,不提示loading
|
||||
setTimeout(() => {
|
||||
if (reqState == 'ing') {
|
||||
reqState = 'ingLoading'
|
||||
infoBox.showLoading()
|
||||
}
|
||||
}, loadingShowTime)
|
||||
}
|
||||
|
||||
return httpReqCallback().then((httpData) => {
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||
let {
|
||||
statusCode,
|
||||
data
|
||||
} = httpData
|
||||
// 避免混淆重新命名
|
||||
let bodyData = data
|
||||
if (statusCode == 500) {
|
||||
isShowErrorToast = true
|
||||
return Promise.reject(bodyData) // 跳转到catch函数
|
||||
}
|
||||
if (statusCode == 401) {
|
||||
// storageManage.token(null, true)
|
||||
// 提示信息
|
||||
isShowErrorToast = true
|
||||
// infoBox.showErrorToast('请登录').then(() => {
|
||||
// go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
// })
|
||||
return Promise.reject(bodyData) // 跳转到catch函数
|
||||
}
|
||||
// http响应码不正确
|
||||
if (statusCode != 200 && statusCode != 204 && statusCode != 201) {
|
||||
isShowErrorToast = true
|
||||
data.message=data.message=='Bad credentials'?'用户名或密码错误':data.message
|
||||
infoBox.showToast(data.message || '服务器异常')
|
||||
return Promise.reject(bodyData) // 跳转到catch函数
|
||||
}
|
||||
|
||||
// // 业务响应异常
|
||||
// if (bodyData.hasOwnProperty('code') && bodyData.code != 200) {
|
||||
// isShowErrorToast = true
|
||||
// infoBox.showToast(bodyData.msg)
|
||||
// if (bodyData.code == 5005) { // 密码已过期, 直接跳转到更改密码页面
|
||||
// uni.reLaunch({
|
||||
// url: '/pageUser/setting/updatePwd'
|
||||
// })
|
||||
// }
|
||||
// // if(bodyData.code == 500){ // 密码已过期, 直接跳转到更改密码页面
|
||||
// // uni.redirectTo({url: '/pages/login/index'})
|
||||
// // }
|
||||
// return bodyData
|
||||
// // return Promise.reject(bodyData)
|
||||
// }
|
||||
|
||||
// 加密数据
|
||||
if (!bodyData.data && bodyData.encryptData) {
|
||||
|
||||
return Promise.resolve({
|
||||
bizData: sm4DecryptByResData(bodyData.encryptData),
|
||||
code: bodyData.code
|
||||
})
|
||||
}
|
||||
|
||||
// 构造请求成功的响应数据
|
||||
return Promise.resolve(bodyData)
|
||||
|
||||
}).catch(res => {
|
||||
if(res.status==401){
|
||||
storageManage.token(null, true)
|
||||
infoBox.showErrorToast(res.message||'请登录').then(() => {
|
||||
uni.redirectTo({url: '/pages/login/index'})
|
||||
reject()
|
||||
})
|
||||
}
|
||||
// if(res.status==400){
|
||||
// storageManage.token(null, true)
|
||||
// infoBox.showErrorToast('').then(() => {
|
||||
// go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
// })
|
||||
// }
|
||||
if(res.status==500){
|
||||
infoBox.showErrorToast(res.message||'服务器异常').then(() => {
|
||||
})
|
||||
}
|
||||
// if(res&&res.msg){
|
||||
// infoBox.showErrorToast(res.msg)
|
||||
// }
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
|
||||
// 如果没有提示错误, 那么此处提示 异常。
|
||||
if (!isShowErrorToast) {
|
||||
infoBox.showErrorToast(`请求网络异常`)
|
||||
}
|
||||
|
||||
return Promise.reject(res)
|
||||
|
||||
}).finally(() => { // finally 是 then结束后再执行, 此处不适用。 需要在请求完成后立马调用: reqFinishFunc()
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||
function req(uri, data, method = "GET", showLoading = true, extParams = {}) {
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
url: baseUrl + uri,
|
||||
data: data,
|
||||
method: method,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 默认 显示loading(控制 xxs 内 不提示loading )
|
||||
function request(args) {
|
||||
const {
|
||||
url,
|
||||
data,
|
||||
params,
|
||||
method = "GET",
|
||||
showLoading = true,
|
||||
extParams = {}
|
||||
} = args
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
url: baseUrl + url,
|
||||
data: params||data,
|
||||
method: method,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 上传
|
||||
function upload(uri, data, file, showLoading = true, extParams = {}) {
|
||||
// 放置token
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.uploadFile(
|
||||
Object.assign({
|
||||
url: baseUrl + uri,
|
||||
formData: data,
|
||||
name: "file",
|
||||
filePath: file.path||file.url,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
).then((httpData) => {
|
||||
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
||||
httpData.data = JSON.parse(httpData.data)
|
||||
return Promise.resolve(httpData)
|
||||
}).catch(err=>{
|
||||
uni.hideLoading()
|
||||
infoBox.showErrorToast(`上传失败`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
req: req,
|
||||
request,
|
||||
upload: upload
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import http from './http.js'
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 操作记录 */
|
||||
export function $getStockOperate(data) {
|
||||
return http.req('/api/tbProductStockOperate/list', {...data,shopId:uni.getStorageSync('shopId')}, 'POST')
|
||||
}
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
export function login(data) {
|
||||
return request({
|
||||
url: "/auth/login",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: "/auth/info",
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
export function getCodeImg(header) {
|
||||
return request({
|
||||
url: "/auth/code",
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return request({
|
||||
url: "/auth/logout",
|
||||
method: "delete"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人中心 修改密码
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function updatePass(data) {
|
||||
return request({
|
||||
url: "/api/users/updatePass",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoData(data) {
|
||||
return request({
|
||||
url: "/api/tbOrderInfo/date",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoDownload(data) {
|
||||
return request({
|
||||
url: "/api/tbOrderInfo/download",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Id查询订单
|
||||
* @param {*} id
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Id查询订单
|
||||
* @param {*} createdAt
|
||||
* @returns
|
||||
*/
|
||||
export function payCount(createdAt) {
|
||||
console.log(createdAt);
|
||||
return request({
|
||||
url: `/api/tbOrderInfo/payCount`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
createdAt: createdAt
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
* @param {*} createdAt
|
||||
* @returns
|
||||
*/
|
||||
export function tbGroupOrderInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbGroupOrderInfo`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退单
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function returnGpOrder(data) {
|
||||
return request({
|
||||
url: `/api/tbGroupOrderInfo/returnGpOrder`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 店铺订单支付获取链接
|
||||
*/
|
||||
export function $getOrderPayUrl(data) {
|
||||
return request({
|
||||
url: `/api/shopPayApi/getOrderPayUrl`,
|
||||
method: "get",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取订阅二维码
|
||||
* @returns
|
||||
*/
|
||||
export function getSubQrCode(params) {
|
||||
return request({
|
||||
url: `/api/msg/subQrCode`,
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
/**
|
||||
* 查询交班记录
|
||||
* @returns
|
||||
*/
|
||||
export function tbHandover(data) {
|
||||
return request({
|
||||
url: '/api/tbHandover?' + data,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提交交班
|
||||
* @returns
|
||||
*/
|
||||
export function handoverData(data) {
|
||||
return request({
|
||||
url: '/api/tbHandover/handoverData',
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -1,315 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
// 销售总会list
|
||||
export function summaryTrade(data) {
|
||||
return request({
|
||||
url: '/api/summary/trade',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
export function tbConsInfoFlowcount(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow/count',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 供应商列表
|
||||
export function tbShopPurveyorTransact(params) {
|
||||
return request({
|
||||
url: '/api/tbShopPurveyorTransact',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 添加供应商
|
||||
export function tbShopPurveyorpost(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑供应商
|
||||
export function tbShopPurveyorput(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 结款记录列表
|
||||
export function tbShopPurveyorTransactinfo(data) {
|
||||
return request({
|
||||
url: '/api/tbShopPurveyorTransact/info',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
// 付款
|
||||
export function tbShopPurveyorpayTransact(data) {
|
||||
return request({
|
||||
url: '/api/tbShopPurveyorTransact/payTransact',
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
||||
// 账单付款记录
|
||||
export function tbShopPurveyorTransacttransactPayInfos(params) {
|
||||
return request({
|
||||
url: '/api/tbShopPurveyorTransact/transactPayInfos',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 删除供应商列表
|
||||
export function tbShopPurveyordelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopPurveyor`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 耗材报损
|
||||
export function tbConsInfoFlowfrmLoss(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow/frmLoss',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 销售排行榜
|
||||
export function dateProduct(params) {
|
||||
return request({
|
||||
url: '/api/summary/productSaleDate',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 是否开启
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/updateStatus`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑
|
||||
export function tbPlussShopStaffDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/` + id,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
// 新增耗材类型
|
||||
export function tbConsType(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType ',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 编辑耗材类型
|
||||
export function tbConsTypeput(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo ',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取耗材类型列表
|
||||
export function tbConsTypeList(params) {
|
||||
return request({
|
||||
url: '/api/tbConsType',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 修改耗材类型
|
||||
export function edittbConsTypeput(data) {
|
||||
return request({
|
||||
url: '/api/tbConsType ',
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 添加耗材列表
|
||||
export function tbConsInfoAddlist(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo ',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 操作耗材入库
|
||||
export function tbConsInfostockInOut(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo/stockInOut ',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 获取耗材列表
|
||||
export function tbConsInfoList(params) {
|
||||
return request({
|
||||
url: '/api/tbConsInfo',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 耗材盘点
|
||||
export function tbConsInfotbConCheck(data) {
|
||||
return request({
|
||||
url: '/api/tbConCheck ',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 获取供应商列表
|
||||
export function tbShopPurveyor(params) {
|
||||
return request({
|
||||
url: '/api/tbShopPurveyor',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 桌型列表
|
||||
export function callTable(params) {
|
||||
return request({
|
||||
url: '/callTable',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 排队列表
|
||||
export function callTablequeue(params) {
|
||||
return request({
|
||||
url: '/callTable/queue',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 取号
|
||||
export function callTabletakeNumber(data) {
|
||||
return request({
|
||||
url: '/callTable/takeNumber',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
// 增减余额
|
||||
export function midfiyAccount(data) {
|
||||
return request({
|
||||
url: '/api/tbShopUser/midfiyAccount',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
// 新增会员
|
||||
export function member(data) {
|
||||
return request({
|
||||
url: '/api/member',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改会员
|
||||
export function tbShopUser(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
export function callTablecallRecord(params) {
|
||||
return request({
|
||||
url: '/callTable/callRecord',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function callTableput(data) {
|
||||
return request({
|
||||
url: `/callTable/updateState`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 叫号
|
||||
export function callTablecall(data) {
|
||||
return request({
|
||||
url: `/callTable/call`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 获取员工列表
|
||||
export function rolesGet(params) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 删除员工
|
||||
export function shopStaffDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 新增员工获取权限
|
||||
export function tbShopPermissionList() {
|
||||
return request({
|
||||
url: `/api/tbShopPermission/list`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 获取角色权限
|
||||
export function getroles() {
|
||||
return request({
|
||||
url: `/api/roles`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
export function tbConsTypes() {
|
||||
return request({
|
||||
url: `/api/tbConsType`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
export function tbPlussShopStaff(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: data.id ? "put" : "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 耗材列表
|
||||
export function viewConInfoFlowget(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfo/allAndPro`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 耗材记录
|
||||
export function tbConsInfoFlowstock(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfoFlow/stock`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
// 用户管理
|
||||
import http from './http.js'
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
const request=http.request
|
||||
|
||||
// 获取店铺会员二维码
|
||||
export function getwxacode(data) {
|
||||
return request({
|
||||
url: `/shop/storage/getwxacode`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 商家用户列表
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopUser(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/queryAllShopUser`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询商家用户概述信息
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/summary`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
isVip:1,
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,735 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺列表
|
||||
* @returns
|
||||
*/
|
||||
export function getShopList(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'get',
|
||||
params: {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺数据
|
||||
* @returns
|
||||
*/
|
||||
export function getShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo/${params}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改店铺信息
|
||||
* @returns
|
||||
*/
|
||||
export function editShopInfo(data) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'put',
|
||||
data:{
|
||||
// shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺图片
|
||||
* @returns
|
||||
*/
|
||||
export function getShopExtend(params) {
|
||||
return request({
|
||||
url: `/tbShopExtend`,
|
||||
method: 'get',
|
||||
params:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺图片
|
||||
* @returns
|
||||
*/
|
||||
export function editShopExtend(data) {
|
||||
return request({
|
||||
url: `/tbShopExtend`,
|
||||
method: 'put',
|
||||
data:{
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 商品列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbProduct(params) {
|
||||
return request({
|
||||
url: "/api/tbProduct",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductDelete(data) {
|
||||
return request({
|
||||
url: "/api/tbProduct",
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品单位列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUnit(params) {
|
||||
return request({
|
||||
url: "/api/tbShopUnit",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺基本配置
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCurrency(shopId) {
|
||||
return request({
|
||||
url: `/api/tbShopCurrency/${shopId}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺信息
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCurrencyPut(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCurrency`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUnitPost(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改单位
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUnitPut(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUnitDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺基本配置
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCurrencyGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUnit`,
|
||||
method: "get",
|
||||
params:{
|
||||
sort:'id',
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryGet(params) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增、编辑分类/新增、编辑子分类
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryPost(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopCategoryDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格增加
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductSpecPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductSpecGet(params) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格更改
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductSpecPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductSpecDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbProductSpec`,
|
||||
method: "DELETE",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分组
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGroupPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改分组
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGroupPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: "PUT",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分组列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGroupGet(params) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表(根据分组中的商品id)
|
||||
* @returns
|
||||
*/
|
||||
export function productListGet(productGroup) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup/${productGroup}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分组
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGroupDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup`,
|
||||
method: "DELETE",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductPost(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductPut(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情(单个商品)
|
||||
* product 商品id
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductGetDetail(product) {
|
||||
return request({
|
||||
url: `/api/tbProduct/${product}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加激活码
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantRegisterPost(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantRegister`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活码列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantRegisterList(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantRegister/list`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加/编辑店铺
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopInfoPost(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情(配置三方支付)
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantThirdApply(shopId) {
|
||||
return request({
|
||||
url: `/api/tbMerchantThirdApply/${shopId}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改第三方配置
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantThirdApplyPut(data) {
|
||||
return request({
|
||||
url: `/api/tbMerchantThirdApply`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置热销商品
|
||||
* @returns
|
||||
*/
|
||||
export function tbProductIsHot(params) {
|
||||
return request({
|
||||
url: `/api/tbProduct/isHot`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加/编辑优惠券
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantCoupon(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/tbMerchantCoupon`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置热销商品
|
||||
* @returns
|
||||
*/
|
||||
export function tbMerchantCouponGet(params) {
|
||||
return request({
|
||||
url: `/api/tbMerchantCoupon`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置热销商品
|
||||
* @returns
|
||||
*/
|
||||
export function geocode(params) {
|
||||
return request({
|
||||
url: `/api/geocode`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增、修改活动
|
||||
* @returns
|
||||
*/
|
||||
export function modityActivate(data) {
|
||||
return request({
|
||||
url: `/shop/storage/modityActivate`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
* @returns
|
||||
*/
|
||||
export function findActivate(params) {
|
||||
return request({
|
||||
url: `/shop/storage/findActivate`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 获取店铺会员二维码
|
||||
export function getwxacode(data) {
|
||||
return request({
|
||||
url: `/shop/storage/getwxacode`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 商家用户列表
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopUser(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/queryAllShopUser`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 查询商家用户概述信息
|
||||
* @returns
|
||||
*/
|
||||
export function queryAllShopInfo(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/summary`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品排序
|
||||
* @returns
|
||||
*/
|
||||
export function upProSort(data) {
|
||||
return request({
|
||||
url: `/api/tbProduct/upProSort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分组排序
|
||||
* @returns
|
||||
*/
|
||||
export function upGroupSort(data) {
|
||||
return request({
|
||||
url: `/api/tbProductGroup/upGroupSort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分类排序
|
||||
* @returns
|
||||
*/
|
||||
export function upCategorySort(data) {
|
||||
return request({
|
||||
url: `/api/tbShopCategory/upCategorySort`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店铺充值记录
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopUserRecharge(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/recharge`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出充值记录
|
||||
* @returns
|
||||
*/
|
||||
export function downloadTableRecharge(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/recharge/download`,
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
},
|
||||
responseType: "blob"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工列表
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlussShopStaffGet(params) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
* @returns
|
||||
*/
|
||||
export function rolesGet() {
|
||||
return request({
|
||||
url: `/api/roles`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加员工
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlussShopStaff(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: data.id ? "put" : "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取员工信息
|
||||
* @returns
|
||||
*/
|
||||
export function tbPlussShopStaffDetail(id) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改员工状态
|
||||
* @returns
|
||||
*/
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff/updateStatus`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工删除
|
||||
* @returns
|
||||
*/
|
||||
export function shopStaffDelete(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "delete",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
//增减余额
|
||||
export function midfiyAccount(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/midfiyAccount`,
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 编辑用户
|
||||
export function tbShopUseredit(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
// 通过活动id获取赠送商品列表
|
||||
export function activate(id) {
|
||||
return request({
|
||||
url: `shop/storage/activate/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 通过活动id获取赠送商品列表
|
||||
export function queryShopUserFlow(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/queryShopUserFlow`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
//新增
|
||||
|
||||
// 查询员工是否拥有权限
|
||||
export function $hasPermission(params) {
|
||||
return request({
|
||||
url: '/api/tbShopPermission/hasPermission',
|
||||
method: "get",
|
||||
params:{
|
||||
userId: uni.getStorageSync("shopUserId"),
|
||||
...params
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import http from './http.js'
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 查询库存 */
|
||||
export function $getProductSku(productId) {
|
||||
return http.req('/api/stock/sku', {productId,shopId:uni.getStorageSync('shopId')}, 'GET')
|
||||
}
|
||||
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
// 桌台管理
|
||||
import http from './http.js'
|
||||
const request = http.request
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
Base64
|
||||
} from 'js-base64'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 台桌区域 */
|
||||
export const $tableArea = new $API('/api/tbShopArea', http.req)
|
||||
/* 台桌 */
|
||||
export const $table = new $API('/api/tbShopTable', http.req)
|
||||
/* 绑定 */
|
||||
// export const $bind=new $API('/api/tbShopTable/bind',http.req)
|
||||
export function $bind(data) {
|
||||
return request({
|
||||
url: "/api/tbShopTable/bind",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
// 转/并桌
|
||||
export function tableswitch(data) {
|
||||
return request({
|
||||
url: '/api/place/switch',
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取台桌详情状态
|
||||
export function $returnTableDetail(data) {
|
||||
return request({
|
||||
url: '/api/tbShopTable/state',
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 选择台桌
|
||||
export function $choseTable(data) {
|
||||
return request({
|
||||
url: '/api/place/choseTable',
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
/**
|
||||
* 用户详情
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopInfo(shopId) {
|
||||
const _shopId=uni.getStorageSync('shopId')
|
||||
return request({
|
||||
url: `/api/tbShopInfo/${shopId||_shopId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店铺信息
|
||||
* @returns
|
||||
*/
|
||||
export function tbShopInfoPut(data) {
|
||||
return request({
|
||||
url: `/api/tbShopInfo`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 查询所属渠道升级版本
|
||||
* @returns
|
||||
*/
|
||||
export function getFindBySource(params) {
|
||||
return request({
|
||||
url: `/api/tbVersion/findBySource`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
@ -14,14 +14,9 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { onMounted, reactive } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
tbShopPurveyorTransacttransactPayInfos
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
||||
const props = defineProps({
|
||||
id: {
|
||||
type: Number
|
||||
|
|
@ -34,12 +29,12 @@
|
|||
getlist()
|
||||
})
|
||||
let getlist = () => {
|
||||
tbShopPurveyorTransacttransactPayInfos({
|
||||
type: "",
|
||||
id: props.id
|
||||
}).then(res => {
|
||||
datas.list = res
|
||||
})
|
||||
// tbShopPurveyorTransacttransactPayInfos({
|
||||
// type: "",
|
||||
// id: props.id
|
||||
// }).then(res => {
|
||||
// datas.list = res
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -103,19 +103,11 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
getCurrentInstance,
|
||||
ref,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { onMounted, getCurrentInstance, ref, reactive } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
tbShopPurveyorTransactinfo,
|
||||
tbShopPurveyorpayTransact
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import datePickerview from './components/my-date-pickerview.vue'
|
||||
|
||||
const timeList = [{
|
||||
label: '今天',
|
||||
value: 'today'
|
||||
|
|
@ -157,13 +149,13 @@
|
|||
getlist()
|
||||
})
|
||||
let confirmtow = (id) => {
|
||||
tbShopPurveyorpayTransact({
|
||||
id,
|
||||
...datas.form
|
||||
}).then(() => {
|
||||
datas.PopUp = false
|
||||
getlist()
|
||||
})
|
||||
// tbShopPurveyorpayTransact({
|
||||
// id,
|
||||
// ...datas.form
|
||||
// }).then(() => {
|
||||
// datas.PopUp = false
|
||||
// getlist()
|
||||
// })
|
||||
}
|
||||
let close = () => {
|
||||
datas.form = {}
|
||||
|
|
@ -225,18 +217,18 @@
|
|||
datas.startTime = start
|
||||
datas.endTime = end
|
||||
}
|
||||
tbShopPurveyorTransactinfo({
|
||||
// shopId: uni.getStorageSync('shopId'),
|
||||
size: 20,
|
||||
createAt: [datas.startTime, datas.endTime],
|
||||
page: 0,
|
||||
sort: "id",
|
||||
type: datas.type,
|
||||
status: datas.status,
|
||||
purveyorId: props.id
|
||||
}).then((res) => {
|
||||
datas.list = res.content
|
||||
})
|
||||
// tbShopPurveyorTransactinfo({
|
||||
// // shopId: uni.getStorageSync('shopId'),
|
||||
// size: 20,
|
||||
// createAt: [datas.startTime, datas.endTime],
|
||||
// page: 0,
|
||||
// sort: "id",
|
||||
// type: datas.type,
|
||||
// status: datas.status,
|
||||
// purveyorId: props.id
|
||||
// }).then((res) => {
|
||||
// datas.list = res.content
|
||||
// })
|
||||
}
|
||||
// 获取当前时间
|
||||
function getdate() {
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@
|
|||
<view class="">
|
||||
<up-button type="primary" shape="circle" size="mini"
|
||||
@tap="toUrl('PAGES_EDIT_SUPPLIER',{item:JSON.stringify(item)})" :plain="true" text="编辑">
|
||||
</up-button> <up-button size="mini" shape="circle" type="primary"
|
||||
@tap="deleteEvent(item.id)" :plain="true" text="删除">
|
||||
</up-button> <up-button size="mini" shape="circle" type="primary"
|
||||
style="background-color: #318AFE;color: #fff;"
|
||||
@tap="toUrl('PAGES_PAYMENT_SETTLEMENT',{id:item.id})" :plain="true" text="结款记录"></up-button>
|
||||
</up-button>
|
||||
<up-button size="mini" shape="circle" type="primary"
|
||||
@tap="deleteEvent(item.id)" :plain="true" text="删除"></up-button>
|
||||
<!-- <up-button size="mini" shape="circle" type="primary" style="background-color: #318AFE;color: #fff;"
|
||||
@tap="toUrl('PAGES_PAYMENT_SETTLEMENT',{id:item.id})" :plain="true" text="结款记录"></up-button> -->
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 200rpx;background-color: #f9f9f9;"> </view>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
<script setup>
|
||||
import { reactive,ref,onMounted } from 'vue';
|
||||
import { $tbShopCategory, $tbProductV2 } from "@/http/yskApi/goods.js"
|
||||
import { getProductPage, getCategoryList } from '@/http/api/product.js'
|
||||
const props=defineProps({
|
||||
show:{
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@
|
|||
import { reactive, ref } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { getTbShopCoupon , delTbShopCoupon} from '@/http/yskApi/coupon.js'
|
||||
|
||||
import { getCouponList } from '@/http/api/coupon.js'
|
||||
|
||||
|
|
@ -138,7 +137,6 @@
|
|||
go.to('PAGES_COUPON_DISCOUNTCOUPONS',{type: 'info', isType: 1, item: JSON.stringify(item)})
|
||||
} else {
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS',{type: 'info', isType: 2, item: JSON.stringify(item)})
|
||||
// go.to('PAGES_COUPON_CERTIFICATE',{type: 'info', item: JSON.stringify(item)})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,38 +77,11 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import tColorPicker from '@/components/t-color-picker/t-color-picker'
|
||||
import { reactive, ref, } from 'vue';
|
||||
import { onLoad, onReady } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import {
|
||||
onLoad,
|
||||
onReady
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
onMounted,
|
||||
reactive,
|
||||
nextTick,
|
||||
ref,
|
||||
onBeforeMount,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
tbProductGroupGet,
|
||||
tbProductGroupDelete,
|
||||
tbProductGroupPut,
|
||||
upGroupSort,
|
||||
tbProductGroupPost
|
||||
} from '@/http/yskApi/shop.js'
|
||||
|
||||
import { addProdGroup, updateProdGroup } from '@/http/api/product.js'
|
||||
|
||||
const $productCategory = {
|
||||
add: tbProductGroupPost,
|
||||
del: tbProductGroupDelete,
|
||||
update: tbProductGroupPut,
|
||||
get: tbProductGroupGet
|
||||
}
|
||||
|
||||
const option = reactive({
|
||||
type: ''
|
||||
})
|
||||
|
|
@ -237,7 +210,7 @@
|
|||
result.push(...returnValidateResult(category))
|
||||
|
||||
if (result.length) {
|
||||
return infoBox.showToast(result[0].errMeessage)
|
||||
return uni.$utils.showToast(result[0].errMeessage)
|
||||
}
|
||||
|
||||
if (option.type === 'edit') {
|
||||
|
|
@ -252,7 +225,7 @@
|
|||
})
|
||||
}
|
||||
|
||||
infoBox.showToast(option.type === 'edit' ? '修改成功' : '添加成功')
|
||||
uni.$utils.showToast(option.type === 'edit' ? '修改成功' : '添加成功')
|
||||
timer = setTimeout(() => {
|
||||
clearTimeout(timer)
|
||||
go.back()
|
||||
|
|
|
|||
|
|
@ -63,18 +63,11 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, onMounted, ref, watch } from 'vue';
|
||||
import myButton from '@/components/my-components/my-button';
|
||||
import myRadio from '@/components/my-components/my-radio';
|
||||
import mySwitch from '@/components/my-components/my-switch';
|
||||
import myPagination from '@/components/my-components/my-pagination'
|
||||
import $coupon from '@/http/yskApi/couponCategory.js';
|
||||
$coupon.get()
|
||||
import {
|
||||
reactive,
|
||||
onMounted,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
|
|
@ -136,13 +129,13 @@
|
|||
}
|
||||
})
|
||||
function getGoods() {
|
||||
$coupon.get(goods.query).then(res=>{
|
||||
goods.list=res.content.map(v=>{
|
||||
return {...v,checked:false}
|
||||
})
|
||||
goods.allChecked=false
|
||||
goods.totalElements=res.totalElements
|
||||
})
|
||||
// $coupon.get(goods.query).then(res=>{
|
||||
// goods.list=res.content.map(v=>{
|
||||
// return {...v,checked:false}
|
||||
// })
|
||||
// goods.allChecked=false
|
||||
// goods.totalElements=res.totalElements
|
||||
// })
|
||||
}
|
||||
getGoods()
|
||||
|
||||
|
|
|
|||
|
|
@ -36,9 +36,7 @@
|
|||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import { $tbProduct } from '@/http/yskApi/goods.js';
|
||||
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
|
|
@ -81,7 +79,7 @@
|
|||
|
||||
function confrim() {
|
||||
if(!sel.value.id){
|
||||
return infoBox.showToast('请选择选择一个规格')
|
||||
return uni.$utils.showToast('请选择选择一个规格')
|
||||
}
|
||||
emits('confirm', sel.value)
|
||||
close()
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, computed, onMounted } from 'vue';
|
||||
import { deletetbProskuCon, } from "@/http/yskApi/consumable.js";
|
||||
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import chooseHaocai from './choose-haocai.vue';
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
$productSpec
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import { reactive, nextTick, ref, } from 'vue';
|
||||
|
|
|
|||
|
|
@ -32,11 +32,7 @@
|
|||
|
||||
<script setup>
|
||||
import { reactive, ref, watch } from 'vue';
|
||||
import {
|
||||
$updateGrounding,
|
||||
$updateProductStatus,$updateProductData,
|
||||
$tbProskuConV2
|
||||
} from '@/http/yskApi/goods.js'
|
||||
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
|
|
@ -103,14 +99,7 @@
|
|||
emits('save')
|
||||
}
|
||||
|
||||
function upDateGoods(par) {
|
||||
return $updateProductData([{
|
||||
id: data.value.id,
|
||||
isSku: 1,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...par
|
||||
}])
|
||||
}
|
||||
|
||||
|
||||
let canShangXiaJia=ref(false)
|
||||
async function hasShangXiajia(tips=false){
|
||||
|
|
|
|||
|
|
@ -53,24 +53,16 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
$indexStatistics,
|
||||
$memberInfoCount
|
||||
} from '@/http/apiManager.js';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
|
||||
import cal from '@/commons/utils/cal.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import ent from '@/commons/utils/ent.js';
|
||||
import unionScan from '@/commons/utils/unionScan.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import {
|
||||
summaryTrade,
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
||||
import { getTrade } from '@/http/api/summary.js'
|
||||
onMounted(() => {
|
||||
vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt;
|
||||
if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) {
|
||||
|
|
@ -125,7 +117,7 @@
|
|||
startTime = start
|
||||
endTime = end
|
||||
}
|
||||
summaryTrade({
|
||||
getTrade({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
startTime,
|
||||
endTime,
|
||||
|
|
@ -145,14 +137,14 @@
|
|||
// 根据选择请求数据
|
||||
function refData() {
|
||||
// 获取 统计数据
|
||||
$indexStatistics(vdata.timeSelected).then(({
|
||||
bizData
|
||||
}) => {
|
||||
vdata.payAmount = bizData.totalSuccAmt;
|
||||
vdata.payCount = bizData.totalSuccNum;
|
||||
vdata.refundAmount = bizData.totalRefundAmt;
|
||||
vdata.refundCount = bizData.totalRefundNum;
|
||||
});
|
||||
// $indexStatistics(vdata.timeSelected).then(({
|
||||
// bizData
|
||||
// }) => {
|
||||
// vdata.payAmount = bizData.totalSuccAmt;
|
||||
// vdata.payCount = bizData.totalSuccNum;
|
||||
// vdata.refundAmount = bizData.totalRefundAmt;
|
||||
// vdata.refundCount = bizData.totalRefundNum;
|
||||
// });
|
||||
}
|
||||
|
||||
// 扫码动作
|
||||
|
|
@ -196,13 +188,13 @@
|
|||
return `${y}-${m}-${d}`
|
||||
}
|
||||
const getMemberData = () => {
|
||||
$memberInfoCount({
|
||||
queryDateRange: vdata.timeSelected
|
||||
}).then(({
|
||||
bizData
|
||||
}) => {
|
||||
Object.assign(memberData, bizData);
|
||||
});
|
||||
// $memberInfoCount({
|
||||
// queryDateRange: vdata.timeSelected
|
||||
// }).then(({
|
||||
// bizData
|
||||
// }) => {
|
||||
// Object.assign(memberData, bizData);
|
||||
// });
|
||||
};
|
||||
defineExpose({
|
||||
refData
|
||||
|
|
|
|||
|
|
@ -65,44 +65,6 @@
|
|||
|
||||
</view>
|
||||
|
||||
<view v-if="vdata.loginType == 'sms' ">
|
||||
<uni-forms-item name="loginPhone">
|
||||
<uni-easyinput class='jeepay-easyinput' v-model="vdata.formData.loginPhone" type="number"
|
||||
:maxlength="11" :disabled="!vdata.allowSendMsgFlag" placeholder="请输入手机号" :clearable="false">
|
||||
<template #prefixIcon>
|
||||
<image src="@/static/login/icon-phone.svg" class="input-icon" />
|
||||
</template>
|
||||
<template #suffixIcon>
|
||||
<view class='show-tips' @tap="sendSmscodeFunc">{{ vdata.sendMsgText }}</view>
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item>
|
||||
<!-- 手机验证码, 不限制数字还是本文, 如果发送为文本则无需app升级。 -->
|
||||
<view style="display: flex;">
|
||||
<uni-easyinput class='jeepay-easyinput' :maxlength="6" placeholder="请输入验证码"
|
||||
v-model="vdata.formData.vercode" :clearable="false">
|
||||
<template #prefixIcon>
|
||||
<image src="@/static/login/icon-sms-code.svg" class="input-icon" />
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
<image :src="vdata.formData.imgCodeUrl"
|
||||
style="width: 200rpx; height: 110rpx;margin-left: 10rpx;" @click="getCode" mode="">
|
||||
</image>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item name="smsCode">
|
||||
<!-- 手机验证码, 不限制数字还是本文, 如果发送为文本则无需app升级。 -->
|
||||
<uni-easyinput class='jeepay-easyinput' :maxlength="6" placeholder="请输入手机验证码"
|
||||
v-model="vdata.formData.smsCode" :clearable="false">
|
||||
<template #prefixIcon>
|
||||
<image src="@/static/login/icon-sms-code.svg" class="input-icon" />
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
|
||||
</uni-forms>
|
||||
|
||||
|
|
@ -121,19 +83,10 @@
|
|||
</template>
|
||||
<script setup>
|
||||
import { encrypt } from '@/commons/utils/rsaEncrypt.js'
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
$phoneCodeLogin,
|
||||
$sendSms
|
||||
} from '@/http/apiManager.js';
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
|
||||
import { login, authCaptcha } from '@/http/api/login.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import timer from '@/commons/utils/timer.js'
|
||||
import formUtil from '@/commons/utils/formUtil.js'
|
||||
|
|
@ -255,7 +208,7 @@
|
|||
// 表单验证
|
||||
formUtil.validate(loginFormRef.value).then(() => {
|
||||
if (!vdata.isSelectedAgreement) {
|
||||
infoBox.showToast('请勾选同意用户服务协议与隐私政策')
|
||||
uni.$utils.showToast('请勾选同意用户服务协议与隐私政策')
|
||||
return false
|
||||
}
|
||||
let loginPromise = null;
|
||||
|
|
@ -274,8 +227,6 @@
|
|||
}
|
||||
loginPromise = login(params)
|
||||
|
||||
} else if (vdata.loginType == 'sms') { // 短信验证码登录
|
||||
loginPromise = $phoneCodeLogin(vdata.formData.loginPhone, vdata.formData.smsCode)
|
||||
}
|
||||
|
||||
if (loginPromise == null) {
|
||||
|
|
@ -343,53 +294,7 @@
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击发送验证码的函数
|
||||
*/
|
||||
function sendSmscodeFunc() {
|
||||
// 按钮禁用
|
||||
if (!vdata.allowSendMsgFlag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证失败
|
||||
if (!formUtil.regexp.mobile.test(vdata.formData.loginPhone)) {
|
||||
return infoBox.showToast("请输入正确的手机号")
|
||||
}
|
||||
|
||||
if (!vdata.formData.vercode) {
|
||||
return infoBox.showToast("请输入图像验证码");
|
||||
}
|
||||
|
||||
vdata.allowSendMsgFlag = false; // 按钮禁用
|
||||
|
||||
|
||||
let data = {
|
||||
phone: vdata.formData.loginPhone,
|
||||
vercode: vdata.formData.vercode,
|
||||
vercodeToken: vdata.formData.vercodeToken,
|
||||
}
|
||||
|
||||
// 发送短信验证码
|
||||
$sendSms(data, 'auth').then(({
|
||||
bizData
|
||||
}) => {
|
||||
infoBox.showSuccessToast('验证码发送成功')
|
||||
timer.startTimeoutTask(1, 60, (subTime) => {
|
||||
|
||||
if (subTime <= 0) { // 任务结束
|
||||
vdata.sendMsgText = '发送验证码'
|
||||
vdata.allowSendMsgFlag = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
vdata.sendMsgText = `${subTime}s后可重新发送`
|
||||
})
|
||||
}).catch(() => {
|
||||
vdata.allowSendMsgFlag = true;
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { $getTreaty } from '@/http/apiManager.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { nextTick } from 'vue';
|
||||
|
||||
|
|
@ -17,9 +16,9 @@ let vdata = reactive({
|
|||
content: '',
|
||||
})
|
||||
onLoad(() => {
|
||||
$getTreaty().then(({ bizData }) => {
|
||||
vdata.content = bizData.privacyPolicy
|
||||
})
|
||||
// $getTreaty().then(({ bizData }) => {
|
||||
// vdata.content = bizData.privacyPolicy
|
||||
// })
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -9,16 +9,15 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { $getTreaty } from '@/http/apiManager.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
let vdata = reactive({
|
||||
content: '',
|
||||
})
|
||||
onLoad(() => {
|
||||
$getTreaty().then(({ bizData }) => {
|
||||
vdata.content = bizData.serviceAgreement
|
||||
})
|
||||
// $getTreaty().then(({ bizData }) => {
|
||||
// vdata.content = bizData.serviceAgreement
|
||||
// })
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
import { nextTick, reactive, ref } from 'vue';
|
||||
import { onReachBottom, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { getShopList } from '@/http/yskApi/shop.js'
|
||||
// import { getShopList } from '@/http/api/shop.js'
|
||||
|
||||
const vdata = reactive({
|
||||
shopList:[
|
||||
|
|
@ -54,9 +54,9 @@ onShow(() => {
|
|||
})
|
||||
|
||||
let getshopList = () => {
|
||||
getShopList().then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
// getShopList().then((res) => {
|
||||
// console.log(res)
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -75,19 +75,10 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
defineProps
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import { reactive, defineProps } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
$table,
|
||||
tableswitch
|
||||
} from '@/http/yskApi/table.js'
|
||||
|
||||
import { getShopTable } from '@/http/api/table.js'
|
||||
let datas = reactive({
|
||||
current: 0,
|
||||
|
|
@ -137,13 +128,13 @@
|
|||
if (datas.current == 0) {
|
||||
// 转桌是否选择菜品
|
||||
if (datas.changeTable.length) {
|
||||
let res = await tableswitch({
|
||||
masterId: datas.item[0].masterId,
|
||||
useType: datas.item[0].useType,
|
||||
cartIds: datas.changeTable,
|
||||
currentTableId: datas.item[0].tableId,
|
||||
targetTableId: datas.selecttableList
|
||||
})
|
||||
// let res = await tableswitch({
|
||||
// masterId: datas.item[0].masterId,
|
||||
// useType: datas.item[0].useType,
|
||||
// cartIds: datas.changeTable,
|
||||
// currentTableId: datas.item[0].tableId,
|
||||
// targetTableId: datas.selecttableList
|
||||
// })
|
||||
if (res) {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue