核销管理

This commit is contained in:
魏啾
2024-12-05 10:48:11 +08:00
parent 907ba4f9d5
commit e6ccfdafd6
11 changed files with 1248 additions and 56 deletions

6
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"files.associations": {
"*.ttml": "xml",
"*.ttss": "css"
}
}

33
http/php/api.ts Normal file
View File

@@ -0,0 +1,33 @@
import { request } from './request'
// 会员签入 登录
export const douyincheckIn = (data : object | any) => {
return request('douyin/checkIn', 'POST', data, true)
}
// 登出
export const userlogout = () => {
return request('user/logout', 'POST', '', true)
}
// 查询绑定状态
export const searchstorestatus = (data : object) => {
return request('meituan/searchstorestatus', 'POST', data, true)
}
// 团购核销准备
export const fulfilmentcertificateprepare = (data : object) => {
return request('douyin/fulfilmentcertificateprepare', 'POST', data, true)
}
// 获取uisdk 绑定 链接
export const getuisdk = (data : object) => {
return request('douyin/getuisdk', 'POST', data, true)
}
// 团购核销
export const certificateprepares = (data : object) => {
return request('douyin/certificateprepare', 'POST', data, true)
}
// 团购核销记录
export const orderlist = (data : object) => {
return request('douyin/orderlist', 'POST', data, true)
}
// 团购核销撤销
export const fulfilmentcertificatecanceles = (data : object) => {
return request('douyin/fulfilmentcertificatecancel', 'POST', data, true)
}

80
http/php/request.ts Normal file
View File

@@ -0,0 +1,80 @@
//服务器接口地址
const baseURL : string = 'https://czgdoumei.sxczgkj.com/index.php/api/'
// 封装公共请求方法
function request(url : string, method : "GET" | "POST" | undefined, data : object | any, toast : boolean) {
let networkType = ''
uni.getNetworkType({
success: (res) => {
networkType = res.networkType
}
});
if (networkType == 'none') {
uni.showToast({
title: '网络异常,请检查网络',
icon: 'none'
})
return false;
}
if (toast) {
uni.showLoading({
title: '加载中',
mask: true
})
}
return new Promise(async (resolve, reject) => {
let header : any
header = {
'content-type': 'application/json',
'clinttype':uni.getStorageSync('clint_type'),
'bausertoken': uni.getStorageSync('phpuserinfo').token
};
uni.request({
url: baseURL + url,
method: method,
data: data,
header: header,
success(res : any) {
if (res.data.code != 1) {
//是否提示错误
if (toast) {
uni.showToast({
title: res.data.msg || res.data.message,
icon: 'none'
})
setTimeout(() => {
uni.hideLoading()
}, 1000)
}
if (res.data.code == 401) {
uni.showToast({
title: res.message || res.msg,
icon: "none",
success: () => {
// uni.removeStorageSync('logintoken');
// uni.removeStorageSync('token');
uni.reLaunch({
url: '/pages/index/index'
})
}
})
}
uni.hideLoading()
reject(res.message | res.msg);
} else {
uni.hideLoading()
resolve(res.data.data);
}
},
fail(err) {
uni.hideLoading()
//请求失败
uni.showToast({
title: '无法连接到服务器',
icon: 'none'
})
reject(err)
}
})
})
}
export { request, baseURL }

View File

