同步代码
This commit is contained in:
267
pagewriteoff/index/index.vue
Normal file
267
pagewriteoff/index/index.vue
Normal file
@@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<view class="constant">
|
||||
<view class="constantitem" @click="object_id =null,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>
|
||||
360
pagewriteoff/index/record.vue
Normal file
360
pagewriteoff/index/record.vue
Normal 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>
|
||||
Reference in New Issue
Block a user