Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
74
commons/goodsData.js
Normal file
74
commons/goodsData.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import dayjs from "dayjs";
|
||||
export const $types = [{
|
||||
title: "计量商品",
|
||||
desc: '单价购买',
|
||||
value: 'normal'
|
||||
},
|
||||
{
|
||||
title: "多规格",
|
||||
desc: '多种不同规格',
|
||||
value: 'sku'
|
||||
},
|
||||
{
|
||||
title: "套餐组合",
|
||||
desc: '选择多种组合',
|
||||
value: 'group'
|
||||
},
|
||||
{
|
||||
title: "称重商品",
|
||||
desc: '按重量售卖',
|
||||
value: 'weight'
|
||||
},
|
||||
{
|
||||
title: "时价商品",
|
||||
desc: '收银端可更改价格',
|
||||
value: 'currentPrice'
|
||||
}
|
||||
]
|
||||
|
||||
// 商品默认sku
|
||||
export const $defaultSku = {
|
||||
salePrice: '',
|
||||
memberPrice: '',
|
||||
costPrice: '',
|
||||
originPrice: '',
|
||||
// stockNumber: '',
|
||||
firstShared: '',
|
||||
suit: 1,
|
||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`,
|
||||
}
|
||||
|
||||
|
||||
// 库存记录筛选类型
|
||||
export const $invoicingType = [{
|
||||
text: '全部',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '供应商入库',
|
||||
value: 'purveyor'
|
||||
},
|
||||
{
|
||||
text: '供应商退货',
|
||||
value: 'reject'
|
||||
},
|
||||
{
|
||||
text: '其他入库',
|
||||
value: 'purchase'
|
||||
},
|
||||
{
|
||||
text: '其他出库',
|
||||
value: 'other-out'
|
||||
}
|
||||
]
|
||||
|
||||
// 页面常用数据
|
||||
export const $pageData = {
|
||||
query: {
|
||||
page: 0,
|
||||
size: 10
|
||||
},
|
||||
totalElements: 0,
|
||||
list: [],
|
||||
hasAjax: false,
|
||||
}
|
||||
@@ -30,5 +30,9 @@ export const $status = {
|
||||
cleaning: {
|
||||
label: "待清台",
|
||||
type: "#FAAD14",
|
||||
}
|
||||
},
|
||||
unbind: {
|
||||
label: "未绑定",
|
||||
type: "rgb(221,221,221)",
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
<!--
|
||||
组件功能: 省市县三级联动选择
|
||||
@author terrfly
|
||||
@site https://www.jeequan.com
|
||||
@date 2022/11/30 13:25
|
||||
-->
|
||||
<template>
|
||||
<uni-data-picker :localdata=" type=='mccAli'? mccAli : areaCodeData" v-model="vdata.selectedVal" @change="changeFunc">
|
||||
<template #default="{data, error, options}">
|
||||
<view v-if="error" class="error">
|
||||
<text>{{error}}</text>
|
||||
</view>
|
||||
<view v-else-if="data.length" class="selected">
|
||||
<text style="font-size: 32rpx;">{{data.map(v=>v.text).join('/')}}</text>
|
||||
</view>
|
||||
<view v-else>
|
||||
<text :class="{'place-style':!vdata.selectedVal}" style="font-size: 32rpx;">请选择</text>
|
||||
</view>
|
||||
</template>
|
||||
</uni-data-picker>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted, watch } from 'vue'
|
||||
import dataKit from '@/commons/utils/dataKit.js'
|
||||
import areaCodeData from "./areaCodeData.json" // 地址
|
||||
import mccAli from "@/commons/JSON/mccAli.json"
|
||||
|
||||
// emit 父组件使用: v-model="val" 进行双向绑定。
|
||||
const emit = defineEmits(['update:areacodeList'])
|
||||
|
||||
// 定义组件参数
|
||||
const props = defineProps({
|
||||
|
||||
// 省市县, 三级 数组 支持双向绑定。
|
||||
areacodeList: { type: Array, default: () => [] },
|
||||
// json 类型
|
||||
type:{type:String}
|
||||
})
|
||||
|
||||
// 当前组件参数
|
||||
const vdata = reactive({
|
||||
|
||||
selectedVal: '',
|
||||
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if(props.areacodeList.length > 0 ){
|
||||
vdata.selectedVal = props.areacodeList[2]
|
||||
}
|
||||
})
|
||||
|
||||
// 切换时
|
||||
watch(() => props.areacodeList, (newVal, oldVal) => {
|
||||
if(Array.isArray(newVal)){
|
||||
vdata.selectedVal = newVal[newVal.length - 1]
|
||||
}else if(typeof newVal =='string'){
|
||||
vdata.selectedVal = [newVal]
|
||||
}
|
||||
})
|
||||
|
||||
function changeFunc(e){
|
||||
let data = []
|
||||
|
||||
if(e.detail.value && e.detail.value.length > 0 ){
|
||||
emit("update:areacodeList",e.detail.value.map(v=> v.value) )
|
||||
}else{
|
||||
emit("update:areacodeList", [] )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 根据最后一位的(县级编码 搜索展开全部内容 )
|
||||
function resetBySingleAreacode(areacode){
|
||||
|
||||
if(!areacode){
|
||||
return
|
||||
}
|
||||
|
||||
let p3 = dataKit.recursionTreeData(areaCodeData, (r => r.value == areacode))
|
||||
if(!p3){
|
||||
return false
|
||||
}
|
||||
|
||||
let p2 = dataKit.recursionTreeData(areaCodeData, (r => r.value == p3[1].value))
|
||||
if(!p2){
|
||||
return false
|
||||
}
|
||||
|
||||
let p1 = dataKit.recursionTreeData(areaCodeData, (r => r.value == p2[1].value))
|
||||
if(!p1){
|
||||
return false
|
||||
}
|
||||
|
||||
emit("update:areacodeList", [p1[0].value, p2[0].value, p3[0].value])
|
||||
|
||||
}
|
||||
|
||||
/** 根据省市县areaCode 获取省市县名称数据 **/
|
||||
function getNameListBySingleAreacode(areacode){
|
||||
|
||||
if(!areacode){
|
||||
return
|
||||
}
|
||||
|
||||
let p3 = dataKit.recursionTreeData(areaCodeData, (r => r.value == areacode))
|
||||
if(!p3){
|
||||
return false
|
||||
}
|
||||
|
||||
let p2 = dataKit.recursionTreeData(areaCodeData, (r => r.value == p3[1].value))
|
||||
if(!p2){
|
||||
return false
|
||||
}
|
||||
|
||||
let p1 = dataKit.recursionTreeData(areaCodeData, (r => r.value == p2[1].value))
|
||||
if(!p1){
|
||||
return false
|
||||
}
|
||||
|
||||
return [p1[0].text, p2[0].text, p3[0].text]
|
||||
|
||||
}
|
||||
|
||||
|
||||
defineExpose({resetBySingleAreacode, getNameListBySingleAreacode})
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.place-style{
|
||||
color: #b3b3b3;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
@@ -129,7 +129,7 @@
|
||||
mode: {
|
||||
//all date time
|
||||
type: String,
|
||||
default: 'all'
|
||||
default: 'time'
|
||||
},
|
||||
yearsLen:{
|
||||
type: Number,
|
||||
|
||||
58
http/yskApi/coupon.js
Normal file
58
http/yskApi/coupon.js
Normal file
@@ -0,0 +1,58 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
@@ -15,11 +15,15 @@ import {
|
||||
} 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://admintestpapi.sxczgkj.cn'
|
||||
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||
|
||||
//预发布
|
||||
let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||
|
||||
//正式
|
||||
// let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
||||
|
||||
// 王伟本地测
|
||||
// let baseUrl = '/ww'
|
||||
@@ -127,8 +131,9 @@ function commonsProcess(showLoading, httpReqCallback) {
|
||||
}).catch(res => {
|
||||
if(res.status==401){
|
||||
storageManage.token(null, true)
|
||||
infoBox.showErrorToast('请登录').then(() => {
|
||||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
infoBox.showErrorToast(res.message||'请登录').then(() => {
|
||||
uni.redirectTo({url: '/pages/login/index'})
|
||||
reject()
|
||||
})
|
||||
}
|
||||
// if(res.status==400){
|
||||
@@ -138,9 +143,7 @@ function commonsProcess(showLoading, httpReqCallback) {
|
||||
// })
|
||||
// }
|
||||
if(res.status==500){
|
||||
storageManage.token(null, true)
|
||||
infoBox.showErrorToast('请登录').then(() => {
|
||||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
infoBox.showErrorToast(res.message||'服务器异常').then(() => {
|
||||
})
|
||||
}
|
||||
// if(res&&res.msg){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 桌台管理
|
||||
import http from './http.js'
|
||||
const request=http.request
|
||||
const request = http.request
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
|
||||
/* 台桌区域 */
|
||||
export const $tableArea=new $API('/api/tbShopArea',http.req)
|
||||
export const $tableArea = new $API('/api/tbShopArea', http.req)
|
||||
/* 台桌 */
|
||||
export const $table=new $API('/api/tbShopTable',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) {
|
||||
@@ -23,4 +23,28 @@ export function $bind(data) {
|
||||
...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
|
||||
}
|
||||
});
|
||||
}
|
||||
178
pageCoupon/components/select-goods.vue
Normal file
178
pageCoupon/components/select-goods.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<up-popup :show="show" @close="close" round="20" mode="bottom">
|
||||
<view class="head">
|
||||
<text></text>
|
||||
<text class="title">请选择</text>
|
||||
<up-icon @tap="close" name="close-circle-fill" color="#333" size="20"></up-icon>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="category">
|
||||
<view class="category_item" @tap="itemClick(item,index)" :class="{active:index===category.active}" v-for="(item,index) in category.list" :key="index">{{item.name}}</view>
|
||||
</view>
|
||||
<up-radio-group v-model="goodsValue" @change="groupChange" style="width: 100%;display: initial;">
|
||||
<view class="goodsList">
|
||||
<view class="goodsItem" @tap="goodsClick(item,index)" v-for="(item,index) in category.goodsList" :key="index">
|
||||
<view>{{item.name}}</view>
|
||||
<up-radio
|
||||
:key="item.id"
|
||||
:name="item.id"
|
||||
@change="groupChange"
|
||||
>
|
||||
</up-radio>
|
||||
</view>
|
||||
</view>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="bomBtn">
|
||||
<view class="affirm" @tap="affirm">确定</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive,ref,onMounted } from 'vue';
|
||||
import {
|
||||
$tbShopCategory,
|
||||
$tbProductV2
|
||||
} from "@/http/yskApi/goods.js"
|
||||
const props=defineProps({
|
||||
show:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
})
|
||||
const emits=defineEmits(['itemClick','close', "affirm"])
|
||||
const category=reactive({
|
||||
list:[],
|
||||
goodsList:[],
|
||||
active: 0,
|
||||
query: {
|
||||
page: 0,
|
||||
size: 999,
|
||||
categoryId: '',
|
||||
sort: "createdAt,desc",
|
||||
}
|
||||
})
|
||||
let goodsValue = ref('');
|
||||
let show=ref(false)
|
||||
|
||||
function itemClick(item,index){
|
||||
category.active = index;
|
||||
category.query.categoryId = item.id;
|
||||
getGoodsList()
|
||||
}
|
||||
function goodsClick (item,index) {
|
||||
goodsValue.value = item.id;
|
||||
}
|
||||
function groupChange ( n ) {
|
||||
// console.log(n)
|
||||
}
|
||||
function getCategoryList () {
|
||||
$tbShopCategory({
|
||||
page:0,size:200
|
||||
}).then(res=>{
|
||||
category.list = res.content;
|
||||
category.query.categoryId = res.content[0].id
|
||||
getGoodsList()
|
||||
})
|
||||
}
|
||||
function getGoodsList () {
|
||||
$tbProductV2(category.query).then(res => {
|
||||
category.goodsList = res.content.map(v => {
|
||||
return {
|
||||
...v,
|
||||
isSellNone: false,
|
||||
checked: false,
|
||||
showDetail: false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
function open(){
|
||||
show.value = true;
|
||||
getCategoryList();
|
||||
}
|
||||
|
||||
function close(){
|
||||
show.value = false;
|
||||
category.active = 0;
|
||||
goodsValue.value = "";
|
||||
emits('close')
|
||||
}
|
||||
/**
|
||||
* 确认
|
||||
*/
|
||||
function affirm() {
|
||||
let item;
|
||||
category.goodsList.forEach((v,e)=>{
|
||||
if ( v.id == goodsValue.value) {
|
||||
item = v;
|
||||
}
|
||||
})
|
||||
emits('affirm',item)
|
||||
close();
|
||||
}
|
||||
defineExpose({
|
||||
open,close,affirm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.head{
|
||||
display: flex;
|
||||
padding: 32rpx 28rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
display: flex;
|
||||
height: 672rpx;
|
||||
.category{
|
||||
min-width: 316rpx;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
background: #F9F9F9;
|
||||
.category_item{
|
||||
padding: 22rpx 24rpx;
|
||||
border-left: 8rpx solid transparent;
|
||||
}
|
||||
.active{
|
||||
border-left: 8rpx solid #318AFE;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.goodsList{
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.goodsItem{
|
||||
width: 100%;
|
||||
padding: 22rpx 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
.bomBtn{
|
||||
padding: 16rpx 38rpx 32rpx 38rpx;
|
||||
background-color: #fff;
|
||||
.affirm{
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
background: #318AFE;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,279 +1,326 @@
|
||||
<template>
|
||||
<!-- 基础赠送设置切换 -->
|
||||
<view class="foundation">
|
||||
<view :class="[switchTop==1?'active':'']" @click="switchTop =1">
|
||||
基础设置
|
||||
</view>
|
||||
<view :class="[switchTop==2?'active':'']" @click="switchTop=2">
|
||||
赠送设置
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="content1">
|
||||
<view>
|
||||
折扣名称
|
||||
<view class="card">
|
||||
<view class="item">
|
||||
<view class="lable">优惠券名称</view>
|
||||
<view class="value">
|
||||
<up-input v-model="formData.title" placeholder="填写名称" border="none" clearable ></up-input>
|
||||
</view>
|
||||
</view>
|
||||
<input type="text" placeholder="填写名称" />
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
折扣(%)
|
||||
</view>
|
||||
<input type="text" placeholder="填写名称" />
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<input type="text" placeholder="隔多少元,可用 " />
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
优惠券类型
|
||||
</view>
|
||||
<radio-group @change="radioChange" style="margin-top: 16rpx;">
|
||||
<radio style="transform:scale(0.7)">单次折扣券</radio>
|
||||
<radio style="transform:scale(0.7)">储值折扣券</radio>
|
||||
</radio-group>
|
||||
<view class="siwtichStyle">
|
||||
<span>最大抵扣金额</span>
|
||||
<switch color="#FFCC33" style="transform:scale(0.7)" />
|
||||
</view>
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
抵扣规则
|
||||
</view>
|
||||
从最高价开始抵扣
|
||||
<view class="siwtichStyle">
|
||||
<span>可抵扣件数</span>
|
||||
<switch color="#FFCC33" style="transform:scale(0.7)" />
|
||||
</view>
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
有效期类型
|
||||
</view>
|
||||
领券后有效期内可用
|
||||
<view class="siwtichStyle">
|
||||
<span>有效期(天)</span>
|
||||
<input type="text" placeholder="填写天数 " />
|
||||
</view>
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
隔天生效
|
||||
</view>
|
||||
<input type="text" placeholder="隔多少天,生效 " />
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
总发放数量
|
||||
</view>
|
||||
<input type="text" placeholder="填写数量" />
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
</view>
|
||||
<view class="content2">
|
||||
<view class="">
|
||||
可用门店
|
||||
</view>
|
||||
<view class="">
|
||||
<span>进本店可用</span>
|
||||
<span>></span>
|
||||
<view class="item">
|
||||
<view class="lable">使用门槛</view>
|
||||
<view class="value">
|
||||
<view>满</view><input v-model="formData.fullAmount" placeholder="填写金额" border="none"></input><view>元</view>,<view>减</view><input v-model="formData.discountAmount" placeholder="填写金额" border="none"></input><view>元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content2">
|
||||
<view class="">
|
||||
可用商品
|
||||
</view>
|
||||
<view class="">
|
||||
<span>指定商品可用</span>
|
||||
<span>></span>
|
||||
</view>
|
||||
|
||||
<view class="siwtichStyle">
|
||||
<!-- <span>选择商品</span> -->
|
||||
<!-- <view class=""> -->
|
||||
<span>选择商品</span>
|
||||
<input type="text" placeholder="选择指定商品 " />
|
||||
<span>></span>
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="content2">
|
||||
<view class="">
|
||||
<view class="card">
|
||||
<view class="item">
|
||||
<view class="lable">有效期类型</view>
|
||||
<view class="value" style="display: flex;flex-direction: column;align-items: flex-start;">
|
||||
<view>
|
||||
<up-radio-group v-model="formData.validityType" @change="typeChange('validityType')">
|
||||
<up-radio name="fixed" label="领券后有效期内可用" style="margin-right: 30rpx;"></up-radio>
|
||||
<up-radio name="custom" label="固定有效期范围内可用"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="date" v-if="formData.validityType=='custom'">
|
||||
<!-- {{formData.useStartTime +'—'+ formData.useEndTime}} -->
|
||||
<view @click="typeChange('validityType')">{{ formData.validStartTime || '开始时间'}}</view>--
|
||||
<view @click="typeChange('validityType')">{{ formData.validEndTime || '结束时间'}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<span>更多设置</span>
|
||||
<span>></span>
|
||||
<view class="item">
|
||||
<view class="lable">有效期(天)</view>
|
||||
<view class="value">
|
||||
<up-input v-model="formData.validDays" placeholder="填写天数" border="none"></up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lable">隔天生效<up-icon @click="modalShow(1)" name="question-circle" color="#999" size="20" style="margin-left: 10rpx;"></up-icon></view>
|
||||
<view class="value">
|
||||
<view>隔</view><input v-model="formData.daysToTakeEffect" placeholder="填写天数" border="none" ></input><view>天生效</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lable">可用日期</view>
|
||||
<view class="value">
|
||||
<up-checkbox-group v-model="formData.userDays" placement="row" @change="checkboxChange" >
|
||||
<up-checkbox
|
||||
:customStyle="{marginBottom: '8px',marginRight: '15px'}"
|
||||
v-for="(item, index) in pageData.value"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.name"
|
||||
>
|
||||
</up-checkbox>
|
||||
</up-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lable">指定时间段可用</view>
|
||||
<view class="value" style="display: flex;flex-direction: column;align-items: flex-start;">
|
||||
<view>
|
||||
<up-radio-group v-model="formData.useTimeType" >
|
||||
<up-radio name="all" label="全时段可用" style="margin-right: 30rpx;"></up-radio>
|
||||
<up-radio name="custom" label="指定时段可用"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="time" v-if="formData.useTimeType=='custom'">
|
||||
<!-- {{formData.useStartTime +'—'+ formData.useEndTime}} -->
|
||||
<view @click="useTimeChange('useStartTime')">{{ formData.useStartTime || '开始时间'}}</view>--
|
||||
<view @click="useTimeChange('useEndTime')">{{ formData.useEndTime || '结束时间'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content2">
|
||||
<view>
|
||||
指定时间段可用
|
||||
</view>
|
||||
<radio-group @change="radioChange" style="margin-top: 16rpx;">
|
||||
<radio style="transform:scale(0.7)">全时段可用</radio>
|
||||
<radio style="transform:scale(0.7)">指定时段可用</radio>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view class="content2">
|
||||
<view class="">
|
||||
发放方式
|
||||
</view>
|
||||
<view class="">
|
||||
<span>用户不可自行领取</span>
|
||||
<span>></span>
|
||||
<view class="card">
|
||||
<view class="item">
|
||||
<view class="lable">总发放数量
|
||||
<up-icon @click="modalShow(2)" name="question-circle" color="#999" size="20" style="margin-left: 10rpx;"></up-icon>
|
||||
</view>
|
||||
<view class="value">
|
||||
<up-input v-model="formData.number" placeholder="填写数量" border="none" clearable ></up-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content1">
|
||||
<view>
|
||||
每人领取限量
|
||||
</view>
|
||||
不限量
|
||||
<hr style="margin-top: 24rpx;color: #E5E5E5;" />
|
||||
<view class="siwtichStyle2">
|
||||
<span>不限量</span>
|
||||
<switch color="#FFCC33" style="transform:scale(0.7)" />
|
||||
</view>
|
||||
<view class="bottomPop">
|
||||
<button @click="save">保存</button>
|
||||
</view>
|
||||
<up-datetime-picker
|
||||
:show="pageData.useTimeShow"
|
||||
v-model="pageData.useTime"
|
||||
mode="time"
|
||||
@cancel="timeCancel"
|
||||
@confirm="timeConfirm"
|
||||
></up-datetime-picker>
|
||||
<my-date-pickerview @confirm="datePickerConfirm" :mode="pageData.mode" ref="datePicker"></my-date-pickerview>
|
||||
<up-modal :show="pageData.show" :title="pageData.title" @confirm="pageData.show = false" ></up-modal>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js'
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
toRef,
|
||||
watch
|
||||
ref
|
||||
} from 'vue';
|
||||
let switchTop = ref(1)
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { getTbShopCouponInfo, addTbShopCoupon } from '@/http/yskApi/coupon.js'
|
||||
const pageData = reactive({
|
||||
value: [
|
||||
{ name: "周一", },
|
||||
{ name: "周二", },
|
||||
{ name: "周三", },
|
||||
{ name: "周四", },
|
||||
{ name: "周五", },
|
||||
{ name: "周六", },
|
||||
{ name: "周日", },
|
||||
],
|
||||
mode: "",
|
||||
title: "",
|
||||
show: false,
|
||||
useTimeShow: false,
|
||||
useTime: "",
|
||||
dateType: "",
|
||||
sueDateType: "",
|
||||
})
|
||||
const formData = reactive({
|
||||
type: '1',
|
||||
title: '',
|
||||
fullAmount: null,
|
||||
discountAmount: null,
|
||||
validityType: 'fixed',
|
||||
validStartTime: '',
|
||||
validEndTime: '',
|
||||
userDays: [],
|
||||
useTimeType: 'all',
|
||||
useStartTime: '',
|
||||
useEndTime: '',
|
||||
validDays: null,
|
||||
daysToTakeEffect: null,
|
||||
number: null,
|
||||
})
|
||||
onLoad((options) => {
|
||||
if ( options.type == 'info' ) {
|
||||
pageData.id = options.id;
|
||||
getConponInfo();
|
||||
}
|
||||
})
|
||||
let datePicker = ref(null)
|
||||
let refTime = ref(null)
|
||||
|
||||
/**
|
||||
* 查看生效时间/发放数量提示
|
||||
*/
|
||||
let modalShow = ( type ) => {
|
||||
if ( type == 1) {
|
||||
pageData.title = "领取后0天后的0点0分生效";
|
||||
} else {
|
||||
pageData.title = "限用户自行领取,(当库存为 0时,集草等活动仍会赠送)";
|
||||
}
|
||||
pageData.show = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
*/
|
||||
let getConponInfo = () => {
|
||||
getTbShopCouponInfo(pageData.id).then((res) => {
|
||||
// formData = res;
|
||||
for (let item in res) {
|
||||
formData[item] = res[item]
|
||||
}
|
||||
formData.userDays = formData.userDays.split(",");
|
||||
console.log(formData)
|
||||
})
|
||||
}
|
||||
|
||||
let typeChange = ( type ) =>{
|
||||
pageData.dateType = type;
|
||||
pageData.mode = 'date'
|
||||
|
||||
if ( formData.validityType == "custom") {
|
||||
datePicker.value.open()
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 指定时间段选择
|
||||
*/
|
||||
let useTimeChange = ( type ) => {
|
||||
console.log(type)
|
||||
pageData.sueDateType = type;
|
||||
pageData.mode = 'time';
|
||||
pageData.useTimeShow = true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭时间段弹窗
|
||||
*/
|
||||
let timeCancel = () => {
|
||||
pageData.useTimeShow = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认时间端选择
|
||||
*/
|
||||
let timeConfirm = () => {
|
||||
pageData.useTimeShow = false;
|
||||
console.log(pageData.useTime)
|
||||
if ( pageData.sueDateType == 'useStartTime') { formData.useStartTime = pageData.useTime}
|
||||
if ( pageData.sueDateType == 'useEndTime') { formData.useEndTime = pageData.useTime}
|
||||
}
|
||||
|
||||
/**
|
||||
* 有效期选择
|
||||
*/
|
||||
let datePickerConfirm = (data) => {
|
||||
console.log(pageData.dateType)
|
||||
if ( pageData.dateType == 'validityType') {
|
||||
// .substring(0,10)
|
||||
formData.validStartTime = data.start;
|
||||
formData.validEndTime = data.end;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
let save = () => {
|
||||
formData.userDays = formData.userDays.toString();
|
||||
let params = {
|
||||
...formData
|
||||
}
|
||||
console.log(params)
|
||||
addTbShopCoupon(params).then((res) => {
|
||||
// console.log(res)
|
||||
go.back(1)
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.foundation {
|
||||
width: 694rpx;
|
||||
height: 70rpx;
|
||||
background: #E6F0FF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 36rpx auto;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 344rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
color: #318AFE;
|
||||
}
|
||||
|
||||
.active {
|
||||
margin: auto;
|
||||
width: 344rpx;
|
||||
height: 56rpx;
|
||||
background: #318AFE;
|
||||
color: #fff;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.content {
|
||||
width: 750rpx;
|
||||
background: #F9F9F9;
|
||||
padding: 32rpx;
|
||||
padding: 32rpx 28rpx 150rpx 28rpx;
|
||||
|
||||
.content1 {
|
||||
background-color: #fff;
|
||||
.card{
|
||||
padding: 32rpx 24rpx;
|
||||
|
||||
>input {
|
||||
margin-top: 16rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 32rpx;
|
||||
.item{
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
margin-bottom: 24rpx;
|
||||
.lable{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.value{
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
input{
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.date,.time{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
margin-top: 10rpx;
|
||||
view{
|
||||
border: 1rpx solid #999;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 10rpx
|
||||
}
|
||||
view:nth-child(1){
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
view:nth-child(2){
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
.time{
|
||||
view{
|
||||
padding: 10rpx 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
>view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.siwtichStyle {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
width: 646rpx;
|
||||
height: 104rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
}
|
||||
.siwtichStyle2 {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
width: 646rpx;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
.item:last-child{
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.content2 {
|
||||
padding: 32rpx 24rpx;
|
||||
margin: 32rpx 0;
|
||||
box-sizing: border-box;
|
||||
width: 694rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
>view:first-child {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
>view:nth-child(3) {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 16rpx;
|
||||
background: #FFFFFF;
|
||||
width: 646rpx;
|
||||
height: 154rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
}
|
||||
|
||||
.siwtichStyle {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx;
|
||||
width: 646rpx;
|
||||
height: 104rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
.bottomPop{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
>button {
|
||||
width: 530rpx;
|
||||
margin: 30rpx 0;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
background: #318AFE;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
206
pageCoupon/editCertificate.vue
Normal file
206
pageCoupon/editCertificate.vue
Normal file
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="card">
|
||||
<view class="item">
|
||||
<view class="lable">商品兑换券名称</view>
|
||||
<view class="value">
|
||||
<up-input v-model="formData.title" placeholder="填写名称" border="none" clearable ></up-input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lable">使用门槛</view>
|
||||
<view class="value">
|
||||
<view>满</view><input v-model="formData.fullAmount" placeholder="填写金额" border="none"></input><view>元,可用</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="lable">总发放数量</view>
|
||||
<view class="value">
|
||||
<up-input v-model="formData.number" placeholder="填写数量" border="none" clearable ></up-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
|
||||
<view class="item">
|
||||
<view class="lable">指定抵扣商品</view>
|
||||
<view class="value">
|
||||
<view class="selectGoods" @tap="selectGoodsOpen">
|
||||
<view>
|
||||
<view class="title">选择商品</view>
|
||||
<view class="goodsName" v-if='formData.products.length <= 0'>选择指定商品</view>
|
||||
<view class="goodsName" v-else>
|
||||
<view class="goodsItem" v-for="(item,index) in formData.products" :key="index">
|
||||
<view class="productName">{{item.name}}</view><up-input @tap.stop="stop" style="border-bottom: 1rpx solid #666;" v-model="item.num" placeholder="填写数量" border="none" ></up-input>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-icon name="arrow-right" color="#9F9F9F" size="22"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="bottomPop">
|
||||
<button @click="save">保存</button>
|
||||
</view>
|
||||
|
||||
<select-goods ref="goods" @affirm="affirm"></select-goods>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js'
|
||||
import myActionSheet from '@/components/my-components/my-action-sheet';
|
||||
import selectGoods from './components/select-goods';
|
||||
import { getTbShopCouponInfo, addTbShopCoupon } from '@/http/yskApi/coupon.js'
|
||||
import { reactive, ref } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
const pageData = reactive({
|
||||
id: null,
|
||||
goodsData: null,
|
||||
title: "",
|
||||
show: false,
|
||||
})
|
||||
let formData = reactive({
|
||||
title: "",
|
||||
type: '2',
|
||||
fullAmount: null,
|
||||
number: null,
|
||||
products: []
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
if ( options.type == 'info' ) {
|
||||
pageData.id = options.id;
|
||||
getConponInfo();
|
||||
}
|
||||
})
|
||||
|
||||
let goods = ref(null)
|
||||
let selectGoodsOpen = () => {
|
||||
goods.value.open();
|
||||
}
|
||||
|
||||
let getConponInfo = () => {
|
||||
getTbShopCouponInfo(pageData.id).then((res) => {
|
||||
// formData = res;
|
||||
for (let item in res) {
|
||||
formData[item] = res[item]
|
||||
}
|
||||
console.log(formData)
|
||||
})
|
||||
}
|
||||
|
||||
let stop = () => { }
|
||||
|
||||
let affirm = (item) => {
|
||||
pageData.goodsData = item;
|
||||
formData.products = [];
|
||||
formData.products.push({
|
||||
productId: item.id,
|
||||
name: item.name,
|
||||
num: null
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
let save = () => {
|
||||
let params = {
|
||||
...formData
|
||||
}
|
||||
addTbShopCoupon(params).then((res) => {
|
||||
go.back(1)
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.content {
|
||||
background: #F9F9F9;
|
||||
padding: 32rpx 28rpx 150rpx 28rpx;
|
||||
|
||||
.card{
|
||||
padding: 32rpx 24rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 32rpx;
|
||||
.item{
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
margin-bottom: 24rpx;
|
||||
.lable{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.value{
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
input{
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.selectGoods{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx 16rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.goodsName{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.goodsItem{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.productName{
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item:last-child{
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.bottomPop{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
>button {
|
||||
width: 530rpx;
|
||||
margin: 30rpx 0;
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
color: #fff;
|
||||
background: #318AFE;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,353 +1,209 @@
|
||||
<template>
|
||||
<!-- 顶部菜单 -->
|
||||
<view class="tagClass">
|
||||
<view class="tag-item" @tap="pageData.status.active=index" :class="{active:index===pageData.status.active}"
|
||||
<view class="tag-item" @tap="tagClick(item)" :class="{active:item.type===pageData.query.type}"
|
||||
v-for="(item,index) in pageData.status.list" :key="index">
|
||||
{{item}}
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜搜 -->
|
||||
<view class="search">
|
||||
<view class="inputsearch">
|
||||
搜索优惠券名称
|
||||
</view>
|
||||
<!-- <view class="search">
|
||||
<up-input
|
||||
placeholder="搜索优惠券名称"
|
||||
prefixIcon="search"
|
||||
shape="circle"
|
||||
border="none"
|
||||
fontSize="14px"
|
||||
prefixIconStyle="font-size: 28px;color: #999;"
|
||||
:customStyle="{backgroundColor:'#F9F9F9',padding: '10rpx 18rpx'}"
|
||||
></up-input>
|
||||
<view class="searchBtn">
|
||||
搜索
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 内容 -->
|
||||
<view class="couponContent">
|
||||
<view class="couponContentList">
|
||||
<view class="couponContentList">
|
||||
<view class="couponContent" v-for="(item,index) in pageData.couponList" :key="index">
|
||||
|
||||
<view class="couponContentListTop">
|
||||
<view>
|
||||
充值20元优惠券
|
||||
</view>
|
||||
<view>
|
||||
ID:258792
|
||||
</view>
|
||||
<view class="title"> {{ item.title }} </view>
|
||||
<view> ID:{{item.id}} </view>
|
||||
</view>
|
||||
<view class="couponContentListcontent">
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
<view> 使用门槛 </view>
|
||||
<view> 满 {{ item.fullAmount }} 元减 {{ item.discountAmount }} 元 </view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
券类型
|
||||
</view>
|
||||
<view>
|
||||
店铺领取可用
|
||||
</view>
|
||||
<view> 领取方式 </view>
|
||||
<view> 用户不可自行领取 </view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
<view> 有效期 </view>
|
||||
<view> 领券后{{ item.validDays }}天过期 </view>
|
||||
</view>
|
||||
<view class="JQclass">
|
||||
|
||||
<image :src="'/static/coupon/qrcode.svg'" mode="scaleToFill" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListcontent2">
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
<view class="num"> {{ item.number }} </view>
|
||||
<view class="lable"> 发放数量 </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
<view class="num"> {{ item.number-item.leftNumber }} </view>
|
||||
<view class="lable"> 已领取 </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
<view class="num"> {{ item.leftNumber }} </view>
|
||||
<view class="lable"> 剩余 </view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
<view class="num"> {{ item.useNumber }} </view>
|
||||
<view class="lable"> 已使用 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListbottom">
|
||||
<button>编辑</button>
|
||||
<button>删除</button>
|
||||
<button>同步</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContent">
|
||||
<view class="couponContentList">
|
||||
<view class="couponContentListTop">
|
||||
<view>
|
||||
充值20元优惠券
|
||||
</view>
|
||||
<view>
|
||||
ID:258792
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListcontent">
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
券类型
|
||||
</view>
|
||||
<view>
|
||||
店铺领取可用
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view class="JQclass">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListcontent2">
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListbottom">
|
||||
<button>编辑</button>
|
||||
<button>删除</button>
|
||||
<button>同步</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContent">
|
||||
<view class="couponContentList">
|
||||
<view class="couponContentListTop">
|
||||
<view>
|
||||
充值20元优惠券
|
||||
</view>
|
||||
<view>
|
||||
ID:258792
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListcontent">
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
券类型
|
||||
</view>
|
||||
<view>
|
||||
店铺领取可用
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
使用门槛门槛
|
||||
</view>
|
||||
<view>
|
||||
满200.00元减20.00元
|
||||
</view>
|
||||
</view>
|
||||
<view class="JQclass">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListcontent2">
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
1000
|
||||
</view>
|
||||
<view class="">
|
||||
发放数量
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponContentListbottom">
|
||||
<button>编辑</button>
|
||||
<button>删除</button>
|
||||
<button>同步</button>
|
||||
<button @tap="editCoupon(item)">编辑</button>
|
||||
<button @tap="delCoupon(item)">删除</button>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="pageData.couponList.length">
|
||||
<my-pagination :page="pageData.query.page" :totalElements="pageData.totalElements" :size="pageData.query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="bottomPop">
|
||||
<button @click="adddiscount">+添加满减优惠券</button>
|
||||
<button @click="addCoupon">+添加{{pageData.status.tagName}}</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { getTbShopCoupon , delTbShopCoupon} from '@/http/yskApi/coupon.js'
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
toRef,
|
||||
watch
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import { onLoad, onShow,onPageScroll,
|
||||
onPullDownRefresh,
|
||||
onReachBottom, } from '@dcloudio/uni-app';
|
||||
const pageData = reactive({
|
||||
status: {
|
||||
list: ['全部', '储存中储存中', '已取完', '已过期', '储存中', '已取完', '已过期', ],
|
||||
list: [
|
||||
{name: '优惠券', type: 1},
|
||||
{name: '商品兑换券', type: 2},
|
||||
],
|
||||
tagName: "优惠券",
|
||||
active: 0,
|
||||
}
|
||||
},
|
||||
query: {
|
||||
type: 1,
|
||||
page: 1,
|
||||
size: 10,
|
||||
},
|
||||
couponList: [],
|
||||
totalElements: 0,
|
||||
})
|
||||
const adddiscount = ()=>{
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS')
|
||||
|
||||
onShow(() => {
|
||||
getCoupon();
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
// pageData.query.page++
|
||||
// getCoupon()
|
||||
})
|
||||
|
||||
/**
|
||||
* tag切换
|
||||
*/
|
||||
let tagClick = ( item ) => {
|
||||
pageData.query.type = item.type;
|
||||
pageData.status.tagName = item.name;
|
||||
pageData.query.page = 1;
|
||||
getCoupon();
|
||||
}
|
||||
|
||||
// 获取优惠券列表
|
||||
let getCoupon = () => {
|
||||
let params = pageData.query;
|
||||
getTbShopCoupon(params).then((res) => {
|
||||
console.log(res)
|
||||
pageData.couponList = res.content;
|
||||
pageData.totalElements = res.totalElements;
|
||||
})
|
||||
}
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
console.log(page)
|
||||
pageData.query.page = page
|
||||
getCoupon()
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
let addCoupon = ()=>{
|
||||
if ( pageData.query.type == 1 ) {
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS')
|
||||
} else {
|
||||
go.to('PAGES_COUPON_CERTIFICATE')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
let editCoupon = (item)=>{
|
||||
console.log(item.id)
|
||||
if ( item.type == 1 ) {
|
||||
go.to('PAGES_COUPON_DISCOUNTCOUPONS',{type: 'info', id: item.id})
|
||||
} else {
|
||||
go.to('PAGES_COUPON_CERTIFICATE',{type: 'info', id: item.id})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
let delCoupon = (item) => {
|
||||
delTbShopCoupon([item.id]).then((res) => {
|
||||
getCoupon();
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
body{
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.tagClass {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
margin-top: 44rpx;
|
||||
|
||||
padding-top: 44rpx;
|
||||
padding: 32rpx 28rpx;
|
||||
background-color: #fff;
|
||||
.tag-item {
|
||||
display: inline-block;
|
||||
padding: 8rpx 22rpx;
|
||||
margin-left: 16rpx;
|
||||
padding: 10rpx 24rpx;
|
||||
margin-right: 32rpx;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
background: #F7F7FA;
|
||||
|
||||
&.active {
|
||||
background: #E6F0FF;
|
||||
color: $my-main-color;
|
||||
color: #318AFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,7 +217,8 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 32rpx;
|
||||
|
||||
background-color: #fff;
|
||||
margin-bottom: 32rpx;
|
||||
.inputsearch {
|
||||
color: #999999;
|
||||
width: 542rpx;
|
||||
@@ -382,116 +239,135 @@
|
||||
border-radius: 32rpx 32rpx 32rpx 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.couponContentList {
|
||||
/* width: 694rpx; */
|
||||
/* height: 544rpx; */
|
||||
margin: 32rpx auto 0;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0 28rpx 182rpx 28rpx;
|
||||
}
|
||||
.couponContent {
|
||||
background-color: #f9f9f9;
|
||||
padding: 32rpx 0;
|
||||
|
||||
.couponContentList {
|
||||
width: 694rpx;
|
||||
height: 544rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
margin: 0 auto;
|
||||
padding: 32rpx 24rpx;
|
||||
|
||||
.couponContentListTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
>view:last-child {
|
||||
width: 98rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
background: #F7F7FA;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
|
||||
}
|
||||
/* background-color: #f9f9f9; */
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
background: #FFFFFF;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
.couponContentListTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.couponContentListcontent {
|
||||
margin-top: 24rpx;
|
||||
padding-top: 1rpx;
|
||||
width: 646rpx;
|
||||
height: 228rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
position: relative;
|
||||
|
||||
>view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 12rpx;
|
||||
|
||||
>view:first-child {
|
||||
width: 180rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
>view:last-child {
|
||||
margin-left: 48rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
line-height: 0rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.JQclass {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
background-color: #318AFE;
|
||||
position: absolute;
|
||||
right: 48rpx;
|
||||
top: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.couponContentListcontent2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
>view:last-child {
|
||||
width: 98rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
text-align: center;
|
||||
padding-top: 24rpx;
|
||||
background: #F7F7FA;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 18rpx;
|
||||
color: #999999;
|
||||
|
||||
}
|
||||
|
||||
.couponContentListbottom {
|
||||
margin-top: 24rpx;
|
||||
|
||||
>button {
|
||||
float: right;
|
||||
width: 140rpx;
|
||||
height: 56rpx;
|
||||
margin-right: 22rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: #FFFFFF;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.couponContentListcontent {
|
||||
margin-top: 24rpx;
|
||||
padding-top: 1rpx;
|
||||
width: 646rpx;
|
||||
height: 228rpx;
|
||||
background: #F9F9F9;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
position: relative;
|
||||
|
||||
>view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 12rpx;
|
||||
|
||||
>view:first-child {
|
||||
width: 180rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
>button:first-child {
|
||||
background-color: #318afe;
|
||||
color: #fff;
|
||||
|
||||
>view:last-child {
|
||||
margin-left: 48rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
line-height: 0rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.JQclass {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
/* background-color: #318AFE; */
|
||||
position: absolute;
|
||||
right: 48rpx;
|
||||
top: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.couponContentListcontent2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
padding-top: 24rpx;
|
||||
.num{
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.lable{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.couponContentListbottom {
|
||||
margin-top: 24rpx;
|
||||
overflow: hidden;
|
||||
>button {
|
||||
float: right;
|
||||
width: 140rpx;
|
||||
height: 56rpx;
|
||||
margin-left: 22rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
background: #F7F7FA;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
>button:first-child {
|
||||
background-color: #318afe;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.couponContent:last-of-type{
|
||||
/* margin-bottom: 150rpx; */
|
||||
}
|
||||
|
||||
.bottomPop {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
||||
@@ -930,7 +930,7 @@
|
||||
import {
|
||||
$types,
|
||||
$defaultSku
|
||||
} from '../goodsData.js'
|
||||
} from '@/commons/goodsData.js'
|
||||
import {
|
||||
$getProductDetail,
|
||||
$tbShopCategory,
|
||||
|
||||
@@ -546,7 +546,7 @@
|
||||
import {
|
||||
$types,
|
||||
$defaultSku
|
||||
} from '../goodsData.js'
|
||||
} from '@/commons/goodsData.js'
|
||||
import {
|
||||
$getProductDetail,
|
||||
$tbShopCategory,
|
||||
|
||||
@@ -183,8 +183,9 @@
|
||||
import go from '@/commons/utils/go.js';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
$types,
|
||||
$defaultSku
|
||||
} from '../goodsData.js'
|
||||
} from '@/commons/goodsData.js'
|
||||
import {
|
||||
$productSpec
|
||||
} from '@/http/yskApi/goods.js';
|
||||
|
||||
@@ -78,7 +78,8 @@
|
||||
import listItem from './components/list-item';
|
||||
import {
|
||||
$pageData
|
||||
} from '../goodsData.js'
|
||||
} from '@/commons/goodsData.js'
|
||||
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
|
||||
@@ -93,8 +93,9 @@
|
||||
$getProductDetail,
|
||||
$getProductStockDetail,$getProductStockDetailSum
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import {$invoicingType} from '../goodsData.js'
|
||||
|
||||
import {
|
||||
$invoicingType
|
||||
} from '@/commons/goodsData.js'
|
||||
const search = reactive({
|
||||
keyword: '',
|
||||
show: false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
$types
|
||||
} from '@/pageProduct/goodsData.js'
|
||||
} from '@/commons/goodsData.js'
|
||||
export function returnSkuSnap(goods) {
|
||||
const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec
|
||||
let result = selectSpec.map(v => {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
||||
placeholder-style="font-size:28rpx;" placeholder="搜索" />
|
||||
</view>
|
||||
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
|
||||
<view @tap.stop="clearSearch" v-if="search.show">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
|
||||
@@ -34,7 +34,7 @@
|
||||
<view :style="{height: status.bottomHeight+'px'}"></view>
|
||||
</view>
|
||||
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide">
|
||||
<view @tap="changestatusActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
<view @tap="changestatusActive(index,item)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in status.list" :key="index">
|
||||
<view>{{item.label}}</view>
|
||||
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
@@ -54,11 +54,18 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
|
||||
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
||||
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-30 ">
|
||||
<template v-if="tables.list.length">
|
||||
<view class="u-flex u-flex-wrap u-row-between">
|
||||
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
||||
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||
</view>
|
||||
</view>
|
||||
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</template>
|
||||
|
||||
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
||||
</view>
|
||||
</view>
|
||||
@@ -239,12 +246,16 @@
|
||||
|
||||
function searchConfirm() {
|
||||
hideSearch()
|
||||
filterTableList()
|
||||
query.page=1;
|
||||
getTable()
|
||||
// tables.list = tables.originList.filter((v) =>
|
||||
// v.name.includes(search.keyword.trim())
|
||||
// );
|
||||
}
|
||||
|
||||
function clearSearch(){
|
||||
search.keyword=''
|
||||
hideSearch()
|
||||
}
|
||||
function hideSearch() {
|
||||
search.show = false
|
||||
maskHide()
|
||||
@@ -372,10 +383,17 @@
|
||||
mask.value.close()
|
||||
}
|
||||
|
||||
const query = {
|
||||
page: 0,
|
||||
const query = reactive({
|
||||
page: 1,
|
||||
size: 10,
|
||||
areaId: 0
|
||||
areaId: 0,
|
||||
totalElements:0
|
||||
})
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
console.log(page);
|
||||
query.page = page
|
||||
getTable()
|
||||
}
|
||||
const tables = reactive({
|
||||
hasAjax: false,
|
||||
@@ -392,12 +410,14 @@
|
||||
query.areaId = item.id
|
||||
}
|
||||
async function getTable() {
|
||||
let state=status.list[status.active].key
|
||||
state=state?(state=='all'?'':state):''
|
||||
const {
|
||||
content
|
||||
} = await $table.get(query)
|
||||
content,total
|
||||
} = await $table.get({...query,name:search.keyword,state})
|
||||
tables.hasAjax = true
|
||||
tables.originList = content
|
||||
filterTableList()
|
||||
query.totalElements=total||0
|
||||
tables.list = content
|
||||
}
|
||||
const areaMap = ref({})
|
||||
async function getArea() {
|
||||
@@ -415,28 +435,19 @@
|
||||
}
|
||||
watch(() => tables.area.sel, (newval) => {
|
||||
console.log(newval);
|
||||
query.page = 0
|
||||
query.page = 1
|
||||
getTable()
|
||||
})
|
||||
watch(() => status.active, (newval) => {
|
||||
query.page = 0
|
||||
query.page = 1
|
||||
// if (newval === 0) {
|
||||
// return tables.list = tables.originList
|
||||
// }
|
||||
// tables.list = tables.originList.filter((v) => {
|
||||
// return v.status == status.list[status.active].key
|
||||
// });
|
||||
filterTableList()
|
||||
getTable()
|
||||
})
|
||||
|
||||
function filterTableList() {
|
||||
tables.list = tables.originList.filter((v) => {
|
||||
console.log(status.list[status.active].key);
|
||||
return (status.active == 0 ? true : v.status == status.list[status.active].key) && (
|
||||
v.name.includes(search.keyword.trim())
|
||||
)
|
||||
});
|
||||
}
|
||||
watch(() => times.active, (newval) => {
|
||||
setTimer()
|
||||
})
|
||||
|
||||
@@ -891,7 +891,13 @@
|
||||
"pageId": "PAGES_COUPON_DISCOUNTCOUPONS",
|
||||
"path": "discountCoupons",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加折扣券"
|
||||
"navigationBarTitleText": "优惠券"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_COUPON_CERTIFICATE",
|
||||
"path": "editCertificate",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品兑换券"
|
||||
}
|
||||
}]
|
||||
},
|
||||
@@ -1088,6 +1094,7 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
||||
@@ -145,86 +145,95 @@
|
||||
icon: '/static/indexImg/icon-cashier.svg',
|
||||
pageUrl: 'PAGES_SHOP_SETUP',
|
||||
},
|
||||
// {
|
||||
// title: '优惠券',
|
||||
// icon: '/static/coupon/icon_coupon.svg',
|
||||
// pageUrl: 'PAGES_COUPON_INDEX',
|
||||
// },
|
||||
{
|
||||
title: '订阅通知',
|
||||
icon: '/static/indexImg/icon-notification.svg',
|
||||
pageUrl: 'PAGES_NOTIFICATION_INDEX',
|
||||
},
|
||||
// // // {
|
||||
// // // title: '进销存',
|
||||
// // // icon: '/static/indexImg/icon-invoicing.svg',
|
||||
// // // pageUrl: 'PAGES_INVOICING_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '进销存',
|
||||
// // // icon: '/static/indexImg/icon-invoicing.svg',
|
||||
// // // pageUrl: 'PAGES_INVOICING_INDEX',
|
||||
// // // },
|
||||
|
||||
// // // {
|
||||
// // // title: '预定座位',
|
||||
// // // icon: '/static/indexImg/icon-yuyue-zuo.svg',
|
||||
// // // pageUrl: 'PAGES_RESERVE_SEAT_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '预约管理',
|
||||
// // // icon: '/static/indexImg/icon-yuyue.svg',
|
||||
// // // pageUrl: 'PAGES_BOOKING_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '充值管理',
|
||||
// // // icon: '/static/indexImg/icon-recharge.svg',
|
||||
// // // pageUrl: 'PAGES_RECHARGE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '存酒管理',
|
||||
// // // icon: '/static/indexImg/icon-wine.svg',
|
||||
// // // pageUrl: 'PAGES_STORING_WINE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '进件管理',
|
||||
// // // icon: '/static/indexImg/icon-passage.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '商户管理',
|
||||
// // // icon: '/static/indexImg/business.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT_BUSINESS',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '门店管理',
|
||||
// // // icon: '/static/indexImg/icon-store.svg',
|
||||
// // // pageUrl: 'PAGES_STORE',
|
||||
// // // entId: 'ENT_MCH_STORE'
|
||||
// // // },
|
||||
// // {
|
||||
// // title: '设备管理',
|
||||
// // icon: '/static/indexImg/icon-calc.svg',
|
||||
// // pageUrl: 'PAGES_DEVICE_MAIN',
|
||||
// // entId: 'ENT_DEVICE'
|
||||
// // },
|
||||
|
||||
// {
|
||||
// title: '数据中心',
|
||||
// icon: '/static/indexImg/icon-pro.svg',
|
||||
// pageUrl: 'PAGES_STAT',
|
||||
// entId: 'ENT_ORDER_STATISTIC'
|
||||
// },
|
||||
// {
|
||||
// title: '商户应用',
|
||||
// icon: '/static/indexImg/icon-app.svg',
|
||||
// pageUrl: 'PAGES_APP',
|
||||
// entId: 'ENT_MCH_APP_LIST'
|
||||
// },
|
||||
// {
|
||||
// title: '会员中心',
|
||||
// icon: '/static/indexImg/icon-member.svg',
|
||||
// pageUrl: 'PAGES_MEMBER_CENTER',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
// {
|
||||
// title: '广告管理',
|
||||
// icon: '/static/indexImg/icon-ad.svg',
|
||||
// pageUrl: 'PAGES_AD_LIST',
|
||||
// entId: 'ENT_ADVERT_CONTROL'
|
||||
// },
|
||||
|
||||
// // // {
|
||||
// // // title: '预定座位',
|
||||
// // // icon: '/static/indexImg/icon-yuyue-zuo.svg',
|
||||
// // // pageUrl: 'PAGES_RESERVE_SEAT_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '预约管理',
|
||||
// // // icon: '/static/indexImg/icon-yuyue.svg',
|
||||
// // // pageUrl: 'PAGES_BOOKING_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '充值管理',
|
||||
// // // icon: '/static/indexImg/icon-recharge.svg',
|
||||
// // // pageUrl: 'PAGES_RECHARGE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '存酒管理',
|
||||
// // // icon: '/static/indexImg/icon-wine.svg',
|
||||
// // // pageUrl: 'PAGES_STORING_WINE_INDEX',
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '进件管理',
|
||||
// // // icon: '/static/indexImg/icon-passage.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '商户管理',
|
||||
// // // icon: '/static/indexImg/business.svg',
|
||||
// // // pageUrl: 'PAGES_APPLYMENT_BUSINESS',
|
||||
// // // entId: 'ENT_MCH_APPLYMENT_LIST'
|
||||
// // // },
|
||||
// // // {
|
||||
// // // title: '门店管理',
|
||||
// // // icon: '/static/indexImg/icon-store.svg',
|
||||
// // // pageUrl: 'PAGES_STORE',
|
||||
// // // entId: 'ENT_MCH_STORE'
|
||||
// // // },
|
||||
// // {
|
||||
// // title: '设备管理',
|
||||
// // icon: '/static/indexImg/icon-calc.svg',
|
||||
// // pageUrl: 'PAGES_DEVICE_MAIN',
|
||||
// // entId: 'ENT_DEVICE'
|
||||
// // },
|
||||
|
||||
// {
|
||||
// title: '数据中心',
|
||||
// icon: '/static/indexImg/icon-pro.svg',
|
||||
// pageUrl: 'PAGES_STAT',
|
||||
// entId: 'ENT_ORDER_STATISTIC'
|
||||
// },
|
||||
// {
|
||||
// title: '商户应用',
|
||||
// icon: '/static/indexImg/icon-app.svg',
|
||||
// pageUrl: 'PAGES_APP',
|
||||
// entId: 'ENT_MCH_APP_LIST'
|
||||
// },
|
||||
// {
|
||||
// title: '会员中心',
|
||||
// icon: '/static/indexImg/icon-member.svg',
|
||||
// pageUrl: 'PAGES_MEMBER_CENTER',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
// {
|
||||
// title: '广告管理',
|
||||
// icon: '/static/indexImg/icon-ad.svg',
|
||||
// pageUrl: 'PAGES_AD_LIST',
|
||||
// entId: 'ENT_ADVERT_CONTROL'
|
||||
// },
|
||||
|
||||
|
||||
// {
|
||||
// title: '营销红包',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
@@ -232,11 +241,6 @@
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
|
||||
// {
|
||||
// title: '优惠券',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_COUPON_INDEX'
|
||||
// },
|
||||
|
||||
{
|
||||
title: '退出登录',
|
||||
|
||||
@@ -239,14 +239,10 @@
|
||||
|
||||
})
|
||||
// #ifdef H5
|
||||
// vdata.formData.username = '15699991111'
|
||||
// vdata.formData.pwd = '123456'
|
||||
vdata.formData.username = ''
|
||||
vdata.formData.pwd = ''
|
||||
vdata.formData.username = '17792050546'
|
||||
vdata.formData.pwd = 'sy666888'
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
vdata.formData.username = ''
|
||||
vdata.formData.pwd = ''
|
||||
// vdata.formData.username = '15699991111'
|
||||
// vdata.formData.pwd = 'qwer1234'
|
||||
// #endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="search bg-fff u-flex u-col-center ">
|
||||
<view class="u-flex-1">
|
||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="输入桌号" @confirm="search"
|
||||
v-model="searchValue">
|
||||
v-model="searchValue">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
<!-- <view class="u-flex">
|
||||
@@ -23,28 +23,39 @@
|
||||
</view>
|
||||
|
||||
<view class="list ">
|
||||
<view class=" bg-fff box bg-fff">
|
||||
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
|
||||
@tap="chooseTable(index,item)">
|
||||
<view class="u-flex">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<template v-if="tables.list.length">
|
||||
<view class=" bg-fff box bg-fff">
|
||||
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
|
||||
@tap="chooseTable(index,item)">
|
||||
<view class="u-flex">
|
||||
<view>{{item.name}}</view>
|
||||
<view class="line"></view>
|
||||
<view>{{''}}</view>
|
||||
<view class="">
|
||||
<view class="u-flex">
|
||||
<view>{{item.name}}</view>
|
||||
<view class="line"></view>
|
||||
<view>{{''}}</view>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-12">
|
||||
<text
|
||||
:style="{color:returnStutasColor(item.status)}">{{returnStutasText(item.status)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-12">
|
||||
<text
|
||||
:style="{color:returnStutasColor(item.status)}">{{returnStutasText(item.status)}}</text>
|
||||
<view class="my-radio u-font-28 u-flex color-333">
|
||||
<view class="circle u-flex u-row-center" :class="{active:index==tables.selIndex}">
|
||||
<uni-icons type="checkmarkempty" :size="16" color="#fff"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-radio u-font-28 u-flex color-333">
|
||||
<view class="circle u-flex u-row-center" :class="{active:index==tables.selIndex}">
|
||||
<uni-icons type="checkmarkempty" :size="16" color="#fff"></uni-icons>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="tables.list.length<=0">
|
||||
<my-img-empty tips="未找到相关的桌台"></my-img-empty>
|
||||
</template>
|
||||
@@ -94,10 +105,13 @@
|
||||
uni.navigateBack()
|
||||
}, 100)
|
||||
}
|
||||
let searchValue=ref('')
|
||||
function search(){
|
||||
|
||||
let searchValue = ref('')
|
||||
|
||||
function search() {
|
||||
query.page=1
|
||||
getTable()
|
||||
}
|
||||
|
||||
function chooseTable(index, item) {
|
||||
if (item.status == 'closed') {
|
||||
return uni.showToast({
|
||||
@@ -109,7 +123,7 @@
|
||||
nouser.value = true
|
||||
return emitChooeTable()
|
||||
} else {
|
||||
tables.selIndex=index
|
||||
tables.selIndex = index
|
||||
emitChooeTable(item)
|
||||
}
|
||||
}
|
||||
@@ -128,11 +142,20 @@
|
||||
function areaChange(e) {
|
||||
area.defaultCateIndex = e.detail.value
|
||||
area.sel = area.list[e.detail.value]
|
||||
query.page=1
|
||||
getTable()
|
||||
}
|
||||
const query = {
|
||||
page: 0,
|
||||
size: 100,
|
||||
areaId: 0
|
||||
page: 1,
|
||||
size: 10,
|
||||
areaId: 0,
|
||||
totalElements:0
|
||||
}
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
console.log(page);
|
||||
query.page = page
|
||||
getTable()
|
||||
}
|
||||
const tables = reactive({
|
||||
hasAjax: false,
|
||||
@@ -141,15 +164,15 @@
|
||||
list: []
|
||||
})
|
||||
async function getTable() {
|
||||
// let state=status.list[status.active].key
|
||||
// state=state?(state=='all'?'':state):''
|
||||
const areaId=area.list[area.defaultCateIndex].id
|
||||
let {
|
||||
content
|
||||
} = await $table.get(query)
|
||||
tables.hasAjax = true
|
||||
content = content.filter(v =>{
|
||||
// return v.status == 'idle'||(v.status=='using')
|
||||
return v.status == 'idle'
|
||||
})
|
||||
console.log(content );
|
||||
content,total
|
||||
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})
|
||||
query.totalElements=total||0;
|
||||
tables.hasAjax = true;
|
||||
console.log(content);
|
||||
tables.list = content
|
||||
tables.selIndex = content.findIndex(v => v.tableId == option.tableId)
|
||||
tables.originList = content
|
||||
@@ -172,11 +195,7 @@
|
||||
}
|
||||
|
||||
watch(() => area.sel, (newval) => {
|
||||
if(!newval){
|
||||
tables.list = tables.originList
|
||||
return
|
||||
}
|
||||
tables.list = tables.originList.filter(v => v.areaId == newval.id)
|
||||
getTable()
|
||||
})
|
||||
let option = {}
|
||||
onLoad(opt => {
|
||||
@@ -197,11 +216,12 @@
|
||||
}
|
||||
|
||||
.my-radio {
|
||||
|
||||
|
||||
.circle {
|
||||
background: #FFFFFF;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
||||
&.active {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
@@ -225,11 +245,14 @@
|
||||
.scale7 {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
::v-deep .uni-searchbar{
|
||||
padding: 0!important;
|
||||
|
||||
::v-deep .uni-searchbar {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.search {
|
||||
padding: 20rpx 28rpx 20rpx 28rpx;
|
||||
|
||||
.icon-saoma {
|
||||
margin-left: 20rpx;
|
||||
width: 34rpx;
|
||||
@@ -239,6 +262,7 @@
|
||||
|
||||
.list {
|
||||
padding: 32rpx 24rpx;
|
||||
|
||||
.no-choose {
|
||||
padding: 36rpx 30rpx 36rpx 24rpx;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<view class="search bg-fff u-flex u-col-center ">
|
||||
<view class="u-flex-1">
|
||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search"
|
||||
@clear="search"
|
||||
v-model="query.name">
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
@@ -15,33 +16,44 @@
|
||||
<view>不选择用户</view>
|
||||
<my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio>
|
||||
</view>
|
||||
<view class="u-m-t-32 bg-fff box bg-fff">
|
||||
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
|
||||
@tap="chooseUser(index,item)">
|
||||
<view class="u-flex">
|
||||
<view class="headimg u-flex u-row-center u-col-center">
|
||||
<image v-if="item.headImg" :src="item.headImg" class="img" mode=""></image>
|
||||
</view>
|
||||
<view class="u-m-l-32">
|
||||
<view>{{item.nickName}}</view>
|
||||
<view class=" u-font-24 u-m-t-12 u-flex">
|
||||
<text class="color-999" v-if="!item.isVip">非会员</text>
|
||||
<text class="color-main" v-else>会员</text>
|
||||
<view class="u-m-l-30 u-flex">
|
||||
<text class="">余额:</text>
|
||||
<text class="color-main">{{item.amount}}</text>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-flex">
|
||||
<text class="">积分:</text>
|
||||
<text class="color-main">{{item.totalScore}}</text>
|
||||
<template v-if="list.length>0">
|
||||
<view class="u-m-t-32 bg-fff box bg-fff">
|
||||
<view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
|
||||
@tap="chooseUser(index,item)">
|
||||
<view class="u-flex">
|
||||
<view class="headimg u-flex u-row-center u-col-center">
|
||||
<image v-if="item.headImg" :src="item.headImg" class="img" mode=""></image>
|
||||
</view>
|
||||
<view class="u-m-l-32">
|
||||
<view>{{item.nickName}}</view>
|
||||
<view class=" u-font-24 u-m-t-12 u-flex">
|
||||
<text class="color-999" v-if="!item.isVip">非会员</text>
|
||||
<text class="color-main" v-else>会员</text>
|
||||
<view class="u-m-l-30 u-flex">
|
||||
<text class="">余额:</text>
|
||||
<text class="color-main">{{item.amount}}</text>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-flex">
|
||||
<text class="">积分:</text>
|
||||
<text class="color-main">{{item.totalScore}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<my-radio @change="chooseUser(index,item)" v-model="item.checked" :size="18"
|
||||
border-color="#d1d1d1"></my-radio>
|
||||
</view>
|
||||
<my-radio @change="chooseUser(index,item)" v-model="item.checked" :size="18"
|
||||
border-color="#d1d1d1"></my-radio>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<template v-if="hasAjax&&list.length<=0">
|
||||
<my-img-empty tips="未找到相关用户"></my-img-empty>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
@@ -54,20 +66,23 @@
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
reactive,onBeforeMount,
|
||||
reactive,
|
||||
onBeforeMount,
|
||||
ref
|
||||
} from 'vue';
|
||||
let nouser = ref(false)
|
||||
let timer=null
|
||||
let timer = null
|
||||
|
||||
function emitChooser(data) {
|
||||
uni.$emit('choose-user', data)
|
||||
timer=setTimeout(() => {
|
||||
timer = setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 100)
|
||||
}
|
||||
onBeforeMount(()=>{
|
||||
onBeforeMount(() => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
|
||||
function chooseUser(index, item) {
|
||||
if (index === undefined || item === undefined) {
|
||||
nouser.value = true
|
||||
@@ -85,28 +100,38 @@
|
||||
}
|
||||
|
||||
const query = reactive({
|
||||
page: 0,
|
||||
page: 1,
|
||||
name: '',
|
||||
size: 300,
|
||||
isVip:1
|
||||
totalElements: 0,
|
||||
size: 10,
|
||||
isVip: 1
|
||||
})
|
||||
const list = reactive([])
|
||||
let hasAjax=ref(false)
|
||||
async function getUser() {
|
||||
const {
|
||||
content
|
||||
content,
|
||||
totalElements
|
||||
} = await Api.queryAllShopUser(query)
|
||||
hasAjax.value=true
|
||||
list.length=content.length
|
||||
for (let i in content) {
|
||||
list.push({
|
||||
list[i]={
|
||||
...content[i],
|
||||
checked: false
|
||||
})
|
||||
}
|
||||
}
|
||||
query.totalElements = totalElements
|
||||
console.log(list);
|
||||
}
|
||||
|
||||
function pageChange(e) {
|
||||
query.page=e
|
||||
getUser()
|
||||
}
|
||||
|
||||
function search() {
|
||||
query.page = 0
|
||||
list.length = 0
|
||||
query.page = 1
|
||||
getUser()
|
||||
}
|
||||
onLoad(() => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="page-gray color-333 u-font-28">
|
||||
<template v-if="true">
|
||||
<view class="block u-p-t-32 u-p-b-32">
|
||||
<view class="block u-p-t-32 u-p-b-32" v-if="table&&table.tableId">
|
||||
<view>桌位号</view>
|
||||
<view class="font-bold u-font-32 u-m-t-16">
|
||||
{{table.name||''}}
|
||||
@@ -330,14 +330,13 @@
|
||||
defaultCateIndex: 0,
|
||||
})
|
||||
watch(() => userNumbers.defaultCateIndex, (newval) => {
|
||||
console.log(newval);
|
||||
updateChoseCount()
|
||||
})
|
||||
|
||||
//更新就餐人数
|
||||
async function updateChoseCount() {
|
||||
console.log($shop.value);
|
||||
if (!$shop.value.isTableFee) {
|
||||
if (!$shop.value.isTableFee&& table.value.tableId) {
|
||||
//不免餐位费
|
||||
const res = await Api.$choseCount({
|
||||
masterId: option.masterId,
|
||||
@@ -530,8 +529,7 @@
|
||||
}else{
|
||||
$seatFee.totalAmount=0
|
||||
}
|
||||
|
||||
console.log(goods.list);
|
||||
console.log(userNumbers.defaultCateIndex);
|
||||
}
|
||||
|
||||
let $shop = ref({
|
||||
|
||||
@@ -63,8 +63,9 @@
|
||||
|
||||
|
||||
</view>
|
||||
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm"
|
||||
@cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)" width="300px"></up-modal>
|
||||
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
|
||||
@confirm="confirmModelConfirm" @cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)"
|
||||
width="300px"></up-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -114,7 +115,7 @@
|
||||
})
|
||||
const modal = reactive({
|
||||
key: '',
|
||||
clear:false
|
||||
clear: false
|
||||
})
|
||||
|
||||
function confirmModelConfirm() {
|
||||
@@ -124,7 +125,7 @@
|
||||
}
|
||||
|
||||
function setModalShow(key = 'show', show = true) {
|
||||
if (key == 'clear'&&show&&props.data.length<=0) {
|
||||
if (key == 'clear' && show && props.data.length <= 0) {
|
||||
return infoBox.showToast('购物车是空的!')
|
||||
}
|
||||
modal.key = key
|
||||
@@ -132,7 +133,7 @@
|
||||
console.log(modal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const edmits = defineEmits(['clear', 'updateNumber'])
|
||||
|
||||
@@ -163,6 +164,13 @@
|
||||
status,
|
||||
type
|
||||
} = props.table
|
||||
if (props.table.tableId == '') {
|
||||
go.to('PAGES_CONFIRM_ORDER', {
|
||||
masterId: props.masterId,
|
||||
isCreateOrderToDetail: props.isCreateOrderToDetail ? 1 : 0
|
||||
})
|
||||
return
|
||||
}
|
||||
go.to('PAGES_CONFIRM_ORDER', {
|
||||
masterId: props.masterId,
|
||||
type,
|
||||
@@ -200,7 +208,7 @@
|
||||
}
|
||||
|
||||
function clear() {
|
||||
setModalShow('clear',false)
|
||||
setModalShow('clear', false)
|
||||
edmits('clear')
|
||||
hideGoods()
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
toRefs,
|
||||
watch
|
||||
} from 'vue';
|
||||
import util from '../util.js';
|
||||
const props = defineProps({
|
||||
img:{
|
||||
type:Object,
|
||||
@@ -99,7 +100,7 @@
|
||||
}
|
||||
return (
|
||||
item.isPauseSale ||
|
||||
(item.typeEnum !== "sku" && item.specList[0].stockNumber <= 0)
|
||||
(item.typeEnum !== "sku" && item.isStock==1&& item.stockNumber <= 0)
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
<list-goods-item :img="{width:'330rpx',height:'330rpx'}"
|
||||
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
|
||||
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
|
||||
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex"
|
||||
:data="goodsItem"></list-goods-item>
|
||||
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
|
||||
:index="goodsItem.goodsIndex" :data="goodsItem"></list-goods-item>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
@@ -122,20 +122,27 @@
|
||||
</view>
|
||||
|
||||
<!-- 选择规格 -->
|
||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel"
|
||||
:goodsData="selGoods"
|
||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
|
||||
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
||||
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||
<!-- 添加附加费 -->
|
||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<up-modal title="提示" content="该台桌购物车里有商品,是否清除该台桌里的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
|
||||
@confirm="confirmModelConfirm" @cancel="confirmModelConfirm('cancel')" @close="setModalShow('clear',false)"
|
||||
width="300px">
|
||||
|
||||
</up-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import {
|
||||
$table
|
||||
$table,
|
||||
$choseTable,
|
||||
$returnTableDetail
|
||||
} from '@/http/yskApi/table.js'
|
||||
import {
|
||||
$tbShopCategory
|
||||
@@ -158,7 +165,8 @@
|
||||
reactive,
|
||||
ref,
|
||||
nextTick,
|
||||
watch,getCurrentInstance
|
||||
watch,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import myCar from './components/car'
|
||||
import go from '@/commons/utils/go.js';
|
||||
@@ -173,11 +181,45 @@
|
||||
import {
|
||||
tbShopInfo
|
||||
} from '@/http/yskApi/user.js'
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js'
|
||||
|
||||
|
||||
const modal = reactive({
|
||||
key: '',
|
||||
clear: false,
|
||||
data: ''
|
||||
})
|
||||
|
||||
async function confirmModelConfirm(isCancel = false) {
|
||||
if (modal.key == 'clear') {
|
||||
try {
|
||||
await $choseTable({
|
||||
masterId: data.masterId,
|
||||
tableId: modal.data.tableId,
|
||||
isClear: !isCancel ? true : false,
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
//TODO handle the exception
|
||||
}
|
||||
data.table = modal.data;
|
||||
setModalShow('clear', false, '')
|
||||
}
|
||||
}
|
||||
|
||||
function setModalShow(key = 'show', show = true, data) {
|
||||
modal.key = key
|
||||
modal[key] = show
|
||||
modal.data = data
|
||||
}
|
||||
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
let canXiadan=ref(false)
|
||||
async function xiadanClick(){
|
||||
canXiadan.value=await hasPermission('允许下单')
|
||||
let canXiadan = ref(false)
|
||||
async function xiadanClick() {
|
||||
canXiadan.value = await hasPermission('允许下单')
|
||||
}
|
||||
xiadanClick()
|
||||
//临时菜
|
||||
@@ -198,9 +240,9 @@
|
||||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
itemId: '', // 栏目右边scroll-view用于滚动的id
|
||||
tabbar: storageManage.cacheGoods()||[],
|
||||
tabbar: storageManage.cacheGoods() || [],
|
||||
menuItemPos: [],
|
||||
arr: storageManage.cacheGoodsNode()||[],//左右联动布局节点信息
|
||||
arr: storageManage.cacheGoodsNode() || [], //左右联动布局节点信息
|
||||
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
||||
timer: null, // 定时器
|
||||
topZhanwei: 136 + 24,
|
||||
@@ -305,8 +347,8 @@
|
||||
page: 0,
|
||||
size: 300
|
||||
}) {
|
||||
const showLoading=data.tabbar.length<=0?true:false
|
||||
return Api.getGoodsLists(par,showLoading)
|
||||
const showLoading = data.tabbar.length <= 0 ? true : false
|
||||
return Api.getGoodsLists(par, showLoading)
|
||||
}
|
||||
//获取购物车数据
|
||||
async function getCart(par = {
|
||||
@@ -333,9 +375,9 @@
|
||||
}
|
||||
//加入购物车
|
||||
function addCart(par) {
|
||||
if (!data.table.tableId) {
|
||||
return infoBox.showToast('请先选择桌台!')
|
||||
}
|
||||
// if (!data.table.tableId) {
|
||||
// return infoBox.showToast('请先选择桌台!')
|
||||
// }
|
||||
const submitPar = {
|
||||
masterId: data.masterId,
|
||||
tableId: data.table.tableId,
|
||||
@@ -400,7 +442,7 @@
|
||||
|
||||
//获取桌台信息
|
||||
async function getTableInfo() {
|
||||
if(data.table.tableId){
|
||||
if (data.table.tableId) {
|
||||
const res = await $table.get({
|
||||
qrcode: data.table.tableId
|
||||
})
|
||||
@@ -413,6 +455,8 @@
|
||||
let $originGoods = []
|
||||
let $category = []
|
||||
async function init() {
|
||||
const masterRes = await getMasterId()
|
||||
data.masterId = masterRes.masterId
|
||||
const shopInfo = await tbShopInfo()
|
||||
$shop.value = shopInfo
|
||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
||||
@@ -440,10 +484,7 @@
|
||||
$originGoods = goods
|
||||
if (!data.table.tableId) {
|
||||
//无桌台
|
||||
const {
|
||||
masterId
|
||||
} = await getMasterId()
|
||||
data.masterId = masterId
|
||||
|
||||
setTabBar(category, goods, [])
|
||||
return
|
||||
}
|
||||
@@ -509,9 +550,9 @@
|
||||
}
|
||||
|
||||
function search() {
|
||||
if(searchValue.value===''){
|
||||
if (searchValue.value === '') {
|
||||
isSearch.value = false
|
||||
return
|
||||
return
|
||||
}
|
||||
isSearch.value = true
|
||||
searchResult.value = returnSearchGoods()
|
||||
@@ -534,8 +575,27 @@
|
||||
|
||||
function watchChooseTable() {
|
||||
uni.$off('choose-table')
|
||||
uni.$on('choose-table', (tableData) => {
|
||||
data.table = tableData
|
||||
uni.$on('choose-table', async (item) => {
|
||||
if (data.table.tableId || cars.length <= 0) {
|
||||
data.table = item
|
||||
return;
|
||||
}
|
||||
if (item.status != "idle") {
|
||||
return infoBox.showToast('该台桌已在使用中')
|
||||
}
|
||||
const res = await $returnTableDetail({
|
||||
tableId: item.tableId,
|
||||
});
|
||||
if (res.cartCount > 0) {
|
||||
setModalShow('clear', true, item)
|
||||
} else {
|
||||
await $choseTable({
|
||||
masterId: data.masterId,
|
||||
tableId: item.tableId,
|
||||
isClear:false
|
||||
});
|
||||
data.table = item
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -591,7 +651,7 @@
|
||||
return prve;
|
||||
}, {});
|
||||
const canBudyGoods = specList
|
||||
.filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item))
|
||||
.filter((v) => util.isCanBuy(v, guigeModelData.chooseGoods.item))
|
||||
.sort((a, b) => {
|
||||
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
||||
return prve + skuMapNumber[cur];
|
||||
@@ -680,7 +740,7 @@
|
||||
prve[i] = matchArr
|
||||
.filter((v) => v.specSnap.match(i))
|
||||
.every((v) => {
|
||||
return !util.isCanBuy(v,guigeModelData.chooseGoods.item)
|
||||
return !util.isCanBuy(v, guigeModelData.chooseGoods.item)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -695,9 +755,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let selGoods=ref({})
|
||||
|
||||
|
||||
let selGoods = ref({})
|
||||
|
||||
function chooseGuige(foodsindex, index) {
|
||||
if (!canAddGoods()) {
|
||||
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
@@ -705,7 +766,7 @@
|
||||
})
|
||||
}
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
selGoods.value=$goods
|
||||
selGoods.value = $goods
|
||||
guigeModelData.title = $goods.name
|
||||
const specList = $goods.specList;
|
||||
const tagSnap = JSON.parse($goods.skuResult.tagSnap)
|
||||
@@ -809,15 +870,16 @@
|
||||
return true
|
||||
}
|
||||
|
||||
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) {
|
||||
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd,goodsIndex)
|
||||
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
|
||||
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
|
||||
}
|
||||
function setSearchGoods(index,chooseNumber){
|
||||
if(index!==undefined){
|
||||
searchResult.value[index].chooseNumber=chooseNumber
|
||||
|
||||
function setSearchGoods(index, chooseNumber) {
|
||||
if (index !== undefined) {
|
||||
searchResult.value[index].chooseNumber = chooseNumber
|
||||
}
|
||||
}
|
||||
async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) {
|
||||
async function goodsUpdate(foodsindex, index, isAdd, searchGoodsIndex) {
|
||||
// if (!canAddGoods()) {
|
||||
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
// chooseTable()
|
||||
@@ -842,7 +904,7 @@
|
||||
//移除
|
||||
cars.splice(goodsInCarIndex, 1)
|
||||
$goods.chooseNumber = 0
|
||||
setSearchGoods(searchGoodsIndex,0)
|
||||
setSearchGoods(searchGoodsIndex, 0)
|
||||
return await removeCartGoods({
|
||||
cartId
|
||||
})
|
||||
@@ -857,7 +919,7 @@
|
||||
})
|
||||
carGoods.number = number
|
||||
$goods.chooseNumber = number
|
||||
setSearchGoods(searchGoodsIndex,number)
|
||||
setSearchGoods(searchGoodsIndex, number)
|
||||
} else {
|
||||
//增加
|
||||
const num = suit
|
||||
@@ -992,8 +1054,8 @@
|
||||
if (!data.menuHeight) {
|
||||
await getElRect('menu-scroll-view', 'menuHeight');
|
||||
}
|
||||
if(e.detail.scrollTop==0){
|
||||
isTabClickOver=true
|
||||
if (e.detail.scrollTop == 0) {
|
||||
isTabClickOver = true
|
||||
return swichMenu(0)
|
||||
}
|
||||
setTimeout(() => { // 节流
|
||||
@@ -1231,10 +1293,12 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
::v-deep .uni-searchbar{
|
||||
padding-top: 12px!important;
|
||||
padding-bottom: 16px!important;
|
||||
|
||||
::v-deep .uni-searchbar {
|
||||
padding-top: 12px !important;
|
||||
padding-bottom: 16px !important;
|
||||
}
|
||||
|
||||
.right-box {
|
||||
width: 572rpx;
|
||||
// background-color: rgb(250, 250, 250);
|
||||
@@ -1258,7 +1322,8 @@
|
||||
.item-title {
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
&.active{
|
||||
|
||||
&.active {
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,62 +1,104 @@
|
||||
<template>
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.totalAmount>0">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold">附加费</view>
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||
</template>
|
||||
</view>
|
||||
<template v-if="data.status!='return'">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>{{data.name||'餐位费'}}</view>
|
||||
<view>x{{data.number}}</view>
|
||||
<view>¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex u-row-between u-m-t-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
||||
<view class="tag yitui u-m-l-10">已退</view>
|
||||
<view>
|
||||
<template v-if="data.status!='return'">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>{{data.name||'餐位费'}}</view>
|
||||
<view>x{{data.number||0}}</view>
|
||||
<view class="price-min-width">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
<view class="line-th">x{{data.number}}</view>
|
||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex u-row-between u-m-t-24 color-999">
|
||||
<view class="u-flex">
|
||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
||||
<view class="tag yitui u-m-l-10">已退</view>
|
||||
</view>
|
||||
<view class="line-th">x{{data.number||0}}</view>
|
||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||
</template>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-24" v-if="packeFee>0">
|
||||
<view>打包费</view>
|
||||
<view>x{{packeNumbber}}</view>
|
||||
<view class="price-min-width">¥{{packeFee}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed
|
||||
} from 'vue'
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
orderInfo:{
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
return {
|
||||
detailList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
table:{
|
||||
table: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
|
||||
const statusMap={
|
||||
unpaid:'未支付'
|
||||
const packeNumbber = computed(() => {
|
||||
if (!props.orderInfo.detailList) {
|
||||
return 0
|
||||
}
|
||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||
return prve + (cur.packAmount>0?cur.num:0)
|
||||
}, 0)
|
||||
})
|
||||
const packeFee = computed(() => {
|
||||
if (!props.orderInfo.detailList) {
|
||||
return 0
|
||||
}
|
||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||
return prve + cur.packAmount
|
||||
}, 0).toFixed(2)
|
||||
})
|
||||
|
||||
const statusMap = {
|
||||
unpaid: '未支付'
|
||||
}
|
||||
const emits=defineEmits(['tuicai','tuikuan','printOrder'])
|
||||
function returnStatus(status){
|
||||
return statusMap[status]||''
|
||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||
|
||||
function returnStatus(status) {
|
||||
return statusMap[status] || ''
|
||||
}
|
||||
function tuikuan(){
|
||||
emits('tuikuan',props.data)
|
||||
|
||||
function tuikuan() {
|
||||
emits('tuikuan', props.data)
|
||||
}
|
||||
function tuicai(){
|
||||
emits('tuicai',props.data)
|
||||
|
||||
function tuicai() {
|
||||
emits('tuicai', props.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -65,9 +107,14 @@
|
||||
padding: 0 6rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
&.yitui {
|
||||
background-color: rgb(188, 188, 188);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.price-min-width{
|
||||
min-width: 100rpx;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -23,44 +23,53 @@
|
||||
|
||||
<view class="">
|
||||
<view class="u-flex">
|
||||
<view class="tui" v-if="item.status=='return'">
|
||||
<view class="tui" v-if="item.status=='return'||item.status=='refund'">
|
||||
已退
|
||||
</view>
|
||||
<view :class="{'line-th':item.status=='return'}">{{item.name||item.productName}}
|
||||
<view :class="{'line-th':item.status=='return'||item.status=='refund'}">{{item.name||item.productName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-8">
|
||||
<view class="u-m-r-20 u-flex " v-if="item.gift">
|
||||
<uni-tag text="赠送"
|
||||
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||
</uni-tag>
|
||||
</view>
|
||||
<view class="u-m-r-20 u-flex" v-if="item.pack">
|
||||
<uni-tag
|
||||
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
||||
size="small" text="打包" inverted type="success" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
|
||||
|
||||
|
||||
<view class="u-m-t-12 color-666 u-font-24" v-if="item.note">
|
||||
备注:{{item.note}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-text-right u-m-t-28">
|
||||
<template v-if="item.status=='return'">
|
||||
<template v-if="item.status=='return'||item.gift||item.status=='refund'">
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{item.salePrice||item.price}}</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="item.priceAmount<=0">
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>¥{{item.priceAmount}}</view>
|
||||
</template>
|
||||
<view>¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="orderInfo.status=='unpaid'">
|
||||
<template v-if="orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@tap="tuicai(item,index)"><text class="no-wrap">退菜</text></my-button>
|
||||
<my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
|
||||
class="no-wrap">退菜</text></my-button>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.status!='refund'">
|
||||
<template v-if="item.status!='refund'&&!item.gift">
|
||||
<template v-if="orderInfo.status=='closed'||orderInfo.status=='refund'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@@ -68,7 +77,7 @@
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
|
||||
@@ -97,7 +106,7 @@
|
||||
<text class="font-bold u-font-32">{{allPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<template v-if="orderInfo.status=='refund'">
|
||||
<view class="u-flex u-row-between u-m-t-32">
|
||||
<view>退款金额</view>
|
||||
@@ -122,7 +131,7 @@
|
||||
<view></view>
|
||||
<view>
|
||||
<text>总计¥</text>
|
||||
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1) }}</text>
|
||||
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
@@ -137,26 +146,29 @@
|
||||
computed
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js'
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js'
|
||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||
|
||||
function returnTotalMoney(item){
|
||||
return (item.price*item.num).toFixed(2)
|
||||
|
||||
function returnTotalMoney(item) {
|
||||
return (item.price * item.num).toFixed(2)
|
||||
}
|
||||
function to2(n){
|
||||
if(!n){
|
||||
|
||||
function to2(n) {
|
||||
if (!n) {
|
||||
return 0
|
||||
}
|
||||
return n.toFixed(2)
|
||||
}
|
||||
|
||||
|
||||
function tuicai(item, index) {
|
||||
emits('tuicai', item, index)
|
||||
}
|
||||
|
||||
function tuikuan(item, index) {
|
||||
hasPermission('允许退款').then(res=>{
|
||||
if(res){
|
||||
hasPermission('允许退款').then(res => {
|
||||
if (res) {
|
||||
emits('tuikuan', item, index)
|
||||
}
|
||||
})
|
||||
@@ -190,9 +202,11 @@
|
||||
|
||||
const allPrice = computed(() => {
|
||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.filter(v => v.isGift !== "true" && v.status !== "return").reduce((a,
|
||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return").reduce((a,
|
||||
b) => {
|
||||
return a + b.priceAmount*1
|
||||
// return a + b.priceAmount*1||(b.num*b.price+b.packAmount*1)
|
||||
// return a + (b.num*b.price+b.packAmount*1)
|
||||
return a + (b.num * b.price)
|
||||
}, 0)
|
||||
return prve + curTotal
|
||||
}, 0)
|
||||
@@ -200,6 +214,19 @@
|
||||
|
||||
})
|
||||
|
||||
const packFee = computed(() => {
|
||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.filter(v => v.gift != true && v.status !== "return").reduce((a,
|
||||
b) => {
|
||||
return a + b.packAmount
|
||||
}, 0)
|
||||
return prve + curTotal
|
||||
}, 0)
|
||||
return goodsPrice.toFixed(2)
|
||||
|
||||
})
|
||||
|
||||
|
||||
const goodsNumber = computed(() => {
|
||||
let result = 0
|
||||
result = props.data.reduce((a, b) => {
|
||||
@@ -222,9 +249,11 @@
|
||||
.border-top {
|
||||
border-color: #F6F6F6;
|
||||
}
|
||||
.border-r-24{
|
||||
|
||||
.border-r-24 {
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
|
||||
.border-bottom {
|
||||
// border-color: rgb(240, 240, 240);
|
||||
border-color: #F6F6F6;
|
||||
@@ -238,11 +267,13 @@
|
||||
padding: 4rpx 8rpx 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
|
||||
&.no-pay {
|
||||
background-color: rgb(170, 170, 170);
|
||||
color: #fff;
|
||||
}
|
||||
&.refund{
|
||||
|
||||
&.refund {
|
||||
background-color: #FCE7E7;
|
||||
padding: 8rpx 20rpx 6rpx 22rpx;
|
||||
color: #EB4F4F;
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
</view> -->
|
||||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
||||
<!-- <template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount"> -->
|
||||
<template v-if="true">
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.seatFee"></extra-vue>
|
||||
</template>
|
||||
@@ -16,7 +17,7 @@
|
||||
<view style="height: 200rpx;"></view>
|
||||
<view class="u-fixed bottom bg-fff ">
|
||||
<view class="u-flex u-abso">
|
||||
<template v-if="orderDetail.info.useType=='takeout'">
|
||||
<template v-if="orderDetail.info.useType=='takeout'||!orderDetail.info.tableId||orderDetail.info.useType=='dine-in-before'">
|
||||
<view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
|
||||
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
|
||||
type="primary">结账</my-button>
|
||||
|
||||
@@ -30,22 +30,42 @@
|
||||
<view class="u-m-t-32">
|
||||
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
||||
<view class="border-bottom u-p-b-32">
|
||||
<view class="u-flex u-row-between u-col-top u-m-t-32" v-for="(item,index) in data.detailList"
|
||||
<view class="" v-for="(item,index) in data.detailList"
|
||||
:key="index">
|
||||
<view>
|
||||
<view class=""> {{item.productName}}</view>
|
||||
<view class="color-999 u-font-24 u-m-t-8">
|
||||
{{item.productSkuName}}
|
||||
<view class="u-flex u-row-between u-col-top u-m-t-32" v-if="item.productId!=-999">
|
||||
<view>
|
||||
<view class=""> {{item.productName}}</view>
|
||||
<view class="color-999 u-font-24 u-m-t-8">
|
||||
{{item.productSkuName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-1 u-row-right">
|
||||
<view>×{{item.num}}</view>
|
||||
<view class="u-text-right u-relative" :style="computedPriceStyle()">
|
||||
<text :class="{'line-th':item.gift}">¥{{goodsPriceAmount(item)}}</text>
|
||||
<view class="u-absolute" style="bottom: 100%;right: 0;" v-if="item.gift">
|
||||
¥0
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-1 u-row-right">
|
||||
<view>×{{item.num}}</view>
|
||||
<view class="u-text-right" :style="computedPriceStyle()">¥{{item.priceAmount}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="border-bottom u-p-t-32 u-p-b-32" v-if="data.packFee>0||(data.seatInfo&&data.seatInfo.priceAmount>0)">
|
||||
<view class="u-flex u-row-between u-col-top" v-if="data.packFee>0">
|
||||
<view class="no-wrap u-m-r-32">打包费</view>
|
||||
<view>¥{{data.packFee||0}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-32 u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
||||
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
||||
<view>¥{{data.seatInfo.priceAmount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32 u-col-top">
|
||||
<view class="no-wrap u-m-r-32">订单备注</view>
|
||||
<view>{{data.remark||'无'}}</view>
|
||||
@@ -78,7 +98,14 @@
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
detailList: []
|
||||
return{
|
||||
packFee:0,
|
||||
seatInfo:{
|
||||
productName:'客座费',
|
||||
priceAmount:0
|
||||
},
|
||||
detailList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
index: {
|
||||
@@ -89,9 +116,16 @@
|
||||
let $goodsMap = {}
|
||||
let goosZhonglei = ref(0)
|
||||
let goodsNumber = ref(0)
|
||||
|
||||
|
||||
const priceSize = 9
|
||||
|
||||
function goodsPriceAmount(item){
|
||||
return item.price*item.num
|
||||
}
|
||||
// const packeFee=computed(()=>{
|
||||
// return props.data.detailList.reduce((prve,cur)=>{
|
||||
// return prve+cur.packAmount
|
||||
// },0).toFixed(2)
|
||||
// })
|
||||
function computedPriceStyle() {
|
||||
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
|
||||
.length) ? prev : current)
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
</view>
|
||||
<view class="u-flex color-999 u-font-24">
|
||||
<view class="u-m-r-20" v-if="item.payType=='vipPay'">
|
||||
<text class="u-m-r-4">{{user.telephone||user.nickName}}</text>
|
||||
<text>余额:</text>
|
||||
<text>¥{{user.amount||'0'}}</text>
|
||||
</view>
|
||||
@@ -194,6 +195,7 @@
|
||||
type: data.id ? 0 : 1 //0 设置 1 取消
|
||||
}).then(res=>{
|
||||
user.value = data
|
||||
order.userId=data.id
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
1
static/coupon/icon_coupon.svg
Normal file
1
static/coupon/icon_coupon.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><defs><style>.a{fill:#80bcff;}.b{clip-path:url(#a);}.c{clip-path:url(#b);}.d{fill:#197dff;}.e{fill:#4c99fe;}</style><clipPath id="a"><rect class="a" width="32" height="32" transform="translate(41 962)"/></clipPath><clipPath id="b"><rect class="a" width="32" height="32" transform="translate(338 862)"/></clipPath></defs><g class="b" transform="translate(-41 -962)"><g class="c" transform="translate(-297 100)"><path class="d" d="M27.706,22.243h0V19.407a1.449,1.449,0,0,0-.824-1.483c-1.848-.857-2.472-1.605-2.472-2.965s.577-2.054,2.472-2.966l.038-.023c.341.822,1.073,1.335,2.613,1.832a1.449,1.449,0,0,1,1,1.371l.542,4.415A2.362,2.362,0,0,1,28.89,22.1l-1.183.145Zm0-13.526V6.061a2.36,2.36,0,0,0-2.472-2.224H.521A2.756,2.756,0,0,0,0,3.886a2.6,2.6,0,0,1,1.649-.854L26.18.021A2.775,2.775,0,0,1,26.518,0,2.323,2.323,0,0,1,28.9,1.927l.542,4.416a1.374,1.374,0,0,1-.636,1.572,9.66,9.66,0,0,0-1.1.8Z" transform="translate(338.913 865.612)"/><path class="e" d="M93.989,182.151a1.367,1.367,0,0,0,.824-1.483V176.22A2.358,2.358,0,0,0,92.341,174H67.627a2.357,2.357,0,0,0-2.471,2.224v4.448a1.326,1.326,0,0,0,.824,1.483c1.125.472,2.471,1.425,2.471,2.966a2.936,2.936,0,0,1-2.422,2.962,1.668,1.668,0,0,0-.872,1.486v4.448a2.358,2.358,0,0,0,2.471,2.225H92.341a2.358,2.358,0,0,0,2.471-2.225v-4.448a1.45,1.45,0,0,0-.824-1.483c-1.8-.835-2.471-1.578-2.471-2.965s.629-2.079,2.471-2.966Zm-9.062,2.6a.393.393,0,0,1-.412.371H80.808V186.6h3.707a.393.393,0,0,1,.412.371v.741a.393.393,0,0,1-.412.371H80.808v2.6a.393.393,0,0,1-.412.371h-.824a.393.393,0,0,1-.412-.371v-2.6H75.453a.393.393,0,0,1-.412-.371v-.741a.393.393,0,0,1,.412-.371H79.16v-1.483H75.453a.393.393,0,0,1-.412-.371V184a.393.393,0,0,1,.412-.371h3.119l-3.386-3.274a.361.361,0,0,1,0-.516l.524-.516a.375.375,0,0,1,.524,0l3.745,3.622,3.744-3.62a.378.378,0,0,1,.528,0l.528.52a.364.364,0,0,1,0,.52L81.4,183.634h3.11a.393.393,0,0,1,.412.371v.742Zm0,0" transform="translate(273.002 694.855)"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
1
static/coupon/qrcode.svg
Normal file
1
static/coupon/qrcode.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24.1" height="24.1" viewBox="0 0 24.1 24.1"><defs><style>.a{fill:#333;}</style></defs><path class="a" d="M179.826,184.148v-2.183h-2.231v2.185Zm3.33,0a1,1,0,0,0,.993-.993v-1.192h-2.139v2.183m-13.222-21.914v6.555h-6.555v-6.555h6.555m1.192-2.185h-8.938a1,1,0,0,0-.993.993v8.938a1,1,0,0,0,.993.993h8.938a1,1,0,0,0,.993-.993v-8.938a1,1,0,0,0-.993-.993Zm-4.469,5.462-1.092,0a1.092,1.092,0,1,0,1.092-1.092A1.092,1.092,0,0,0,164.419,165.512Zm17.545-3.277v6.555H175.41v-6.555h6.555m1.192-2.185h-8.938a1,1,0,0,0-.993.993v8.938a1,1,0,0,0,.993.993h8.938a1,1,0,0,0,.993-.993v-8.938a1,1,0,0,0-.993-.993Zm-4.469,5.462-1.092,0a1.092,1.092,0,1,0,1.092-1.092A1.092,1.092,0,0,0,177.595,165.512Zm-8.806,9.9v6.555h-6.555V175.41h6.555m1.192-2.185h-8.938a1,1,0,0,0-.993.993v8.938a1,1,0,0,0,.993.993h8.938a1,1,0,0,0,.993-.993v-8.938a1,1,0,0,0-.993-.993Zm-4.469,5.462-1.092,0a1.092,1.092,0,1,0,1.092-1.092A1.092,1.092,0,0,0,164.419,178.688Zm18.737-5.462h-1.218v4.37h-2.185v-4.37h-5.535a1,1,0,0,0-.993.993v8.938a1,1,0,0,0,.993.993h1.192V177.6h2.185v2.185h6.555v-5.562A1,1,0,0,0,183.156,173.225Z" transform="translate(-160.049 -160.05)"/></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user