pull/3/head
张宇 2 years ago
parent 282785fedc
commit 931e2e043f

@ -17,14 +17,15 @@ export default {
@import "tailwindcss/base"; @import "tailwindcss/base";
@import "tailwindcss/utilities"; @import "tailwindcss/utilities";
* { *,
page,
view,
text {
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
*::-webkit-scrollbar { *::-webkit-scrollbar {
height: 0px; height: 0px;
width: 0px; width: 0px;
@ -53,11 +54,12 @@ export default {
page { page {
// min-height: calc(100vh - 44px); // min-height: calc(100vh - 44px);
min-height: calc(100vh); min-height: calc(100dvh);
background-color: rgb(247 248 250); background-color: rgb(247 248 250);
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-top: var(--status-bar-height);
} }
.content { .content {

@ -37,6 +37,14 @@ export default {
}) })
}, },
UpdateLevel(data) {
return request({
url: "/admin/user/UpdateLevel",
method: "GET",
data,
})
},

@ -44,5 +44,13 @@ export default {
}) })
}, },
CreateDiscount(data) {
return request({
url: "/admin/UserMembers/CreateDiscount",
method: "POST",
data,
})
},
}; };

@ -2,7 +2,7 @@
<view> <view>
<view v-if="props.modelValue && props.modelValue.length" @click="open(true)" class="flex gap-2 overflow-x-auto"> <view v-if="props.modelValue && props.modelValue.length" @click="open(true)" class="flex gap-2 overflow-x-auto">
<view class=" flex rounded-[14px] relative" :key="img"> <view class=" flex rounded-[14px] relative" :key="img">
已选择 {{ LArr.length || 0 }} 件商品 已选择 {{ props.modelValue.length || 0 }} 件商品
</view> </view>
</view> </view>

@ -315,4 +315,8 @@ getOrderGood({ index: 0 });
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.content {
padding-top: 44px;
}
</style>

@ -136,14 +136,14 @@
</view> </view>
<template #footer> <template #footer>
<view class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;"> <view class="bg-gray-50 p-2 flex justify-between" style="font-size: 22rpx;">
<view>应付: {{ (Number(item.total_price) + Number(item.delivery_money)).toFixed(2) }} </view> <view>应付: {{ (Number(item.total_price) + Number(item.delivery_money)).toFixed(2) }} </view>
<view>余额支付: {{ item.pay_balance }} </view> <view>余额支付: {{ item.pay_balance }} </view>
<view v-if="((Number(item.total_price) + Number(item.delivery_money)) - <view v-if="((Number(item.total_price) + Number(item.delivery_money)) -
item.pay_price) > 0">优惠: {{ ((Number(item.total_price) + Number(item.delivery_money)) - item.pay_price) > 0">优惠: {{ ((Number(item.total_price) + Number(item.delivery_money)) -
item.pay_price).toFixed(2) }} </view> item.pay_price).toFixed(2) }} </view>
</view> </view>
<view class="h-2 opacity-0 text-white">占位</view>
<view class="flex justify-between items-center"> <view class="flex justify-between items-center">
<view class="font-bold">实付: {{ item.pay_price }} </view> <view class="font-bold">实付: {{ item.pay_price }} </view>
<view class="flex-1 flex justify-end"> <view class="flex-1 flex justify-end">