@@ -91,7 +91,8 @@
const hour = times.value[0][indexArr[0]]
const month = times.value[1][indexArr[1]]
const s = times.value[2][indexArr[2]]
return `${hour}:${month}:${s}`
// return `${hour}:${month}:${s}`
return `${hour}:${month}`
}
//获取$event.detail.value
function getEnentDetailValue(e) {
@@ -152,11 +153,11 @@
function returnBasicTimeConstructor() {
return {
startTime: {
value: '00:00:00',
value: '00:00',
index: [0, 0, 0]
},
endTime: {
value: '00:00:00',
value: '23:59',
index: [0, 0, 0]
}
}
@@ -190,13 +191,13 @@
}
// 触发定时器保存事件将数据给到添加商品页面
function emitTimerSave() {
const par={
days:list.value[0].cycleChecked.join(','),
startTime:list.value[0].startTime.value,
endTime:list.value[0].endTime.value
const par = {
days: list.value[0].cycleChecked.join(','),
startTime: list.value[0].startTime.value,
endTime: list.value[0].endTime.value
}
console.log(par);
uni.$emit('timerSave',par)
uni.$emit('timerSave', par)
go.back()
}
@@ -207,14 +208,14 @@
function returnTimeIndex(time) {
console.log(time);
return time.split(':').map(v=>{
return v*1
return time.split(':').map(v => {
return v * 1
})
}
function returnTimer(res) {
return [{
cycleChecked: res.days ? res.days.split(',').filter(v=>v) : [],
cycleChecked: res.days ? res.days.split(',').filter(v => v) : [],
startTime: res.startTime ? {
value: res.startTime,
index: returnTimeIndex(res.startTime)

View File

@@ -8,8 +8,7 @@
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
}
},
"pages": [
{
"pages": [{
"pageId": "PAGES_INDEX",
"path": "pages/index/index",
"style": {
@@ -760,13 +759,28 @@
{
"root": "pageBwc",
"pages": [{
"pageId": "PAGES_BWC",
"path": "index/index",
"style": {
"navigationBarTitleText": "霸王餐"
}
"pageId": "PAGES_BWC",
"path": "index/index",
"style": {
"navigationBarTitleText": "霸王餐"
}
]
}]
},
{
"root": "pagewriteoff",
"pages": [{
"pageId": "PAGES_WEITEOFF",
"path": "index/index",
"style": {
"navigationBarTitleText": "核销列表"
}
}, {
"pageId": "PAGES_WEITEOFF_RECORD",
"path": "index/record",
"style": {
"navigationBarTitleText": "核销记录"
}
}]
},
{
"root": "pageBooking",
@@ -877,11 +891,10 @@
}
},
{
"path" : "quan/quan",
"path": "quan/quan",
"pageId": "PAGES_ORDER_QUAN",
"style" :
{
"navigationBarTitleText" : "券包"
"style": {
"navigationBarTitleText": "券包"
}
}
@@ -1094,44 +1107,42 @@
{
"root": "pageNotification",
"pages": [{
"pageId": "PAGES_NOTIFICATION_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "订阅通知"
}
"pageId": "PAGES_NOTIFICATION_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "订阅通知"
}
]
}]
},
{
"root": "pageCreditBuyer",
"pages": [{
"pageId": "PAGES_CREDIT_BUYER_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "挂账管理"
}
},{
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
"path": "addDebtor",
"style": {
"navigationBarTitleText": "挂账人"
}
},{
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
"path": "rePaymentRecord",
"style": {
"navigationBarTitleText": "账单付款记录"
}
},{
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
"path": "creditDetail",
"style": {
"navigationBarTitleText": "查看明细"
}
"pageId": "PAGES_CREDIT_BUYER_INDEX",
"path": "index",
"style": {
"navigationBarTitleText": "挂账管理"
}
]
}, {
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
"path": "addDebtor",
"style": {
"navigationBarTitleText": "挂账人"
}
}, {
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
"path": "rePaymentRecord",
"style": {
"navigationBarTitleText": "账单付款记录"
}
}, {
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
"path": "creditDetail",
"style": {
"navigationBarTitleText": "查看明细"
}
}]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -284,8 +284,11 @@
// pageUrl: 'PAGES_RED_INDEX',
// entId: 'ENT_MCH_MEMBER'
// },
{
title: '核销管理',
icon: '/static/indexImg/pagewriteoff.svg',
pageUrl: 'PAGES_WEITEOFF'
},
{
title: '退出登录',
icon: '/static/indexImg/icon-login-out.svg',
@@ -373,6 +376,7 @@
/* #endif */
/* #ifndef H5 */
padding-top: calc(84rpx + 44px);
/* #endif */
>view {
text-align: center;

View File

@@ -0,0 +1,255 @@
<template>
<view class="">
<up-overlay :show="overlayshow" @click="overlayshow = false">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<!-- 抖音 -->
<view class="bottomconstant">
<view class="itemlist">
<!-- <view class="ordernumber">
订单号111
</view> -->
<view class="title">
请选择商品
</view>
<view class="itemlists" v-for="(item,index) in form.goods" :key="index">
<view class="top">
<view class="tag">
{{item.title}}
</view>
<view class="date">
¥{{item.amount}}
</view>
</view>
<!-- <view class="bottom">
核销
</view> -->
<view v-if="item.type" @click="item.type =!item.type">
<up-icon name="checkmark-circle" color="#2979ff" size="22"></up-icon>
</view>
<view class="icon" v-else @click="item.type =!item.type"></view>
</view>
<view class="bouttonbox">
<view class="keep" @click="confirms">
确定核销
</view>
<view class="cancel" @click="overlayshow = false">
取消
</view>
</view>
</view>
</view>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch,
defineExpose
} from 'vue';
const form = reactive({
id: "",
number: '',
sum_pay_amount: '',
goods: [],
verify_token: '',
});
import {
certificateprepares
} from '@/http/php/api.ts';
//显示
const overlayshow = ref(false);
const open = (val) => {
Object.assign(form, val)
form.goods.map((item) => {
item.type = true
})
overlayshow.value = true
}
let confirms = async () => {
// 判断是否选择商品
if (form.goods.filter(i => i.type).length == 0) {
uni.showToast({
title: '请选择商品',
icon: 'none'
})
return false
}
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
couponCode: form.couponCode,
num: form.goods.length
}
} else {
let encrypted_codes = form.goods.filter(i => i.type).map((obj, index) => {
return obj.encrypted_code;
})
data = {
verify_token: form.verify_token,
encrypted_codes: encrypted_codes.toString(),
id: form.id
}
}
await certificateprepares(data)
uni.showToast({
title: '验证成功',
icon: 'none'
})
overlayshow.value = false
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist:nth-child(1) {
margin-top: 0;
}
.itemlist {
// margin-top: 16rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 16rpx;
display: flex;
justify-content: space-between;
align-items: center;
.top {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.date {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.icon {
width: 40rpx;
height: 40rpx;
border: 1px solid #909399;
border-radius: 50%;
}
.bottom {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
.bouttonbox {
margin-top: 80rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.keep {
width: 490rpx;
height: 80rpx;
background: #318AFE;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 80rpx;
}
.cancel {
text-align: center;
width: 490rpx;
height: 80rpx;
background: #ffffff;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 80rpx;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,155 @@
<template>
<view class="">
<up-overlay :show="overlayshow" @click="overlayshow = false">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<!-- 抖音 -->
<view class="bottomconstant">
<view class="itemlist">
<!-- <view class="ordernumber">
订单号111
</view> -->
<view class="title">
绑定门店
</view>
<view class="itemlists" v-for="(item,index) in 4" :key="index">
<view class="top">
<view class="tag">
名称qqqqqqqqq
</view>
<view class="date">
地址qqqqqqq
</view>
</view>
<view class="bottom">
操作
</view>
</view>
</view>
</view>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch,
defineExpose
} from 'vue';
//显示
const overlayshow = ref(false);
const open = () => {
overlayshow.value = true
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist:nth-child(1) {
margin-top: 0;
}
.itemlist {
// margin-top: 16rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 16rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 16rpx;
display: flex;
justify-content: space-between;
align-items: center;
.top {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
.date {
margin-top: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
}
.bottom {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,267 @@
<template>
<view class="constant">
<view class="constantitem" @click="overlayshow = true">
<view>扫码核销</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',1)">
<view>美团记录</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',2)">
<view>抖音记录</view>
<view>
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
</view>
</view>
<!-- 核销准备 -->
<up-overlay :show="overlayshow">
<view class="boxoverlay">
<view class="rect" @tap.stop>
<view class="top">
团购卷核销
</view>
<view class="subsection">
<up-subsection :list="subsectionlist" :current="subsectioncurrent" @change="sectionChange">
</up-subsection>
</view>
<view class="search">
<up-search :show-action="false" searchIcon="scan" :clearabled="true" @clickIcon='clickIcon'
placeholder="请扫码或者输入卷码" v-model="object_id"></up-search>
</view>
<view class="search">
<up-alert fontSize='10' :show-icon="true" title="请使用相机识别扫码" type="warning"
:closable="true"></up-alert>
</view>
<view class="bouttonbox">
<view class="keep" @click="confirms">
确认
</view>
<view class="cancel" @click="overlayshow = false">
取消
</view>
</view>
</view>
</view>
</up-overlay>
<!-- 绑定门店 -->
<dialogs ref="dialogsref"></dialogs>
<!-- 选择商品 -->
<commodity ref="refcommodity"></commodity>
<!-- 二维码 -->
<up-overlay :show="qrcodes.show" @click="qrcodes.show = false">
<view class="boxoverlay">
<view class="rect" @tap.stop
style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
<!-- <view>{{subsectioncurrent==0?'请用美团':'抖音'}}</view> -->
<view style="padding-bottom:40rpx;font-weight: 600;">请进行手机扫码</view>
<!-- <up-qrcode :size="200" :val="qrcodes.val" :icon='qrcodes.icon'></up-qrcode> -->
<up-qrcode :size="200" :val="qrcodes.val"></up-qrcode>
</view>
</view>
</up-overlay>
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onUnload,
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import {
userlogout,
douyincheckIn,
fulfilmentcertificateprepare, //准备核销
searchstorestatus, //状态查询
getuisdk //获取uisdk 绑定 链接
} from '@/http/php/api.ts';
import go from '@/commons/utils/go.js'
import dialogs from '../components/dialogs.vue'
import commodity from '../components/commodity.vue'
onLoad(async () => {
// 登录 会员入签
let res = await douyincheckIn({
token: uni.getStorageSync("iToken"),
loginName: uni.getStorageSync("shopId"),
clientType: 'ADMIN'
})
uni.setStorageSync('phpuserinfo', res.userInfo)
uni.setStorageSync('clint_type', 1)
})
//显示
const overlayshow = ref(false);
// 切换
const subsectioncurrent = ref(0);
const subsectionlist = ref(['美团', '抖音']);
const sectionChange = (index) => {
subsectioncurrent.value = index;
uni.setStorageSync('clint_type', index + 1)
}
// 二维码或者条形码
const object_id = ref(null)
// 扫码
const clickIcon = () => {
uni.scanCode({ // 允许从相机和相册扫码
success: (res) => {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
object_id.value = res.result
}
});
}
// 二维码
const qrcodes = reactive({
val: 'www.baidu.com',
icon: '@/static/logo.png',
show: false
})
// 首先获取状态
let confirms = async () => {
if (object_id.value == null) {
uni.showToast({
title: '请扫码或者输入卷码',
icon: 'none'
})
return false;
}
let res = await searchstorestatus()
// status == 0 则需要显示二维码 ==1 去核销
if (res.status == 0) {
qrcodes.val = await getuisdk()
overlayshow.value = false
qrcodes.show = true
} else {
clickkeep()
}
}
// 点击确定
const clickkeep = async () => {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
code: object_id.value
}
} else {
data = {
object_id: object_id.value
}
}
let res = await fulfilmentcertificateprepare(data)
overlayshow.value = false
refcommodity.value.open(res)
}
// 这是选择门店
// const dialogsref = ref(null)
// const dialogconfirm = () => {
// dialogsref.value.open()
// }
// 选择商品
const refcommodity = ref(null)
// 跳转
const clickpath = (URL, title) => {
uni.setStorageSync('clint_type', title)
go.to(URL)
}
onShow(async () => {})
// 销毁组件
onUnload(async () => {
// 退出
await userlogout()
})
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.constant {
.constantitem {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
padding: 24rpx 32rpx;
}
.boxoverlay {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
.rect {
padding: 32rpx 28rpx;
width: 80%;
background-color: #fff;
border-radius: 18rpx;
.top {
font-size: 32rpx;
font-weight: 600;
}
.subsection {
margin-top: 24rpx;
}
.search {
margin-top: 24rpx;
}
.bouttonbox {
margin-top: 80rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.keep {
width: 490rpx;
height: 80rpx;
background: #318AFE;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 80rpx;
}
.cancel {
text-align: center;
width: 490rpx;
height: 80rpx;
background: #ffffff;
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
line-height: 80rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,360 @@
<template>
<view class="constant">
<!-- <view class="topbox">
<view class="left">
<view class="">
筛选
</view>
<view class=""></view>
</view>
<view class="right">
<up-input class="input" placeholder="搜索订单号" v-model="value"
@change="change"></up-input>
</view>
</view> -->
<!-- 抖音 -->
<view v-if="form.type == 2">
<view class="bottomconstant" v-for="(item,index) in form.list" :key="index">
<view class="itemlist">
<view class="ordernumber">
{{item.d_order_id}}
</view>
<view class="title">
{{item.title}}
</view>
<view class="itemlists" v-for="(item1,index1) in item.douyinCodeGoods" :key="item1.id">
<view class="top">
<view class="date">
{{item1.create_time}}
</view>
<view class="tag" v-if="item1.status == 1" @click="clickcancel(item1)"
style="background: #318AFE;color: #fff; border-radius: 10rpx;">
撤销核销
</view>
<view class="tag" v-if="item1.status == 0">
等待验券
</view>
<view class="tag" v-if="item1.status == 2">
失败
</view>
</view>
<view class="bottom">
<view class="bottomtitle">
{{item1.title}}
</view>
<view class="price">
<view class="prices">
{{item1.pay_amount}}
</view>
<!-- <view class="pricees">
{{item1.market_price}}
</view> -->
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 美团 -->
<view class="bottomconstant" v-else>
<view class="itemlist" v-for="(item,index) in form.list" :key="index">
<view class="itemlists" style="padding: 0;">
<view class="top">
<view class="date">
{{item.couponUseTime}}
</view>
<view class="tag" :style="!item.type?'background: #318AFE;color: #fff; border-radius: 10rpx;':''"
@click="clickcancel(item)">
{{item.type ? item.couponStatusDesc:'撤销核销'}}
</view>
</view>
<view class="bottom">
<view class="bottomtitle">
{{item.dealTitle}}
</view>
<view class="price">
<view class="prices">
¥{{item.couponBuyPrice}}
</view>
<!-- <view class="pricees">
156
</view> -->
</view>
</view>
</view>
</view>
</view>
<up-loadmore :status="form.status" />
</view>
</template>
<script setup>
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import dayjs from "dayjs";
import {
orderlist,
fulfilmentcertificatecanceles
} from '@/http/php/api.ts';
// 下拉加载
onReachBottom(() => {
if (form.status != 'nomore') {
form.page = ++form.page;
getlist()
}
})
onLoad(async (e) => {
form.type = uni.getStorageSync('clint_type')
initial()
})
const dropdownvalue = ref(1)
const optionsdropdown = [{
label: '等待验证',
value: 1,
},
{
label: '成功',
value: 2,
},
{
label: '失败',
value: 3,
}
]
// 初始化
const initial = () => {
form.page = 1
form.status = 'loadmore'
form.d_order_id = ''
form.querystatus = ''
getlist()
}
//
const form = reactive({
type: '',
d_order_id: '',
querystatus: '',
page: 1,
status: '',
list: [],
count: '',
date: ''
});
const getlist = async () => {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
page: form.page,
date: form.date
}
} else {
data = {
page: form.page,
status: form.querystatus,
d_order_id: form.d_order_id
}
}
let res = await orderlist(data)
form.count = res.count
form.status = 'loading';
if (form.page == 1 && res.list.length == 0) {
form.status = 'nomore'
return false;
} else {
setTimeout(() => {
if (form.page == 1) {
form.list = res.list
} else {
form.list = [...form.list, ...res.list];
}
if (form.list.length >= form.count && res.list.length < 10) {
form.status = 'nomore';
} else {
form.status = 'loadmore';
}
// 这是美团处理的数据
if (uni.getStorageSync('clint_type') == 1) {
form.list = form.list.map(item => {
// 计算60天后
item.couponUseTimes = dayjs(item.couponUseTime).add(60, 'day').format(
'YYYY-MM-DD HH:mm:ss')
item.type = dayjs().isAfter(dayjs(item.couponUseTime).add(60, 'day'),
'year')
return item
});
}
}, 500)
}
}
const clickcancel = async (item) => {
uni.showModal({
title: '确认撤销吗?',
success: async (res) => {
if (res.confirm) {
let data = null
if (uni.getStorageSync('clint_type') == 1) {
data = {
couponCode: item.couponCode
}
} else {
data = {
verify_id: item.verify_id,
certificate_id: item.certificate_id
}
}
await fulfilmentcertificatecanceles(data)
uni.showToast({
title: '撤销核销成功',
icon: 'success'
})
setTimeout(() => {
initial()
}, 1000)
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
</script>
<style lang="scss" scoped>
page {
background: #F9F9F9;
}
.constant {
padding-bottom: 32rpx;
.topbox {
width: 100%;
padding: 32rpx 28rpx;
background: #fff;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.left {}
.right {
width: 80%;
.input {
width: 100%;
}
}
}
.bottomconstant {
padding: 0 28rpx;
width: 100%;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.itemlist {
margin-top: 32rpx;
padding: 32rpx 24rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.ordernumber {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.title {
margin-top: 16rpx;
padding-bottom: 24rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1rpx solid #E5E5E5;
}
.itemlists {
padding-top: 24rpx;
.top {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.date {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.tag {
background: #EAF4FD;
border-radius: 4rpx 4rpx 4rpx 4rpx;
padding: 6rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
color: #318AFE;
}
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
.bottomtitle {
width: 350rpx;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
white-space: nowrap; //溢出不换行
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.price {
margin-top: 16rpx;
display: flex;
justify-content: flex-start;
align-items: center;
.prices {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
}
.pricees {
margin-left: 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 24rpx;
color: #999999;
text-decoration-line: line-through;
}
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve"> <image id="image0" width="96" height="96" x="0" y="0"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
AAB1MAAA6mAAADqYAAAXcJy6UTwAAABRUExURQAAAFCf/0uZ/0yZ/kyY/kuY/UyZ/0yZ/kuY/k2Z
/0yZ/UqX/0uZ/0uY/kuZ/kyZ/kyY/UuZ/UiX/0uZ/kuZ/UyX/0yY/kqa/0uZ/kyZ/v///7LMcjEA
AAAZdFJOUwAQX6+/n3/v31CAYHCwz8CQoCDwj0DQMODQpj2tAAAAAWJLR0QadWfkMgAAAAd0SU1F
B+gMBQIoEmmNJfAAAAHtSURBVGje7ZnZloMgDEChm63RKlK3///RsXVciTUBOmdmDnkF7wVTSU4R
IgQr5OF4ap3idD684V8iN3of19vW8o8+8M844wJv/A1D7I/ftoC8IC/vf4hIGoLEJx/bQupXkBqC
u19BZgj88ts2CH5KkEoh8w8K1OtR1OBF0PNF8SmBevesB8HI/9AORr5Ai6CzYOKf0XFXwR7fVbDL
pwp0ZsknChKBllICnyaIXyNgw6cJvgsrWPBpgmEM+HyaoEAMRD5NcBSGgcon/opgbSDzqd/BykDn
k7/khYHBpx8VMwOHzziLkD6WwOccdmDDZ52mYMHnHdfA5zPrAbD53IIDXD67ogGTzy+Zl26OpPMt
avL18bjS+X+muw6CIAiC3y5QJTmUjQAp9tsBfEHF4QtRsQUxT5CzBSlPkLIFUcHh1xFb0N5rBt+s
dfuCrkieiIGVUorAKYIgCIIgCILgnwneXk9VjaNAq0LU2RZEJ11H1DgIdNz/75holJH1fUGZWQqa
qbcrEIaehmub1jFb3grDehPp4rayyPWeYLlGVa7H5SLZjXEpLeNFMsybwNnzz8wicZsIucQmzPNt
NoZjfzxk1ozhQqspNybM8p2Yg9U6sxjgucbNBczyXSFzZFytM4tO2usou3w3SooQIfzFFziLPvqM
MV6wAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTA1VDAyOjQwOjE4KzAwOjAwFHedYwAAACV0
RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wNVQwMjo0MDoxOCswMDowMGUqJd8AAAAodEVYdGRhdGU6
dGltZXN0YW1wADIwMjQtMTItMDVUMDI6NDA6MTgrMDA6MDAyPwQAAAAAAElFTkSuQmCC" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB