Merge branch 'ymf' of https://newgitea.sxczgkj.cn/czg_team/cashier_app into new_gyq
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
</view>
|
||||
<up-switch
|
||||
v-model="form.isEnable"
|
||||
:disabled="isMainShop()?false:true"
|
||||
size="18"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@@ -99,7 +100,7 @@
|
||||
|
||||
<button class="add u-m-t-32" @click="addcashbackStepList">添加</button>
|
||||
</view>
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
<my-bottom-btn-group @save="save" isOpenPermission @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -107,6 +108,7 @@
|
||||
import { reactive, computed, onMounted } from "vue";
|
||||
import userTypes from "./user-types.vue";
|
||||
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
|
||||
import { isMainShop } from "@/store/account";
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</view>
|
||||
<view class="u-flex-1 u-p-l-16">
|
||||
<up-search bgColor="#F9F9F9" height="60rpx" :showAction="false" placeholder="搜索订单号"
|
||||
|
||||
@search="search" @clear="search" v-model="searchText"></up-search>
|
||||
</view>
|
||||
</view>
|
||||
@@ -22,7 +23,7 @@
|
||||
<view class="color-999 u-font-24">
|
||||
<view> 关联订单:{{ item.orderNo }} </view>
|
||||
<view class="u-m-t-14">
|
||||
<text class="color-333 font-bold"> {{ item.shopName }}</text>
|
||||
<text class="color-333 font-bold u-m-r-20"> {{ item.shopName }}</text>
|
||||
<text class="color-666 u-font-24">{{ item.createTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -33,8 +34,8 @@
|
||||
</view>
|
||||
<view class="color-333 u-flex u-row-between u-font-28" style="margin-top: 52rpx">
|
||||
<view>
|
||||
<view class="color-666">用户昵称</view>
|
||||
<view class="color-333 u-m-t-24 u-line-1">{{ item.nickName }}</view>
|
||||
<view class="color-666">{{ item.nickName }}</view>
|
||||
<view class="color-333 u-m-t-24 u-line-1">{{ item.phone }}</view>
|
||||
</view>
|
||||
<view class="u-flex u-text-center">
|
||||
<view>
|
||||
@@ -69,6 +70,7 @@
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { isMainShop } from "@/store/account.js";
|
||||
import {
|
||||
ref,
|
||||
onMounted,
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<view class="u-p-b-24"></view>
|
||||
</view>
|
||||
<view class="u-p-t-48 u-p-b-48 u-p-l-60 u-p-r-60">
|
||||
<my-button type="primary" shape="circle" @click="save">保存</my-button>
|
||||
<my-button type="primary" shape="circle" @click="save" v-if="isMainShop()">保存</my-button>
|
||||
</view>
|
||||
|
||||
<view class="bg-fff default-box-radius">
|
||||
@@ -131,7 +131,7 @@ import {
|
||||
import couponStatus from "./components/status.vue";
|
||||
import CouponList from "@/pageMarket/components/coupon-list.vue";
|
||||
import DateTimePicker from "@/pageMarket/components/date-time-picker.vue";
|
||||
|
||||
import {isMainShop} from "@/store/account.js";
|
||||
import Modal from "@/pageMarket/components/modal.vue";
|
||||
import * as couponRedemptionApi from "@/http/api/market/couponRedemption.js";
|
||||
import { saveFileFromTemp } from "@/utils/downloadFile.js";
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
</view>
|
||||
<up-switch
|
||||
v-model="accountInfoStore.shopInfo.isProductSuggest"
|
||||
:disabled="isMainShop()?false:true"
|
||||
|
||||
size="18"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@@ -68,12 +70,14 @@
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<view class="fixed-bottom">
|
||||
<my-button @click="go.to('PAGES_MARKET_COUPON_EXCHANGE_CODE_ADD')"
|
||||
>添加兑换码</my-button
|
||||
>
|
||||
</view>
|
||||
<template v-if="isMainShop()">
|
||||
<view style="height: 100rpx"></view>
|
||||
<view class="fixed-bottom">
|
||||
<my-button @click="go.to('PAGES_MARKET_COUPON_EXCHANGE_CODE_ADD')"
|
||||
>添加兑换码</my-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<Modal
|
||||
v-model="modalData.show"
|
||||
@@ -116,13 +120,14 @@ import Modal from "@/pageMarket/components/modal.vue";
|
||||
import * as couponRedemptionApi from "@/http/api/market/couponRedemption.js";
|
||||
import { useAccountInfoStore } from "@/store/account.js";
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { isMainShop } from "@/store/account.js";
|
||||
const accountInfoStore = useAccountInfoStore();
|
||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||
const loadFinish = ref(false);
|
||||
const form = reactive({
|
||||
isEnable: 0,
|
||||
useType: "all",
|
||||
shopIdList:[]
|
||||
shopIdList: [],
|
||||
});
|
||||
|
||||
const actions = [
|
||||
@@ -223,7 +228,7 @@ const handleConfirm = async () => {
|
||||
}
|
||||
|
||||
couponRedemptionApi.enable({
|
||||
shopIdList: form.shopIdList||[],
|
||||
shopIdList: form.shopIdList || [],
|
||||
useType: form.useType,
|
||||
isEnable: form.isEnable,
|
||||
});
|
||||
@@ -261,6 +266,7 @@ function getShopInfo() {
|
||||
watch(
|
||||
() => accountInfoStore.shopInfo.isProductSuggest,
|
||||
(newVal, oldVal) => {
|
||||
if(!isMainShop()) return;
|
||||
if (!loadFinish.value) return;
|
||||
accountInfoStore.editShopInfo({
|
||||
isProductSuggest: newVal,
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
class="number-box"
|
||||
placeholder="请输入"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
type="number"
|
||||
type="digit"
|
||||
|
||||
v-model="form.payAmount"
|
||||
/>
|
||||
@@ -264,7 +264,10 @@ function setForm(data) {
|
||||
console.log(form);
|
||||
}
|
||||
|
||||
onMounted(() => {});
|
||||
onMounted(() => {
|
||||
setForm(distributionStore.config);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
<view class="u-m-t-16 u-p-b-8">
|
||||
<view class="u-flex u-m-t-16">
|
||||
<input
|
||||
:disabled="index==0?true:false"
|
||||
:class="{'disabled':index==0?true:false}"
|
||||
|
||||
class="number-box"
|
||||
placeholder="请输入"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
@@ -76,6 +79,8 @@
|
||||
<view class="u-flex u-m-t-16">
|
||||
<input
|
||||
class="number-box"
|
||||
:disabled="index==0?true:false"
|
||||
:class="{'disabled':index==0?true:false}"
|
||||
placeholder="请输入"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
type="digit"
|
||||
@@ -271,7 +276,13 @@ function cancel(){
|
||||
}
|
||||
onLoad(()=>{
|
||||
showDetailListSwitch.value=distributionStore.config.levelConfigList.map(()=>true)
|
||||
form.levelConfigList=[...distributionStore.config.levelConfigList||[]]
|
||||
const levelConfigList=[...distributionStore.config.levelConfigList||[]]
|
||||
form.levelConfigList=levelConfigList.length?levelConfigList:[
|
||||
{ name:'',
|
||||
levelOneCommission:'',
|
||||
inviteCount:0,
|
||||
costAmount:0}
|
||||
]
|
||||
form.upgradeType=distributionStore.config.upgradeType
|
||||
})
|
||||
</script>
|
||||
@@ -303,6 +314,10 @@ $height: 70rpx;
|
||||
height: $height;
|
||||
flex: 1;
|
||||
line-height: $height;
|
||||
&.disabled{
|
||||
background-color: #f7f7fa;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.unit {
|
||||
display: flex;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</text>
|
||||
<text class="t">折扣:{{ item.discountRate }}%</text>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<view class="footer" v-if="isMainShop()">
|
||||
<view class="btn">
|
||||
<u-button shape="circle" @click="delHandle(item)">删除</u-button>
|
||||
</view>
|
||||
@@ -49,7 +49,7 @@ import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
|
||||
import { limitTimeDiscountPage, limitTimeDiscountDel } from '@/http/api/market/index.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { convertTimeFormat } from '@/utils/index.js';
|
||||
|
||||
import {isMainShop} from "@/store/account.js";
|
||||
// 去编辑
|
||||
function editorHandle(item) {
|
||||
uni.setStorageSync('limitDiscountObj', item);
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
<script setup>
|
||||
import Modal from "@/pageMarket/components/modal.vue";
|
||||
|
||||
import { ref, reactive, computed, watch, onMounted } from "vue";
|
||||
import { ref, reactive, computed, watch, onMounted ,nextTick} from "vue";
|
||||
import { useNewUserDiscountStore } from "@/store/market.js";
|
||||
|
||||
const isLoading = ref(false);
|
||||
@@ -190,7 +190,7 @@ function addItem() {
|
||||
}
|
||||
function editItem(index) {
|
||||
modalData.index = index;
|
||||
modalData.form = form.randomDiscountList[index];
|
||||
modalData.form = {...form.randomDiscountList[index]}
|
||||
modalData.show = true;
|
||||
modalData.key = "edit";
|
||||
modalData.title = "编辑方案";
|
||||
@@ -299,7 +299,10 @@ async function init() {
|
||||
};
|
||||
console.log(data);
|
||||
Object.assign(form, data);
|
||||
isLoading.value = false;
|
||||
nextTick(() => {
|
||||
isLoading.value = false;
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -230,7 +230,6 @@ onReachBottom(() => {
|
||||
getList();
|
||||
});
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getShopInfo();
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="u-p-t-48 u-p-b-48 u-p-l-60 u-p-r-60">
|
||||
<view class="u-p-t-48 u-p-b-48 u-p-l-60 u-p-r-60" v-if="isMainShop()">
|
||||
<my-button type="primary" shape="circle" @click="save">保存</my-button>
|
||||
</view>
|
||||
|
||||
@@ -124,7 +124,7 @@ import {
|
||||
} from "@dcloudio/uni-app";
|
||||
import couponStatus from "./components/status.vue";
|
||||
import CouponList from "@/pageMarket/components/coupon-list.vue";
|
||||
|
||||
import {isMainShop} from "@/store/account.js";
|
||||
import Modal from "@/pageMarket/components/modal.vue";
|
||||
import * as rechargeRedemptionApi from "@/http/api/market/rechargeRedemption.js";
|
||||
import { saveFileFromTemp } from "@/utils/downloadFile.js";
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<up-switch
|
||||
v-model="accountInfoStore.shopInfo.isProductSuggest"
|
||||
size="18"
|
||||
:disabled="isMainShop()?false:true"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></up-switch>
|
||||
@@ -81,12 +82,15 @@
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<template v-if="isMainShop()">
|
||||
<view style="height: 100rpx"></view>
|
||||
<view class="fixed-bottom">
|
||||
<my-button @click="go.to('PAGES_MARKET_RECHARGE_EXCHANGE_CODE_ADD')"
|
||||
>添加兑换码</my-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<Modal
|
||||
v-model="modalData.show"
|
||||
@@ -129,6 +133,7 @@ import Modal from "@/pageMarket/components/modal.vue";
|
||||
import * as rechargeRedemptionApi from "@/http/api/market/rechargeRedemption.js";
|
||||
import { useAccountInfoStore } from "@/store/account.js";
|
||||
import go from "@/commons/utils/go.js";
|
||||
import {isMainShop} from "@/store/account.js";
|
||||
const accountInfoStore = useAccountInfoStore();
|
||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||
const loadFinish = ref(false);
|
||||
@@ -274,6 +279,7 @@ function getShopInfo() {
|
||||
watch(
|
||||
() => accountInfoStore.shopInfo.isProductSuggest,
|
||||
(newVal, oldVal) => {
|
||||
if(!isMainShop()) return;
|
||||
if (!loadFinish.value) return;
|
||||
accountInfoStore.editShopInfo({
|
||||
isProductSuggest: newVal,
|
||||
|
||||
BIN
pageMarket/static/images/member.png
Normal file
BIN
pageMarket/static/images/member.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 936 B |
287
pageMarket/superVip/add-plans.vue
Normal file
287
pageMarket/superVip/add-plans.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view class="min-page u-font-28 color-333">
|
||||
<view class="container">
|
||||
<view class="">
|
||||
<view class="font-bold u-m-b-16">周期名称</view>
|
||||
<up-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入周期名称"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
></up-input>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="font-bold u-m-b-16">周期价格</view>
|
||||
<view class="u-flex">
|
||||
<input class="number-box" type="digit" v-model="form.price" />
|
||||
<view class="unit">元</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="font-bold u-m-b-16">周期时间</view>
|
||||
<view class="u-flex" style="gap: 24rpx; align-items: stretch">
|
||||
<up-input type="digit" v-model="form.circleTime"></up-input>
|
||||
<view class="times">
|
||||
<up-select
|
||||
v-model:current="form.circleUnit"
|
||||
showOptionsLabel
|
||||
label="单位"
|
||||
keyName="value"
|
||||
labelName="label"
|
||||
:options="times"
|
||||
@select="selectItem"
|
||||
></up-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="font-bold u-m-b-16">赠送成长值</view>
|
||||
<up-input
|
||||
type="number"
|
||||
v-model="form.reward"
|
||||
placeholder="赠送成长值"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
></up-input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="container">
|
||||
<view class="font-bold u-m-b-16">赠送优惠券</view>
|
||||
<CouponList v-model="form.couponList"></CouponList>
|
||||
<view class="u-flex">
|
||||
<view class="u-flex gap-20" @click="addCoupon()">
|
||||
<up-icon name="plus-circle-fill" color="#318AFE" size="16"></up-icon>
|
||||
<text class="">添加</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import CouponList from "./components/coupon-list.vue";
|
||||
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||
import { useSuperVipStore } from "@/store/market.js";
|
||||
import { add } from "lodash";
|
||||
const times = [
|
||||
{
|
||||
label: "年",
|
||||
value: "年",
|
||||
},
|
||||
{
|
||||
label: "月",
|
||||
value: "月",
|
||||
},
|
||||
{
|
||||
label: "周",
|
||||
value: "周",
|
||||
},
|
||||
{
|
||||
label: "天",
|
||||
value: "天",
|
||||
},
|
||||
];
|
||||
const placeholderStyle = {
|
||||
"font-size": "28rpx",
|
||||
};
|
||||
const superVipStore = useSuperVipStore();
|
||||
|
||||
const form = reactive({
|
||||
name: "",
|
||||
price: 0,
|
||||
reward: 0,
|
||||
couponList: [], // 存储已选择的优惠券
|
||||
circleTime: 1, // 会员周期
|
||||
circleUnit: "月", // 会员周期单位
|
||||
});
|
||||
function addCoupon() {
|
||||
form.couponList.push({
|
||||
coupon: { id: null },
|
||||
num: "",
|
||||
title: "",
|
||||
});
|
||||
}
|
||||
const showDetailListSwitch = ref([true]);
|
||||
|
||||
//判断输入每一项是否为空
|
||||
function checkInput() {
|
||||
for (let item of form.couponList) {
|
||||
if (!item.coupon.id) {
|
||||
uni.showToast({
|
||||
title: "请选择优惠券",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!item.num) {
|
||||
uni.showToast({
|
||||
title: "请输入优惠券数量",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async function save() {
|
||||
const isPas = checkInput();
|
||||
if (!isPas) {
|
||||
return;
|
||||
}
|
||||
if (!form.name) {
|
||||
uni.showToast({
|
||||
title: "请输入周期名称",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!form.price) {
|
||||
uni.showToast({
|
||||
title: "请输入周期价格",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!form.circleTime) {
|
||||
uni.showToast({
|
||||
title: "请输入周期时间",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (optiopns.type == "edit") {
|
||||
superVipStore.editPlan(optiopns.index, form);
|
||||
} else {
|
||||
superVipStore.addPlan(form);
|
||||
}
|
||||
const res = await superVipStore.editConfig();
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "none",
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
icon: "none",
|
||||
});
|
||||
return
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
function cancel() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}
|
||||
const optiopns = reactive({});
|
||||
onLoad((opt) => {
|
||||
Object.assign(optiopns, opt);
|
||||
if (opt.type === "edit" && opt.index !== undefined && opt.index !== null) {
|
||||
const item = superVipStore.config.configList[opt.index];
|
||||
Object.assign(form, item);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
background: #f7f7f7;
|
||||
padding: 56rpx 28rpx;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.x-padding {
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
$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;
|
||||
&.disabled {
|
||||
background-color: #f7f7fa;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.title {
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.first {
|
||||
border-bottom: 2rpx solid #e5e5e5;
|
||||
}
|
||||
.arrow {
|
||||
transition: all 0.3s ease-in-out;
|
||||
&.rotate {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
.times {
|
||||
padding: 10rpx 20rpx;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
:deep(.times .u-select) {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
336
pageMarket/superVip/components/config.vue
Normal file
336
pageMarket/superVip/components/config.vue
Normal file
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<view class="box">
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">提交生日/姓名</text>
|
||||
<up-radio-group v-model="form.isSubmitInfo" placement="row">
|
||||
<up-radio :key="1" :name="1">
|
||||
<template #label>
|
||||
<text> 是 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio :key="0" :name="0">
|
||||
<template #label>
|
||||
<text> 否 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-10"
|
||||
>*成为会员前需提交生日、姓名、性别信息</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container" style="padding-left: 0; padding-right: 0">
|
||||
<view class="x-padding">
|
||||
<view class="u-flex u-row-between custome">
|
||||
<text class="font-bold color-333">会员开通方式</text>
|
||||
<up-radio-group v-model="form.openType" placement="row">
|
||||
<up-radio key="PAY" name="PAY">
|
||||
<template #label>
|
||||
<text> 购买开通 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
<up-radio key="CONDITION" name="CONDITION">
|
||||
<template #label>
|
||||
<text> 条件开通 </text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-line></up-line>
|
||||
</view>
|
||||
<template v-if="form.openType == 'PAY'">
|
||||
<view
|
||||
class="u-flex u-row-between u-p-t-26"
|
||||
@click="go.to('PAGES_MARKET_SUPER_VIP_VIP_PLANS')"
|
||||
>
|
||||
<text class="font-bold color-333">会员周期列表</text>
|
||||
<view class="u-flex">
|
||||
<text class="u-font-24 color-main">去设置</text>
|
||||
<up-icon name="arrow-right" color="#318AFE"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="form.openType == 'CONDITION'">
|
||||
<view class="u-flex u-row-between u-col-baseline u-m-t-32">
|
||||
<text class="font-bold color-333">成为会员条件</text>
|
||||
<view class="u-flex-1 u-p-l-32">
|
||||
<view v-for="(item, index) in conditionLists" :key="index">
|
||||
<up-checkbox usedAlone v-model:checked="item.checked">
|
||||
<template #label>
|
||||
<view> {{ item.label }} </view>
|
||||
</template>
|
||||
</up-checkbox>
|
||||
<view class="u-m-t-24 u-m-b-24">
|
||||
<up-number-box
|
||||
:inputWidth="100"
|
||||
:decimalLength="item.precision || 0"
|
||||
v-if="item.label != '绑定手机号' && item.checked"
|
||||
v-model="item.value"
|
||||
:step="item.step"
|
||||
:min="item.min || 0"
|
||||
></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">可用门店</view>
|
||||
<my-shop-select
|
||||
@shop-select="shopSelect"
|
||||
v-model:selShops="form.memberPriceShopIdList"
|
||||
v-model:useType="form.memberPriceShopType"
|
||||
></my-shop-select>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333 u-m-b-16">规则说明</view>
|
||||
<up-textarea
|
||||
v-model="form.remark"
|
||||
placeholder="请输入规则说明"
|
||||
></up-textarea>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 container">
|
||||
<view class="font-bold color-333">获取成长值升级</view>
|
||||
<view class="u-m-t-6 color-999 u-font-24"
|
||||
>*两个条件必选有一条是大于0的数值</view
|
||||
>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每消费1元获得成长值</text>
|
||||
<up-number-box
|
||||
v-model="form.costReward"
|
||||
inputWidth="80"
|
||||
placeholder="请输入内容"
|
||||
></up-number-box>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-26 gap-20">
|
||||
<text>每充值1元获得成长值</text>
|
||||
<up-number-box
|
||||
v-model="form.rechargeReward"
|
||||
inputWidth="80"
|
||||
placeholder="请输入内容"
|
||||
></up-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, computed, onMounted, ref, inject, watch } from "vue";
|
||||
import userTypes from "./user-types.vue";
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import go from "@/commons/utils/go.js";
|
||||
|
||||
const conditionLists = ref([
|
||||
{ label: "绑定手机号", checked: false, code: "BIND_PHONE" },
|
||||
{
|
||||
label: "订单达成指定次数",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "ORDER",
|
||||
step: 1,
|
||||
stepStrictly: true,
|
||||
min: 1,
|
||||
},
|
||||
{
|
||||
label: "消费达到指定金额",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "COST_AMOUNT",
|
||||
precision: 2,
|
||||
min: 0.01,
|
||||
},
|
||||
{
|
||||
label: "充值达到指定金额",
|
||||
checked: false,
|
||||
value: "",
|
||||
code: "RECHARGE_AMOUNT",
|
||||
precision: 2,
|
||||
min: 0.01,
|
||||
},
|
||||
]);
|
||||
|
||||
const superVipStore = inject("superVipStore");
|
||||
|
||||
//分销奖励次数
|
||||
const isLimitCount = ref(0);
|
||||
const isLimitCounts = [
|
||||
{
|
||||
value: 0,
|
||||
label: "限制",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "不限制",
|
||||
},
|
||||
];
|
||||
//开通方式
|
||||
const opentypes = [
|
||||
{
|
||||
value: "auto",
|
||||
label: "自动开通",
|
||||
},
|
||||
{
|
||||
value: "manual",
|
||||
label: "手动开通",
|
||||
},
|
||||
{
|
||||
value: "pay",
|
||||
label: "付费开通",
|
||||
},
|
||||
];
|
||||
const form = reactive({
|
||||
isSubmitInfo: 1,
|
||||
openType: "PAY",
|
||||
configList: [],
|
||||
memberPriceShopType: "ALL",
|
||||
remark: "",
|
||||
costReward: 0,
|
||||
rechargeReward: 0,
|
||||
memberPriceShopIdList: [],
|
||||
isMemberPrice: 1,
|
||||
isOpen: 0,
|
||||
});
|
||||
watch(
|
||||
() => isLimitCount.value,
|
||||
(newval) => {
|
||||
if (newval) {
|
||||
form.rewardCount = -1;
|
||||
} else {
|
||||
form.rewardCount = "";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
async function save() {
|
||||
console.log(form);
|
||||
const submitData = {
|
||||
...form,
|
||||
};
|
||||
const res = await superVipStore.editConfig(submitData);
|
||||
uni.showToast({
|
||||
title: "更新成功",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
function cancel() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
watch(
|
||||
() => superVipStore.config,
|
||||
(newval) => {
|
||||
setForm(newval);
|
||||
}
|
||||
);
|
||||
|
||||
function setForm(data) {
|
||||
if (data.rewardCount == -1) {
|
||||
isLimitCount.value = 1;
|
||||
}
|
||||
Object.assign(form, data);
|
||||
console.log(form);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setForm(superVipStore.config);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.x-padding {
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
.text-tips {
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 6rpx 0 0 6rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background-color: #f7f7fa;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.text-tips1 {
|
||||
border-radius: 0 6rpx 6rpx 0;
|
||||
}
|
||||
.gap-40 {
|
||||
gap: 40rpx;
|
||||
}
|
||||
.my-input {
|
||||
border: 2rpx solid #d9d9d9;
|
||||
height: 60rpx;
|
||||
border-right: none;
|
||||
width: 240rpx;
|
||||
text-align: center;
|
||||
padding: 0 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.box {
|
||||
padding: 0 28rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.add {
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #318afe;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
line-height: 56rpx;
|
||||
margin: 0;
|
||||
}
|
||||
.color-red {
|
||||
color: #ff2f2f;
|
||||
}
|
||||
$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;
|
||||
}
|
||||
:deep(.custome .u-radio-group) {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
110
pageMarket/superVip/components/coupon-list.vue
Normal file
110
pageMarket/superVip/components/coupon-list.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<view>
|
||||
<view
|
||||
class="u-flex u-row-between u-m-b-24"
|
||||
style="gap: 40rpx"
|
||||
v-for="(item, index) in modelValue"
|
||||
:key="index"
|
||||
>
|
||||
<view
|
||||
class="choose-coupon u-flex-1 u-flex u-row-between"
|
||||
@click="showCoupon(item, index)"
|
||||
>
|
||||
<template v-if="item.coupon.title">
|
||||
<text>{{ item.coupon.title }}</text>
|
||||
<view class="u-flex" @click.stop="clearCoupon(index)">
|
||||
<up-icon name="close" size="14"></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<text class="color-999">选择赠送券</text>
|
||||
<up-icon name="arrow-down" size="14"></up-icon>
|
||||
</template>
|
||||
</view>
|
||||
<view class="u-flex-1 u-flex">
|
||||
<view class="u-flex-1 input-number-box u-flex">
|
||||
<input
|
||||
class="u-flex-1 input"
|
||||
type="number"
|
||||
v-model="item.num"
|
||||
placeholder=""
|
||||
placeholder-class="color-999 u-font-28"
|
||||
/>
|
||||
<text class="no-wrap color-999 number">数量</text>
|
||||
</view>
|
||||
<view class="u-m-l-20">
|
||||
<up-icon
|
||||
name="minus-circle-fill"
|
||||
color="#EB4F4F"
|
||||
size="18"
|
||||
@click="removeCoupon(index)"
|
||||
></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<chooseCoupon
|
||||
v-model="chooseCouponData.couponId"
|
||||
v-model:show="chooseCouponData.show"
|
||||
@confirm="confirmCoupon"
|
||||
:list="couponList"
|
||||
></chooseCoupon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import chooseCoupon from "@/pageMarket/components/choose-coupon.vue";
|
||||
import { couponPage } from "@/http/api/market/index.js";
|
||||
|
||||
const chooseCouponData = reactive({
|
||||
couponId: "",
|
||||
show: false,
|
||||
index: -1,
|
||||
item: null,
|
||||
});
|
||||
const modelValue = defineModel({
|
||||
type: Array,
|
||||
default: () => [],
|
||||
});
|
||||
|
||||
function clearCoupon(index) {
|
||||
modelValue.value[index].coupon = { id: null };
|
||||
}
|
||||
const couponList = ref([]);
|
||||
function showCoupon(item, index) {
|
||||
chooseCouponData.couponId = item ? item.id : "";
|
||||
chooseCouponData.show = true;
|
||||
chooseCouponData.index = index;
|
||||
chooseCouponData.item = item;
|
||||
}
|
||||
function confirmCoupon(e) {
|
||||
modelValue.value[chooseCouponData.index].coupon = e
|
||||
}
|
||||
function removeCoupon(index) {
|
||||
modelValue.value.splice(index, 1);
|
||||
}
|
||||
onMounted(() => {
|
||||
couponPage({ size: 999 }).then((res) => {
|
||||
couponList.value = res.records;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.choose-coupon {
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 1px solid #d9d9d9;
|
||||
}
|
||||
.input-number-box {
|
||||
border-radius: 8rpx;
|
||||
border: 1px solid #d9d9d9;
|
||||
.input {
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
.number {
|
||||
background-color: #f7f7fa;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
</style>
|
||||
197
pageMarket/superVip/components/fenxiao-mingxi.vue
Normal file
197
pageMarket/superVip/components/fenxiao-mingxi.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<view class="list u-font-28">
|
||||
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="color-666 u-font-24 u-flex">
|
||||
<text class="no-wrap"> 关联订单:</text>
|
||||
<text> {{ item.orderNo }} </text>
|
||||
</view>
|
||||
<view class="status" :class="[item.status]">
|
||||
{{ returnStatus(item.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-16">
|
||||
<view>
|
||||
<view class="color-333 u-font-28 u-flex u-line-1">
|
||||
<text class="font-bold"> 分销员 </text>
|
||||
<text class="color-666 u-font-24 u-m-l-28">
|
||||
{{ item.nickName }}
|
||||
</text>
|
||||
<text class="color-666 u-font-24 u-m-l-10"> {{ item.phone }} </text>
|
||||
</view>
|
||||
<view class="color-333 u-font-28 u-flex u-m-t-16 u-line-1">
|
||||
<text class="font-bold"> 下级用户 </text>
|
||||
<text class="color-666 u-font-24 u-m-l-28">
|
||||
{{ item.sourceNickName }}
|
||||
</text>
|
||||
<text class="color-666 u-font-24 u-m-l-10"> {{ item.sourcePhone }} </text>
|
||||
</view>
|
||||
<view class="color-333 u-font-28 u-flex u-m-t-16 u-line-1">
|
||||
<text class="font-bold"> 创建时间 </text>
|
||||
<text class="color-666 u-font-24 u-m-l-28">
|
||||
{{ item.sourceNickName }}
|
||||
</text>
|
||||
<text class="color-666 u-font-24 u-m-l-10"> {{ item.createTime }} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view
|
||||
class="text-center color-main font-bold"
|
||||
:class="[ item.status == 'refund' ? 'color-red' : '']"
|
||||
>{{ item.rewardAmount }}</view
|
||||
>
|
||||
<view class="color-66 u-font-24">{{
|
||||
item.level == 1 ? "直接分成" : "间接分成"
|
||||
}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-30">
|
||||
<up-loadmore :status="isEnd ? 'nomore' : 'loading'"></up-loadmore>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
watch,
|
||||
toRaw,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
inject,
|
||||
} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
isEnd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const statusMap = {
|
||||
success: "已入账",
|
||||
refund: "已退款",
|
||||
pending: "待入账",
|
||||
};
|
||||
function returnStatus(status) {
|
||||
return status in statusMap ? statusMap[status] : status;
|
||||
}
|
||||
|
||||
const $actions = [
|
||||
{
|
||||
name: "更改分销组",
|
||||
value: "change-group",
|
||||
},
|
||||
{
|
||||
name: "重置分销组",
|
||||
value: "reset-group",
|
||||
},
|
||||
{
|
||||
name: "恢复分销员",
|
||||
value: "back-fenxiao",
|
||||
},
|
||||
{
|
||||
name: "取消分销员",
|
||||
value: "cancel-fenxiao",
|
||||
},
|
||||
];
|
||||
const actions = ref($actions);
|
||||
|
||||
const emits = defineEmits(["refresh"]);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.list {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
.money {
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 28rpx;
|
||||
}
|
||||
.more {
|
||||
display: flex;
|
||||
height: 56rpx;
|
||||
padding: 8rpx 28rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
border: 2rpx solid $my-main-color;
|
||||
color: $my-main-color;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: fixed;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
}
|
||||
.status {
|
||||
display: flex;
|
||||
padding: 8rpx 18rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 0 0 8rpx 8rpx;
|
||||
border: 1px solid transparent;
|
||||
&.success {
|
||||
color: rgba(123, 209, 54, 1);
|
||||
border-color: rgba(123, 209, 54, 1);
|
||||
background-color: rgba(123, 209, 54, 0.12);
|
||||
}
|
||||
&.refund {
|
||||
border-color: rgba(249, 50, 40, 1);
|
||||
background-color: rgba(209, 64, 54, 0.12);
|
||||
color: rgba(255, 47, 47, 1);
|
||||
}
|
||||
&.pending {
|
||||
border-color: rgba(153, 153, 153, 1);
|
||||
background-color: rgba(153, 153, 153, 0.12);
|
||||
color: rgba(153, 153, 153, 1);
|
||||
}
|
||||
}
|
||||
.color-red {
|
||||
color: #ff2f2f;
|
||||
}
|
||||
.text-center{
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
258
pageMarket/superVip/components/open-list.vue
Normal file
258
pageMarket/superVip/components/open-list.vue
Normal file
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
<view class="list u-font-28">
|
||||
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="color-666 u-font-24 u-flex">
|
||||
<text class="no-wrap"> 订单号:</text>
|
||||
<text> {{ item.orderNo }} </text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex u-row-between">
|
||||
<view class="color-333 u-font-28">
|
||||
<view>
|
||||
<text> {{ item.nickName }} </text>
|
||||
<text> {{ item.phone }}</text>
|
||||
</view>
|
||||
<view class="u-m-t-8 color-999 u-font-24">
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center">
|
||||
<view class="color-red u-font-32 font-700">
|
||||
{{ item.amount }}
|
||||
</view>
|
||||
<view class="u-m-t-2 color-999 u-font-24">
|
||||
<view>{{ item.circleTime }}个{{ item.circleUnit }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-30">
|
||||
<up-loadmore :status="isEnd ? 'nomore' : 'loading'"></up-loadmore>
|
||||
</view>
|
||||
|
||||
<up-action-sheet
|
||||
:show="showActions"
|
||||
:actions="actions"
|
||||
@select="handleSelect"
|
||||
@close="showActions = false"
|
||||
cancel-text="取消"
|
||||
></up-action-sheet>
|
||||
<Modal
|
||||
v-model="modalData.show"
|
||||
:title="modalData.title"
|
||||
@confirm="handleConfirm"
|
||||
>
|
||||
<view class="u-p-48" v-if="modalData.key == 'change-group'">
|
||||
<view class="u-m-r-36 u-m-b-24">分销组</view>
|
||||
<up-radio-group v-model="group" placement="row" place="row">
|
||||
<up-radio
|
||||
v-for="item in distributionStore.config.levelConfigList"
|
||||
:key="item.id"
|
||||
:name="item.id"
|
||||
:label="item.name"
|
||||
>
|
||||
<template #label>
|
||||
<text>
|
||||
{{ item.name }}
|
||||
</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<view class="u-p-48 u-flex" v-if="modalData.key == 'reset-group'">
|
||||
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
||||
<view class="u-font-32 color-333 u-m-l-20"
|
||||
>是否确认重置分销组 重置后将会按照用户的实际数据匹配分销组</view
|
||||
>
|
||||
</view>
|
||||
<view class="u-p-48 u-flex" v-if="modalData.key == 'cancel-group'">
|
||||
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
||||
<view class="u-font-32 color-333 u-m-l-20">是否确认取消分销员</view>
|
||||
</view>
|
||||
</Modal>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
watch,
|
||||
toRaw,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
inject,
|
||||
} from "vue";
|
||||
import go from "@/commons/utils/go.js";
|
||||
|
||||
import Modal from "@/pageMarket/components/modal.vue";
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
isEnd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
//选中的分销组
|
||||
const group = ref("");
|
||||
|
||||
const distributionStore = inject("distributionStore");
|
||||
const distributionApi = inject("distributionApi");
|
||||
const modalData = reactive({
|
||||
show: false,
|
||||
title: "",
|
||||
key: "",
|
||||
data: null,
|
||||
});
|
||||
const showActions = ref(false);
|
||||
const $actions = [
|
||||
{
|
||||
name: "更改分销组",
|
||||
value: "change-group",
|
||||
},
|
||||
{
|
||||
name: "重置分销组",
|
||||
value: "reset-group",
|
||||
},
|
||||
{
|
||||
name: "恢复分销员",
|
||||
value: "back-fenxiao",
|
||||
},
|
||||
{
|
||||
name: "取消分销员",
|
||||
value: "cancel-fenxiao",
|
||||
},
|
||||
];
|
||||
const actions = ref($actions);
|
||||
function moreShow(item) {
|
||||
modalData.data = item;
|
||||
group.value = item.distributionLevelId;
|
||||
if (item.isAssignLevel == 0) {
|
||||
actions.value = $actions.filter((item) => item.value !== "reset-group");
|
||||
} else {
|
||||
actions.value = $actions.filter((item) => item.value !== "change-group");
|
||||
}
|
||||
if (item.status == 1) {
|
||||
actions.value = actions.value.filter(
|
||||
(item) => item.value !== "back-fenxiao"
|
||||
);
|
||||
}
|
||||
if (item.status == 9) {
|
||||
actions.value = actions.value.filter(
|
||||
(item) => item.value !== "cancel-fenxiao"
|
||||
);
|
||||
}
|
||||
showActions.value = true;
|
||||
}
|
||||
function handleSelect(item) {
|
||||
console.log(item);
|
||||
modalData.title = item.name;
|
||||
modalData.key = item.value;
|
||||
|
||||
showActions.value = false;
|
||||
modalData.show = true;
|
||||
}
|
||||
|
||||
const emits = defineEmits(["refresh"]);
|
||||
|
||||
async function handleConfirm() {
|
||||
if (modalData.key == "reset-group") {
|
||||
await distributionApi.resetLevel({
|
||||
id: modalData.data.id,
|
||||
shopId: uni.getSystemInfoSync("shopInfo").id || "",
|
||||
});
|
||||
}
|
||||
if (modalData.key == "change-group") {
|
||||
const level = distributionStore.config.levelConfigList.find(
|
||||
(item) => item.id == group.value
|
||||
);
|
||||
await distributionApi.editDistributionUser({
|
||||
id: modalData.data.id,
|
||||
isAssignLevel: 1,
|
||||
distributionLevelId: group.value,
|
||||
distributionLevelName: level.name,
|
||||
});
|
||||
emits("refresh");
|
||||
}
|
||||
if (modalData.key == "cancel-fenxiao") {
|
||||
await distributionApi.editDistributionUser({
|
||||
id: modalData.data.id,
|
||||
status: 9,
|
||||
});
|
||||
emits("refresh");
|
||||
}
|
||||
if (modalData.key == "back-fenxiao") {
|
||||
await distributionApi.editDistributionUser({
|
||||
id: modalData.data.id,
|
||||
status: 1,
|
||||
});
|
||||
emits("refresh");
|
||||
}
|
||||
group.value = "";
|
||||
modalData.show = false;
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.list {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
.money {
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 28rpx;
|
||||
}
|
||||
.more {
|
||||
display: flex;
|
||||
height: 56rpx;
|
||||
padding: 8rpx 28rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
border: 2rpx solid $my-main-color;
|
||||
color: $my-main-color;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: fixed;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
}
|
||||
</style>
|
||||
70
pageMarket/superVip/components/user-types.vue
Normal file
70
pageMarket/superVip/components/user-types.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-radio-group v-model="userType" placement="row">
|
||||
<up-radio
|
||||
v-for="item in userTypeList"
|
||||
:key="item.value"
|
||||
:name="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
<template #label>
|
||||
<text>
|
||||
{{ item.label }}
|
||||
</text>
|
||||
<text v-if="item.desc" class="color-666 u-font-24">
|
||||
{{ item.desc }}
|
||||
</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
|
||||
const userType = defineModel({
|
||||
default: () => "all",
|
||||
type: String,
|
||||
});
|
||||
const userTypeList = [
|
||||
{
|
||||
value: "all",
|
||||
label: "全部用户",
|
||||
},
|
||||
{
|
||||
value: "new",
|
||||
label: "仅限新用户",
|
||||
},
|
||||
{
|
||||
value: "vip",
|
||||
label: "仅会员",
|
||||
desc:'(分店需开启超级会员可用)'
|
||||
},
|
||||
];
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.box {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: top;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx 24rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
position: relative;
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 24rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
.shop-item {
|
||||
padding: 4rpx 8rpx 4rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
margin-bottom: 16rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
</style>
|
||||
172
pageMarket/superVip/components/vip-lv-list.vue
Normal file
172
pageMarket/superVip/components/vip-lv-list.vue
Normal file
@@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<view class="list u-font-28 color-333">
|
||||
<view class="u-m-t-32 item" v-for="(item, index) in list" :key="item.id">
|
||||
<view class="color-000 font-bold u-font-32">
|
||||
<view> {{ item.name }} </view>
|
||||
</view>
|
||||
<view class="u-m-t-32 u-flex">
|
||||
<view class="u-flex-1">
|
||||
<text class="color-666">所需成长值:</text>
|
||||
<text>{{ item.experienceValue || 0 }}</text>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<text class="color-666">会员折扣:</text>
|
||||
<text>{{ item.discount || 100 }}%</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32 u-flex u-row-right gap-20">
|
||||
<view class="del" @click="delItem(item)" v-if="index != 0">删除</view>
|
||||
<view class="edit" @click="editItem(item)">编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-30">
|
||||
<up-loadmore :status="isEnd ? 'nomore' : 'loading'"></up-loadmore>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<view class="bottom">
|
||||
<my-button @click="go.to('PAGES_MARKET_SUPER_VIP_LV_ADD')">
|
||||
<view class="u-flex">
|
||||
<text>+ 添加会员等级</text>
|
||||
</view>
|
||||
</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
watch,
|
||||
toRaw,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
inject,
|
||||
} from "vue";
|
||||
import go from "@/commons/utils/go.js";
|
||||
const memberApi=inject('memberApi')
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
isEnd: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
function delItem(item) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定删除该会员等级吗?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
memberApi.levelDel(item.id).then((res) => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: "none",
|
||||
});
|
||||
emits("refresh");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function editItem(item) {
|
||||
go.to("PAGES_MARKET_SUPER_VIP_LV_ADD", {
|
||||
id: item.id,
|
||||
type: "edit",
|
||||
});
|
||||
}
|
||||
|
||||
const emits = defineEmits(["refresh"]);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.list {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
.money {
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 28rpx;
|
||||
}
|
||||
.more {
|
||||
display: flex;
|
||||
height: 56rpx;
|
||||
padding: 8rpx 28rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
border: 2rpx solid $my-main-color;
|
||||
color: $my-main-color;
|
||||
background: #fff;
|
||||
}
|
||||
.del {
|
||||
display: flex;
|
||||
height: 56rpx;
|
||||
padding: 8rpx 28rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
border: 2rpx solid #f7f7fa;
|
||||
color: #999;
|
||||
background: #f7f7fa;
|
||||
}
|
||||
.edit {
|
||||
display: flex;
|
||||
height: 56rpx;
|
||||
padding: 8rpx 28rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
border: 2rpx solid $my-main-color;
|
||||
|
||||
color: #fff;
|
||||
background: $my-main-color;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: fixed;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
}
|
||||
</style>
|
||||
447
pageMarket/superVip/index.vue
Normal file
447
pageMarket/superVip/index.vue
Normal file
@@ -0,0 +1,447 @@
|
||||
<template>
|
||||
<view class="min-page u-font-28">
|
||||
<up-sticky>
|
||||
<view class="bg-fff top">
|
||||
<view class="bg-fff container u-flex u-m-b-48">
|
||||
<image
|
||||
style="width: 60rpx; height: 60rpx"
|
||||
src="/pageMarket/static/images/member.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="superVipStore.config.isOpen"
|
||||
size="18"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
|
||||
<view
|
||||
v-if="active == 2"
|
||||
class="u-flex u-row-between u-m-t-32"
|
||||
style="gap: 58rpx"
|
||||
>
|
||||
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
||||
<up-icon name="search" size="18"></up-icon>
|
||||
<input
|
||||
class="u-m-l-10 u-font-28"
|
||||
type="text"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
placeholder="搜索关键词"
|
||||
v-model="keyWord"
|
||||
@blur="keyWordBlur"
|
||||
/>
|
||||
<up-icon
|
||||
v-if="keyWord"
|
||||
name="close"
|
||||
size="14"
|
||||
@click="clearKeyWord"
|
||||
></up-icon>
|
||||
</view>
|
||||
<view
|
||||
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
|
||||
@click="showTimeArea = true"
|
||||
>
|
||||
<template
|
||||
v-if="userComponentQuery.startTime && userComponentQuery.endTime"
|
||||
>
|
||||
<text class="u-font-20">
|
||||
{{ userComponentQuery.startTime }} -
|
||||
{{ userComponentQuery.endTime }}
|
||||
</text>
|
||||
<view @click.stop="clearTime">
|
||||
<up-icon name="close" size="14"></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="color-999">请选择日期范围</text>
|
||||
<up-icon name="arrow-right" size="12"></up-icon>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="active == 2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.totalRow
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单数</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.totalAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">订单金额(元)</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="active == 3" class="u-flex u-m-t-32">
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.successAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">已入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.pendingAmount || 0
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">待入账金额(元)</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center">
|
||||
<view class="u-font-32 color-main font-bold">{{
|
||||
listRes.balanceAmount
|
||||
}}</view>
|
||||
<view class="u-font-24 color-666 u-m-t-16">
|
||||
<text>运营余额(元)</text>
|
||||
<text class="color-main" @click="go.to('PAGES_PAY')"
|
||||
>充值{{ ">" }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-sticky>
|
||||
<configVue v-if="active == 0"></configVue>
|
||||
<vipLvList
|
||||
v-if="active == 1"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></vipLvList>
|
||||
|
||||
<openListVue
|
||||
v-if="active == 2"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></openListVue>
|
||||
<fenxiaoMingxiVue
|
||||
v-if="active == 3"
|
||||
:list="list"
|
||||
:isEnd="isEnd"
|
||||
@refresh="refresh"
|
||||
></fenxiaoMingxiVue>
|
||||
<!-- 选择门店 -->
|
||||
<shopSelActionSheetVue
|
||||
@choose="chooseShop"
|
||||
v-model="showShopSelActionSheet"
|
||||
title="选择门店"
|
||||
>
|
||||
</shopSelActionSheetVue>
|
||||
|
||||
<dateAreaSel
|
||||
:show="showTimeArea"
|
||||
:minYear="2022"
|
||||
@close="showTimeArea = false"
|
||||
@confirm="confirmTimeArea"
|
||||
></dateAreaSel>
|
||||
|
||||
<!-- 分销明细状态 -->
|
||||
<up-action-sheet
|
||||
:show="showActions"
|
||||
:actions="actions"
|
||||
@select="handleSelect"
|
||||
@close="showActions = false"
|
||||
cancel-text="取消"
|
||||
></up-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import go from "@/commons/utils/go.js";
|
||||
import { ref, onMounted, watch, provide } from "vue";
|
||||
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
|
||||
import * as memberApi from "@/http/api/market/member.js";
|
||||
import configVue from "./components/config.vue";
|
||||
import shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
|
||||
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
||||
import vipLvList from "./components/vip-lv-list.vue";
|
||||
import openListVue from "./components/open-list.vue";
|
||||
import fenxiaoMingxiVue from "./components/fenxiao-mingxi.vue";
|
||||
|
||||
import { useSuperVipStore } from "@/store/market.js";
|
||||
import { reactive } from "vue";
|
||||
|
||||
const actions = [
|
||||
{
|
||||
name: "全部",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "已入账",
|
||||
value: "success",
|
||||
},
|
||||
{
|
||||
name: "待入账",
|
||||
value: "pending",
|
||||
},
|
||||
{
|
||||
name: "已退款",
|
||||
value: "refund",
|
||||
},
|
||||
];
|
||||
function clearKeyWord() {
|
||||
keyWord.value = "";
|
||||
userComponentQuery.user = "";
|
||||
}
|
||||
function clearTime() {
|
||||
userComponentQuery.startTime = "";
|
||||
userComponentQuery.endTime = "";
|
||||
}
|
||||
const selActions = ref("");
|
||||
const showActions = ref(false);
|
||||
function handleSelect(e) {
|
||||
selActions.value = e;
|
||||
}
|
||||
|
||||
const superVipStore = useSuperVipStore();
|
||||
superVipStore.getConfig();
|
||||
provide("superVipStore", superVipStore);
|
||||
provide("memberApi", memberApi);
|
||||
const showTimeArea = ref(false);
|
||||
function confirmTimeArea(e) {
|
||||
console.log(e);
|
||||
userComponentQuery.startTime = e[0];
|
||||
userComponentQuery.endTime = e[1];
|
||||
}
|
||||
const tabs = [
|
||||
{
|
||||
label: "会员基础设置",
|
||||
value: "basic",
|
||||
},
|
||||
{
|
||||
label: "会员等级设置",
|
||||
value: "user",
|
||||
},
|
||||
{
|
||||
label: "购买会员订单",
|
||||
value: "recoders",
|
||||
},
|
||||
];
|
||||
|
||||
const keyWord = ref("");
|
||||
function keyWordBlur() {
|
||||
userComponentQuery.user = keyWord.value;
|
||||
}
|
||||
const userComponentQuery = reactive({
|
||||
user: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
});
|
||||
|
||||
const form = ref({
|
||||
isOpen: 0,
|
||||
});
|
||||
|
||||
const list = ref([]);
|
||||
const pageNum = ref(1);
|
||||
const isEnd = ref(false);
|
||||
const selShop = ref({
|
||||
shopId: "",
|
||||
shopName: "",
|
||||
});
|
||||
const searchText = ref("");
|
||||
|
||||
function search() {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
function chooseShop(e) {
|
||||
selShop.value = e;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => selShop.value.shopId,
|
||||
(newval) => {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => userComponentQuery,
|
||||
(newval) => {
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
|
||||
getList();
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
function refresh() {
|
||||
isEnd.value = false;
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const listRes = ref({});
|
||||
async function getList() {
|
||||
let res = null;
|
||||
if (active.value == 1) {
|
||||
//会员等级列表
|
||||
res = await memberApi.levelList();
|
||||
if (res) {
|
||||
list.value = res || [];
|
||||
isEnd.value = true;
|
||||
superVipStore.setVipLevelList(res || []);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (active.value == 2) {
|
||||
//购买会员订单记录
|
||||
res = await memberApi.orderList({
|
||||
page: pageNum.value,
|
||||
size: 10,
|
||||
key: userComponentQuery.user,
|
||||
startTime: userComponentQuery.startTime
|
||||
? userComponentQuery.startTime + " 00:00:00"
|
||||
: "",
|
||||
endTime: userComponentQuery.endTime
|
||||
? userComponentQuery.endTime + " 23:59:59"
|
||||
: "",
|
||||
});
|
||||
}
|
||||
|
||||
if (res) {
|
||||
listRes.value = res;
|
||||
if (pageNum.value == 1) {
|
||||
list.value = res.records || [];
|
||||
} else {
|
||||
list.value = [...list.value, ...(res.records || [])];
|
||||
}
|
||||
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
|
||||
console.log(isEnd.value);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示选择门店弹窗
|
||||
const showShopSelActionSheet = ref(false);
|
||||
|
||||
function showShopSelActionSheetFun() {
|
||||
showShopSelActionSheet.value = true;
|
||||
}
|
||||
const active = ref(0);
|
||||
|
||||
watch(
|
||||
() => active.value,
|
||||
(newval) => {
|
||||
userComponentQuery.startTime = "";
|
||||
userComponentQuery.endTime = "";
|
||||
keyWord.value = "";
|
||||
refresh();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => selActions.value,
|
||||
() => {
|
||||
refresh();
|
||||
}
|
||||
);
|
||||
onReachBottom(() => {
|
||||
if (!isEnd.value) {
|
||||
pageNum.value++;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => superVipStore.config.isOpen,
|
||||
() => {
|
||||
superVipStore.editConfig().then((res) => {
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "更新成功",
|
||||
icon: "none",
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
onShow(() => {
|
||||
pageNum.value = 1;
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
|
||||
.box {
|
||||
}
|
||||
|
||||
.top {
|
||||
padding: 32rpx 24rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
padding: 32rpx 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.tag {
|
||||
border-radius: 12rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
&.success {
|
||||
background-color: #edfff0;
|
||||
color: #5bbc6d;
|
||||
}
|
||||
|
||||
&.end {
|
||||
background-color: #f7f7f7;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.filter-box {
|
||||
display: flex;
|
||||
padding: 8rpx 24rpx;
|
||||
align-items: center;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #d9d9d9;
|
||||
background: #f7f7f7;
|
||||
min-height: 62rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
366
pageMarket/superVip/level-list.vue
Normal file
366
pageMarket/superVip/level-list.vue
Normal file
@@ -0,0 +1,366 @@
|
||||
<template>
|
||||
<view class="min-page u-font-28">
|
||||
<view class="container first">
|
||||
<view class="title">升级条件</view>
|
||||
<view class="u-m-t-16">
|
||||
<up-radio-group v-model="form.upgradeType" placement="row">
|
||||
<up-radio
|
||||
v-for="item in distributionStore.upgradeTypes"
|
||||
:key="item.value"
|
||||
:name="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
<template #label>
|
||||
<text>
|
||||
{{ item.label }}
|
||||
</text>
|
||||
</template>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container" v-for="(item,index) in form.levelConfigList">
|
||||
<view class="u-flex u-row-between">
|
||||
<text class="font-bold color-333 u-font-32">{{index+1}}级:{{ item.name }}</text>
|
||||
<view class="u-flex" @click="toggle(index)">
|
||||
<text class="color-main u-m-r-14">展开</text>
|
||||
<view class="u-flex arrow" :class="[!showDetailListSwitch[index]?'rotate' : '']">
|
||||
<up-icon name="arrow-down" color="#318AFE" ></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="showDetailListSwitch[index]">
|
||||
<view class="u-m-t-60">
|
||||
<view class="title">名称</view>
|
||||
<view class="u-p-t-16 u-p-b-24">
|
||||
<input placeholder="请输入名称" placeholder-class="color-999 u-font-28" v-model="item.name" @input="checkName($event, index)"></input>
|
||||
</view>
|
||||
<up-line></up-line>
|
||||
<view class="title u-m-t-24">分成比例</view>
|
||||
<view class="u-m-t-16 u-p-b-24">
|
||||
<view class="u-flex u-m-t-16">
|
||||
<input
|
||||
class="number-box"
|
||||
placeholder="请输入"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
type="digit"
|
||||
@input="checkNumberCommission($event,index)"
|
||||
v-model="item.levelOneCommission"
|
||||
/>
|
||||
<view class="unit">%</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="form.upgradeType!='not_upgrade'">
|
||||
<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-flex u-m-t-16">
|
||||
<input
|
||||
:disabled="index==0?true:false"
|
||||
:class="{'disabled':index==0?true:false}"
|
||||
|
||||
class="number-box"
|
||||
placeholder="请输入"
|
||||
placeholder-class="color-999 u-font-28"
|
||||
type="number"
|
||||
v-model="item.inviteCount"
|
||||
/>
|
||||
<view class="unit">人</view>
|
||||
</view>
|
||||
</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"
|
||||
:disabled="index==0?true:false"
|
||||
:class="{'disabled':index==0?true:false}"
|
||||
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-flex" v-if="index==0||index==form.levelConfigList.length-1" @click="addLevelConfig">
|
||||
<up-icon name="plus-circle-fill" color="#318AFE" ></up-icon>
|
||||
<text class="u-m-l-16">{{index==0? '添加':'继续添加'}}</text>
|
||||
</view>
|
||||
<view class="u-flex" @click="remove(index)" v-if="index!=0">
|
||||
<up-icon name="minus-circle-fill" color="#EB4F4F" ></up-icon>
|
||||
<text class="u-m-l-16">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
|
||||
import { ref, onMounted, watch, reactive , computed} from "vue";
|
||||
import { useDistributionStore } from "@/store/market.js";
|
||||
|
||||
const distributionStore = useDistributionStore();
|
||||
|
||||
const form = reactive({
|
||||
upgradeType: "",
|
||||
levelConfigList:[]
|
||||
});
|
||||
|
||||
const showDetailListSwitch=ref([true])
|
||||
|
||||
function toggle(index) {
|
||||
showDetailListSwitch.value[index] = !showDetailListSwitch.value[index];
|
||||
}
|
||||
|
||||
//现在全部的分成比例总和
|
||||
const allCommission=()=>{
|
||||
let sum=0
|
||||
for(let item of form.levelConfigList){
|
||||
sum+=parseFloat(item.levelOneCommission)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
|
||||
let timer=null
|
||||
//全部的分成比例加起来不能超过100%
|
||||
function checkNumberCommission(e,index){
|
||||
const value=e.detail.value
|
||||
clearInterval(timer)
|
||||
|
||||
if(value>100){
|
||||
uni.showToast({
|
||||
title:'分成比例不能超过100',
|
||||
icon:'none'
|
||||
})
|
||||
timer= setTimeout(()=>{
|
||||
form.levelConfigList[index].levelOneCommission=''
|
||||
},30)
|
||||
|
||||
return false
|
||||
}
|
||||
//输入最多两位小数,两位小数点后的去除掉不让输入
|
||||
if(value.indexOf('.')!=-1){
|
||||
const arr=value.split('.')
|
||||
if(arr[1].length>2){
|
||||
timer= setTimeout(()=>{
|
||||
form.levelConfigList[index].levelOneCommission=arr[0]+'.'+arr[1].substring(0,2)
|
||||
},30)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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){
|
||||
form.levelConfigList.splice(index,1)
|
||||
showDetailListSwitch.value.splice(index,1)
|
||||
}
|
||||
function addLevelConfig(){
|
||||
form.levelConfigList.push({
|
||||
name:'',
|
||||
levelOneCommission:'',
|
||||
inviteCount:'',
|
||||
costAmount:''
|
||||
})
|
||||
showDetailListSwitch.value.push(true)
|
||||
}
|
||||
//判断输入每一项是否为空
|
||||
function checkInput(){
|
||||
for(let item of form.levelConfigList){
|
||||
if(!item.name){
|
||||
uni.showToast({
|
||||
title:'请输入名称',
|
||||
icon:'none'
|
||||
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!item.levelOneCommission){
|
||||
uni.showToast({
|
||||
title:'请输入分成比例',
|
||||
icon:'none'
|
||||
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(form.upgradeType==='not_upgrade'){
|
||||
continue
|
||||
}
|
||||
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
|
||||
}
|
||||
async function save(){
|
||||
const isPas=checkInput()
|
||||
if(!isPas){
|
||||
return
|
||||
}
|
||||
|
||||
await distributionStore.editConfig(form)
|
||||
uni.showToast({
|
||||
title:'保存成功',
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
}, 1500);
|
||||
|
||||
|
||||
}
|
||||
function cancel(){
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
}
|
||||
onLoad(()=>{
|
||||
showDetailListSwitch.value=distributionStore.config.levelConfigList.map(()=>true)
|
||||
const levelConfigList=[...distributionStore.config.levelConfigList||[]]
|
||||
form.levelConfigList=levelConfigList.length?levelConfigList:[
|
||||
{ name:'',
|
||||
levelOneCommission:'',
|
||||
inviteCount:0,
|
||||
costAmount:0}
|
||||
]
|
||||
form.upgradeType=distributionStore.config.upgradeType
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
background: #f7f7f7;
|
||||
padding: 56rpx 28rpx;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.x-padding {
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
$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;
|
||||
&.disabled{
|
||||
background-color: #f7f7fa;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.title {
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.first {
|
||||
border-bottom: 2rpx solid #e5e5e5;
|
||||
}
|
||||
.arrow{
|
||||
transition: all 0.3s ease-in-out;
|
||||
&.rotate{
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
363
pageMarket/superVip/vip-lv-add.vue
Normal file
363
pageMarket/superVip/vip-lv-add.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<view class="min-page u-font-28 color-333">
|
||||
<view class="container">
|
||||
<view class="border-bottom u-p-b-16">
|
||||
<view class="font-bold u-m-b-16">会员标题</view>
|
||||
<input
|
||||
v-model="form.name"
|
||||
placeholder="请输入会员标题"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
/>
|
||||
</view>
|
||||
<view class="border-bottom u-p-b-16 u-m-t-16">
|
||||
<view class="font-bold u-m-b-16">会员折扣(%)</view>
|
||||
<input
|
||||
v-model="form.discount"
|
||||
placeholder="请输入会员折扣"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
/>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<view class="font-bold u-m-b-16">所需会员值</view>
|
||||
<input
|
||||
v-model="form.experienceValue"
|
||||
:disabled="optiopns.index == 0 ? true : false"
|
||||
placeholder="请输入所需会员值"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="container u-flex u-row-between">
|
||||
<view class="font-bold">等级标识</view>
|
||||
<view class="u-flex upload-box">
|
||||
<my-upload-img v-model="form.logo"></my-upload-img>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="">
|
||||
<view class="font-bold">消费送积分</view>
|
||||
<view class="color-999 u-font-24 u-m-t-2">每消费X元赠送1积分</view>
|
||||
</view>
|
||||
<up-switch
|
||||
:size="20"
|
||||
v-model="form.isCostRewardPoints"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></up-switch>
|
||||
</view>
|
||||
<view class="bg-gray u-m-t-16" style="padding: 24rpx 72rpx" v-if="form.isCostRewardPoints">
|
||||
<view class="u-flex">
|
||||
<input
|
||||
class="number-box"
|
||||
type="digit"
|
||||
v-model="form.costRewardPoints"
|
||||
/>
|
||||
<view class="unit">元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="">
|
||||
<view class="font-bold u-m-b-16">等级说明</view>
|
||||
<up-textarea
|
||||
v-model="form.remark"
|
||||
placeholder="请输入等级说明"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="font-bold u-m-b-16">自动发放</view>
|
||||
<up-switch
|
||||
:size="20"
|
||||
v-model="form.isCycleReward"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></up-switch>
|
||||
</view>
|
||||
<template v-if="form.isCycleReward">
|
||||
<view class="u-m-t-32">
|
||||
<view class="font-bold u-m-b-16">周期时间</view>
|
||||
<view class="u-flex" style="gap: 24rpx; align-items: stretch">
|
||||
<up-input type="digit" v-model="form.cycleTime"></up-input>
|
||||
<view class="times">
|
||||
<up-select
|
||||
v-model:current="form.cycleUnit"
|
||||
showOptionsLabel
|
||||
label="单位"
|
||||
keyName="value"
|
||||
labelName="label"
|
||||
:options="times"
|
||||
@select="selectItem"
|
||||
></up-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="font-bold u-m-b-16">赠送积分</view>
|
||||
<up-input
|
||||
type="number"
|
||||
v-model="form.cycleRewardPoints"
|
||||
placeholder="赠送成长值"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
></up-input>
|
||||
</view>
|
||||
<view class="font-bold u-m-b-16 u-m-t-32">赠送优惠券</view>
|
||||
<CouponList v-model="form.cycleRewardCouponList"></CouponList>
|
||||
<view class="u-flex">
|
||||
<view class="u-flex gap-20" @click="addCoupon()">
|
||||
<up-icon name="plus-circle-fill" color="#318AFE" size="16"></up-icon>
|
||||
<text class="">添加</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<my-bottom-btn-group @save="save" @cancel="cancel"></my-bottom-btn-group>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import CouponList from "./components/coupon-list.vue";
|
||||
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||
import { useSuperVipStore } from "@/store/market.js";
|
||||
import * as memberApi from "@/http/api/market/member.js";
|
||||
import { options } from "../../../cashier_wx/uni_modules/uview-plus/components/u-markdown/marked.esm";
|
||||
|
||||
const times = [
|
||||
{
|
||||
label: "年",
|
||||
value: "年",
|
||||
},
|
||||
{
|
||||
label: "月",
|
||||
value: "月",
|
||||
},
|
||||
{
|
||||
label: "周",
|
||||
value: "周",
|
||||
},
|
||||
{
|
||||
label: "天",
|
||||
value: "天",
|
||||
},
|
||||
];
|
||||
const placeholderStyle = {
|
||||
"font-size": "28rpx",
|
||||
};
|
||||
const superVipStore = useSuperVipStore();
|
||||
|
||||
const form = reactive({
|
||||
name: "",
|
||||
experienceValue: 0,
|
||||
discount: 100,
|
||||
logo: '',
|
||||
costRewardPoints: 1,
|
||||
isCostRewardPoints: 0,
|
||||
isCycleReward: 0,
|
||||
cycleTime: 1,
|
||||
cycleUnit: "月",
|
||||
cycleRewardPoints: 1,
|
||||
cycleRewardCouponList: [],
|
||||
remark: "",
|
||||
});
|
||||
function addCoupon() {
|
||||
form.couponList.push({
|
||||
coupon: { id: null },
|
||||
num: "",
|
||||
title: "",
|
||||
});
|
||||
}
|
||||
const showDetailListSwitch = ref([true]);
|
||||
|
||||
//判断输入每一项是否为空
|
||||
function checkInput() {
|
||||
for (let item of form.cycleRewardCouponList) {
|
||||
if (!item.coupon.id) {
|
||||
uni.showToast({
|
||||
title: "请选择优惠券",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!item.num) {
|
||||
uni.showToast({
|
||||
title: "请输入优惠券数量",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async function save() {
|
||||
const isPas = checkInput();
|
||||
if (!isPas) {
|
||||
return;
|
||||
}
|
||||
if (!form.name) {
|
||||
uni.showToast({
|
||||
title: "请输入会员标题",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!form.discount) {
|
||||
uni.showToast({
|
||||
title: "请输入会员折扣",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!form.experienceValue && optiopns.index != 0) {
|
||||
uni.showToast({
|
||||
title: "请输入所需成长值",
|
||||
icon: "none",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const submitForm = {
|
||||
...form,
|
||||
};
|
||||
const res =
|
||||
optiopns.type == "edit"
|
||||
? await memberApi.levelEdit(submitForm)
|
||||
: await memberApi.levelAdd(submitForm);
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: "保存成功",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "保存失败",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
function cancel() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}
|
||||
const optiopns = reactive({});
|
||||
onLoad((opt) => {
|
||||
Object.assign(optiopns, opt);
|
||||
uni.setNavigationBarTitle({
|
||||
title: opt.type !== "edit" ? "添加会员等级" : "编辑会员等级",
|
||||
});
|
||||
if (opt.type === "edit" && opt.id !== undefined && opt.id !== null) {
|
||||
const index = superVipStore.vipLevelList.findIndex(
|
||||
(item) => item.id == opt.id
|
||||
);
|
||||
optiopns.index = index;
|
||||
const item = superVipStore.vipLevelList.find((item) => item.id == opt.id);
|
||||
Object.assign(form, item);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.min-page {
|
||||
background: #f7f7f7;
|
||||
padding: 56rpx 28rpx;
|
||||
}
|
||||
.container {
|
||||
background: #fff;
|
||||
padding: 32rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.x-padding {
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
$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;
|
||||
&.disabled {
|
||||
background-color: #f7f7fa;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
.my-btn {
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
border-radius: 12rpx;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
background: #e6f0ff;
|
||||
color: $my-main-color;
|
||||
}
|
||||
|
||||
.delete-btn {
|
||||
background: #ffe7e6;
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.title {
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.first {
|
||||
border-bottom: 2rpx solid #e5e5e5;
|
||||
}
|
||||
.arrow {
|
||||
transition: all 0.3s ease-in-out;
|
||||
&.rotate {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
.times {
|
||||
padding: 10rpx 20rpx;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
:deep(.times .u-select) {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
||||
140
pageMarket/superVip/vip-plans.vue
Normal file
140
pageMarket/superVip/vip-plans.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<view class="min-page bg-f7 u-font-28">
|
||||
<view class="default-box-padding">
|
||||
<view
|
||||
v-for="(item, index) in superVipStore.config.configList"
|
||||
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-000">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="u-m-t-22 color-666 u-font-32 u-flex">
|
||||
<view class="u-flex-1">
|
||||
<view>
|
||||
<text class="color-666">价格:</text>
|
||||
<text>{{item.price}}元</text>
|
||||
</view>
|
||||
<view class="u-m-t-20">
|
||||
<text class="color-666">周期:</text>
|
||||
<text> {{item.circleTime}}个{{ item.circleUnit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<view>
|
||||
<text class="color-666">赠送成长值:</text>
|
||||
<text>{{item.reward}}</text>
|
||||
</view>
|
||||
<view class="u-m-t-20">
|
||||
<text class="color-666">赠送优惠券:</text>
|
||||
<text> {{returnCouponAllNum(item)}}张</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-32">
|
||||
<view class="btn del" @click="handleDelete(index)">删除</view>
|
||||
<view class="btn edit" @click="handleEdit(item,index)">编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 100rpx"></view>
|
||||
<view class="fixed-bottom">
|
||||
<my-button @click="go.to('PAGES_MARKET_SUPER_VIP_ADD_PLAN')">
|
||||
<view class="u-flex">
|
||||
<up-icon name="plus" color="#fff" size="12"></up-icon>
|
||||
<text class="u-m-l-10">添加方案</text>
|
||||
</view>
|
||||
</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
onShow,
|
||||
onPageScroll,
|
||||
onReachBottom,
|
||||
onBackPress,
|
||||
} from "@dcloudio/uni-app";
|
||||
import { useSuperVipStore } from "@/store/market.js";
|
||||
import go from "@/commons/utils/go.js";
|
||||
const superVipStore = useSuperVipStore();
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
|
||||
function handleDelete(index) {
|
||||
uni.showModal({
|
||||
title: "确认删除吗?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
superVipStore.config.configList.splice(index, 1);
|
||||
superVipStore.editConfig().then(res=>{
|
||||
if(res){
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function returnCouponAllNum(item){
|
||||
return (item.couponList||[]).reduce((pre,cur)=>pre+cur.num,0)
|
||||
}
|
||||
|
||||
function handleEdit(item,index) {
|
||||
uni.setStorageSync("suggestItem", item);
|
||||
go.to("PAGES_MARKET_SUPER_VIP_ADD_PLAN", {
|
||||
type: "edit",
|
||||
index: index,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
Reference in New Issue
Block a user