@ -279,6 +279,9 @@ export default {
</script> </script>
<style> <style scoped>
/* 在这里添加样式,根据需要自定义表单样式 */ /* 在这里添加样式,根据需要自定义表单样式 */
.content {
padding-top: 44px;
}
</style> </style>

@ -48,10 +48,11 @@
</div> </div>
<view class="h-[64px]"></view> <view class="h-14">
<view class="fixed left-2 right-2 bottom-4 z-50"> <view class="fixed left-2 right-2 bottom-4 z-50">
<myTabbar tab="shop"></myTabbar> <myTabbar tab="shop"></myTabbar>
</view> </view>
</view>
<wd-toast /> <wd-toast />
<wd-message-box></wd-message-box> <wd-message-box></wd-message-box>
@ -89,7 +90,7 @@ const user_info = uni.getStorageSync("user_info");
const shopList = ref({}); const shopList = ref({});
const changeS = async (row) => { const changeS = async (row) => {
const { fetchData } = await useApi(shop.editStatus, { loading }) const { fetchData, result } = await useApi(shop.editStatus, { loading })
fetchData({ fetchData({
id: row.id, id: row.id,

@ -18,7 +18,15 @@
<image mode="aspectFill" :src="userInfo.avatar_pic" :alt="userInfo.name" <image mode="aspectFill" :src="userInfo.avatar_pic" :alt="userInfo.name"
style="width: 60px;height: 60px;border-radius: 4px; margin-right: 12px;" /> style="width: 60px;height: 60px;border-radius: 4px; margin-right: 12px;" />
<view> <view>
<view style="color: rgba(0,0,0,0.85); font-size: 16px;">{{ userInfo.nickname }} <view style="color: rgba(0,0,0,0.85); font-size: 16px;">
{{ userInfo.nickname }}
<wd-tag v-if="userInfo.user_merge" class="mx-1" size="small" type="success">
v {{ userInfo.user_merge.member_level }}
</wd-tag>
<wd-button type="warning" @click="showLv = true" size="small" style="margin-left: 10px;">修改等级</wd-button>
</view> </view>
<view style="color: rgba(0,0,0,0.25); font-size: 12px;"> <view style="color: rgba(0,0,0,0.25); font-size: 12px;">
@ -116,6 +124,9 @@
<wd-toast /> <wd-toast />
<wd-action-sheet v-model="showAc" :actions="actions" @select="select" /> <wd-action-sheet v-model="showAc" :actions="actions" @select="select" />
<wd-action-sheet v-model="showLv" :actions="actionsLv" @select="changeLevel" />
<wd-message-box></wd-message-box> <wd-message-box></wd-message-box>
</view> </view>
@ -125,9 +136,11 @@
import { ref } from 'vue'; import { ref } from 'vue';
import utils from '@/utils/utils.js'; import utils from '@/utils/utils.js';
import user from '@/api/store/user.js'; import user from '@/api/store/user.js';
import userMembers from '@/api/store/userMembers.js';
import yList from "/components/yList/index.vue"; import yList from "/components/yList/index.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading"; import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni' import { useMessage } from '@/uni_modules/wot-design-uni'
import { useApi } from "@/hooks/useApi.js"
const message = useMessage() const message = useMessage()
import { import {
@ -255,6 +268,43 @@ onLoad(async (e) => {
loading.value = false loading.value = false
}) })
const showLv = ref(false);
const actionsLv = ref([])
const changeLevel = e => {
console.log(e);
loading.value = true
user.UpdateLevel({
user_merge_id: userInfo.value.user_merge.id,
level: e.item.level,
}).then(async (res) => {
loading.value = true
const data = await user.userItem({ id: userInfo.value.id });
userInfo.value = data.data
loading.value = false
})
}
/**
* 获取数据的函数
*/
const getmemberList = async () => {
const { fetchData } = await useApi(userMembers.LevelShow, { loading })
fetchData().then(res => {
actionsLv.value = res.data.map(item => {
return {
...item,
subname: `等级 ${item.level}`
}
});
actionsLv.value.ok = true;
})
};
getmemberList()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -2,7 +2,7 @@
<view> <view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="100px"> <wd-form v-if="!loading" :model="form" :rules="rules" :disabled="mode == 'show'" ref="dialogForm" label-width="100px">
<wd-form-item label="折扣名称" prop="name"> <wd-form-item label="折扣名称" prop="name">
<wd-input placeholder="请输入折扣名称" v-model="dataForm.name" clearable style="width: 100%"></wd-input> <wd-input placeholder="请输入折扣名称" v-model="dataForm.name" clearable style="width: 100%"></wd-input>
</wd-form-item> </wd-form-item>
@ -75,19 +75,13 @@ export default {
// //
dataForm: { dataForm: {
"id": 0, "id": 0,
"mch_id": 0, "user_members_level": '',
"user_members_level": 0, "name": '',
"name": "2", "discount": '',
"discount": 0, "status": 0,
"status": 1,
"goods_list": [], "goods_list": [],
"start_time": new Date(), "start_time": new Date(),
"end_time": new Date(), "end_time": new Date(),
"delete_time": null,
"time": [
"2024-01-08 00:00:00",
"2024-01-09 00:00:00"
]
}, },
columns: [], columns: [],
loading: false loading: false
@ -108,6 +102,7 @@ export default {
} }
this.getmemberList() this.getmemberList()
}, },
methods: { methods: {
async getmemberList() { async getmemberList() {
const { fetchData } = await useApi(userMembers.LevelShow) const { fetchData } = await useApi(userMembers.LevelShow)
@ -164,10 +159,11 @@ export default {
*/ */
async handleSubmit() { async handleSubmit() {
// //
const res = await userMembers.LevelSave({ const res = await userMembers.CreateDiscount({
...this.dataForm, ...this.dataForm,
start_time: utils.dateFormat(this.dataForm.start_time), start_time: utils.dateFormat(this.dataForm.start_time),
end_time: utils.dateFormat(this.dataForm.end_time), end_time: utils.dateFormat(this.dataForm.end_time),
goods_list: this.dataForm.goods_list.map(item => item.id)
}); });
if (res.code == 0) { if (res.code == 0) {

@ -31,7 +31,7 @@
<div class="grid p-2"> <div class="grid p-2">
<yList height="90vh" ref="yListRef" :apiObj="user.userList" :params="{ ...params }"> <yList height="86vh" ref="yListRef" :apiObj="user.userList" :params="{ ...params }">
<template #default="{ list: userList }"> <template #default="{ list: userList }">
<div v-for="user of userList" class="rounded-md overflow-hidden"> <div v-for="user of userList" class="rounded-md overflow-hidden">
<wd-card class="rounded-md overflow-hidden" type="rectangle"> <wd-card class="rounded-md overflow-hidden" type="rectangle">
@ -49,7 +49,11 @@
<image mode="aspectFill" :src="user.avatar_pic" :alt="user.name" <image mode="aspectFill" :src="user.avatar_pic" :alt="user.name"
style="width: 60px;height: 60px;border-radius: 4px; margin-right: 12px;" /> style="width: 60px;height: 60px;border-radius: 4px; margin-right: 12px;" />
<view> <view>
<view style="color: rgba(0,0,0,0.85); font-size: 16px;">{{ user.nickname }} <view style="color: rgba(0,0,0,0.85); font-size: 16px;">
{{ user.nickname }}
<wd-tag v-if="user.user_merge" class="mx-1" size="small" type="success">
v {{ user.user_merge.member_level }}
</wd-tag>
</view> </view>
<view style="color: rgba(0,0,0,0.25); font-size: 12px;"> <view style="color: rgba(0,0,0,0.25); font-size: 12px;">
@ -63,12 +67,12 @@
<template #footer> <template #footer>
<view v-if="user.user_merge" class="bg-gray-50 p-2 mb-2.5 flex justify-between" style="font-size: 22rpx;"> <view v-if="user.user_merge" class="bg-gray-50 p-2 flex justify-between" style="font-size: 22rpx;">
<view>余额{{ user.user_merge.balance }} </view> <view>余额{{ user.user_merge.balance }} </view>
<view>积分{{ user.user_merge.integral }} </view> <view>积分{{ user.user_merge.integral }} </view>
<view>佣金{{ user.user_merge.money }} </view> <view>佣金{{ user.user_merge.money }} </view>
</view> </view>
<view v-if="user.user_merge" class="h-2 opacity-0 text-white">·</view>
<view class="flex justify-between items-center"> <view class="flex justify-between items-center">
<view></view> <view></view>

@ -70,7 +70,11 @@
<block v-for="item in 1" :key="1"> <block v-for="item in 1" :key="1">
<wd-tab :title="`会员专享`"> <wd-tab :title="`会员专享`">
<yList class="p-2 bg-gray-50" height="90vh" ref="yListRef" :apiObj="userMembers.DiscountList" <view class="my-4 flex px-14 gap-4">
<wd-button class="flex-1" @click="utils.toUrl('/store/user/editGoods')" size="small">新增折扣</wd-button>
</view>
<yList v-if="!loading" class="p-2 bg-gray-50" height="86vh" ref="yListRef" :apiObj="userMembers.DiscountList"
:params="{ ...params }"> :params="{ ...params }">
<template #default="{ list }"> <template #default="{ list }">
<div v-for="user of list" class="rounded-md overflow-hidden "> <div v-for="user of list" class="rounded-md overflow-hidden ">
@ -110,8 +114,16 @@
<wd-button @click="changeS(user)" v-if="user.status !== 1" size="small" plain <wd-button @click="changeS(user)" v-if="user.status !== 1" size="small" plain
style="margin-right: 8px;"> style="margin-right: 8px;">
开启</wd-button> --> 开启</wd-button> -->
<wd-button @click="utils.toUrl('/store/user/editGoods?edit=' + JSON.stringify(user))" size="small" <wd-button @click="utils.toUrl('/store/user/editGoods?edit=' + JSON.stringify({
style="margin-right: 0px;">编辑</wd-button> ...user,
goods_list: user.goods_list.map(item => {
return {
id: item.id,
pic_url: item.pic_url,
name: item.name
}
})
}))" size="small" style="margin-right: 0px;">编辑</wd-button>
</view> </view>
</view> </view>
@ -161,7 +173,7 @@ const gradients = [
const toast = useToast() const toast = useToast()
const message1 = useMessage(); const message1 = useMessage();
const tab = ref(1); const tab = ref(0);
/** /**
* @type {Ref<boolean>} * @type {Ref<boolean>}

Loading…
Cancel
Save