pull/4/head
张宇 2 years ago
parent d0b02cb3f0
commit 42db292c9c

@ -121,6 +121,7 @@ export default {
url: "/shop/OrderInpersonPayment/orderList", url: "/shop/OrderInpersonPayment/orderList",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
@ -129,6 +130,7 @@ export default {
url: "/shop/OrderInpersonPayment/GetQrItem", url: "/shop/OrderInpersonPayment/GetQrItem",
method: "POST", method: "POST",
data, data,
type: "mall",
}); });
}, },
} }

@ -1,56 +0,0 @@
import {
request
} from "@/utils/request";
export default {
userList(data) {
return request({
url: "/shop/user/userList",
method: "GET",
data,
type: "mall",
})
},
userItem(data) {
return request({
url: "/shop/user/userItem",
method: "GET",
data,
type: "mall",
})
},
getLog(data) {
return request({
url: "/shop/user/getLog",
method: "GET",
data,
type: "mall",
})
},
changeInformation(data) {
return request({
url: "/shop/user/changeInformation",
method: "GET",
data,
type: "mall",
})
},
UpdateLevel(data) {
return request({
url: "/shop/user/UpdateLevel",
method: "GET",
data,
type: "mall",
})
},
};

@ -0,0 +1,33 @@
import {
request
} from "@/utils/request";
export default {
List(data) {
return request({
url: "/admin/Coupon/List",
method: "GET",
data,
type: 'store'
});
},
GetItem(data) {
return request({
url: "/admin/Coupon/GetItem",
method: "GET",
data,
type: 'store'
});
},
Create(data) {
return request({
url: "/admin/Coupon/Create",
method: "POST",
data,
type: 'store'
});
},
};

