Merge branch 'ymf' of https://newgitea.sxczgkj.cn/czg_team/cashier_app into new_gyq
This commit is contained in:
commit
e6212251e3
|
|
@ -365,7 +365,7 @@ text {
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
z-index: 999;
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
padding-bottom: 28rpx;
|
padding-bottom: 28rpx;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
@ -427,4 +427,51 @@ text {
|
||||||
}
|
}
|
||||||
.bg-f7{
|
.bg-f7{
|
||||||
background-color: #F7F7F7;
|
background-color: #F7F7F7;
|
||||||
}
|
}
|
||||||
|
.default-box-padding{
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
}
|
||||||
|
.default-box-radius{
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
.default-box-x-padding{
|
||||||
|
padding-left: 28rpx;
|
||||||
|
padding-right: 28rpx;
|
||||||
|
}
|
||||||
|
.default-box-y-padding{
|
||||||
|
padding-top: 32rpx;
|
||||||
|
padding-bottom: 32rpx;
|
||||||
|
}
|
||||||
|
$height: 70rpx;
|
||||||
|
|
||||||
|
.number-box {
|
||||||
|
font-size: 28rpx;
|
||||||
|
padding: 0 26rpx;
|
||||||
|
border-radius: 6rpx 0 0 6rpx;
|
||||||
|
border-top: 2rpx solid #d9d9d9;
|
||||||
|
border-bottom: 2rpx solid #d9d9d9;
|
||||||
|
border-left: 2rpx solid #d9d9d9;
|
||||||
|
background: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: $height;
|
||||||
|
flex: 1;
|
||||||
|
line-height: $height;
|
||||||
|
}
|
||||||
|
.unit {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 38rpx;
|
||||||
|
height: $height;
|
||||||
|
line-height: $height;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 0 6rpx 6rpx 0;
|
||||||
|
border: 2rpx solid #d9d9d9;
|
||||||
|
background: #f7f7fa;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
.u-col-baseline{
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
.text-right{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view style="height: 180rpx"></view>
|
<view class="zhanwei" :class="[direction == 'column' ? 'zhanwei1' : '']"></view>
|
||||||
|
|
||||||
<view class="fixed-bottom u-flex gap-20">
|
<view
|
||||||
|
class="fixed-bottom u-flex gap-20"
|
||||||
|
:class="[direction == 'column' ? 'u-flex-column' : '']"
|
||||||
|
>
|
||||||
<view class="u-flex-1">
|
<view class="u-flex-1">
|
||||||
<my-button type="primary" @click="save" shape="circle">
|
<my-button type="primary" @click="save" shape="circle">
|
||||||
保存
|
保存
|
||||||
</my-button>
|
</my-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -18,7 +21,15 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const emit= defineEmits(["save", "cancel"]);
|
const emit = defineEmits(["save", "cancel"]);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
//方向 row横向布局 column 纵向布局
|
||||||
|
direction: {
|
||||||
|
type: String,
|
||||||
|
default: "row",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
emit("save");
|
emit("save");
|
||||||
|
|
@ -27,3 +38,17 @@ function cancel() {
|
||||||
emit("cancel");
|
emit("cancel");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.zhanwei {
|
||||||
|
height: 180rpx;
|
||||||
|
}
|
||||||
|
.zhanwei1{
|
||||||
|
height: 240rpx;
|
||||||
|
}
|
||||||
|
.fixed-bottom {
|
||||||
|
&.u-flex-column{
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,57 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<up-checkbox-group v-model="useType" placement="row" shape="square" size="28rpx">
|
<up-checkbox-group
|
||||||
<up-checkbox v-for="item in dinetyps" :key="item.value" :name="item.value" :label="item.label" :customStyle="customStyle"></up-checkbox>
|
v-model="useType"
|
||||||
</up-checkbox-group>
|
placement="row"
|
||||||
</view>
|
shape="square"
|
||||||
|
size="28rpx"
|
||||||
|
>
|
||||||
|
<up-checkbox
|
||||||
|
v-for="item in dinetyps"
|
||||||
|
:key="item.value"
|
||||||
|
:name="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:customStyle="radioCustomStyle"
|
||||||
|
></up-checkbox>
|
||||||
|
</up-checkbox-group>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from "vue";
|
||||||
|
|
||||||
|
|
||||||
const customStyle = ref({
|
|
||||||
marginRight: '15px'
|
|
||||||
});
|
|
||||||
|
|
||||||
// 可使用类型:dine堂食/pickup自取/deliv配送/express快递
|
// 可使用类型:dine堂食/pickup自取/deliv配送/express快递
|
||||||
const dinetyps = [
|
const dinetyps = [
|
||||||
{
|
{
|
||||||
value: 'dine-in',
|
value: "dine-in",
|
||||||
label: '堂食'
|
label: "堂食",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'take-out',
|
value: "take-out",
|
||||||
label: '自取'
|
label: "自取",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'post',
|
value: "post",
|
||||||
label: '配送'
|
label: "配送",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'take-away',
|
value: "take-away",
|
||||||
label: '快递'
|
label: "快递",
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
radioCustomStyle: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return { marginRight: "15px" };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const useType = defineModel({
|
const useType = defineModel({
|
||||||
default: () => [],
|
default: () => [],
|
||||||
type: Array
|
type: Array,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,97 +1,118 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<up-radio-group v-model="useTimeType" placement="row">
|
<up-radio-group v-model="useTimeType" placement="row">
|
||||||
<up-radio v-for="item in useTimeTypeList" :key="item.value" :value="item.value" :name="item.value" :label="item.label" :customStyle="customStyle"></up-radio>
|
<up-radio
|
||||||
</up-radio-group>
|
v-for="item in useTimeTypeList"
|
||||||
<view class="u-flex u-m-t-30 box" v-if="useTimeType == 'custom'">
|
:key="item.value"
|
||||||
<view class="u-flex u-flex-1">
|
:value="item.value"
|
||||||
<view class="item" @click="pirckerShow(startValue, 'startValue')">
|
:name="item.value"
|
||||||
<text class="u-m-r-12" v-if="!startValue">开始时间</text>
|
:label="item.label"
|
||||||
<text class="u-m-r-12" v-else>{{ startValue }}</text>
|
:customStyle="customStyle"
|
||||||
</view>
|
></up-radio>
|
||||||
<view class="u-m-l-8 u-m-r-8" style="padding: 0 30rpx">—</view>
|
</up-radio-group>
|
||||||
<view class="item" @click="pirckerShow(endValue, 'endValue')">
|
<view class="container" v-if="useTimeType == 'custom'">
|
||||||
<text class="u-m-r-12" v-if="!endValue">结束时间</text>
|
<view class="u-flex u-m-t-30 box" >
|
||||||
<text class="u-m-r-12" v-else>{{ endValue }}</text>
|
<view class="u-flex u-flex-1">
|
||||||
</view>
|
<view class="item" @click="pirckerShow(startValue, 'startValue')">
|
||||||
</view>
|
<text class="u-m-r-12" v-if="!startValue">开始时间</text>
|
||||||
<up-icon name="clock"></up-icon>
|
<text class="u-m-r-12" v-else>{{ startValue }}</text>
|
||||||
</view>
|
</view>
|
||||||
<up-datetime-picker :show="show" v-model="value1" closeOnClickOverlay @close="close" @cancel="close" @confirm="confirm" mode="time"></up-datetime-picker>
|
<view class="u-m-l-8 u-m-r-8" style="padding: 0 30rpx">—</view>
|
||||||
</view>
|
<view class="item" @click="pirckerShow(endValue, 'endValue')">
|
||||||
|
<text class="u-m-r-12" v-if="!endValue">结束时间</text>
|
||||||
|
<text class="u-m-r-12" v-else>{{ endValue }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<up-icon name="clock"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<up-datetime-picker
|
||||||
|
:show="show"
|
||||||
|
v-model="value1"
|
||||||
|
closeOnClickOverlay
|
||||||
|
@close="close"
|
||||||
|
@cancel="close"
|
||||||
|
@confirm="confirm"
|
||||||
|
mode="time"
|
||||||
|
></up-datetime-picker>
|
||||||
|
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from "vue";
|
||||||
|
function cancel(){
|
||||||
|
union.navigateBack()
|
||||||
|
}
|
||||||
const customStyle = ref({
|
const customStyle = ref({
|
||||||
marginRight: '15px'
|
marginRight: "15px",
|
||||||
});
|
});
|
||||||
|
|
||||||
const useTimeType = defineModel('useTimeType', {
|
const useTimeType = defineModel("useTimeType", {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'all'
|
default: "all",
|
||||||
});
|
});
|
||||||
const useTimeTypeList = [
|
const useTimeTypeList = [
|
||||||
{
|
{
|
||||||
value: 'all',
|
value: "all",
|
||||||
label: '全时段可用'
|
label: "全时段可用",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'custom',
|
value: "custom",
|
||||||
label: '指定时间段可用'
|
label: "指定时间段可用",
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
import dayjs from 'dayjs';
|
import dayjs from "dayjs";
|
||||||
const startValue = defineModel('startValue', {
|
const startValue = defineModel("startValue", {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
});
|
});
|
||||||
const endValue = defineModel('endValue', {
|
const endValue = defineModel("endValue", {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
show.value = false;
|
show.value = false;
|
||||||
}
|
}
|
||||||
const value1 = ref('');
|
const value1 = ref("");
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
const nowKey = ref('');
|
const nowKey = ref("");
|
||||||
|
|
||||||
function pirckerShow(date, key) {
|
function pirckerShow(date, key) {
|
||||||
nowKey.value = key;
|
nowKey.value = key;
|
||||||
show.value = true;
|
show.value = true;
|
||||||
value1.value = date || '';
|
value1.value = date || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirm(e) {
|
function confirm(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
||||||
if (nowKey.value == 'startValue') {
|
if (nowKey.value == "startValue") {
|
||||||
startValue.value = e.value;
|
startValue.value = e.value;
|
||||||
} else if (nowKey.value == 'endValue') {
|
} else if (nowKey.value == "endValue") {
|
||||||
endValue.value = e.value;
|
endValue.value = e.value;
|
||||||
}
|
}
|
||||||
value1.value = e.value;
|
value1.value = e.value;
|
||||||
show.value = false;
|
show.value = false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item {
|
.item {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
padding: 0 12rpx;
|
padding: 0 12rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.box {
|
.box {
|
||||||
border: 2rpx solid #dddfe6;
|
border: 2rpx solid #dddfe6;
|
||||||
padding: 16rpx 30rpx;
|
padding: 16rpx 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 564rpx;
|
width: 564rpx;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="item" @click="pirckerShow(startDate, 'startDate')">
|
<view class="item" @click="pirckerShow(startDate, 'startDate')">
|
||||||
<text class="u-m-r-12" v-if="!startDate">请选择日期范围</text>
|
<text class="u-m-r-12" v-if="!startDate">{{ startText }}</text>
|
||||||
<text class="u-m-r-12" v-else>{{ startDate }}</text>
|
<text class="u-m-r-12" v-else>{{ startDate }}</text>
|
||||||
<up-icon name="arrow-down" size="14"></up-icon>
|
<up-icon name="arrow-down" size="14"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-l-8 u-m-r-8">—</view>
|
<view class="u-m-l-8 u-m-r-8">—</view>
|
||||||
<view class="item" @click="pirckerShow(endDate, 'endDate')">
|
<view class="item" @click="pirckerShow(endDate, 'endDate')">
|
||||||
<text class="u-m-r-12" v-if="!endDate">请选择日期范围</text>
|
<text class="u-m-r-12" v-if="!endDate">{{ endText }}</text>
|
||||||
<text class="u-m-r-12" v-else>{{ endDate }}</text>
|
<text class="u-m-r-12" v-else>{{ endDate }}</text>
|
||||||
<up-icon name="arrow-down" size="14"></up-icon>
|
<up-icon name="arrow-down" size="14"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -29,6 +29,16 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
const props=defineProps({
|
||||||
|
startText: {
|
||||||
|
type: String,
|
||||||
|
default: "请选择开始时间",
|
||||||
|
},
|
||||||
|
endText: {
|
||||||
|
type: String,
|
||||||
|
default: "请选择结束时间",
|
||||||
|
},
|
||||||
|
});
|
||||||
const startDate = defineModel("startDate", {
|
const startDate = defineModel("startDate", {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<up-checkbox-group v-model="selectedWeek" :options="week">
|
<up-checkbox-group v-model="selectedWeek" :options="week">
|
||||||
<up-checkbox
|
<up-checkbox
|
||||||
:customStyle="customStyle"
|
:customStyle="customStyle"
|
||||||
|
:shape="shape"
|
||||||
v-for="item in week"
|
v-for="item in week"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
|
|
@ -19,7 +20,12 @@ const customStyle={
|
||||||
marginRight: '40rpx',
|
marginRight: '40rpx',
|
||||||
marginBottom: '16rpx',
|
marginBottom: '16rpx',
|
||||||
}
|
}
|
||||||
|
const props = defineProps({
|
||||||
|
shape: {
|
||||||
|
type: String,
|
||||||
|
default: 'square' // circle
|
||||||
|
},
|
||||||
|
});
|
||||||
const selectedWeek=defineModel({
|
const selectedWeek=defineModel({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import http from "@/http/http.js";
|
import http from "@/http/http.js";
|
||||||
const request = http.request;
|
const request = http.request;
|
||||||
const urlType = "market";
|
const marketUrl = "market";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新客立减
|
* 新客立减
|
||||||
|
|
@ -15,3 +15,24 @@ export function getDiscountByUserId(params) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getConfig(params) {
|
||||||
|
return request({
|
||||||
|
url: marketUrl + `/admin/consumeDiscount`,
|
||||||
|
method: "get",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editConfig(params) {
|
||||||
|
return request({
|
||||||
|
url: marketUrl + `/admin/consumeDiscount`,
|
||||||
|
method: "POST",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
import http from "@/http/http.js";
|
||||||
|
const request = http.request;
|
||||||
|
const urlType = "market";
|
||||||
|
|
||||||
|
export function suggestPage(params) {
|
||||||
|
return request({
|
||||||
|
url: urlType + `/admin/suggest/page`,
|
||||||
|
method: "get",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function addSuggest(params) {
|
||||||
|
return request({
|
||||||
|
url: urlType + `/admin/suggest`,
|
||||||
|
method: "POST",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function editSuggest(params) {
|
||||||
|
return request({
|
||||||
|
url: urlType + `/admin/suggest`,
|
||||||
|
method: "PUT",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function deleteSuggest(params) {
|
||||||
|
return request({
|
||||||
|
url: urlType + `/admin/suggest?id=${params.id}`,
|
||||||
|
method: "DELETE",
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,198 @@
|
||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view @click="show = true">
|
||||||
|
<slot v-if="$slots.default"> </slot>
|
||||||
|
<view v-else class="choose-goods u-flex u-row-between">
|
||||||
|
<text class="color-999" v-if="!modelValue">请选择商品</text>
|
||||||
|
<text class="color-333 u-m-r-32 u-line-1" v-else>{{ goodsName }}</text>
|
||||||
|
<up-icon size="14" name="arrow-down"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<up-popup :show="show" mode="bottom">
|
||||||
|
<view class="">
|
||||||
|
<view class="top u-flex u-row-between">
|
||||||
|
<text class="font-bold u-font-32 color-333">{{ title }}</text>
|
||||||
|
<up-icon size="18" name="close" @click="show = false"></up-icon>
|
||||||
|
</view>
|
||||||
|
<scroll-view :scroll-y="true" style="max-height: 50vh" @scroll="scroll" :scroll-top="scrollTop">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
class="item"
|
||||||
|
@click="itemClick(item)"
|
||||||
|
:class="[selGoods&&selGoods.id == item.id ? 'selected' : '']"
|
||||||
|
>
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<view class="u-flex gap-20">
|
||||||
|
<view class="u-flex" @click.stop="preview(item)">
|
||||||
|
<up-image
|
||||||
|
:src="item.coverImg"
|
||||||
|
width="80rpx"
|
||||||
|
height="80rpx"
|
||||||
|
></up-image>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<text class="u-font-32 color-333">{{ item.name }}</text>
|
||||||
|
</view>
|
||||||
|
<text class="u-font-32 color-red u-p-l-30"
|
||||||
|
>¥{{ item.lowPrice }}</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="bottom">
|
||||||
|
<view class="btn cancel" @click="close">{{ cancelText }}</view>
|
||||||
|
<view class="btn success" @click="confirm">{{ confirmText }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, watch } from "vue";
|
||||||
|
import { getProductList } from "@/http/api/product.js";
|
||||||
|
const show = ref(false);
|
||||||
|
const modelValue = defineModel({
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const goodsName = defineModel("goodsName", {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "选择商品",
|
||||||
|
},
|
||||||
|
confirmText: {
|
||||||
|
type: String,
|
||||||
|
default: "确认",
|
||||||
|
},
|
||||||
|
cancelText: {
|
||||||
|
type: String,
|
||||||
|
default: "取消",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const selGoods = ref("");
|
||||||
|
function itemClick(item) {
|
||||||
|
if (selGoods.value&& selGoods.value.id == item.id) {
|
||||||
|
selGoods.value = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
selGoods.value = item;
|
||||||
|
}
|
||||||
|
const list = ref([]);
|
||||||
|
|
||||||
|
const scrollTop = ref(0);
|
||||||
|
function scroll(e) {
|
||||||
|
scrollTop.value = e.detail.scrollTop;
|
||||||
|
}
|
||||||
|
function preview(item) {
|
||||||
|
uni.previewImage({
|
||||||
|
urls: item.images || [item.coverImg],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
watch(
|
||||||
|
() => modelValue.value,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
console.log(newVal, oldVal);
|
||||||
|
selGoods.value = list.value.find((item) => item.id == newVal);
|
||||||
|
console.log(selGoods.value);
|
||||||
|
if(selGoods.value){
|
||||||
|
goodsName.value = selGoods.value.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(()=>list.value.length,(newVal,oldVal)=>{
|
||||||
|
selGoods.value = list.value.find((item) => item.id == modelValue.value);
|
||||||
|
console.log(selGoods.value);
|
||||||
|
if(selGoods.value){
|
||||||
|
modelValue.value = selGoods.value.id;
|
||||||
|
goodsName.value = selGoods.value.name;
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
show.value = false;
|
||||||
|
}
|
||||||
|
function confirm() {
|
||||||
|
if (!selGoods.value) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择商品",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
modelValue.value = selGoods.value.id;
|
||||||
|
show.value = false;
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getProductList().then((res) => {
|
||||||
|
list.value = res;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.popup-content {
|
||||||
|
background: #fff;
|
||||||
|
width: 640rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
}
|
||||||
|
.top {
|
||||||
|
padding: 40rpx 48rpx;
|
||||||
|
border-bottom: 1px solid #d9d9d9;
|
||||||
|
}
|
||||||
|
.bottom {
|
||||||
|
padding: 48rpx 52rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-top: 1px solid #d9d9d9;
|
||||||
|
gap: 50rpx;
|
||||||
|
.btn {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
padding: 18rpx 60rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
border: 2rpx solid transparent;
|
||||||
|
&.success {
|
||||||
|
background-color: $my-main-color;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
&.cancel {
|
||||||
|
border-color: #d9d9d9;
|
||||||
|
box-shadow: 0 4rpx 0 0 #00000005;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item {
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
margin: 10rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
|
box-shadow: 0 0 10px transparent;
|
||||||
|
&.selected {
|
||||||
|
border-color: $my-main-color;
|
||||||
|
box-shadow: 0 0 10px $my-main-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.choose-goods {
|
||||||
|
display: flex;
|
||||||
|
padding: 24rpx;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 2rpx solid #d9d9d9;
|
||||||
|
background: #fff;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -67,8 +67,8 @@ function confirm(){
|
||||||
.btn{
|
.btn{
|
||||||
flex:1;
|
flex:1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 34rpx 20rpx;
|
padding: 18rpx 60rpx;
|
||||||
border-radius: 4rpx;
|
border-radius: 100rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
border: 2rpx solid transparent;
|
border: 2rpx solid transparent;
|
||||||
&.success{
|
&.success{
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="color-333 u-font-32 font-bold">{{
|
<view class="color-333 u-font-32 font-bold">{{
|
||||||
item.accountPoints
|
item.consumeCount
|
||||||
}}</view>
|
}}</view>
|
||||||
|
|
||||||
<view class="u-flex u-m-t-12" style="align-items: baseline">
|
<view class="u-flex u-m-t-12" style="align-items: baseline">
|
||||||
|
|
@ -86,14 +86,7 @@
|
||||||
</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>
|
||||||
<template v-if="hasAjax && list.length <= 0">
|
<template v-if="hasAjax && list.length <= 0">
|
||||||
<my-img-empty tips="未找到相关用户"></my-img-empty>
|
<my-img-empty tips="未找到相关用户"></my-img-empty>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
<view
|
<view
|
||||||
class="text-center color-main font-bold"
|
class="text-center color-main font-bold"
|
||||||
:class="[ item.status == 'refund' ? 'color-red' : '']"
|
:class="[ item.status == 'refund' ? 'color-red' : '']"
|
||||||
>{{ 0 }}</view
|
>{{ item.rewardAmount }}</view
|
||||||
>
|
>
|
||||||
<view class="color-66 u-font-24">{{
|
<view class="color-66 u-font-24">{{
|
||||||
item.level == 1 ? "直接分成" : "间接分成"
|
item.level == 1 ? "直接分成" : "间接分成"
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
||||||
<view class="u-flex u-row-between">
|
<view class="u-flex u-row-between">
|
||||||
<view class="color-333 u-font-28">
|
<view class="color-333 u-font-28">
|
||||||
<view> 用户昵称 </view>
|
<view> {{ item.shopUserName }} </view>
|
||||||
<view class="u-m-t-4">
|
<view class="u-m-t-4">
|
||||||
<text class="color-333 font-bold"> {{ item.shopUserName }}</text>
|
<text class="color-333 "> {{ item.shopUserPhone }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
>是否确认重置分销组 重置后将会按照用户的实际数据匹配分销组</view
|
>是否确认重置分销组 重置后将会按照用户的实际数据匹配分销组</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-48 u-flex" v-if="modalData.key == 'cancel-group'">
|
<view class="u-p-48 u-flex" v-if="modalData.key == 'cancel-fenxiao'">
|
||||||
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
||||||
<view class="u-font-32 color-333 u-m-l-20">是否确认取消分销员</view>
|
<view class="u-font-32 color-333 u-m-l-20">是否确认取消分销员</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -179,6 +179,8 @@ async function handleConfirm() {
|
||||||
id: modalData.data.id,
|
id: modalData.data.id,
|
||||||
shopId: uni.getSystemInfoSync("shopInfo").id || "",
|
shopId: uni.getSystemInfoSync("shopInfo").id || "",
|
||||||
});
|
});
|
||||||
|
emits("refresh");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (modalData.key == "change-group") {
|
if (modalData.key == "change-group") {
|
||||||
const level=distributionStore.config.levelConfigList.find((item) => item.id == group.value)
|
const level=distributionStore.config.levelConfigList.find((item) => item.id == group.value)
|
||||||
|
|
@ -204,6 +206,10 @@ async function handleConfirm() {
|
||||||
});
|
});
|
||||||
emits("refresh");
|
emits("refresh");
|
||||||
}
|
}
|
||||||
|
uni.showToast({
|
||||||
|
title:'操作成功',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
group.value = "";
|
group.value = "";
|
||||||
modalData.show = false;
|
modalData.show = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-t-16">
|
<view class="u-flex u-row-between u-m-t-16">
|
||||||
<view class="color-333 u-font-28 color-666">
|
<view class="color-333 u-font-28 color-666">
|
||||||
<view> 用户昵称 </view>
|
<view> {{item.nickName}} </view>
|
||||||
<view class="u-m-t-4">
|
<view class="u-m-t-4">
|
||||||
<text class=""> {{ item.nickName }}</text>
|
<text class=""> {{ item.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="color-main u-font-32 font-700">{{ item.changeAmount }}</text>
|
<text class="color-main u-font-32 font-700">{{ item.changeAmount }}</text>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<view class="u-font-28 u-flex-1 u-p-r-4">
|
<view class="u-font-28 u-flex-1 u-p-r-4">
|
||||||
<view class="color-333 font-bold">分销</view>
|
<view class="color-333 font-bold">分销</view>
|
||||||
<view class="color-666 u-m-t-4 u-font-24"
|
<view class="color-666 u-m-t-4 u-font-24"
|
||||||
>允许客户充值并使用余额支付
|
>用户成为业务员,可促进消费
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<up-switch
|
<up-switch
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
v-model="keyWord"
|
v-model="keyWord"
|
||||||
@blur="keyWordBlur"
|
@blur="keyWordBlur"
|
||||||
/>
|
/>
|
||||||
|
<up-icon v-if="keyWord" name="close" size="14" @click="clearKeyWord"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
|
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
|
||||||
|
|
@ -50,6 +51,9 @@
|
||||||
{{ userComponentQuery.startTime }} -
|
{{ userComponentQuery.startTime }} -
|
||||||
{{ userComponentQuery.endTime }}
|
{{ userComponentQuery.endTime }}
|
||||||
</text>
|
</text>
|
||||||
|
<view @click.stop="clearTime">
|
||||||
|
<up-icon name="close" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<text class="color-999">请选择日期范围</text>
|
<text class="color-999">请选择日期范围</text>
|
||||||
|
|
@ -66,14 +70,13 @@
|
||||||
class="u-font-28 filter-box u-flex u-row-between"
|
class="u-font-28 filter-box u-flex u-row-between"
|
||||||
@click="showActions = true"
|
@click="showActions = true"
|
||||||
>
|
>
|
||||||
<template v-if="selActions&&selActions.value">
|
<template v-if="selActions && selActions.value">
|
||||||
<text class="u-font-28 u-m-r-10">{{ selActions.name }} </text>
|
<text class="u-font-28 u-m-r-10">{{ selActions.name }} </text>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<text class="color-999 u-m-r-10">全部</text>
|
<text class="color-999 u-m-r-10">全部</text>
|
||||||
</template>
|
</template>
|
||||||
<up-icon name="arrow-down" size="12"></up-icon>
|
<up-icon name="arrow-down" size="12"></up-icon>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
||||||
<up-icon name="search" size="18"></up-icon>
|
<up-icon name="search" size="18"></up-icon>
|
||||||
|
|
@ -97,6 +100,9 @@
|
||||||
{{ userComponentQuery.startTime }} -
|
{{ userComponentQuery.startTime }} -
|
||||||
{{ userComponentQuery.endTime }}
|
{{ userComponentQuery.endTime }}
|
||||||
</text>
|
</text>
|
||||||
|
<view @click.stop="clearTime">
|
||||||
|
<up-icon name="close" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<text class="color-999">请选择日期</text>
|
<text class="color-999">请选择日期</text>
|
||||||
|
|
@ -115,7 +121,7 @@
|
||||||
<view class="u-font-32 color-main font-bold">{{
|
<view class="u-font-32 color-main font-bold">{{
|
||||||
listRes.totalAmount
|
listRes.totalAmount
|
||||||
}}</view>
|
}}</view>
|
||||||
<view class="u-font-24 color-666 u-m-t-16">支付开通人数</view>
|
<view class="u-font-24 color-666 u-m-t-16">已支付金额(元)</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="active == 3" class="u-flex u-m-t-32">
|
<view v-if="active == 3" class="u-flex u-m-t-32">
|
||||||
|
|
@ -137,7 +143,9 @@
|
||||||
}}</view>
|
}}</view>
|
||||||
<view class="u-font-24 color-666 u-m-t-16">
|
<view class="u-font-24 color-666 u-m-t-16">
|
||||||
<text>运营余额(元)</text>
|
<text>运营余额(元)</text>
|
||||||
<text class="color-main" @click="go.to('PAGES_PAY')">充值{{'>'}}</text>
|
<text class="color-main" @click="go.to('PAGES_PAY')"
|
||||||
|
>充值{{ ">" }}</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -229,10 +237,18 @@ const actions = [
|
||||||
value: "refund",
|
value: "refund",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const selActions=ref('')
|
function clearKeyWord() {
|
||||||
|
keyWord.value = "";
|
||||||
|
userComponentQuery.user = "";
|
||||||
|
}
|
||||||
|
function clearTime() {
|
||||||
|
userComponentQuery.startTime = "";
|
||||||
|
userComponentQuery.endTime = "";
|
||||||
|
}
|
||||||
|
const selActions = ref("");
|
||||||
const showActions = ref(false);
|
const showActions = ref(false);
|
||||||
function handleSelect(e) {
|
function handleSelect(e) {
|
||||||
selActions.value = e;
|
selActions.value = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
const distributionStore = useDistributionStore();
|
const distributionStore = useDistributionStore();
|
||||||
|
|
@ -360,7 +376,7 @@ async function getList() {
|
||||||
page: pageNum.value,
|
page: pageNum.value,
|
||||||
size: 10,
|
size: 10,
|
||||||
key: userComponentQuery.user,
|
key: userComponentQuery.user,
|
||||||
status: selActions.value.value,
|
status: selActions.value?.value || "",
|
||||||
startTime: userComponentQuery.startTime
|
startTime: userComponentQuery.startTime
|
||||||
? userComponentQuery.startTime + " 00:00:00"
|
? userComponentQuery.startTime + " 00:00:00"
|
||||||
: "",
|
: "",
|
||||||
|
|
@ -391,6 +407,9 @@ const active = ref(0);
|
||||||
watch(
|
watch(
|
||||||
() => active.value,
|
() => active.value,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
|
userComponentQuery.startTime = "";
|
||||||
|
userComponentQuery.endTime = "";
|
||||||
|
keyWord.value = "";
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
pageNum.value = 1;
|
pageNum.value = 1;
|
||||||
getList();
|
getList();
|
||||||
|
|
@ -399,21 +418,28 @@ watch(
|
||||||
watch(
|
watch(
|
||||||
() => active.value,
|
() => active.value,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => selActions.value,
|
||||||
|
() => {
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
watch(()=>selActions.value,()=>{
|
|
||||||
refresh()
|
|
||||||
})
|
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
if (!isEnd.value) {
|
if (!isEnd.value) {
|
||||||
pageNum.value++;
|
pageNum.value++;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
watch(()=>distributionStore.config.isEnable,()=>{
|
watch(
|
||||||
distributionStore.editConfig()
|
() => distributionStore.config.isEnable,
|
||||||
})
|
() => {
|
||||||
|
distributionStore.editConfig();
|
||||||
|
}
|
||||||
|
);
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
pageNum.value = 1;
|
pageNum.value = 1;
|
||||||
getList();
|
getList();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
<view class="u-m-t-60">
|
<view class="u-m-t-60">
|
||||||
<view class="title">名称</view>
|
<view class="title">名称</view>
|
||||||
<view class="u-p-t-16 u-p-b-24">
|
<view class="u-p-t-16 u-p-b-24">
|
||||||
<input placeholder="请输入名称" placeholder-class="color-999 u-font-28" v-model="item.name"></input>
|
<input placeholder="请输入名称" placeholder-class="color-999 u-font-28" v-model="item.name" @input="checkName($event, index)"></input>
|
||||||
</view>
|
</view>
|
||||||
<up-line></up-line>
|
<up-line></up-line>
|
||||||
<view class="title u-m-t-24">分成比例</view>
|
<view class="title u-m-t-24">分成比例</view>
|
||||||
|
|
@ -50,8 +50,10 @@
|
||||||
<view class="unit">%</view>
|
<view class="unit">%</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<up-line></up-line>
|
<template v-if="form.upgradeType!='not_upgrade'">
|
||||||
<view class="title u-m-t-24">有效人数</view>
|
<up-line></up-line>
|
||||||
|
<template v-if="form.upgradeType!='cost'">
|
||||||
|
<view class="title u-m-t-24">有效人数</view>
|
||||||
<view class="u-m-t-16 u-p-b-8">
|
<view class="u-m-t-16 u-p-b-8">
|
||||||
<view class="u-flex u-m-t-16">
|
<view class="u-flex u-m-t-16">
|
||||||
<input
|
<input
|
||||||
|
|
@ -64,13 +66,36 @@
|
||||||
<view class="unit">人</view>
|
<view class="unit">人</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="color-999 u-font-24">有效人数:被邀请人在店铺消费过,即有一笔订单完成</view>
|
<view class="color-999 u-font-24">有效人数:被邀请人在店铺消费过,即有一笔订单完成</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view class="title u-m-t-24">消费金额达</view>
|
||||||
|
<view class="u-m-t-16 u-p-b-8">
|
||||||
|
<view class="u-flex u-m-t-16">
|
||||||
|
<input
|
||||||
|
class="number-box"
|
||||||
|
placeholder="请输入"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
type="digit"
|
||||||
|
v-model="item.costAmount"
|
||||||
|
/>
|
||||||
|
<view class="unit">元</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="color-999 u-font-24">消费金额:分销员和被邀请人在店铺订单消费总金额(不包含退款)</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<view class="u-m-t-24 u-flex u-row-right" style="gap: 40rpx;">
|
<view class="u-m-t-24 u-flex u-row-right" style="gap: 40rpx;">
|
||||||
<view class="u-flex" v-if="index==0||index==form.levelConfigList.length-1" @click="addLevelConfig">
|
<view class="u-flex" v-if="index==0||index==form.levelConfigList.length-1" @click="addLevelConfig">
|
||||||
<up-icon name="plus-circle-fill" color="#318AFE" ></up-icon>
|
<up-icon name="plus-circle-fill" color="#318AFE" ></up-icon>
|
||||||
<text class="u-m-l-16">{{index==0? '添加':'继续添加'}}</text>
|
<text class="u-m-l-16">{{index==0? '添加':'继续添加'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex" @click="remove(index)">
|
<view class="u-flex" @click="remove(index)" v-if="index!=0">
|
||||||
<up-icon name="minus-circle-fill" color="#EB4F4F" ></up-icon>
|
<up-icon name="minus-circle-fill" color="#EB4F4F" ></up-icon>
|
||||||
<text class="u-m-l-16">删除</text>
|
<text class="u-m-l-16">删除</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -124,16 +149,19 @@ let timer=null
|
||||||
//全部的分成比例加起来不能超过100%
|
//全部的分成比例加起来不能超过100%
|
||||||
function checkNumberCommission(e,index){
|
function checkNumberCommission(e,index){
|
||||||
const value=e.detail.value
|
const value=e.detail.value
|
||||||
const total=allCommission()
|
clearInterval(timer)
|
||||||
if(total>100){
|
|
||||||
|
if(value>100){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'分成比例加起来不能超过100%',
|
title:'分成比例不能超过100',
|
||||||
icon:'none'
|
icon:'none'
|
||||||
})
|
})
|
||||||
form.levelConfigList[index].levelOneCommission=''
|
timer= setTimeout(()=>{
|
||||||
|
form.levelConfigList[index].levelOneCommission=''
|
||||||
|
},30)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
clearInterval(timer)
|
|
||||||
//输入最多两位小数,两位小数点后的去除掉不让输入
|
//输入最多两位小数,两位小数点后的去除掉不让输入
|
||||||
if(value.indexOf('.')!=-1){
|
if(value.indexOf('.')!=-1){
|
||||||
const arr=value.split('.')
|
const arr=value.split('.')
|
||||||
|
|
@ -145,6 +173,21 @@ function checkNumberCommission(e,index){
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkName(e,index){
|
||||||
|
const value=e.detail.value
|
||||||
|
if(value.length>10){
|
||||||
|
uni.showToast({
|
||||||
|
title:'名称最多10个字符',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
timer= setTimeout(()=>{
|
||||||
|
form.levelConfigList[index].name=value.substring(0,10)
|
||||||
|
|
||||||
|
},30)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
function remove(index){
|
function remove(index){
|
||||||
form.levelConfigList.splice(index,1)
|
form.levelConfigList.splice(index,1)
|
||||||
showDetailListSwitch.value.splice(index,1)
|
showDetailListSwitch.value.splice(index,1)
|
||||||
|
|
@ -153,7 +196,8 @@ function addLevelConfig(){
|
||||||
form.levelConfigList.push({
|
form.levelConfigList.push({
|
||||||
name:'',
|
name:'',
|
||||||
levelOneCommission:'',
|
levelOneCommission:'',
|
||||||
inviteCount:''
|
inviteCount:'',
|
||||||
|
costAmount:''
|
||||||
})
|
})
|
||||||
showDetailListSwitch.value.push(true)
|
showDetailListSwitch.value.push(true)
|
||||||
}
|
}
|
||||||
|
|
@ -176,13 +220,28 @@ function addLevelConfig(){
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if(item.inviteCount===''){
|
if(form.upgradeType==='not_upgrade'){
|
||||||
uni.showToast({
|
continue
|
||||||
title:'请输入有效人数',
|
|
||||||
icon:'none'
|
|
||||||
})
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
if(form.upgradeType==='cost'){
|
||||||
|
if(item.costAmount===''||item.costAmount===null){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请输入消费金额',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(item.inviteCount===''||item.inviteCount===null){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请输入有效人数',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-between u-font-28 color-666 u-m-t-16">
|
<view class="u-flex u-flex-between u-font-28 color-666 u-m-t-16">
|
||||||
<view>
|
<view>
|
||||||
<text>关联订单:WX1987787224197300224</text>
|
<text>关联订单:{{item.orderNo}}</text>
|
||||||
<text></text>
|
<text></text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,321 @@
|
||||||
|
<template>
|
||||||
|
<view class="min-page bg-f7 u-p-t-30 u-font-28">
|
||||||
|
<up-sticky>
|
||||||
|
<view class="bg-fff u-flex default-box-padding">
|
||||||
|
<image
|
||||||
|
style="width: 60rpx; height: 60rpx"
|
||||||
|
src="/pageMarket/static/images/new-user-discount.png"
|
||||||
|
></image>
|
||||||
|
<view class="u-flex-1 u-flex u-p-l-24">
|
||||||
|
<view class="u-font-28 u-flex-1 u-p-r-4">
|
||||||
|
<view class="color-333 font-bold">新客立减 </view>
|
||||||
|
<view class="color-666 u-m-t-4 u-font-24">首单下单减免金额 </view>
|
||||||
|
</view>
|
||||||
|
<up-switch
|
||||||
|
v-model="newUserDiscountStore.config.isEnable"
|
||||||
|
size="18"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
></up-switch>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-sticky>
|
||||||
|
<view class="default-box-padding">
|
||||||
|
<view
|
||||||
|
class="bg-fff default-box-radius default-box-padding u-flex u-row-between"
|
||||||
|
>
|
||||||
|
<text class="color-000 font-bold">活动时间</text>
|
||||||
|
<my-time-area
|
||||||
|
startText="开始时间"
|
||||||
|
endText="结束时间"
|
||||||
|
v-model:startDate="form.startTime"
|
||||||
|
v-model:endDate="form.endTime"
|
||||||
|
></my-time-area>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="default-box-radius bg-fff u-m-t-32 default-box-y-padding">
|
||||||
|
<view
|
||||||
|
class="u-flex u-p-b-16 default-box-x-padding"
|
||||||
|
style="align-items: baseline"
|
||||||
|
>
|
||||||
|
<view class="font-bold">减免方式</view>
|
||||||
|
<view class="u-m-l-32">
|
||||||
|
<up-radio-group v-model="form.discountType">
|
||||||
|
<up-radio key="FIXED" name="FIXED" label="固定金额"
|
||||||
|
>固定金额</up-radio
|
||||||
|
>
|
||||||
|
<up-radio key="RANDOM" name="RANDOM" label="随机立减"
|
||||||
|
>随机立减</up-radio
|
||||||
|
>
|
||||||
|
</up-radio-group>
|
||||||
|
<view class="u-flex u-m-t-16" v-if="form.discountType === 'FIXED'">
|
||||||
|
<input
|
||||||
|
class="number-box"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
type="digit"
|
||||||
|
v-model="form.discountAmount"
|
||||||
|
/>
|
||||||
|
<view class="unit">元</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<up-line></up-line>
|
||||||
|
<view
|
||||||
|
class="u-flex default-box-x-padding default-box-y-padding"
|
||||||
|
v-if="form.discountType === 'RANDOM'"
|
||||||
|
>
|
||||||
|
<view class="font-bold u-m-r-14 no-wrap">随机减免方案</view>
|
||||||
|
<my-button height="60rpx" @click="addItem"><text class="no-wrap">添加方案</text></my-button>
|
||||||
|
<text class="color-red u-font-24 u-m-l-14"
|
||||||
|
>所有概率相加必须等于100%</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="table" v-if="form.discountType === 'RANDOM'">
|
||||||
|
<view
|
||||||
|
class="header u-flex u-row-between color-666 default-box-x-padding u-p-t-48 u-p-b-48 bg-f7"
|
||||||
|
>
|
||||||
|
<view class="">减免金额(元)</view>
|
||||||
|
<view class="">概率(%)</view>
|
||||||
|
<view class="">操作</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="tr color-666 u-flex u-row-between default-box-x-padding u-p-t-48 u-p-b-48"
|
||||||
|
v-for="(item, index) in form.randomDiscountList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="" style="min-width: 200rpx">{{ item.amount }}</view>
|
||||||
|
<view class="">{{ item.probability }}</view>
|
||||||
|
<view class="u-flex gap-20">
|
||||||
|
<text class="color-main" @click="editItem(index)">编辑</text>
|
||||||
|
<text class="color-red" @click="deleteItem(index)">删除</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex default-box-x-padding u-col-baseline u-m-t-32">
|
||||||
|
<text class="font-bold no-wrap">可使用类型</text>
|
||||||
|
<view class="u-m-l-42">
|
||||||
|
<my-dine-types
|
||||||
|
v-model="form.useTypeList"
|
||||||
|
:radioCustomStyle="{ marginRight: '10rpx' }"
|
||||||
|
></my-dine-types>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<my-bottom-btn-group
|
||||||
|
@cancel="cancel"
|
||||||
|
@save="save"
|
||||||
|
direction="column"
|
||||||
|
></my-bottom-btn-group>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
v-model="modalData.show"
|
||||||
|
:title="modalData.title"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
>
|
||||||
|
<view class="u-p-l-38 u-p-r-38 u-p-t-40 u-p-b-40">
|
||||||
|
<view class="u-flex" style="gap: 50rpx">
|
||||||
|
<text class="u-font-32" style="min-width: 128rpx">减免金额</text>
|
||||||
|
<view class="u-flex u-m-t-16">
|
||||||
|
<input
|
||||||
|
class="number-box"
|
||||||
|
placeholder="减免金额"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
type="digit"
|
||||||
|
v-model="modalData.form.amount"
|
||||||
|
/>
|
||||||
|
<view class="unit">元</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-m-t-40 u-col-baseline" style="gap: 50rpx">
|
||||||
|
<text class="u-font-32 text-right" style="min-width: 128rpx"
|
||||||
|
>概率</text
|
||||||
|
>
|
||||||
|
<view>
|
||||||
|
<view class="u-flex u-m-t-16">
|
||||||
|
<input
|
||||||
|
class="number-box"
|
||||||
|
placeholder="概率"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
type="digit"
|
||||||
|
v-model="modalData.form.probability"
|
||||||
|
/>
|
||||||
|
<view class="unit">%</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-18 color-666 u-font-28"
|
||||||
|
>所有概率相加必须等于100%</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</Modal>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import Modal from "@/pageMarket/components/modal.vue";
|
||||||
|
|
||||||
|
import { ref, reactive, computed, watch, onMounted } from "vue";
|
||||||
|
import { useNewUserDiscountStore } from "@/store/market.js";
|
||||||
|
|
||||||
|
const isLoading = ref(false);
|
||||||
|
const newUserDiscountStore = useNewUserDiscountStore();
|
||||||
|
|
||||||
|
const modalData = reactive({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
key: "",
|
||||||
|
index: -1,
|
||||||
|
form: {
|
||||||
|
amount: "",
|
||||||
|
probability: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function resetModalData() {
|
||||||
|
modalData.index = -1;
|
||||||
|
modalData.form = {
|
||||||
|
amount: "",
|
||||||
|
probability: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function addItem() {
|
||||||
|
resetModalData();
|
||||||
|
modalData.show = true;
|
||||||
|
modalData.key = "add";
|
||||||
|
modalData.title = "添加方案";
|
||||||
|
}
|
||||||
|
function editItem(index) {
|
||||||
|
modalData.index = index;
|
||||||
|
modalData.form = form.randomDiscountList[index];
|
||||||
|
modalData.show = true;
|
||||||
|
modalData.key = "edit";
|
||||||
|
modalData.title = "编辑方案";
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleConfirm() {
|
||||||
|
if (modalData.form.amount == "") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请填写减免金额",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (modalData.form.probability == "") {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请填写概率",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
modalData.show = false;
|
||||||
|
if (modalData.key == "add") {
|
||||||
|
form.randomDiscountList.push(modalData.form);
|
||||||
|
} else if (modalData.key == "edit") {
|
||||||
|
form.randomDiscountList[modalData.index] = modalData.form;
|
||||||
|
}
|
||||||
|
resetModalData();
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = reactive({
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
discountType: "FIXED",
|
||||||
|
useTypeList: [],
|
||||||
|
randomDiscountList: [],
|
||||||
|
discountAmount: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function deleteItem(index) {
|
||||||
|
form.randomDiscountList.splice(index, 1);
|
||||||
|
}
|
||||||
|
function save() {
|
||||||
|
if (form.useTypeList.length == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择可使用类型",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(form.discountType == "FIXED" && form.discountAmount == ""){
|
||||||
|
uni.showToast({
|
||||||
|
title:'请填写减免金额',
|
||||||
|
icon:'none'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
newUserDiscountStore
|
||||||
|
.editConfig(
|
||||||
|
{
|
||||||
|
...form,
|
||||||
|
startTime: form.startTime ? form.startTime + " 00:00:00" : "",
|
||||||
|
endTime: form.endTime ? form.endTime + " 23:59:59" : "",
|
||||||
|
},
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
if (res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "保存成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => newUserDiscountStore.config.isEnable,
|
||||||
|
(newVal) => {
|
||||||
|
if(isLoading.value) return;
|
||||||
|
newUserDiscountStore.editConfig().then((res) => {
|
||||||
|
if (res) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "操作成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
const res = await newUserDiscountStore.getConfig();
|
||||||
|
const data = {
|
||||||
|
...res,
|
||||||
|
startTime: res.startTime ? res.startTime.split(" ")[0] : "",
|
||||||
|
endTime: res.endTime ? res.endTime.split(" ")[0] : "",
|
||||||
|
useTypeList: res.useTypeList || [],
|
||||||
|
randomDiscountList: res.randomDiscountList || [],
|
||||||
|
};
|
||||||
|
console.log(data);
|
||||||
|
Object.assign(form, data);
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.tr {
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.fixed-bottom) {
|
||||||
|
left: 110rpx;
|
||||||
|
right: 110rpx;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
<template>
|
||||||
|
<view class="min-page bg-f7 default-box-padding u-font-28 color-333">
|
||||||
|
<view class="default-box-padding bg-fff default-box-radius">
|
||||||
|
<view>
|
||||||
|
<view class="font-bold u-m-b-16">模版名称</view>
|
||||||
|
<up-input
|
||||||
|
placeholder="请输入模版名称"
|
||||||
|
border="none"
|
||||||
|
v-model="form.title"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
></up-input>
|
||||||
|
<view class="u-m-t-24">
|
||||||
|
<up-line></up-line>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-24">
|
||||||
|
<view class="font-bold u-m-b-16">选择商品</view>
|
||||||
|
<chooseGoods v-model="form.foods"> </chooseGoods>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-16">
|
||||||
|
<view class="font-bold u-m-b-16">自定义引导语</view>
|
||||||
|
<up-input
|
||||||
|
placeholder="请输入内容"
|
||||||
|
border="none"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
></up-input>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="default-box-padding bg-fff default-box-radius u-m-t-32">
|
||||||
|
<view class="font-bold">可用周期</view>
|
||||||
|
<view class="u-m-t-16 u-p-b-24">
|
||||||
|
<my-week-sel shape="circle" v-model="form.useDays"></my-week-sel>
|
||||||
|
</view>
|
||||||
|
<up-line></up-line>
|
||||||
|
<view class="font-bold u-m-t-24 u-m-b-16">指定时间段可用</view>
|
||||||
|
<view class="my-hour-area">
|
||||||
|
<my-hour-area
|
||||||
|
v-model:useTimeType="form.useTimeType"
|
||||||
|
v-model:startValue="form.useStartTime"
|
||||||
|
v-model:endValue="form.useEndTime"
|
||||||
|
></my-hour-area>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<my-bottom-btn-group
|
||||||
|
@cancel="cancel"
|
||||||
|
@save="save"
|
||||||
|
direction="column"
|
||||||
|
></my-bottom-btn-group>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, onMounted } from "vue";
|
||||||
|
import chooseGoods from "@/pageMarket/components/choose-goods.vue";
|
||||||
|
import * as suggestApi from "@/http/api/market/suggest.js";
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onReady,
|
||||||
|
onShow,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom,
|
||||||
|
onBackPress,
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
|
|
||||||
|
const form = reactive({
|
||||||
|
foods: "",
|
||||||
|
useDays: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
||||||
|
useStartTime: "",
|
||||||
|
useTimeType: "all",
|
||||||
|
useEndTime: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
if (!form.title) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入模版名称",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (form.useTimeType == "custom") {
|
||||||
|
if (!form.useStartTime) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择开始时间",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.useEndTime) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择结束时间",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (form.useDays.length == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择可用周期",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!form.foods) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择商品",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(options.type=='edit'){
|
||||||
|
suggestApi
|
||||||
|
.editSuggest({
|
||||||
|
title: form.title,
|
||||||
|
id: form.id,
|
||||||
|
foods: form.foods,
|
||||||
|
useDays: form.useDays.join(","),
|
||||||
|
useStartTime: form.useStartTime,
|
||||||
|
useTimeType: form.useTimeType,
|
||||||
|
useEndTime: form.useEndTime,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "修改成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
suggestApi
|
||||||
|
.addSuggest({
|
||||||
|
title: form.title,
|
||||||
|
foods: form.foods,
|
||||||
|
useDays: form.useDays.join(","),
|
||||||
|
useStartTime: form.useStartTime,
|
||||||
|
useTimeType: form.useTimeType,
|
||||||
|
useEndTime: form.useEndTime,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "添加成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const options=reactive({})
|
||||||
|
onLoad((opt) => {
|
||||||
|
Object.assign(options,opt)
|
||||||
|
const type = opt.type;
|
||||||
|
if (type == "edit") {
|
||||||
|
const item = uni.getStorageSync("suggestItem");
|
||||||
|
form.title = item.title;
|
||||||
|
form.foods = item.foods;
|
||||||
|
form.useDays = item.useDays.split(",");
|
||||||
|
form.useStartTime = item.useStartTime;
|
||||||
|
form.useTimeType = item.useTimeType;
|
||||||
|
form.useEndTime = item.useEndTime;
|
||||||
|
form.id = item.id;
|
||||||
|
console.log(form);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.my-hour-area .container) {
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
}
|
||||||
|
:deep(.my-hour-area .box) {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
}
|
||||||
|
:deep(.fixed-bottom) {
|
||||||
|
left: 110rpx;
|
||||||
|
right: 110rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,280 @@
|
||||||
|
<template>
|
||||||
|
<view class="min-page bg-f7 u-font-28">
|
||||||
|
<up-sticky>
|
||||||
|
<view class="bg-fff default-box-padding">
|
||||||
|
<view class="u-flex">
|
||||||
|
<image
|
||||||
|
style="width: 60rpx; height: 60rpx"
|
||||||
|
src="/pageMarket/static/images/suggest.png"
|
||||||
|
></image>
|
||||||
|
<view class="u-flex-1 u-flex u-p-l-24">
|
||||||
|
<view class="u-font-28 u-flex-1 u-p-r-24">
|
||||||
|
<view class="color-333 font-bold">点餐智能推荐 </view>
|
||||||
|
<view class="color-666 u-m-t-4 u-font-24"
|
||||||
|
>进入点单页X秒未点自动推荐商品,此推荐设置启用即生效
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<up-switch
|
||||||
|
v-model="accountInfoStore.shopInfo.isProductSuggest"
|
||||||
|
size="18"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
></up-switch>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-32">
|
||||||
|
<view class="u-flex">
|
||||||
|
<view class="color-333 font-bold">首次弹窗触发时间 </view>
|
||||||
|
<view class="time" @click="showTimeModal">{{
|
||||||
|
accountInfoStore.shopInfo.suggestTime
|
||||||
|
}}</view>
|
||||||
|
<text class="u-m-l-10">秒</text>
|
||||||
|
</view>
|
||||||
|
<view class="color-666 u-font-24 u-m-t-8"
|
||||||
|
>多个弹窗时,每个弹窗之间关闭和弹出间隔为15秒
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-sticky>
|
||||||
|
<view class="default-box-padding">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
class="u-m-b-56 default-box-radius bg-fff default-box-padding"
|
||||||
|
>
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<text class="u-font-32 font-bold color-333">{{ item.title }}</text>
|
||||||
|
<view class="status" :class="['status' + item.status]">{{
|
||||||
|
item.status == 1 ? "启用" : "禁用"
|
||||||
|
}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-22 color-666 u-font-24">
|
||||||
|
<view> {{ item.useDays }}</view>
|
||||||
|
<view class="u-m-t-16"> {{ returnUseTimeType(item) }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-right gap-20 u-m-t-24">
|
||||||
|
<view class="btn del" @click="handleDelete(item)">删除</view>
|
||||||
|
<view class="btn edit" @click="handleEdit(item)">编辑</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="height: 100rpx"></view>
|
||||||
|
<view class="fixed-bottom">
|
||||||
|
<my-button @click="go.to('PAGES_MARKET_ORDER_RECOMMENDATION_ADD')"
|
||||||
|
>添加</my-button
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
v-model="modalData.show"
|
||||||
|
:title="modalData.title"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
>
|
||||||
|
<template v-if="modalData.key == 'timeModal'">
|
||||||
|
<view class="default-box-padding">
|
||||||
|
<view class="u-flex u-m-t-16">
|
||||||
|
<input
|
||||||
|
class="number-box"
|
||||||
|
placeholder="首次弹窗触发时间"
|
||||||
|
placeholder-class="color-999 u-font-28"
|
||||||
|
type="number"
|
||||||
|
v-model="firstModalTime"
|
||||||
|
/>
|
||||||
|
<view class="unit">秒</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-font-28 color-666 u-m-t-8"
|
||||||
|
>设置为0时,进入点餐页立即弹出</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</Modal>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onReady,
|
||||||
|
onShow,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom,
|
||||||
|
onBackPress,
|
||||||
|
} from "@dcloudio/uni-app";
|
||||||
|
import Modal from "@/pageMarket/components/modal.vue";
|
||||||
|
import * as suggestApi from "@/http/api/market/suggest.js";
|
||||||
|
import { useAccountInfoStore } from "@/store/account.js";
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
|
const accountInfoStore = useAccountInfoStore();
|
||||||
|
import { ref, reactive, onMounted } from "vue";
|
||||||
|
import { watch } from "vue";
|
||||||
|
const loadFinish = ref(false);
|
||||||
|
const form = reactive({
|
||||||
|
isEnable: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
const firstModalTime = ref(0);
|
||||||
|
const modalData = reactive({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
key: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleDelete(item) {
|
||||||
|
uni.showModal({
|
||||||
|
title: "确认删除吗?",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
suggestApi
|
||||||
|
.deleteSuggest({
|
||||||
|
id: item.id,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: "删除成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function refreshList() {
|
||||||
|
query.pageNum = 1;
|
||||||
|
isEnd.value = false;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleEdit(item) {
|
||||||
|
uni.setStorageSync("suggestItem", item);
|
||||||
|
go.to("PAGES_MARKET_ORDER_RECOMMENDATION_ADD", {
|
||||||
|
type: "edit",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function showTimeModal() {
|
||||||
|
modalData.show = true;
|
||||||
|
firstModalTime.value = accountInfoStore.shopInfo.suggestTime || 0;
|
||||||
|
modalData.title = "首次弹窗触发时间";
|
||||||
|
modalData.key = "timeModal";
|
||||||
|
}
|
||||||
|
const handleConfirm = async () => {
|
||||||
|
if (firstModalTime.value < 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请输入正确的时间",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
accountInfoStore.editShopInfo({
|
||||||
|
suggestTime: firstModalTime.value,
|
||||||
|
id: accountInfoStore.shopInfo.id,
|
||||||
|
});
|
||||||
|
uni.showToast({
|
||||||
|
title: "设置成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
modalData.show = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const isEnd = ref(false);
|
||||||
|
const query = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
};
|
||||||
|
const list = ref([]);
|
||||||
|
const getList = async () => {
|
||||||
|
loadFinish.value = false;
|
||||||
|
if (isEnd.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await suggestApi.suggestPage(query);
|
||||||
|
loadFinish.value = true;
|
||||||
|
if (query.pageNum >= res.totalPage * 1) {
|
||||||
|
isEnd.value = true;
|
||||||
|
}
|
||||||
|
if (query.pageNum == 1) {
|
||||||
|
list.value = res.records || [];
|
||||||
|
} else {
|
||||||
|
list.value = list.value.concat(res.records || []);
|
||||||
|
}
|
||||||
|
console.log(list.value);
|
||||||
|
query.pageNum++;
|
||||||
|
};
|
||||||
|
function returnUseTimeType(item) {
|
||||||
|
if (item.useTimeType == "all") {
|
||||||
|
return "全天";
|
||||||
|
}
|
||||||
|
return `${item.useStartTime} - ${item.useEndTime}`;
|
||||||
|
}
|
||||||
|
function getShopInfo() {
|
||||||
|
accountInfoStore.getShopInfo().then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
watch(
|
||||||
|
() => accountInfoStore.shopInfo.isProductSuggest,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
if (!loadFinish.value) return;
|
||||||
|
accountInfoStore.editShopInfo({
|
||||||
|
isProductSuggest: newVal,
|
||||||
|
id: accountInfoStore.shopInfo.id,
|
||||||
|
});
|
||||||
|
uni.showToast({
|
||||||
|
title: "修改成功",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onReachBottom(() => {
|
||||||
|
console.log("触底");
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
getShopInfo();
|
||||||
|
});
|
||||||
|
onShow(() => {
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.status {
|
||||||
|
padding: 8rpx 18rpx;
|
||||||
|
border: 2rpx solid transparent;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
&.status1 {
|
||||||
|
background-color: rgba(123, 209, 54, 0.12);
|
||||||
|
border-color: rgba(123, 209, 54, 1);
|
||||||
|
color: #7bd136;
|
||||||
|
}
|
||||||
|
&.status0 {
|
||||||
|
border-color: rgba(153, 153, 153, 1);
|
||||||
|
background-color: rgba(153, 153, 153, 0.12);
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
padding: 8rpx 42rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
&.del {
|
||||||
|
background-color: #f7f7fa;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
&.edit {
|
||||||
|
background-color: $my-main-color;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fixed-bottom {
|
||||||
|
left: 70rpx;
|
||||||
|
right: 70rpx;
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
margin-left: 30rpx;
|
||||||
|
padding: 4rpx 20rpx;
|
||||||
|
border: 1px solid $my-main-color;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
color: $my-main-color;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 886 B |
33
pages.json
33
pages.json
|
|
@ -686,6 +686,39 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "运营余额"
|
"navigationBarTitleText": "运营余额"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_MARKET_NEW_USER_DISCOUNT",
|
||||||
|
"path": "newUserDiscount/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "新客立减"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_MARKET_ORDER_RECOMMENDATION",
|
||||||
|
"path": "orderRecommendation/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "点餐智能推荐"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_MARKET_ORDER_RECOMMENDATION_ADD",
|
||||||
|
"path": "orderRecommendation/add",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "添加"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ const menuList = ref([
|
||||||
{
|
{
|
||||||
title: '新客立减',
|
title: '新客立减',
|
||||||
icon: '',
|
icon: '',
|
||||||
pageUrl: 'PAGES_ORDER_INDEX',
|
pageUrl: 'PAGES_MARKET_NEW_USER_DISCOUNT',
|
||||||
intro: '首单下单减免金额'
|
intro: '首单下单减免金额'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -100,7 +100,7 @@ const menuList = ref([
|
||||||
{
|
{
|
||||||
title: '点餐智能推荐',
|
title: '点餐智能推荐',
|
||||||
icon: '',
|
icon: '',
|
||||||
pageUrl: '',
|
pageUrl: 'PAGES_MARKET_ORDER_RECOMMENDATION',
|
||||||
intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效'
|
intro: '进入点单页X秒未点自动推荐商品,此推荐设置启用即生效'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
// stores/counter.js
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import * as shopApi from "@/http/api/shop.js";
|
||||||
|
|
||||||
|
// 分销
|
||||||
|
export const useAccountInfoStore = defineStore("accountInfo", {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
shopInfo: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
getShopInfo() {
|
||||||
|
return shopApi.getShopInfo().then((res) => {
|
||||||
|
this.shopInfo = res;
|
||||||
|
return this.shopInfo;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editShopInfo(data,autoRefresh = true) {
|
||||||
|
return shopApi.editShopInfo(data).then((res) => {
|
||||||
|
if(autoRefresh) {
|
||||||
|
this.getShopInfo()
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||||
|
});
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// stores/counter.js
|
// stores/counter.js
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import * as distributionApi from "@/http/api/market/distribution.js";
|
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||||
|
import * as consumeDiscountApi from "@/http/api/market/consumeDiscount.js";
|
||||||
|
|
||||||
export const upgradeTypes = [
|
export const upgradeTypes = [
|
||||||
{
|
{
|
||||||
|
|
@ -51,3 +52,33 @@ export const useDistributionStore = defineStore("distribution", {
|
||||||
},
|
},
|
||||||
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//新客立减
|
||||||
|
export const useNewUserDiscountStore = defineStore("newUserDiscount", {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
//分销配置
|
||||||
|
config: {
|
||||||
|
isEnable: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
async getConfig() {
|
||||||
|
const data = await consumeDiscountApi.getConfig();
|
||||||
|
this.config = data;
|
||||||
|
return this.config;
|
||||||
|
},
|
||||||
|
async editConfig(data, isAutoResrefresh = true) {
|
||||||
|
const res = await consumeDiscountApi.editConfig({
|
||||||
|
...this.config,
|
||||||
|
...data,
|
||||||
|
});
|
||||||
|
if (isAutoResrefresh) {
|
||||||
|
this.getConfig();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue