This commit is contained in:
duan
2024-10-29 15:46:56 +08:00
35 changed files with 1702 additions and 1111 deletions

74
commons/goodsData.js Normal file
View 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,
}

View File

@@ -30,5 +30,9 @@ export const $status = {
cleaning: { cleaning: {
label: "待清台", label: "待清台",
type: "#FAAD14", type: "#FAAD14",
},
unbind: {
label: "未绑定",
type: "rgb(221,221,221)",
} }
} }

View File

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

View File

@@ -129,7 +129,7 @@
mode: { mode: {
//all date time //all date time
type: String, type: String,
default: 'all' default: 'time'
}, },
yearsLen:{ yearsLen:{
type: Number, type: Number,

58
http/yskApi/coupon.js Normal file
View 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
})
}

View File

@@ -15,11 +15,15 @@ import {
} from '@/commons/utils/encryptUtil.js' } from '@/commons/utils/encryptUtil.js'
import infoBox from "@/commons/utils/infoBox.js" import infoBox from "@/commons/utils/infoBox.js"
import go from '@/commons/utils/go.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' // let baseUrl = '/ww'
@@ -127,8 +131,9 @@ function commonsProcess(showLoading, httpReqCallback) {
}).catch(res => { }).catch(res => {
if(res.status==401){ if(res.status==401){
storageManage.token(null, true) storageManage.token(null, true)
infoBox.showErrorToast('请登录').then(() => { infoBox.showErrorToast(res.message||'请登录').then(() => {
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH) uni.redirectTo({url: '/pages/login/index'})
reject()
}) })
} }
// if(res.status==400){ // if(res.status==400){
@@ -138,9 +143,7 @@ function commonsProcess(showLoading, httpReqCallback) {
// }) // })
// } // }
if(res.status==500){ if(res.status==500){
storageManage.token(null, true) infoBox.showErrorToast(res.message||'服务器异常').then(() => {
infoBox.showErrorToast('请登录').then(() => {
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
}) })
} }
// if(res&&res.msg){ // if(res&&res.msg){

View File

@@ -1,6 +1,6 @@
// 桌台管理 // 桌台管理
import http from './http.js' import http from './http.js'
const request=http.request const request = http.request
import $API from '@/http/classApi.js' import $API from '@/http/classApi.js'
import appConfig from '@/config/appConfig.js' import appConfig from '@/config/appConfig.js'
import { import {
@@ -9,9 +9,9 @@ import {
import infoBox from '@/commons/utils/infoBox.js' 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 const $bind=new $API('/api/tbShopTable/bind',http.req)
export function $bind(data) { export function $bind(data) {
@@ -24,3 +24,27 @@ export function $bind(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
}
});
}

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

View File

@@ -1,279 +1,326 @@
<template> <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="content">
<view class="content1"> <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><input v-model="formData.discountAmount" placeholder="填写金额" border="none"></input><view></view>
</view>
</view>
</view>
<view class="card">
<view class="item">
<view class="lable">有效期类型</view>
<view class="value" style="display: flex;flex-direction: column;align-items: flex-start;">
<view> <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>
<input type="text" placeholder="填写名称" /> <view class="date" v-if="formData.validityType=='custom'">
<hr style="margin-top: 24rpx;color: #E5E5E5;" /> <!-- {{formData.useStartTime +''+ formData.useEndTime}} -->
</view> <view @click="typeChange('validityType')">{{ formData.validStartTime || '开始时间'}}</view>--
<view class="content1"> <view @click="typeChange('validityType')">{{ formData.validEndTime || '结束时间'}}</view>
<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>
</view>
<view class="content2">
<view class="">
可用商品
</view>
<view class="">
<span>指定商品可用</span>
<span>></span>
</view> </view>
<view class="siwtichStyle">
<!-- <span>选择商品</span> -->
<!-- <view class=""> -->
<span>选择商品</span>
<input type="text" placeholder="选择指定商品 " />
<span>></span>
<!-- </view> -->
</view> </view>
</view> </view>
<view class="content2"> <view class="item">
<view class=""> <view class="lable">有效期</view>
<view class="value">
</view> <up-input v-model="formData.validDays" placeholder="填写天数" border="none"></up-input>
<view class="">
<span>更多设置</span>
<span>></span>
</view> </view>
</view> </view>
<view class="content2"> <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> <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>
<radio-group @change="radioChange" style="margin-top: 16rpx;"> <view class="time" v-if="formData.useTimeType=='custom'">
<radio style="transform:scale(0.7)">全时段可用</radio> <!-- {{formData.useStartTime +''+ formData.useEndTime}} -->
<radio style="transform:scale(0.7)">指定时段可用</radio> <view @click="useTimeChange('useStartTime')">{{ formData.useStartTime || '开始时间'}}</view>--
</radio-group> <view @click="useTimeChange('useEndTime')">{{ formData.useEndTime || '结束时间'}}</view>
</view>
<view class="content2">
<view class="">
发放方式
</view>
<view class="">
<span>用户不可自行领取</span>
<span>></span>
</view> </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>
</view> </view>
<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="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> </view>
</template> </template>
<script setup> <script setup>
import go from '@/commons/utils/go.js'
import { import {
reactive, reactive,
ref, ref
toRef,
watch
} from 'vue'; } 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> </script>
<style lang="scss"> <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 { .content {
width: 750rpx;
background: #F9F9F9; background: #F9F9F9;
padding: 32rpx; padding: 32rpx 28rpx 150rpx 28rpx;
.content1 { .card{
padding: 32rpx 24rpx;
background-color: #fff; background-color: #fff;
padding: 32rpx 24rpx; margin-bottom: 32rpx;
.item{
>input { padding-bottom: 24rpx;
margin-top: 16rpx; border-bottom: 2rpx solid #E5E5E5;
} margin-bottom: 24rpx;
.lable{
>view {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold; font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
} margin-bottom: 16rpx;
.siwtichStyle {
margin-top: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
padding: 0 24rpx;
width: 646rpx;
height: 104rpx;
background: #F9F9F9;
border-radius: 12rpx 12rpx 12rpx 12rpx;
} }
.siwtichStyle2 { .value{
margin-top: 24rpx; display: flex;
justify-content: flex-start;
align-items: center;
input{
width: 150rpx;
text-align: center;
}
.date,.time{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
padding: 0 24rpx;
width: 646rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
}
}
.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-weight: 400;
font-size: 28rpx; font-size: 26rpx;
color: #333333; color: #999999;
margin-top: 10rpx;
view{
border: 1rpx solid #999;
padding: 10rpx 20rpx;
border-radius: 10rpx
} }
view:nth-child(1){
>view:nth-child(3) { margin-right: 10rpx;
display: flex;
justify-content: space-between;
margin-top: 16rpx;
background: #FFFFFF;
width: 646rpx;
height: 154rpx;
background: #F9F9F9;
border-radius: 12rpx 12rpx 12rpx 12rpx;
} }
view:nth-child(2){
.siwtichStyle { margin-left: 10rpx;
margin-top: 24rpx; }
display: flex; }
align-items: center; .time{
justify-content: space-between; view{
padding: 0 24rpx; padding: 10rpx 30rpx;
width: 646rpx; }
height: 104rpx; }
background: #F9F9F9; }
border-radius: 12rpx 12rpx 12rpx 12rpx; }
.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;
} }
} }
} }

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

View File

@@ -1,353 +1,209 @@
<template> <template>
<!-- 顶部菜单 --> <!-- 顶部菜单 -->
<view class="tagClass"> <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"> v-for="(item,index) in pageData.status.list" :key="index">
{{item}} {{item.name}}
</view> </view>
</view> </view>
<!-- 搜搜 --> <!-- 搜搜 -->
<view class="search"> <!-- <view class="search">
<view class="inputsearch"> <up-input
搜索优惠券名称 placeholder="搜索优惠券名称"
</view> 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 class="searchBtn">
搜索 搜索
</view> </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 class="couponContentListTop">
<view> <view class="title"> {{ item.title }} </view>
充值20元优惠券 <view> ID:{{item.id}} </view>
</view>
<view>
ID:258792
</view>
</view> </view>
<view class="couponContentListcontent"> <view class="couponContentListcontent">
<view> <view>
<view> <view> 使用门槛 </view>
使用门槛 <view> {{ item.fullAmount }} 元减 {{ item.discountAmount }} </view>
</view> </view>
<view> <view>
满200.00元减20.00 <view> 领取方式 </view>
</view> <view> 用户不可自行领取 </view>
</view> </view>
<view> <view>
<view> <view> 有效期 </view>
券类型 <view> 领券后{{ item.validDays }}天过期 </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 class="JQclass"> <view class="JQclass">
<image :src="'/static/coupon/qrcode.svg'" mode="scaleToFill" />
</view> </view>
</view> </view>
<view class="couponContentListcontent2"> <view class="couponContentListcontent2">
<view class=""> <view class="">
<view class=""> <view class="num"> {{ item.number }} </view>
1000 <view class="lable"> 发放数量 </view>
</view> </view>
<view class=""> <view class="">
发放数量 <view class="num"> {{ item.number-item.leftNumber }} </view>
</view> <view class="lable"> 已领取 </view>
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="num"> {{ item.leftNumber }} </view>
1000 <view class="lable"> 剩余 </view>
</view> </view>
<view class=""> <view class="">
发放数量 <view class="num"> {{ item.useNumber }} </view>
</view> <view class="lable"> 已使用 </view>
</view>
<view class="">
<view class="">
1000
</view>
<view class="">
发放数量
</view>
</view>
<view class="">
<view class="">
1000
</view>
<view class="">
发放数量
</view>
</view> </view>
</view> </view>
<view class="couponContentListbottom"> <view class="couponContentListbottom">
<button>编辑</button> <button @tap="editCoupon(item)">编辑</button>
<button>删除</button> <button @tap="delCoupon(item)">删除</button>
<button>同步</button>
</view> </view>
</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>
<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>
</view>
</view>
</view>
<view class="bottomPop"> <view class="bottomPop">
<button @click="adddiscount">+添加满减优惠券</button> <button @click="addCoupon">+添加{{pageData.status.tagName}}</button>
</view> </view>
</template> </template>
<script setup> <script setup>
import go from '@/commons/utils/go.js' import go from '@/commons/utils/go.js'
import { getTbShopCoupon , delTbShopCoupon} from '@/http/yskApi/coupon.js'
import { import {
reactive, reactive,
ref, ref,
toRef, onMounted
watch
} from 'vue'; } from 'vue';
import { onLoad, onShow,onPageScroll,
onPullDownRefresh,
onReachBottom, } from '@dcloudio/uni-app';
const pageData = reactive({ const pageData = reactive({
status: { status: {
list: ['全部', '储存中储存中', '已取完', '已过期', '储存中', '已取完', '已过期', ], list: [
{name: '优惠券', type: 1},
{name: '商品兑换券', type: 2},
],
tagName: "优惠券",
active: 0, active: 0,
} },
query: {
type: 1,
page: 1,
size: 10,
},
couponList: [],
totalElements: 0,
}) })
const adddiscount = ()=>{
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') 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> </script>
<style lang='scss'> <style lang='scss'>
body{
background-color: #f9f9f9;
}
.tagClass { .tagClass {
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
overflow-x: auto; overflow-x: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
margin-top: 44rpx; padding-top: 44rpx;
padding: 32rpx 28rpx;
background-color: #fff;
.tag-item { .tag-item {
display: inline-block; display: inline-block;
padding: 8rpx 22rpx; padding: 10rpx 24rpx;
margin-left: 16rpx; margin-right: 32rpx;
border-radius: 4rpx 4rpx 4rpx 4rpx; border-radius: 4rpx 4rpx 4rpx 4rpx;
text-align: center; text-align: center;
color: #666; font-weight: 400;
font-size: 28rpx;
color: #666666;
background: #F7F7FA; background: #F7F7FA;
&.active { &.active {
background: #E6F0FF; background: #E6F0FF;
color: $my-main-color; color: #318AFE;
} }
} }
} }
@@ -361,7 +217,8 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 32rpx; padding: 32rpx;
background-color: #fff;
margin-bottom: 32rpx;
.inputsearch { .inputsearch {
color: #999999; color: #999999;
width: 542rpx; width: 542rpx;
@@ -382,24 +239,30 @@
border-radius: 32rpx 32rpx 32rpx 32rpx; border-radius: 32rpx 32rpx 32rpx 32rpx;
} }
} }
.couponContent {
background-color: #f9f9f9;
padding: 32rpx 0;
.couponContentList { .couponContentList {
width: 694rpx; /* width: 694rpx; */
height: 544rpx; /* height: 544rpx; */
background: #FFFFFF; margin: 32rpx auto 0;
margin-bottom: 32rpx;
padding: 0 28rpx 182rpx 28rpx;
}
.couponContent {
/* background-color: #f9f9f9; */
border-radius: 18rpx 18rpx 18rpx 18rpx; border-radius: 18rpx 18rpx 18rpx 18rpx;
margin: 0 auto; background: #FFFFFF;
padding: 32rpx 24rpx; padding: 32rpx 24rpx;
margin-bottom: 32rpx;
.couponContentListTop { .couponContentListTop {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.title{
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
>view:last-child { >view:last-child {
width: 98rpx; width: 98rpx;
height: 36rpx; height: 36rpx;
@@ -454,7 +317,7 @@
.JQclass { .JQclass {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
background-color: #318AFE; /* background-color: #318AFE; */
position: absolute; position: absolute;
right: 48rpx; right: 48rpx;
top: 90rpx; top: 90rpx;
@@ -466,21 +329,32 @@
justify-content: space-between; justify-content: space-between;
text-align: center; text-align: center;
padding-top: 24rpx; 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 { .couponContentListbottom {
margin-top: 24rpx; margin-top: 24rpx;
overflow: hidden;
>button { >button {
float: right; float: right;
width: 140rpx; width: 140rpx;
height: 56rpx; height: 56rpx;
margin-right: 22rpx; margin-left: 22rpx;
line-height: 56rpx; line-height: 56rpx;
text-align: center; text-align: center;
background: #FFFFFF; color: #999;
background: #F7F7FA;
border-radius: 28rpx 28rpx 28rpx 28rpx; border-radius: 28rpx 28rpx 28rpx 28rpx;
border: 2rpx solid #E5E5E5;
font-size: 28rpx; font-size: 28rpx;
} }
@@ -490,6 +364,8 @@
} }
} }
} }
.couponContent:last-of-type{
/* margin-bottom: 150rpx; */
} }
.bottomPop { .bottomPop {

View File

@@ -930,7 +930,7 @@
import { import {
$types, $types,
$defaultSku $defaultSku
} from '../goodsData.js' } from '@/commons/goodsData.js'
import { import {
$getProductDetail, $getProductDetail,
$tbShopCategory, $tbShopCategory,

View File

@@ -546,7 +546,7 @@
import { import {
$types, $types,
$defaultSku $defaultSku
} from '../goodsData.js' } from '@/commons/goodsData.js'
import { import {
$getProductDetail, $getProductDetail,
$tbShopCategory, $tbShopCategory,

View File

@@ -183,8 +183,9 @@
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
import color from '@/commons/color.js'; import color from '@/commons/color.js';
import { import {
$types,
$defaultSku $defaultSku
} from '../goodsData.js' } from '@/commons/goodsData.js'
import { import {
$productSpec $productSpec
} from '@/http/yskApi/goods.js'; } from '@/http/yskApi/goods.js';

View File

@@ -78,7 +78,8 @@
import listItem from './components/list-item'; import listItem from './components/list-item';
import { import {
$pageData $pageData
} from '../goodsData.js' } from '@/commons/goodsData.js'
import { import {
computed, computed,
reactive, reactive,

View File

@@ -93,8 +93,9 @@
$getProductDetail, $getProductDetail,
$getProductStockDetail,$getProductStockDetailSum $getProductStockDetail,$getProductStockDetailSum
} from '@/http/yskApi/goods.js' } from '@/http/yskApi/goods.js'
import {$invoicingType} from '../goodsData.js' import {
$invoicingType
} from '@/commons/goodsData.js'
const search = reactive({ const search = reactive({
keyword: '', keyword: '',
show: false show: false

View File

@@ -1,6 +1,6 @@
import { import {
$types $types
} from '@/pageProduct/goodsData.js' } from '@/commons/goodsData.js'
export function returnSkuSnap(goods) { export function returnSkuSnap(goods) {
const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec const selectSpec = typeof goods.selectSpec === 'string' ? JSON.parse(goods.selectSpec) : goods.selectSpec
let result = selectSpec.map(v => { let result = selectSpec.map(v => {

View File

@@ -22,7 +22,7 @@
<input v-model="search.keyword" @confirm="searchConfirm" type="text" <input v-model="search.keyword" @confirm="searchConfirm" type="text"
placeholder-style="font-size:28rpx;" placeholder="搜索" /> placeholder-style="font-size:28rpx;" placeholder="搜索" />
</view> </view>
<view @tap.stop="hideSearch" v-if="search.show">取消</view> <view @tap.stop="clearSearch" v-if="search.show">取消</view>
</view> </view>
</view> </view>
<view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide"> <view :style="{height:times.show?timesHeight:0}" class="tranistion status overflow-hide">
@@ -34,7 +34,7 @@
<view :style="{height: status.bottomHeight+'px'}"></view> <view :style="{height: status.bottomHeight+'px'}"></view>
</view> </view>
<view :style="{height:status.show?statusHeight:0}" class="tranistion status overflow-hide"> <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"> v-for="(item,index) in status.list" :key="index">
<view>{{item.label}}</view> <view>{{item.label}}</view>
<uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons> <uni-icons v-if="status.active===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
@@ -55,10 +55,17 @@
</view> </view>
</view> </view>
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between"> <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"> <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> <table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
</view> </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> <my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
</view> </view>
</view> </view>
@@ -239,12 +246,16 @@
function searchConfirm() { function searchConfirm() {
hideSearch() hideSearch()
filterTableList() query.page=1;
getTable()
// tables.list = tables.originList.filter((v) => // tables.list = tables.originList.filter((v) =>
// v.name.includes(search.keyword.trim()) // v.name.includes(search.keyword.trim())
// ); // );
} }
function clearSearch(){
search.keyword=''
hideSearch()
}
function hideSearch() { function hideSearch() {
search.show = false search.show = false
maskHide() maskHide()
@@ -372,10 +383,17 @@
mask.value.close() mask.value.close()
} }
const query = { const query = reactive({
page: 0, page: 1,
size: 10, size: 10,
areaId: 0 areaId: 0,
totalElements:0
})
// 页数改变事件
function pageChange(page) {
console.log(page);
query.page = page
getTable()
} }
const tables = reactive({ const tables = reactive({
hasAjax: false, hasAjax: false,
@@ -392,12 +410,14 @@
query.areaId = item.id query.areaId = item.id
} }
async function getTable() { async function getTable() {
let state=status.list[status.active].key
state=state?(state=='all'?'':state):''
const { const {
content content,total
} = await $table.get(query) } = await $table.get({...query,name:search.keyword,state})
tables.hasAjax = true tables.hasAjax = true
tables.originList = content query.totalElements=total||0
filterTableList() tables.list = content
} }
const areaMap = ref({}) const areaMap = ref({})
async function getArea() { async function getArea() {
@@ -415,28 +435,19 @@
} }
watch(() => tables.area.sel, (newval) => { watch(() => tables.area.sel, (newval) => {
console.log(newval); console.log(newval);
query.page = 0 query.page = 1
getTable() getTable()
}) })
watch(() => status.active, (newval) => { watch(() => status.active, (newval) => {
query.page = 0 query.page = 1
// if (newval === 0) { // if (newval === 0) {
// return tables.list = tables.originList // return tables.list = tables.originList
// } // }
// tables.list = tables.originList.filter((v) => { // tables.list = tables.originList.filter((v) => {
// return v.status == status.list[status.active].key // 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) => { watch(() => times.active, (newval) => {
setTimer() setTimer()
}) })

View File

@@ -891,7 +891,13 @@
"pageId": "PAGES_COUPON_DISCOUNTCOUPONS", "pageId": "PAGES_COUPON_DISCOUNTCOUPONS",
"path": "discountCoupons", "path": "discountCoupons",
"style": { "style": {
"navigationBarTitleText": "添加折扣券" "navigationBarTitleText": "优惠券"
}
}, {
"pageId": "PAGES_COUPON_CERTIFICATE",
"path": "editCertificate",
"style": {
"navigationBarTitleText": "商品兑换券"
} }
}] }]
}, },
@@ -1088,6 +1094,7 @@
} }
] ]
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",

View File

@@ -145,6 +145,11 @@
icon: '/static/indexImg/icon-cashier.svg', icon: '/static/indexImg/icon-cashier.svg',
pageUrl: 'PAGES_SHOP_SETUP', pageUrl: 'PAGES_SHOP_SETUP',
}, },
// {
// title: '优惠券',
// icon: '/static/coupon/icon_coupon.svg',
// pageUrl: 'PAGES_COUPON_INDEX',
// },
{ {
title: '订阅通知', title: '订阅通知',
icon: '/static/indexImg/icon-notification.svg', icon: '/static/indexImg/icon-notification.svg',
@@ -225,6 +230,10 @@
// pageUrl: 'PAGES_AD_LIST', // pageUrl: 'PAGES_AD_LIST',
// entId: 'ENT_ADVERT_CONTROL' // entId: 'ENT_ADVERT_CONTROL'
// }, // },
// { // {
// title: '营销红包', // title: '营销红包',
// icon: '/static/indexImg/red-envelope.svg', // icon: '/static/indexImg/red-envelope.svg',
@@ -232,11 +241,6 @@
// entId: 'ENT_MCH_MEMBER' // entId: 'ENT_MCH_MEMBER'
// }, // },
// {
// title: '优惠券',
// icon: '/static/indexImg/red-envelope.svg',
// pageUrl: 'PAGES_COUPON_INDEX'
// },
{ {
title: '退出登录', title: '退出登录',

View File

@@ -239,14 +239,10 @@
}) })
// #ifdef H5 // #ifdef H5
// vdata.formData.username = '15699991111' vdata.formData.username = '17792050546'
// vdata.formData.pwd = '123456' vdata.formData.pwd = 'sy666888'
vdata.formData.username = ''
vdata.formData.pwd = ''
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
vdata.formData.username = ''
vdata.formData.pwd = ''
// vdata.formData.username = '15699991111' // vdata.formData.username = '15699991111'
// vdata.formData.pwd = 'qwer1234' // vdata.formData.pwd = 'qwer1234'
// #endif // #endif

View File

@@ -23,6 +23,8 @@
</view> </view>
<view class="list "> <view class="list ">
<view class="">
<template v-if="tables.list.length">
<view class=" bg-fff box bg-fff"> <view class=" bg-fff box bg-fff">
<view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index" <view class="u-flex item u-row-between" v-for="(item,index) in tables.list" :key="index"
@tap="chooseTable(index,item)"> @tap="chooseTable(index,item)">
@@ -45,6 +47,15 @@
</view> </view>
</view> </view>
</view> </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="tables.list.length<=0"> <template v-if="tables.list.length<=0">
<my-img-empty tips="未找到相关的桌台"></my-img-empty> <my-img-empty tips="未找到相关的桌台"></my-img-empty>
</template> </template>
@@ -94,10 +105,13 @@
uni.navigateBack() uni.navigateBack()
}, 100) }, 100)
} }
let searchValue=ref('') let searchValue = ref('')
function search(){
function search() {
query.page=1
getTable()
} }
function chooseTable(index, item) { function chooseTable(index, item) {
if (item.status == 'closed') { if (item.status == 'closed') {
return uni.showToast({ return uni.showToast({
@@ -109,7 +123,7 @@
nouser.value = true nouser.value = true
return emitChooeTable() return emitChooeTable()
} else { } else {
tables.selIndex=index tables.selIndex = index
emitChooeTable(item) emitChooeTable(item)
} }
} }
@@ -128,11 +142,20 @@
function areaChange(e) { function areaChange(e) {
area.defaultCateIndex = e.detail.value area.defaultCateIndex = e.detail.value
area.sel = area.list[e.detail.value] area.sel = area.list[e.detail.value]
query.page=1
getTable()
} }
const query = { const query = {
page: 0, page: 1,
size: 100, size: 10,
areaId: 0 areaId: 0,
totalElements:0
}
// 页数改变事件
function pageChange(page) {
console.log(page);
query.page = page
getTable()
} }
const tables = reactive({ const tables = reactive({
hasAjax: false, hasAjax: false,
@@ -141,15 +164,15 @@
list: [] list: []
}) })
async function getTable() { async function getTable() {
// let state=status.list[status.active].key
// state=state?(state=='all'?'':state):''
const areaId=area.list[area.defaultCateIndex].id
let { let {
content content,total
} = await $table.get(query) } = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})
tables.hasAjax = true query.totalElements=total||0;
content = content.filter(v =>{ tables.hasAjax = true;
// return v.status == 'idle'||(v.status=='using') console.log(content);
return v.status == 'idle'
})
console.log(content );
tables.list = content tables.list = content
tables.selIndex = content.findIndex(v => v.tableId == option.tableId) tables.selIndex = content.findIndex(v => v.tableId == option.tableId)
tables.originList = content tables.originList = content
@@ -172,11 +195,7 @@
} }
watch(() => area.sel, (newval) => { watch(() => area.sel, (newval) => {
if(!newval){ getTable()
tables.list = tables.originList
return
}
tables.list = tables.originList.filter(v => v.areaId == newval.id)
}) })
let option = {} let option = {}
onLoad(opt => { onLoad(opt => {
@@ -202,6 +221,7 @@
background: #FFFFFF; background: #FFFFFF;
width: 18px; width: 18px;
height: 18px; height: 18px;
&.active { &.active {
background-color: $my-main-color; background-color: $my-main-color;
border-color: $my-main-color; border-color: $my-main-color;
@@ -225,11 +245,14 @@
.scale7 { .scale7 {
transform: scale(0.7); transform: scale(0.7);
} }
::v-deep .uni-searchbar{
padding: 0!important; ::v-deep .uni-searchbar {
padding: 0 !important;
} }
.search { .search {
padding: 20rpx 28rpx 20rpx 28rpx; padding: 20rpx 28rpx 20rpx 28rpx;
.icon-saoma { .icon-saoma {
margin-left: 20rpx; margin-left: 20rpx;
width: 34rpx; width: 34rpx;
@@ -239,6 +262,7 @@
.list { .list {
padding: 32rpx 24rpx; padding: 32rpx 24rpx;
.no-choose { .no-choose {
padding: 36rpx 30rpx 36rpx 24rpx; padding: 36rpx 30rpx 36rpx 24rpx;
} }

View File

@@ -3,6 +3,7 @@
<view class="search bg-fff u-flex u-col-center "> <view class="search bg-fff u-flex u-col-center ">
<view class="u-flex-1"> <view class="u-flex-1">
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search" <uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="搜索" @confirm="search"
@clear="search"
v-model="query.name"> v-model="query.name">
</uni-search-bar> </uni-search-bar>
</view> </view>
@@ -15,6 +16,7 @@
<view>不选择用户</view> <view>不选择用户</view>
<my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio> <my-radio v-model="nouser" :size="18" border-color="#d1d1d1" @change="chooseUser"></my-radio>
</view> </view>
<template v-if="list.length>0">
<view class="u-m-t-32 bg-fff box bg-fff"> <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" <view class="u-flex item u-row-between" v-for="(item,index) in list" :key="index"
@tap="chooseUser(index,item)"> @tap="chooseUser(index,item)">
@@ -42,6 +44,16 @@
border-color="#d1d1d1"></my-radio> border-color="#d1d1d1"></my-radio>
</view> </view>
</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> </view>
@@ -54,20 +66,23 @@
onLoad onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
reactive,onBeforeMount, reactive,
onBeforeMount,
ref ref
} from 'vue'; } from 'vue';
let nouser = ref(false) let nouser = ref(false)
let timer=null let timer = null
function emitChooser(data) { function emitChooser(data) {
uni.$emit('choose-user', data) uni.$emit('choose-user', data)
timer=setTimeout(() => { timer = setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 100) }, 100)
} }
onBeforeMount(()=>{ onBeforeMount(() => {
clearInterval(timer) clearInterval(timer)
}) })
function chooseUser(index, item) { function chooseUser(index, item) {
if (index === undefined || item === undefined) { if (index === undefined || item === undefined) {
nouser.value = true nouser.value = true
@@ -85,28 +100,38 @@
} }
const query = reactive({ const query = reactive({
page: 0, page: 1,
name: '', name: '',
size: 300, totalElements: 0,
isVip:1 size: 10,
isVip: 1
}) })
const list = reactive([]) const list = reactive([])
let hasAjax=ref(false)
async function getUser() { async function getUser() {
const { const {
content content,
totalElements
} = await Api.queryAllShopUser(query) } = await Api.queryAllShopUser(query)
hasAjax.value=true
list.length=content.length
for (let i in content) { for (let i in content) {
list.push({ list[i]={
...content[i], ...content[i],
checked: false checked: false
})
} }
}
query.totalElements = totalElements
console.log(list); console.log(list);
} }
function pageChange(e) {
query.page=e
getUser()
}
function search() { function search() {
query.page = 0 query.page = 1
list.length = 0
getUser() getUser()
} }
onLoad(() => { onLoad(() => {

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="page-gray color-333 u-font-28"> <view class="page-gray color-333 u-font-28">
<template v-if="true"> <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>桌位号</view>
<view class="font-bold u-font-32 u-m-t-16"> <view class="font-bold u-font-32 u-m-t-16">
{{table.name||''}} {{table.name||''}}
@@ -330,14 +330,13 @@
defaultCateIndex: 0, defaultCateIndex: 0,
}) })
watch(() => userNumbers.defaultCateIndex, (newval) => { watch(() => userNumbers.defaultCateIndex, (newval) => {
console.log(newval);
updateChoseCount() updateChoseCount()
}) })
//更新就餐人数 //更新就餐人数
async function updateChoseCount() { async function updateChoseCount() {
console.log($shop.value); console.log($shop.value);
if (!$shop.value.isTableFee) { if (!$shop.value.isTableFee&& table.value.tableId) {
//不免餐位费 //不免餐位费
const res = await Api.$choseCount({ const res = await Api.$choseCount({
masterId: option.masterId, masterId: option.masterId,
@@ -530,8 +529,7 @@
}else{ }else{
$seatFee.totalAmount=0 $seatFee.totalAmount=0
} }
console.log(userNumbers.defaultCateIndex);
console.log(goods.list);
} }
let $shop = ref({ let $shop = ref({

View File

@@ -63,8 +63,9 @@
</view> </view>
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm" <up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
@cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)" width="300px"></up-modal> @confirm="confirmModelConfirm" @cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)"
width="300px"></up-modal>
</view> </view>
</template> </template>
@@ -114,7 +115,7 @@
}) })
const modal = reactive({ const modal = reactive({
key: '', key: '',
clear:false clear: false
}) })
function confirmModelConfirm() { function confirmModelConfirm() {
@@ -124,7 +125,7 @@
} }
function setModalShow(key = 'show', show = true) { 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('购物车是空的!') return infoBox.showToast('购物车是空的!')
} }
modal.key = key modal.key = key
@@ -163,6 +164,13 @@
status, status,
type type
} = props.table } = 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', { go.to('PAGES_CONFIRM_ORDER', {
masterId: props.masterId, masterId: props.masterId,
type, type,
@@ -200,7 +208,7 @@
} }
function clear() { function clear() {
setModalShow('clear',false) setModalShow('clear', false)
edmits('clear') edmits('clear')
hideGoods() hideGoods()
} }

View File

@@ -53,6 +53,7 @@
toRefs, toRefs,
watch watch
} from 'vue'; } from 'vue';
import util from '../util.js';
const props = defineProps({ const props = defineProps({
img:{ img:{
type:Object, type:Object,
@@ -99,7 +100,7 @@
} }
return ( return (
item.isPauseSale || item.isPauseSale ||
(item.typeEnum !== "sku" && item.specList[0].stockNumber <= 0) (item.typeEnum !== "sku" && item.isStock==1&& item.stockNumber <= 0)
); );
}) })

View File

@@ -103,8 +103,8 @@
<list-goods-item :img="{width:'330rpx',height:'330rpx'}" <list-goods-item :img="{width:'330rpx',height:'330rpx'}"
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)" @chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)" @add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex" @reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
:data="goodsItem"></list-goods-item> :index="goodsItem.goodsIndex" :data="goodsItem"></list-goods-item>
</view> </view>
</view> </view>
@@ -122,20 +122,27 @@
</view> </view>
<!-- 选择规格 --> <!-- 选择规格 -->
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" <guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
:goodsData="selGoods"
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap" :title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
:skus="guigeModelData.chooseGoods.skus"></guige-model> :skus="guigeModelData.chooseGoods.skus"></guige-model>
<!-- 添加附加费 --> <!-- 添加附加费 -->
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge> <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> </template>
<script setup> <script setup>
import _ from 'lodash'; import _ from 'lodash';
import * as Api from '@/http/yskApi/Instead.js' import * as Api from '@/http/yskApi/Instead.js'
import { import {
$table $table,
$choseTable,
$returnTableDetail
} from '@/http/yskApi/table.js' } from '@/http/yskApi/table.js'
import { import {
$tbShopCategory $tbShopCategory
@@ -158,7 +165,8 @@
reactive, reactive,
ref, ref,
nextTick, nextTick,
watch,getCurrentInstance watch,
getCurrentInstance
} from 'vue'; } from 'vue';
import myCar from './components/car' import myCar from './components/car'
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
@@ -173,11 +181,45 @@
import { import {
tbShopInfo tbShopInfo
} from '@/http/yskApi/user.js' } 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(); const instance = getCurrentInstance();
let canXiadan=ref(false) let canXiadan = ref(false)
async function xiadanClick(){ async function xiadanClick() {
canXiadan.value=await hasPermission('允许下单') canXiadan.value = await hasPermission('允许下单')
} }
xiadanClick() xiadanClick()
//临时菜 //临时菜
@@ -198,9 +240,9 @@
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
tabbar: storageManage.cacheGoods()||[], tabbar: storageManage.cacheGoods() || [],
menuItemPos: [], menuItemPos: [],
arr: storageManage.cacheGoodsNode()||[],//左右联动布局节点信息 arr: storageManage.cacheGoodsNode() || [], //左右联动布局节点信息
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度 scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
timer: null, // 定时器 timer: null, // 定时器
topZhanwei: 136 + 24, topZhanwei: 136 + 24,
@@ -305,8 +347,8 @@
page: 0, page: 0,
size: 300 size: 300
}) { }) {
const showLoading=data.tabbar.length<=0?true:false const showLoading = data.tabbar.length <= 0 ? true : false
return Api.getGoodsLists(par,showLoading) return Api.getGoodsLists(par, showLoading)
} }
//获取购物车数据 //获取购物车数据
async function getCart(par = { async function getCart(par = {
@@ -333,9 +375,9 @@
} }
//加入购物车 //加入购物车
function addCart(par) { function addCart(par) {
if (!data.table.tableId) { // if (!data.table.tableId) {
return infoBox.showToast('请先选择桌台!') // return infoBox.showToast('请先选择桌台!')
} // }
const submitPar = { const submitPar = {
masterId: data.masterId, masterId: data.masterId,
tableId: data.table.tableId, tableId: data.table.tableId,
@@ -400,7 +442,7 @@
//获取桌台信息 //获取桌台信息
async function getTableInfo() { async function getTableInfo() {
if(data.table.tableId){ if (data.table.tableId) {
const res = await $table.get({ const res = await $table.get({
qrcode: data.table.tableId qrcode: data.table.tableId
}) })
@@ -413,6 +455,8 @@
let $originGoods = [] let $originGoods = []
let $category = [] let $category = []
async function init() { async function init() {
const masterRes = await getMasterId()
data.masterId = masterRes.masterId
const shopInfo = await tbShopInfo() const shopInfo = await tbShopInfo()
$shop.value = shopInfo $shop.value = shopInfo
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo) const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
@@ -440,10 +484,7 @@
$originGoods = goods $originGoods = goods
if (!data.table.tableId) { if (!data.table.tableId) {
//无桌台 //无桌台
const {
masterId
} = await getMasterId()
data.masterId = masterId
setTabBar(category, goods, []) setTabBar(category, goods, [])
return return
} }
@@ -509,7 +550,7 @@
} }
function search() { function search() {
if(searchValue.value===''){ if (searchValue.value === '') {
isSearch.value = false isSearch.value = false
return return
} }
@@ -534,8 +575,27 @@
function watchChooseTable() { function watchChooseTable() {
uni.$off('choose-table') uni.$off('choose-table')
uni.$on('choose-table', (tableData) => { uni.$on('choose-table', async (item) => {
data.table = tableData 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; return prve;
}, {}); }, {});
const canBudyGoods = specList const canBudyGoods = specList
.filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item)) .filter((v) => util.isCanBuy(v, guigeModelData.chooseGoods.item))
.sort((a, b) => { .sort((a, b) => {
const aNumber = a.specSnap.split(",").reduce((prve, cur) => { const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
return prve + skuMapNumber[cur]; return prve + skuMapNumber[cur];
@@ -680,7 +740,7 @@
prve[i] = matchArr prve[i] = matchArr
.filter((v) => v.specSnap.match(i)) .filter((v) => v.specSnap.match(i))
.every((v) => { .every((v) => {
return !util.isCanBuy(v,guigeModelData.chooseGoods.item) return !util.isCanBuy(v, guigeModelData.chooseGoods.item)
}); });
} }
} }
@@ -697,7 +757,8 @@
} }
let selGoods=ref({}) let selGoods = ref({})
function chooseGuige(foodsindex, index) { function chooseGuige(foodsindex, index) {
if (!canAddGoods()) { if (!canAddGoods()) {
return infoBox.showToast('请先选择桌台', 0.5).then(res => { return infoBox.showToast('请先选择桌台', 0.5).then(res => {
@@ -705,7 +766,7 @@
}) })
} }
const $goods = data.tabbar[index].foods[foodsindex] const $goods = data.tabbar[index].foods[foodsindex]
selGoods.value=$goods selGoods.value = $goods
guigeModelData.title = $goods.name guigeModelData.title = $goods.name
const specList = $goods.specList; const specList = $goods.specList;
const tagSnap = JSON.parse($goods.skuResult.tagSnap) const tagSnap = JSON.parse($goods.skuResult.tagSnap)
@@ -809,15 +870,16 @@
return true return true
} }
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) { function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd,goodsIndex) goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
} }
function setSearchGoods(index,chooseNumber){
if(index!==undefined){ function setSearchGoods(index, chooseNumber) {
searchResult.value[index].chooseNumber=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()) { // if (!canAddGoods()) {
// return infoBox.showToast('请先选择桌台', 0.5).then(res => { // return infoBox.showToast('请先选择桌台', 0.5).then(res => {
// chooseTable() // chooseTable()
@@ -842,7 +904,7 @@
//移除 //移除
cars.splice(goodsInCarIndex, 1) cars.splice(goodsInCarIndex, 1)
$goods.chooseNumber = 0 $goods.chooseNumber = 0
setSearchGoods(searchGoodsIndex,0) setSearchGoods(searchGoodsIndex, 0)
return await removeCartGoods({ return await removeCartGoods({
cartId cartId
}) })
@@ -857,7 +919,7 @@
}) })
carGoods.number = number carGoods.number = number
$goods.chooseNumber = number $goods.chooseNumber = number
setSearchGoods(searchGoodsIndex,number) setSearchGoods(searchGoodsIndex, number)
} else { } else {
//增加 //增加
const num = suit const num = suit
@@ -992,8 +1054,8 @@
if (!data.menuHeight) { if (!data.menuHeight) {
await getElRect('menu-scroll-view', 'menuHeight'); await getElRect('menu-scroll-view', 'menuHeight');
} }
if(e.detail.scrollTop==0){ if (e.detail.scrollTop == 0) {
isTabClickOver=true isTabClickOver = true
return swichMenu(0) return swichMenu(0)
} }
setTimeout(() => { // 节流 setTimeout(() => { // 节流
@@ -1231,10 +1293,12 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
::v-deep .uni-searchbar{
padding-top: 12px!important; ::v-deep .uni-searchbar {
padding-bottom: 16px!important; padding-top: 12px !important;
padding-bottom: 16px !important;
} }
.right-box { .right-box {
width: 572rpx; width: 572rpx;
// background-color: rgb(250, 250, 250); // background-color: rgb(250, 250, 250);
@@ -1258,7 +1322,8 @@
.item-title { .item-title {
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; font-weight: bold;
&.active{
&.active {
color: $my-main-color; color: $my-main-color;
} }
} }

View File

@@ -1,5 +1,5 @@
<template> <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="u-flex u-row-between">
<view class="font-bold">附加费</view> <view class="font-bold">附加费</view>
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'"> <template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
@@ -9,11 +9,12 @@
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button> <my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
</template> </template>
</view> </view>
<view>
<template v-if="data.status!='return'"> <template v-if="data.status!='return'">
<view class="u-flex u-row-between u-m-t-24"> <view class="u-flex u-row-between u-m-t-24">
<view>{{data.name||'餐位费'}}</view> <view>{{data.name||'餐位费'}}</view>
<view>x{{data.number}}</view> <view>x{{data.number||0}}</view>
<view>{{data.totalAmount}}</view> <view class="price-min-width">{{data.totalAmount}}</view>
</view> </view>
</template> </template>
<template v-else> <template v-else>
@@ -22,41 +23,82 @@
<view class="line-th ">{{data.name||'餐位费'}}</view> <view class="line-th ">{{data.name||'餐位费'}}</view>
<view class="tag yitui u-m-l-10">已退</view> <view class="tag yitui u-m-l-10">已退</view>
</view> </view>
<view class="line-th">x{{data.number}}</view> <view class="line-th">x{{data.number||0}}</view>
<view class="line-th">{{data.totalAmount}}</view> <view class="line-th">{{data.totalAmount}}</view>
</view> </view>
</template> </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> </view>
</template> </template>
<script setup> <script setup>
import {
computed
} from 'vue'
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: () => {} default: () => {}
}, },
orderInfo:{ orderInfo: {
type: Object, type: Object,
default: () => {} default: () => {
return {
detailList: []
}
}
}, },
table:{ table: {
type: Object, type: Object,
default: () => {} default: () => {}
} }
}) })
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={ const statusMap = {
unpaid:'未支付' unpaid: '未支付'
} }
const emits=defineEmits(['tuicai','tuikuan','printOrder']) const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
function returnStatus(status){
return statusMap[status]||'' 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> </script>
@@ -65,9 +107,14 @@
padding: 0 6rpx; padding: 0 6rpx;
border-radius: 8rpx; border-radius: 8rpx;
font-size: 24rpx; font-size: 24rpx;
&.yitui { &.yitui {
background-color: rgb(188, 188, 188); background-color: rgb(188, 188, 188);
color: #fff; color: #fff;
} }
} }
.price-min-width{
min-width: 100rpx;
text-align: right;
}
</style> </style>

View File

@@ -23,44 +23,53 @@
<view class=""> <view class="">
<view class="u-flex"> <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>
<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> </view>
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</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"> <view class="u-m-t-12 color-666 u-font-24" v-if="item.note">
备注{{item.note}} 备注{{item.note}}
</view> </view>
</view> </view>
<view class="u-text-right u-m-t-28"> <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>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>
<template v-else> <template v-else>
<template v-if="item.priceAmount<=0"> <view>{{returnTotalMoney(item)}}</view>
<view>0.00</view>
<view class="line-th color-666 ">{{returnTotalMoney(item)}}</view>
</template>
<template v-else>
<view>{{item.priceAmount}}</view>
</template>
</template> </template>
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view> <view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
</view> </view>
</view> </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'"> <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 :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
<my-button :width="128" :height="48" plain shape="circle" <my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
@tap="tuicai(item,index)"><text class="no-wrap">退菜</text></my-button> class="no-wrap">退菜</text></my-button>
</view> </view>
</template> </template>
<template v-if="item.status!='refund'"> <template v-if="item.status!='refund'&&!item.gift">
<template v-if="orderInfo.status=='closed'||orderInfo.status=='refund'"> <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'"> <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" <my-button :width="128" :height="48" plain shape="circle"
@@ -122,7 +131,7 @@
<view></view> <view></view>
<view> <view>
<text>总计</text> <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> </view>
<view class="u-m-t-24"> <view class="u-m-t-24">
@@ -137,14 +146,17 @@
computed computed
} from 'vue'; } from 'vue';
import color from '@/commons/color.js' 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']) const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
function returnTotalMoney(item){ function returnTotalMoney(item) {
return (item.price*item.num).toFixed(2) return (item.price * item.num).toFixed(2)
} }
function to2(n){
if(!n){ function to2(n) {
if (!n) {
return 0 return 0
} }
return n.toFixed(2) return n.toFixed(2)
@@ -155,8 +167,8 @@
} }
function tuikuan(item, index) { function tuikuan(item, index) {
hasPermission('允许退款').then(res=>{ hasPermission('允许退款').then(res => {
if(res){ if (res) {
emits('tuikuan', item, index) emits('tuikuan', item, index)
} }
}) })
@@ -190,9 +202,11 @@
const allPrice = computed(() => { const allPrice = computed(() => {
const goodsPrice = props.data.reduce((prve, cur) => { 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) => { 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) }, 0)
return prve + curTotal return prve + curTotal
}, 0) }, 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(() => { const goodsNumber = computed(() => {
let result = 0 let result = 0
result = props.data.reduce((a, b) => { result = props.data.reduce((a, b) => {
@@ -222,9 +249,11 @@
.border-top { .border-top {
border-color: #F6F6F6; border-color: #F6F6F6;
} }
.border-r-24{
.border-r-24 {
border-radius: 24rpx; border-radius: 24rpx;
} }
.border-bottom { .border-bottom {
// border-color: rgb(240, 240, 240); // border-color: rgb(240, 240, 240);
border-color: #F6F6F6; border-color: #F6F6F6;
@@ -238,11 +267,13 @@
padding: 4rpx 8rpx 2rpx 10rpx; padding: 4rpx 8rpx 2rpx 10rpx;
border-radius: 8rpx; border-radius: 8rpx;
font-size: 24rpx; font-size: 24rpx;
&.no-pay { &.no-pay {
background-color: rgb(170, 170, 170); background-color: rgb(170, 170, 170);
color: #fff; color: #fff;
} }
&.refund{
&.refund {
background-color: #FCE7E7; background-color: #FCE7E7;
padding: 8rpx 20rpx 6rpx 22rpx; padding: 8rpx 20rpx 6rpx 22rpx;
color: #EB4F4F; color: #EB4F4F;

View File

@@ -7,7 +7,8 @@
</view> --> </view> -->
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info" <goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list> :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" <extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
:data="orderDetail.seatFee"></extra-vue> :data="orderDetail.seatFee"></extra-vue>
</template> </template>
@@ -16,7 +17,7 @@
<view style="height: 200rpx;"></view> <view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff "> <view class="u-fixed bottom bg-fff ">
<view class="u-flex u-abso"> <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'"> <view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
<my-button @tap="toPay" borderRadius="100rpx" shape="circle" <my-button @tap="toPay" borderRadius="100rpx" shape="circle"
type="primary">结账</my-button> type="primary">结账</my-button>

View File

@@ -30,8 +30,9 @@
<view class="u-m-t-32"> <view class="u-m-t-32">
<view class="u-font-32">{{goosZhonglei}}种商品{{goodsNumber}}</view> <view class="u-font-32">{{goosZhonglei}}种商品{{goodsNumber}}</view>
<view class="border-bottom u-p-b-32"> <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"> :key="index">
<view class="u-flex u-row-between u-col-top u-m-t-32" v-if="item.productId!=-999">
<view> <view>
<view class=""> {{item.productName}}</view> <view class=""> {{item.productName}}</view>
<view class="color-999 u-font-24 u-m-t-8"> <view class="color-999 u-font-24 u-m-t-8">
@@ -40,12 +41,31 @@
</view> </view>
<view class="u-flex u-flex-1 u-row-right"> <view class="u-flex u-flex-1 u-row-right">
<view>×{{item.num}}</view> <view>×{{item.num}}</view>
<view class="u-text-right" :style="computedPriceStyle()">{{item.priceAmount}}</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>
</view> </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="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 class="no-wrap u-m-r-32">订单备注</view>
<view>{{data.remark||'无'}}</view> <view>{{data.remark||'无'}}</view>
@@ -78,8 +98,15 @@
data: { data: {
type: Object, type: Object,
default: () => { default: () => {
return{
packFee:0,
seatInfo:{
productName:'客座费',
priceAmount:0
},
detailList: [] detailList: []
} }
}
}, },
index: { index: {
type: [String, Number], type: [String, Number],
@@ -91,7 +118,14 @@
let goodsNumber = ref(0) let goodsNumber = ref(0)
const priceSize = 9 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() { function computedPriceStyle() {
const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}` const item = props.data.detailList.reduce((prev, current) => (`${prev.price}`.length > `${current.price}`
.length) ? prev : current) .length) ? prev : current)

View File

@@ -46,6 +46,7 @@
</view> </view>
<view class="u-flex color-999 u-font-24"> <view class="u-flex color-999 u-font-24">
<view class="u-m-r-20" v-if="item.payType=='vipPay'"> <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>余额</text>
<text>{{user.amount||'0'}}</text> <text>{{user.amount||'0'}}</text>
</view> </view>
@@ -194,6 +195,7 @@
type: data.id ? 0 : 1 //0 设置 1 取消 type: data.id ? 0 : 1 //0 设置 1 取消
}).then(res=>{ }).then(res=>{
user.value = data user.value = data
order.userId=data.id
}) })
}) })
} }

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