@ -8,6 +8,7 @@ export default {
url: "/admin/goods/goodsList", url: "/admin/goods/goodsList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -16,6 +17,7 @@ export default {
url: "/admin/goods/goodsEditAttribute", url: "/admin/goods/goodsEditAttribute",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -25,6 +27,7 @@ export default {
url: "/admin/classify/list", url: "/admin/classify/list",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/classify/createItem", url: "/admin/classify/createItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -43,6 +47,7 @@ export default {
url: "/admin/freightRules/list", url: "/admin/freightRules/list",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -51,6 +56,7 @@ export default {
url: "/admin/goods/goodsItem", url: "/admin/goods/goodsItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -59,6 +65,7 @@ export default {
url: "/admin/goods/goodsEdit", url: "/admin/goods/goodsEdit",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/dataCount/oneLine", url: "/admin/dataCount/oneLine",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
orderProfit(data) { orderProfit(data) {
@ -16,6 +17,7 @@ export default {
url: "/admin/dataCount/orderProfit", url: "/admin/dataCount/orderProfit",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
orderGood(data) { orderGood(data) {
@ -23,6 +25,7 @@ export default {
url: "/admin/dataCount/orderGood", url: "/admin/dataCount/orderGood",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/store/getStoreSetting", url: "/admin/store/getStoreSetting",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -41,6 +45,7 @@ export default {
url: "/admin/store/setStoreSetting", url: "/admin/store/setStoreSetting",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
} }

@ -8,6 +8,7 @@ export default {
url: "/admin/order/orderList", url: "/admin/order/orderList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -16,6 +17,7 @@ export default {
url: "/admin/order/orderSend", url: "/admin/order/orderSend",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -24,6 +26,7 @@ export default {
url: "/admin/order/GetExpressList", url: "/admin/order/GetExpressList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -32,6 +35,7 @@ export default {
url: "/admin/order/printOrder", url: "/admin/order/printOrder",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -40,6 +44,7 @@ export default {
url: "/admin/order/updateNotes", url: "/admin/order/updateNotes",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -49,6 +54,7 @@ export default {
url: "/admin/shop/checkLog", url: "/admin/shop/checkLog",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -57,6 +63,7 @@ export default {
url: "/admin/order/confirmCancel", url: "/admin/order/confirmCancel",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -66,6 +73,7 @@ export default {
url: "/admin/after_sale/index", url: "/admin/after_sale/index",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -75,6 +83,7 @@ export default {
url: "/admin/after_sale/update", url: "/admin/after_sale/update",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -83,6 +92,7 @@ export default {
url: "/admin/after_sale/show", url: "/admin/after_sale/show",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -91,6 +101,7 @@ export default {
url: "/client/common/express", url: "/client/common/express",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
enums(data) { enums(data) {
@ -98,6 +109,7 @@ export default {
url: "/client/after_sale/enums", url: "/client/after_sale/enums",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -110,6 +122,7 @@ export default {
url: "/admin/OrderInpersonPayment/orderList", url: "/admin/OrderInpersonPayment/orderList",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
@ -118,6 +131,7 @@ export default {
url: "/admin/OrderInpersonPayment/GetQrItem", url: "/admin/OrderInpersonPayment/GetQrItem",
method: "POST", method: "POST",
data, data,
type: 'store'
}); });
}, },
} }

@ -9,6 +9,7 @@ export default {
url: "/admin/shop/List", url: "/admin/shop/List",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/shop/edit", url: "/admin/shop/edit",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/admin/shop/editStatus", url: "/admin/shop/editStatus",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/shop/synchronousGoods", url: "/admin/shop/synchronousGoods",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/user/userList", url: "/admin/user/userList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/user/userItem", url: "/admin/user/userItem",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -26,6 +28,7 @@ export default {
url: "/admin/user/getLog", url: "/admin/user/getLog",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -34,6 +37,7 @@ export default {
url: "/admin/user/changeInformation", url: "/admin/user/changeInformation",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -42,6 +46,7 @@ export default {
url: "/admin/user/UpdateLevel", url: "/admin/user/UpdateLevel",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },

@ -9,6 +9,7 @@ export default {
url: "/admin/UserMembers/LevelShow", url: "/admin/UserMembers/LevelShow",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -17,6 +18,7 @@ export default {
url: "/admin/UserMembers/LevelSave", url: "/admin/UserMembers/LevelSave",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -25,6 +27,7 @@ export default {
url: "/admin/UserMembers/SetList", url: "/admin/UserMembers/SetList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -33,6 +36,7 @@ export default {
url: "/admin/UserMembers/SetSave", url: "/admin/UserMembers/SetSave",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -41,6 +45,7 @@ export default {
url: "/admin/UserMembers/DiscountList", url: "/admin/UserMembers/DiscountList",
method: "GET", method: "GET",
data, data,
type: 'store'
}) })
}, },
@ -49,6 +54,7 @@ export default {
url: "/admin/UserMembers/CreateDiscount", url: "/admin/UserMembers/CreateDiscount",
method: "POST", method: "POST",
data, data,
type: 'store'
}) })
}, },

@ -110,6 +110,9 @@ const open = (O) => {
} }
if (props.modelValue) { if (props.modelValue) {
console.clear(props.modelValue);
console.log(props.modelValue);
if (Array.isArray(props.modelValue)) { if (Array.isArray(props.modelValue)) {
LArr.value = JSON.parse(JSON.stringify(props.modelValue)) LArr.value = JSON.parse(JSON.stringify(props.modelValue))
} else { } else {

@ -86,9 +86,6 @@
</view> </view>
</view> --> </view> -->
<!-- <view @click="utils.toUrl('/mall/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <!-- <view @click="utils.toUrl('/mall/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">订单管理</view> <view class="font-bold">订单管理</view>
@ -106,7 +103,6 @@
<view style="transition: 1s;" class="w-full h-full bg-white pt-4 rounded-tr-3xl rounded-tl-3xl shadow-lg oh"> <view style="transition: 1s;" class="w-full h-full bg-white pt-4 rounded-tr-3xl rounded-tl-3xl shadow-lg oh">
<view class="order mb-2"> <view class="order mb-2">
<wd-grid v-show="oneLine.ok"> <wd-grid v-show="oneLine.ok">
<wd-grid-item @click="utils.toUrl('/mall/user/list')" icon="round" :text="`用户 (${oneLine.user_count})`" />
<wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" :text="`商品 (${oneLine.goods_count})`" /> <wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" :text="`商品 (${oneLine.goods_count})`" />
<wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round" <wd-grid-item @click="utils.toUrl('/mall/goods/index')" icon="round"
:text="`售罄 (${oneLine.empty_stock_count})`" /> :text="`售罄 (${oneLine.empty_stock_count})`" />

@ -65,6 +65,30 @@
} }
} }
}, },
{
"path": "coupon/index",
"style": {
"navigationBarTitleText": "优惠券列表",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{
"path": "coupon/edit",
"style": {
"navigationBarTitleText": "优惠券编辑",
"enablePullDownRefresh": false,
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"gestureBack": "YES"
}
}
},
{ {
"path": "inpersonPay/index", "path": "inpersonPay/index",
"style": { "style": {

@ -0,0 +1,274 @@
<template>
<view>
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<wd-form v-if="!loading" ref="form" :model="formData" :rules="formRules">
<!-- 基础信息 -->
<wd-cell-group title="基本信息" border>
<wd-input label="券名称" v-model="formData.name" />
<wd-input label="优惠券金额" v-model="formData.price" />
<wd-input label="满减金额" v-model="formData.full_price" />
<!-- 其他基本信息字段可以根据需要添加 -->
</wd-cell-group>
<wd-cell-group title="领取类型">
<div class="bg-white rounded p-2">
<wd-radio-group v-model="formData.send_type" shape="button" @change="change">
<wd-radio :value="0">领取后过期</wd-radio>
<wd-radio :value="1">定时过期</wd-radio>
</wd-radio-group>
</div>
<wd-input v-if="formData.send_type == 0" label="过期时间" v-model="formData.day" />
<div v-if="formData.send_type == 1" label="过期时间" style="display: flex;flex-direction: column;">
<wd-datetime-picker v-model="formData.start_time" label="开始时间" />
<wd-datetime-picker v-model="formData.end_time" label="结束时间" />
</div>
</wd-cell-group>
<!-- 是否启用 -->
<wd-cell-group title="领取中心显示" border>
<view class="p-4">
<wd-switch v-model="formData.is_show" :active-value="1" :inactive-value="0"></wd-switch>
</view>
</wd-cell-group>
<!-- 是否启用 -->
<wd-cell-group title="优惠券类型" border>
<view class="p-4">
<div class="mb-4">
<wd-radio-group v-model="formData.coupon_type" shape="button">
<wd-radio :value="1">商品</wd-radio>
<wd-radio :value="2">分类</wd-radio>
<wd-radio :value="3">当面付</wd-radio>
</wd-radio-group>
</div>
<view v-if="formData.coupon_type == 1">
<wd-form-item label="选择商品">
<yGoods v-model="formData.coupon_deatil" :size="1"></yGoods>
</wd-form-item>
</view>
<view v-if="formData.coupon_type == 2">
<wd-select-picker type="checkbox" label="选择分类" v-model="formData.cats"
:columns="classifyList"></wd-select-picker>
</view>
</view>
</wd-cell-group>
<wd-cell-group title="优惠券数量" border>
<view class="p-4">
<wd-input-number v-model="formData.stock" min="0" />
</view>
</wd-cell-group>
<wd-cell-group title="领取限制" border>
<view class="p-4">
<div class="mb-4">
<wd-radio-group v-model="formData.limit_type" shape="button">
<wd-radio :value="1">不限</wd-radio>
<wd-radio :value="2">每天一次</wd-radio>
<wd-radio :value="3">每人一次</wd-radio>
</wd-radio-group>
</div>
</view>
</wd-cell-group>
<!-- 提交按钮 -->
<view class="mt-2 px-12 py-3 bg-slate-50">
<wd-button type="primary" size="large" @click="handleSubmit" block>
保存
</wd-button>
</view>
</wd-form>
</view>
</template>
<script>
import yUpload from "@/components/yUpload/index.vue";
import uniDataPicker from "@/components/uni-data-picker/components/uni-data-picker/uni-data-picker.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading";
import utils from '@/utils/utils.js'
import coupon from '@/api/store/coupon.js';
import yGoods from "@/components/yGoods/index.vue";
import goods from '@/api/store/goods.js'
/**
* 从本地存储中获取用户信息
*/
const user_info = uni.getStorageSync("user_info");
export default {
components: {
yUpload, uniDataPicker, kevyloading, yGoods
},
data() {
return {
utils,
user_info,
//
formData: {
"name": "", //
"price": "", //
"full_price": "", //
"send_type": "", //
"day": "", //
"start_time": null,
"end_time": null,
"is_show": 1, //
"coupon_type": 1, //
"limit_type": 1, //
"stock": 0, //
"coupon_deatil": [],
"cats": []
},
//
formRules: {
//
},
//
addrList: [
//
],
classifyList: [],
loading: false
};
},
async onLoad(e) {
// this.getDistrict();
if (e.id) {
await this.getClassify()
this.GetItem(e.id);
}
// this.formData = JSON.parse(e.edit)
},
methods: {
async getClassify() {
goods.classify.list().then(res => {
this.classifyList = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
})
},
/**
* 获取门店设置
*/
async GetItem(id) {
this.loading = true;
const res = await coupon.GetItem({ id });
if (res.data.id) {
this.formData = JSON.parse(JSON.stringify(res.data));
this.formData.start_time = this.formData.start_time ? new Date(this.formData.start_time * 1000) : new Date()
this.formData.end_time = new Date(this.formData.end_time * 1000)
this.formData.cats = this.formData.cats || []
this.formData.coupon_deatil = []
if (this.formData.coupon_type == 1) {
this.formData.coupon_deatil = res.data.coupon_deatil
}
if (this.formData.coupon_type == 2) {
this.formData.cats = res.data.coupon_deatil?.map(item => item.id) || []
}
}
this.loading = false;
},
/**
* 处理省市区选择变化
* @param {Object} value - 选择的值
*/
areaChange(value) {
//
},
/**
* 处理省市区选择
* @param {Object} detail - 选择器详细信息
*/
select({ detail }) {
if (detail.value.length) {
const [province_id, city_id, district_id] = detail.value.map(
(el) => el.value
);
this.formData.province_id = province_id;
this.formData.city_id = city_id;
this.formData.district_id = district_id;
this.formData.district = [province_id, city_id, district_id];
}
},
/**
* 处理表单提交
*/
async handleSubmit() {
console.log(this.formData);
try {
let mix_id_list = []
if (this.formData.coupon_type == 1) {
mix_id_list = this.formData.coupon_deatil?.map(item => [item.id]) || []
}
if (this.formData.coupon_type == 2) {
mix_id_list = this.formData.cats?.map(item => [item]) || []
}
//
const res = await coupon.Create({
...this.formData,
start_time: this.formData.send_type == 1 ? utils.dateFormat(this.formData.start_time) : utils.dateFormat(new Date()),
end_time: this.formData.send_type == 1 ? utils.dateFormat(this.formData.end_time) : utils.dateFormat(new Date()),
mix_id_list: mix_id_list
});
if (res.code == 0) {
setTimeout(() => {
uni.showToast({
title: '保存成功!',
icon: 'success'
});
}, 100);
uni.navigateBack()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
} catch (error) {
console.log(error);
setTimeout(() => {
uni.showToast({
title: '请检查表单!',
icon: 'none'
});
}, 100);
}
},
},
};
</script>
<style>
/* 在这里添加样式,根据需要自定义表单样式 */
</style>

@ -0,0 +1,300 @@
<template>
<view class="content">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<!-- <view class="w-full">
<wd-navbar fixed safeAreaInsetTop :leftText="coupon_info?.info?.name || '商城首页'">
<template #right>
<wd-icon @click="utils.toUrl('/store/setup/index')" name="setting" size="22px"></wd-icon>
</template>
</wd-navbar>
</view> -->
<view class=" bg-white sticky top-0 z-50 flex items-center">
<view class="flex-1">
<wd-search @search="search({ value: params.keywords })" @clear="search({ value: params.keywords = '' })"
v-model="params.keywords" hide-cancel>
<template #prefix>
<wd-popover v-model="popover" mode="menu" :content="menu" @menuclick="changeSearchType">
<view class="search-type">
<text>{{ searchType }}</text>
<wd-icon custom-class="icon-arrow" name="fill-arrow-down"></wd-icon>
</view>
</wd-popover>
</template>
</wd-search>
</view>
<view class="mr-2">
<wd-button @click="utils.toUrl('/store/coupon/edit')" size="small">新增券</wd-button>
</view>
</view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2">
<yList height="91vh" ref="yListRef" :apiObj="coupon.List" :params="{ ...params }">
<template #default="{ list: couponList }">
<view class="flex flex-col">
<view v-for="coupon of couponList" class="overflow-hidden relative">
<wd-swipe-action class="rounded-xl overflow-hidden mb-3 ">
<view class="couponCart relative " style="background-color: #fff;
background-image: linear-gradient(135deg,#ff552d 10%,#0000 0,#0000 50%,#fe4b26 0,#ff702c 60%,#0000 0,#0000);
background-size: 9.09px 9.09px;">
<view class="w-[76%] bg-red-600 absolute top-0 bottom-0 left-0" style="z-index: 0;"></view>
<view class="relative px-4 py-4" style="z-index: 1;">
<view
class="rounded-r-xl font-bold absolute top-0 left-0 px-2 pr-4 py-1 text-[12px] bg-neutral-900 text-orange-500 z-30">
ID: {{ coupon.id }}
</view>
<view
class="rounded-xl font-bold absolute top-0 left-8 px-2 pr-4 py-1 pl-8 text-[12px] bg-neutral-800 text-orange-500 z-20">
{{ ["优惠券", "商品可用", "分类可用", "当面付"][coupon.coupon_type] }}
</view>
<view v-if="coupon.stock > 0"
class="rounded-xl font-bold absolute top-0 left-24 px-2 py-1 pl-8 text-[12px] bg-neutral-700 text-orange-400 z-10">
剩余 {{ coupon.stock }}
</view>
<view v-else
class="rounded-xl font-bold absolute top-0 left-24 px-2 py-1 pl-8 text-[12px] bg-neutral-700 text-white z-10">
已领完
</view>
<view class="flex">
<view class="mt-4 mr-6">
<!-- <view class="price text-[16px] text-orange-300">
</view> -->
<view class="leading-4 mt-1">
<view class="price text-[12px] text-orange-300">
{{ coupon.name }}
</view>
<view class="price text-white text-[12px]">
<div class="day" v-if="coupon.send_type == 1">
有效时间 {{ formatOfTime(coupon.start_time) }} - {{ formatOfTime(coupon.end_time) }}
</div>
<div v-else>--</div>
</view>
<view class="price text-white text-[12px]">
过期时间{{ coupon.day }}
</view>
<div class="flex flex-col">
<view class="price text-white text-[12px] mr-4">
券金额 {{ coupon.price }}
</view>
<view class="price text-white text-[12px]">
满减金额 {{ coupon.full_price }}
</view>
</div>
</view>
</view>
</view>
<view class="mt-4 text-white flex items-center justify-center absolute top-0 right-[24%] ">
<view class="bg-red-700 px-4 py-2 font-bold text-[13px] rounded-l-full " :round="false"
size="small">
<span v-if="coupon.limit_type == 1"></span>
<span v-if="coupon.limit_type == 2"></span>
<span v-if="coupon.limit_type == 3"></span>
</view>
</view>
</view>
</view>
<template #right>
<view class="flex h-full ">
<view
class="px-4 text-nowrap h-full bg-red-700 text-white text-black flex items-center justify-center">
<view @click="utils.toUrl('/store/coupon/edit?id=' + coupon.id)" style="writing-mode: vertical-rl;
text-orientation: upright;">
编辑
</view>
</view>
</view>
</template>
</wd-swipe-action>
</view>
</view>
</template>
</yList>
</view>
<wd-toast />
<wd-message-box></wd-message-box>
</view>
</template>
<script setup>
import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js';
import coupon from '@/api/store/coupon.js';
import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue";
import {
onShow,
} from "@dcloudio/uni-app";
const yListRef = ref(null);
const searchType = ref('券名');
const popover = ref(false);
const search = ({ value } = {}) => {
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
};
const menu = ref([
{ content: '券名' },
{ content: '券金额' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/**
* @type {Ref<boolean>}
* 控制页面加载状态的 Ref
*/
const loading = ref(false);
const formatOfTime = (theTimeStamp) => {
const date = new Date(theTimeStamp * 1000); //
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}`;
}
//
onShow(() => {
nextTick(() => {
search({ value: params.value.keywords = '' })
})
// search('')
// getcouponList();
})
</script>
<style lang="scss" scoped>
.search-type {
position: relative;
height: 30px;
line-height: 30px;
padding: 0 8px 0 16px;
font-size: 24rpx;
color: rgba(0, 0, 0, .45);
}
.search-type::after {
position: absolute;
content: '';
width: 1px;
right: 0;
top: 5px;
bottom: 5px;
background: rgba(0, 0, 0, 0.25);
}
.search-type {
:deep(.icon-arrow) {
display: inline-block;
font-size: 20px;
vertical-align: middle;
}
}
.couponBox,
.title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}
.couponBox {
justify-content: flex-start;
}
.title {
justify-content: space-between;
}
.title-tip {
color: rgba(0, 0, 0, 0.25);
font-size: 12px;
}
</style>

@ -34,7 +34,7 @@
</view> </view>
</view> </view>
<!-- <view @click="utils.toUrl('/store/user/memberList')" <view @click="utils.toUrl('/store/user/memberList')"
class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">等级管理</view> <view class="font-bold">等级管理</view>
@ -45,7 +45,7 @@
<wd-icon name="layers opacity-80" class="opacity-80" size="42px"></wd-icon> <wd-icon name="layers opacity-80" class="opacity-80" size="42px"></wd-icon>
</div> </div>
</view> </view>
</view> --> </view>
<view @click="utils.toUrl('/store/cat/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/cat/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
@ -73,7 +73,7 @@
<view @click="utils.toUrl('/store/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/order/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">订单管理</view> <view class="font-bold">商城订单</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view> <view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end"> <view class="flex justify-end">
@ -98,7 +98,19 @@
<view @click="utils.toUrl('/store/inpersonPay/index')" <view @click="utils.toUrl('/store/inpersonPay/index')"
class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">当面付订单</view> <view class="font-bold">当面付</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end">
<div class="rotate-[-28deg] translate-y-3 translate-x-5">
<wd-icon name="phone" class="opacity-80" size="42px"></wd-icon>
</div>
</view>
</view>
<view @click="utils.toUrl('/store/coupon/index')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
<view class="font-bold">优惠券</view>
<view class="h-0.5 w-5 mt-0.5 bg-white"></view> <view class="h-0.5 w-5 mt-0.5 bg-white"></view>
<view class="flex justify-end"> <view class="flex justify-end">

@ -150,7 +150,6 @@ const tableLogin = async (id) => {
}); });
if (res.code === 0) { if (res.code === 0) {
uni.setStorageSync("token", res.data.access_token);
uni.setStorageSync("mall_token", res.data.access_token); uni.setStorageSync("mall_token", res.data.access_token);
uni.setStorageSync("mall_info", res.data.user_info); uni.setStorageSync("mall_info", res.data.user_info);
// uni.showToast({ // uni.showToast({

@ -45,7 +45,6 @@ onLoad((opt) => {
}); });
if (res.code === 0) { if (res.code === 0) {
uni.setStorageSync("token", res.data.access_token);
uni.setStorageSync("mall_token", res.data.access_token); uni.setStorageSync("mall_token", res.data.access_token);
uni.setStorageSync("mall_info", res.data.user_info); uni.setStorageSync("mall_info", res.data.user_info);
// uni.showToast({ // uni.showToast({

Loading…
Cancel
Save