新增团购页面,优化考勤数据日期传参

This commit is contained in:
gyq
2025-12-03 10:43:57 +08:00
parent 3d6d3850b2
commit d49e755506
13 changed files with 2161 additions and 250 deletions

View File

@@ -3,42 +3,31 @@
<el-dialog width="400px" :title="title" v-model="show" @close="reset">
<div class="u-p-15">
<div v-if="openSwitch" class="openSwitch">
<el-button
size="large"
@click="changeKey('paysSel', index)"
v-for="(item, index) in pays"
:key="index"
:type="paysSel == index ? 'primary' : ''"
>
<el-button size="large" @click="changeKey('paysSel', index)" v-for="(item, index) in pays" :key="index"
:type="paysSel == index ? 'primary' : ''">
<img :src="item.icon" alt="" style="width: 30px; height: 30px; margin-right: 10px" />
<span>
{{ item.text }}
</span>
</el-button>
</div>
<div class="u-m-t-20 flex flex-col">
<el-alert :closable="false" v-if="tips" :title="tips" type="warning" show-icon></el-alert>
</div>
<div class="u-m-t-20 flex justify-center">
<el-form label-width="90px" label-position="left">
<el-form-item label="" label-width="0">
<el-input
v-model="form.code"
@change="codeInputChange"
placeholder="请扫码或者输入券码"
ref="refInputCode"
></el-input>
<el-input v-model="form.code" @change="codeInputChange" placeholder="请扫码或者输入券码" ref="refInputCode"
:disabled="!pays[this.paysSel].status"></el-input>
</el-form-item>
<div class="u-flex u-row-center u-m-t-50">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="confirm">确定</el-button>
<el-button type="primary" :disabled="!pays[this.paysSel].status" @click="confirm">确定</el-button>
</div>
</el-form>
</div>
</div>
</el-dialog>
<bind-shop ref="refBindShop"></bind-shop>
<choose-goods ref="refChooseGoods" @hexiaoSuccess="hexiaoSuccess"></choose-goods>
</div>
@@ -51,6 +40,7 @@ import tiktokIcon from "@/assets/icons/douyin.png";
const user = useUserStore();
import * as $Api from "@/api/coup/index.js";
import { searchstorestatus, thirdPartyCoupon_bindUrl, getuisdk } from '@/api/coup/group'
import orderApi from "@/api/order/order";
import bindShop from "./douyin-quan-bind-shop.vue";
import chooseGoods from "./choose-quan-goods.vue";
@@ -94,10 +84,14 @@ export default {
pays: [
{
text: "美团",
clint_type: 1,
status: 0,
icon: meituanIcon,
},
{
text: "抖音",
clint_type: 2,
status: 0,
icon: tiktokIcon,
},
],
@@ -117,6 +111,44 @@ export default {
},
},
methods: {
// 查询抖音/美团绑定的状态
async searchstorestatus() {
try {
const { mt_status, dy_status } = await searchstorestatus(this.pays[this.paysSel].clint_type)
// console.log('查询抖音/美团绑定的状态', mt_status, dy_status);
this.pays.forEach(item => {
if (item.clint_type == 1) {
item.status = mt_status
}
if (item.clint_type == 2) {
item.status = dy_status
}
})
if (this.pays[this.paysSel].clint_type == 1 && this.pays[this.paysSel].status == 0) {
// 如果没有绑定,先提示用户去绑定
const res = await thirdPartyCoupon_bindUrl()
ElMessageBox.confirm('您的店铺还未绑定美团,请绑定后操作!', '注意', {
confirmButtonText: '去绑定'
}).then(() => {
window.open(res)
}).catch(() => { })
}
if (this.pays[this.paysSel].clint_type == 2 && this.pays[this.paysSel].status == 0) {
// 如果没有抖音,先提示用户去绑定
const res = await getuisdk()
ElMessageBox.confirm('您的店铺还未绑定抖音,请绑定后操作!', '注意', {
confirmButtonText: '去绑定'
}).then(() => {
window.open(res)
}).catch(() => { })
}
} catch (error) {
console.log(error);
}
},
refChooseGoodsOpen(data, types) {
this.$refs.refChooseGoods.open(data, types);
},
@@ -152,6 +184,8 @@ export default {
this.$nextTick(() => {
this.$refs.refInputCode.focus(); //获取焦点
});
this.searchstorestatus()
},
async confirm() {
@@ -189,7 +223,7 @@ export default {
window.open(res2);
}
})
.catch(() => {});
.catch(() => { });
return;
}
const res1 = await $Api.$meituan_fulfilmentcertificateprepare({
@@ -215,6 +249,8 @@ export default {
setTimeout(() => {
this.$refs.refInputCode.focus();
}, 100);
this.searchstorestatus()
},
close() {
this.show = false;
@@ -241,22 +277,28 @@ export default {
height: 164px;
overflow: hidden;
}
.openSwitch {
display: flex;
justify-content: center;
}
.flex {
display: flex;
}
.justify-center {
justify-content: center;
}
:deep(.el-form) {
width: 200px;
}
:deep(.el-alert) {
width: inherit;
}
.flex-col {
flex-direction: column;
}