This commit is contained in:
dzc committed 2024-11-13 07:02:40 +08:00
1 parent 328489c6dd
commit 037dd3a17f
28 files changed
+958 -275

No files matched your search

+13 -1
View File
@@ -16,6 +16,18 @@ onHide(() => {
@import "@/sheep/scss/global.scss";
@import url(@/uni_modules/tm-ui/css/remixicon.min.css);
$theme-green: #06be36;
$theme-blue: #0094ff;
.botder_btn {
border: 1px solid #999;
color: #999;
font-weight: 500;
font-size: 28rpx;
border-radius: 10rpx;
padding: 8rpx 15rpx;
}
.prefix_title {
font-size: 32rpx;
font-weight: 500;
@@ -26,7 +38,7 @@ onHide(() => {
display: inline-block;
width: 8rpx;
height: 24rpx;
background: #0094ff;
background: $theme-blue;
border-radius: 4rpx;
margin-right: 10rpx;
}
+8 -13
View File
@@ -16,13 +16,6 @@
"disableScroll": true
}
},
{
"path": "pages/tabbar/food",
"style": {
"navigationBarTitleText": "菜谱",
"disableScroll": true
}
},
{
"path": "pages/tabbar/order",
"style": {
@@ -104,6 +97,14 @@
"disableScroll": true
}
},
{
"path": "food",
"style": {
"navigationBarTitleText": "菜谱",
"navigationBarBackgroundColor": "#1777FF",
"disableScroll": true
}
},
{
"path": "product-detail",
"style": {
@@ -167,12 +168,6 @@
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home-select.png"
},
{
"pagePath": "pages/tabbar/food",
"text": "菜谱",
"iconPath": "static/tabbar/food.png",
"selectedIconPath": "static/tabbar/food-select.png"
},
{
"pagePath": "pages/tabbar/order",
"text": "订单",
+60 -26
View File
@@ -1,13 +1,16 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { isEmpty } from "radash"
import dayjs from "dayjs"
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
const state = reactive<any>({
detailType: "add",
detailId: null,
detail: null,
})
const applyForm = reactive<any>({
displayTimeRange: "",
@@ -26,13 +29,37 @@ const applyFormRules = reactive<any>({
]
})
onLoad(() => {
onLoad((options: any) => {
const { type, id } = options
if (!isEmpty(type)) state.detailType = type
if (!isEmpty(id)) state.detailId = id
if (type === 'view') {
getDetail()
}
});
onShow(() => {
})
const getDetail = async () => {
if (isEmpty(state.detailId)) return
const _pa = { id: state.detailId }
const { data } = await applyApi.foreignDetail(_pa)
if (!isEmpty(data)) {
state.detail = data
const startTime = hooks.useTime(data.applyStartTime, "{y}-{m}-{d}")
const endTime = hooks.useTime(data.applyEndTime, "{y}-{m}-{d}")
applyForm.displayTimeRangeStr = startTime + "~" + endTime
applyForm.count = data.count
if (isEmpty(data.remark)) {
applyForm.remark = "无"
} else {
applyForm.remark = data.remark
}
}
}
const applyFormRef = ref<any>(null)
const doSubmit = async () => {
applyFormRef.value.submit()
@@ -64,29 +91,36 @@ const doSubmit = async () => {
<template>
<crud-layout title="外来人员就餐" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="displayTimeRangeStr" label="使用时间" :showBottom="false">
<tm-between-time start="2020-1-1" end="2030-1-1" v-model="applyForm.displayTimeRange"
v-model:model-str="applyForm.displayTimeRangeStr" format="YYYY-MM-DD">
<view style="pointer-events: none;">
<tm-input v-model="applyForm.displayTimeRangeStr" disabled placeholder="请选择使用时间..">
<template v-slot:rightIcon>
<text class="p-0.5rem color-#b1b1b1 iconfont icon-xiangxiajiantouxiao"></text>
</template>
</tm-input>
</view>
</tm-between-time>
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" showClear placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" showClear placeholder="请输入备注.."></tm-input>
</tm-form-item>
</tm-form>
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
<view class="card p-x-30rpx p-y-40rpx">
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="displayTimeRangeStr" label="使用时间" :showBottom="false">
<tm-between-time start="2020-1-1" end="2030-1-1" v-model="applyForm.displayTimeRange"
v-model:model-str="applyForm.displayTimeRangeStr" format="YYYY-MM-DD">
<view :style="{ pointerEvents: state.detailType == 'view' ? 'auto' : 'none' }">
<tm-input v-model="applyForm.displayTimeRangeStr" disabled placeholder="请选择使用时间..">
<template v-slot:rightIcon>
<text v-if="state.detailType != 'view'"
class="p-0.5rem color-#b1b1b1 iconfont icon-xiangxiajiantouxiao"></text>
</template>
</tm-input>
</view>
</tm-between-time>
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'" placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'"
:placeholder="state.detailType == 'view' ? '' : '请输入备注..'"></tm-input>
</tm-form-item>
</tm-form>
</view>
<view v-if="state.detailType != 'view'"
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doSubmit">
提交
</view>
+9 -20
View File
@@ -6,11 +6,7 @@ import { isEmpty } from 'radash'
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
}
const state = reactive<any>({
pa: {
id: null,
@@ -33,14 +29,6 @@ onShow(() => {
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
}
</script>
@@ -52,18 +40,19 @@ const doTab = (e: any) => {
<template #top>
<view class="h-30rpx" />
</template>
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-row items-center justify-between">
<view class="">
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)">
<view class="flex-row items-center">
<view class="flex-row items-center">
<tm-tag v-if="v.status == 1" size="m" color="info">未使用</tm-tag>
<tm-tag v-if="v.status == 2" size="m" color="success">已使用</tm-tag>
<view class="m-t-10rpx sub-text-26">
<text>{{ v.userNameStr }}</text>
<text class="m-l-10rpx">{{ v.userMobile }}</text>
</view>
</view>
<image class="w-100rpx h-100rpx" :src="v.code" mode="aspectFill" />
<view class="flex-row items-center sub-text-28">
<text class="m-l-30rpx">{{ v.userNameStr }}</text>
<text class="m-l-30rpx">{{ v.userMobile }}</text>
</view>
</view>
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
</view>
</z-paging>
</crud-layout>
+48 -15
View File
@@ -8,11 +8,16 @@ import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '待审核', disabled: false },
{ id: 2, name: '已通过', disabled: false },
{ id: 3, name: '已拒绝', disabled: false },
]
}
const state = reactive<any>({
pa: {
status: 1,
status: data.tabs[0].id,
},
})
@@ -26,23 +31,26 @@ onLoad(() => {
});
onShow(() => {
pageRef.value.reload(false)
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
const target = data.tabs[e];
state.pa.status = target.id
pageRef.value.reload(true)
}
const doApply = async () => {
router.jump("/pages/apply/foreign-apply")
router.jump("/pages/apply/foreign-apply", { type: 'add' })
}
const doCard = (v: any) => {
if (v.status == 2) {
router.jump("/pages/apply/foreign-items", { id: v.id })
} else {
router.jump("/pages/apply/foreign-apply", { type: 'view', id: v.id })
}
}
@@ -64,11 +72,23 @@ const doCard = (v: any) => {
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i"
@tap="doCard(v)">
<view class="flex-row items-center justify-between">
<view class="sub-text-28">电子餐券</view>
<view class="sub-text-24">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="sub-text-30">电子餐券</view>
<view class="flex-row items-center">
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="flex-row-center m-l-20rpx">
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
</view>
</view>
</view>
<view class="sub-text-24">
<view class="m-t-20rpx">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
<view class="flex items-center">
<text>有效期</text>
<text class="m-l-10rpx">
{{ hooks.useTime(v.applyStartTime, " {y}-{m}-{d}") }}
@@ -76,11 +96,24 @@ const doCard = (v: any) => {
{{ hooks.useTime(v.applyEndTime, "{y}-{m}-{d}") }}
</text>
</view>
<view class="m-t-20rpx">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
<view v-if="v.status != 1">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>审核人</text>
<text class="m-l-10rpx">{{ v.checkUserName }}</text>
</view>
<view class="flex items-center">
<text>审核时间</text>
<text class="m-l-10rpx"> {{ hooks.useTime(v.checkTime, "") }}</text>
</view>
</view>
</view>
<view class="flex items-center justify-end m-t-25rpx">
<text v-if="v.status == 2" class="botder_btn">使用</text>
<text v-else class="botder_btn">查看</text>
</view>
</view>
<template #bottom>
<view
+43 -12
View File
@@ -1,11 +1,15 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { isEmpty } from "radash"
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
const state = reactive<any>({
detailType: "add",
detailId: null,
detail: null,
})
const applyForm = reactive<any>({
@@ -19,13 +23,34 @@ const applyFormRules = reactive<any>({
{ required: true, max: 20, message: '最多申请20张' },
]
})
onLoad(() => {
onLoad((options: any) => {
const { type, id } = options
if (!isEmpty(type)) state.detailType = type
if (!isEmpty(id)) state.detailId = id
if (type === 'view') {
getDetail()
}
});
onShow(() => {
})
const getDetail = async () => {
if (isEmpty(state.detailId)) return
const _pa = { id: state.detailId }
const { data } = await applyApi.strideDetail(_pa)
if (!isEmpty(data)) {
state.detail = data
applyForm.count = data.count
if (isEmpty(data.remark)) {
applyForm.remark = "无"
} else {
applyForm.remark = data.remark
}
}
}
const applyFormRef = ref<any>(null)
const doSubmit = async () => {
applyFormRef.value.submit()
@@ -55,16 +80,22 @@ const doSubmit = async () => {
<template>
<crud-layout title="外来人员就餐" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" showClear placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" showClear placeholder="请输入备注.."></tm-input>
</tm-form-item>
</tm-form>
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
<view class="card p-x-30rpx p-y-40rpx">
<tm-form ref="applyFormRef" v-model="applyForm" :rules="applyFormRules" direction="vertical">
<tm-form-item name="count" label="申请数量" :showBottom="false">
<tm-input v-model="applyForm.count" type="number" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'" placeholder="请输入申请数量.." />
</tm-form-item>
<view class="h-30rpx" />
<tm-form-item name="remark" label="备注" :required="false" :showBottom="false">
<tm-input v-model="applyForm.remark" type="textarea" :disabled="state.detailType == 'view'"
:showClear="state.detailType != 'view'"
:placeholder="state.detailType == 'view' ? '' : '请输入备注..'"></tm-input>
</tm-form-item>
</tm-form>
</view>
<view v-if="state.detailType != 'view'"
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doSubmit">
提交
</view>
+10 -22
View File
@@ -6,11 +6,6 @@ import { isEmpty } from 'radash'
import { hooks, router } from "@@/index"
import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
}
const state = reactive<any>({
pa: {
id: null,
@@ -19,7 +14,7 @@ const state = reactive<any>({
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, applyApi.foreignItems, null, 'data')
const pageHook = hooks.usePage(pageRef, applyApi.strideItems, null, 'data')
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
}
@@ -33,14 +28,6 @@ onShow(() => {
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
}
</script>
@@ -52,18 +39,19 @@ const doTab = (e: any) => {
<template #top>
<view class="h-30rpx" />
</template>
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-row items-center justify-between">
<view class="">
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list" :key="i" @tap="hooks.usePreviewImage(v.code)">
<view class="flex-row items-center">
<view class="flex-row items-center">
<tm-tag v-if="v.status == 1" size="m" color="info">未使用</tm-tag>
<tm-tag v-if="v.status == 2" size="m" color="success">已使用</tm-tag>
<view class="m-t-10rpx sub-text-26">
<text>{{ v.userNameStr }}</text>
<text class="m-l-10rpx">{{ v.userMobile }}</text>
</view>
</view>
<image class="w-100rpx h-100rpx" :src="v.code" mode="aspectFill" />
<view class="flex-row items-center sub-text-26">
<text class="m-l-30rpx">{{ v.username }}</text>
<text class="m-l-30rpx">{{ v.userMobile }}</text>
</view>
</view>
<view class="iconfont icon-erweima font-size-40rpx! color-blue" />
</view>
</z-paging>
</crud-layout>
+58 -8
View File
@@ -8,11 +8,16 @@ import { applyApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['待审核', '已通过', '已拒绝'],
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '待审核', disabled: false },
{ id: 2, name: '已通过', disabled: false },
{ id: 3, name: '已拒绝', disabled: false },
]
}
const state = reactive<any>({
pa: {
status: 1,
status: data.tabs[0].id,
},
})
@@ -26,20 +31,29 @@ onLoad(() => {
});
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
const target = data.tabs[e];
state.pa.status = target.id
pageRef.value.reload(true)
}
const doApply = async () => {
router.jump("/pages/apply/stride-apply")
}
const doCard = (v: any) => {
if (v.status == 2) {
router.jump("/pages/apply/stride-items", { id: v.id })
} else {
router.jump("/pages/apply/stride-apply", { type: 'view', id: v.id })
}
}
</script>
@@ -55,7 +69,43 @@ const doApply = async () => {
</view>
</template>
<view class="h-20rpx" />
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i"
@tap="doCard(v)">
<view class="flex-row items-center justify-between">
<view class="sub-text-30">跨单位就餐</view>
<view class="flex-row items-center">
<view class="second-text-26">{{ hooks.useTime(v.createTime, "") }}</view>
<view class="flex-row-center m-l-20rpx">
<tm-tag v-if="v.status == 1" size="xs" color="info">待审核</tm-tag>
<tm-tag v-if="v.status == 2" size="xs" color="success">已通过</tm-tag>
<tm-tag v-if="v.status == 3" size="xs" color="error">已拒绝</tm-tag>
</view>
</view>
</view>
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>数量</text>
<text class="m-l-10rpx">{{ v.count }}</text>
</view>
</view>
<view v-if="v.status != 1">
<view class="h-1px m-y-20rpx bg-#999 bg-opacity-5" />
<view class="flex items-center justify-between second-text-26">
<view class="flex items-center">
<text>审核人</text>
<text class="m-l-10rpx">{{ v.checkUserName }}</text>
</view>
<view class="flex items-center">
<text>审核时间</text>
<text class="m-l-10rpx"> {{ hooks.useTime(v.checkTime, "") }}</text>
</view>
</view>
</view>
<view class="flex items-center justify-end m-t-25rpx">
<text v-if="v.status == 2" class="botder_btn">使用</text>
<text v-else class="botder_btn">查看</text>
</view>
</view>
<template #bottom>
<view
@@ -69,11 +69,10 @@ const remove = () => {
@tap="props.productId && router.jump('/pages/merchant/product-detail', { id: props.productId })">
<image v-if="props.mode == 'default'" class=" size-180rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<image v-if="props.mode == 'car'" class=" size-120rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<view class="flex-1 m-l-20rpx">
<view class="sub-text-28 show-line">{{ props.name }}</view>
<view class="m-t-10rpx flex-row items-center">
<view class="second-text-32 color-#f63a36!">
<view class="second-text-32 color-red!">
¥{{ hooks.useMoney(props.price) }}
</view>
<view v-if="props.mode == 'default'" class="m-l-20rpx second-text-24 line-through">
@@ -85,7 +84,7 @@ const remove = () => {
</view>
<view v-if="props.mode == 'default'" class="flex-row items-center MT 10rpx">
<view class="second-text-24">{{ hooks.useFormatNum("库存", "", props.stock) }}</view>
<view class="w-1px h-20rpx m-x-5rpx bg-#c4c4c4" />
<view class="w-1px h-20rpx m-x-5rpx bg-#999" />
<view class="second-text-24">{{ hooks.useFormatNum("销量", "", props.salesCount) }}</view>
</view>
<view class="flex-row items-center justify-end m-t-20rpx">
@@ -95,7 +94,7 @@ const remove = () => {
</view>
<view class="sub-text-28 m-x-20rpx">{{ props.modelValue }}</view>
<view class="flex-row-center size-40rpx rounded-full bg-#0094ff" @tap.stop="add">
<view class="font-size-40rpx iconfont icon-a-" />
<view class="font-size-40rpx color-white iconfont icon-a-" />
</view>
</view>
</view>
+22 -4
View File
@@ -176,6 +176,17 @@ const getHeight = () => {
return `calc(100vh - ${uni.upx2px(rpx)}px)`
}
const doPhone = () => {
if (isEmpty(state.detail.phone)) {
uni.showToast({ title: '该店铺没有预留电话', icon: "none" })
return
}
hooks.useMakePhoneCall(state.detail.phone)
}
const doFood = () => {
router.jump("/pages/merchant/food", { merchantId: state.detailId })
}
</script>
<template>
@@ -220,8 +231,8 @@ const getHeight = () => {
<!-- end 简介 end -->
<!-- start 功能 start -->
<view class="h-15rpx" />
<view class="flex-row items-center justify-between card p-y-20rpx p-x-30rpx">
<view class="flex-row-center">
<view class="flex-row items-center justify-evenly card p-y-20rpx">
<view class="flex-row-center" @tap="doPhone">
<view class="flex-row-center w-50rpx h-50rpx bg-#167aff rounded-full">
<text class="font-size-28rpx! color-white iconfont icon-dianhua" />
</view>
@@ -234,6 +245,13 @@ const getHeight = () => {
</view>
<text class="m-l-20rpx sub-text-28">包厢预定</text>
</view>
<view class="w-1px h-30rpx bg-#c4c4c4" />
<view class="flex-row-center" @tap="doFood">
<view class="flex-row-center w-50rpx h-50rpx bg-#167aff rounded-full">
<text class="font-size-28rpx! color-white iconfont icon-caipu" />
</view>
<text class="m-l-20rpx sub-text-28">每日菜谱</text>
</view>
</view>
<!-- end 功能 end -->
</view>
@@ -243,7 +261,7 @@ const getHeight = () => {
<view class="h-15rpx" />
<view class="flex-row">
<scroll-view scroll-y :style="{ height: getHeight() }"
class="menu w-200rpx h-full p-l-12rpx bg-#f6f6f6">
class="menu w-200rpx h-full p-l-12rpx p-b-20rpx bg-#f6f6f6">
<view class="menu_item flex-row-center" v-for="( v, i ) in state.classifyList " :key="v.id"
:class="[{ 'menu_item_active': i == state.currentClassifyIndex }]" @tap="doClassify(i)">
<view class="menu_item_title show-line">
@@ -251,7 +269,7 @@ const getHeight = () => {
</view>
</view>
</scroll-view>
<scroll-view scroll-y :style="{ height: getHeight() }" class="flex-1">
<scroll-view scroll-y :style="{ height: getHeight() }" class="flex-1 p-b-20rpx">
<view v-for="( cV, cI ) in state.shopList " :key="cI">
<view class="flex-row-center m-y-20rpx">
<view class="w-25rpx h-1px bg-#d2d2d2" />
+147
View File
@@ -0,0 +1,147 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import dayjs from "dayjs"
import { hooks, router } from "@@/index"
import { foodApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
import CustomWaterfallsFlow from "@@/components/other/custom-waterfalls-flow/custom-waterfalls-flow.vue"
const data = {
tabs: [
{ id: null, name: '全部', disabled: false },
{ id: 1, name: '早餐', disabled: false },
{ id: 2, name: '午餐', disabled: false },
{ id: 3, name: '晚餐', disabled: false },
],
weekDays: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
}
const state = reactive<any>({
dateList: [],
currentDateIndex: 0,
pa: {
merchantId: null,
startTime: null,
hourType: data.tabs[0].id,
},
})
onLoad((options: any) => {
initDate()
if (!isEmpty(options.merchantId)) {
state.pa.merchantId = options.merchantId
}
});
onShow(() => {
if (pageRef.value && pageRef.value.reload) {
pageRef.value.reload(false)
}
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, foodApi.page, null, 'data.list')
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
}
const initDate = () => {
const list: any = []
const now = new Date()
for (let i = 0; i < 10; i++) {
const date = dayjs(now).add(i, 'd')
const weekDayStr = date.isSame(now, 'day') ? '今天' : data.weekDays[date.day()]
list.push({
weekDayStr,
date: date.toDate(),
dayTime: date.format('MM-DD'),
dateTime: date.format("YYYY-MM-DD"),
})
}
state.dateList = list
state.pa.startTime = state.dateList[0].dateTime
pageRef.value?.reload(false)
}
const doDateItem = (v: any, i: any) => {
state.currentDateIndex = i
state.pa.startTime = state.dateList[i].dateTime
pageRef.value.reload(true)
}
const doTab = (e: any) => {
const target = data.tabs[e];
state.pa.hourType = target.id
pageRef.value.reload(true)
}
const doProduct = (v: any) => {
router.jump('/pages/merchant/product-detail', { id: v.spuId })
}
</script>
<template>
<crud-layout title="每日菜谱" navBgColor="#1777FF" navBgTitleColor="white" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="5"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="bg-#1777FF p-15rpx">
<scroll-view scroll-x class="whitespace-nowrap">
<view class="flex-row items-center space-x-15rpx">
<view :class="{ active_date: state.currentDateIndex == i }"
class="flex-col-center flex-shrink-0 size-95rpx color-white rounded-8rpx font-size-24rpx font-700"
v-for="(v, i) in state.dateList" :key="i" @tap="doDateItem(v, i)">
<view class="">{{ v.dayTime }}</view>
<view class="">{{ v.weekDayStr }}</view>
</view>
</view>
</scroll-view>
</view>
<view class="bg-white rounded-16rpx px-20rpx m-x-10rpx m-t-15rpx">
<z-tabs :list="data.tabs" @change="doTab" />
</view>
</template>
<view class="h-20rpx" />
<view class="m-x-10rpx">
<custom-waterfalls-flow :value="pageHook.list" imageKey="picUrl" :columnSpace="1"
@wapperClick="doProduct" @imageClick="doProduct">
<template v-slot:default="v">
<view class="p-x-15rpx p-y-25rpx">
<view class="sub-text-28 show-line">{{ v.name }}</view>
<view class="m-t-10rpx flex-row items-center">
<view class="second-text-32 color-#f63a36!">
¥{{ hooks.useMoney(v.price) }}
</view>
<view class="m-l-20rpx second-text-24 line-through">
¥{{ hooks.useMoney(v.marketPrice) }}
</view>
</view>
<view class="flex-row items-center MT 10rpx">
<view class="second-text-24">{{ hooks.useFormatNum("库存", "", v.stock) }}</view>
<view class="w-1px h-20rpx m-x-5rpx bg-#999" />
<view class="second-text-24">{{ hooks.useFormatNum("销量", "", v.salesCount) }}</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</view>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped>
:deep() {
.layout_main>scroll-view {
padding: 0 !important;
}
}
.active_date {
background-color: white;
color: #1679FF !important;
}
</style>
+3 -3
View File
@@ -66,7 +66,7 @@ const getShopCarList = async () => {
<view>部门</view>
<view>{{ state.detail.deptName }}</view>
</view>
<view class="m-t-15rpx h-1px bg-#c4c4c4 bg-opacity-5" />
<view class="m-t-15rpx h-1px bg-#999 bg-opacity-5" />
<view class="info_cell">
<view>订单号</view>
<view>{{ state.detail.id }}</view>
@@ -100,7 +100,7 @@ const getShopCarList = async () => {
<view class="sub-text-32">¥ {{ hooks.useMoney(v.totalPrice) }}</view>
</view>
</view>
<view class="m-y-15rpx h-1px bg-#c4c4c4 bg-opacity-5" />
<view class="m-y-15rpx h-1px bg-#999 bg-opacity-5" />
<view class="flex-row items-center justify-between">
<view class="sub-text-32">实付款</view>
<view class="flex-row items-end">
@@ -123,7 +123,7 @@ const getShopCarList = async () => {
}
&>view {
color: #c4c4c4;
color: #999;
font-size: 28rpx;
font-weight: 500;
line-height: 1.4em;
-59
View File
@@ -1,59 +0,0 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { hooks } from "@@/index"
import { foodApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['早餐', '午餐', '晚餐'],
}
const state = reactive<any>({
pa: {
status: 1,
},
})
onLoad(() => {
});
onShow(() => {
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, foodApi.page, null, 'data.list')
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
}
const doTab = (e: any) => {
if (state.pa.status != e + 1) {
state.pa.status = e + 1
pageRef.value.reload(true)
}
}
</script>
<template>
<crud-layout title="每日菜谱" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="5"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
<view class="h-30rpx" />
<view class="bg-white rounded-16rpx px-20rpx">
<z-tabs :list="data.tabs" @change="doTab" />
</view>
</template>
<view class="h-20rpx" />
<view class="flex-col card p-x-20rpx p-y-30rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i">
</view>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped></style>
+4 -2
View File
@@ -15,7 +15,9 @@ onLoad(() => {
});
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const pageRef = ref<any>(null)
@@ -29,7 +31,7 @@ const query = (page: number, pagesize: number) => {
<template>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="5"
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="10"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<template #top>
+37 -15
View File
@@ -3,7 +3,7 @@ import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { hooks, router } from "@@/index"
import { orderApi } from "@@/api"
import { orderApi, payApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
@@ -18,7 +18,7 @@ const data = {
}
const state = reactive<any>({
pa: {
orderStatus: null,
orderStatus: data.tabs[0].id,
},
})
@@ -26,7 +26,9 @@ onLoad(() => {
});
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const doTab = (e: any) => {
const target = data.tabs[e];
@@ -44,6 +46,33 @@ const doToDetail = (v: any) => {
router.jump("/pages/order/detail", { id: v.id })
}
const doAppraise = () => {
}
const doRefund = (v: any) => {
uni.showModal({
title: '提示',
content: '是否确定退款',
confirmColor: '#0094ff',
success: async (res) => {
if (!res.confirm) return
try {
uni.showLoading({ title: '退款中...', mask: true });
const _pa = { id: v.id }
const { data, code }: any = await payApi.refundHardwareOrder(_pa)
if (code != 0) throw new Error()
pageRef.value.reload(true)
uni.hideLoading()
uni.showToast({ title: '退款成功', icon: "none" });
} catch (error) {
console.error(error);
uni.hideLoading()
}
}
});
}
</script>
@@ -67,7 +96,7 @@ const doToDetail = (v: any) => {
<view class="flex-row items-center justify-between">
<view class="flex-row items-center">
<view class="main-text-28">{{ v.merchantStr }}</view>
<view class="m-l-15rpx color-#c4c4c4 font-size-26rpx! iconfont icon-youjiantou" />
<view class="m-l-15rpx color-#999 font-size-26rpx! iconfont icon-youjiantou" />
</view>
<tm-tag v-if="v.orderStatus == 1" color="info" size="xs">未支付</tm-tag>
<tm-tag v-if="v.orderStatus == 5" color="success" size="xs">待核销</tm-tag>
@@ -110,7 +139,9 @@ const doToDetail = (v: any) => {
</view>
</view>
<view v-if="[5, 10].includes(v.orderStatus)" class="flex-row items-center justify-end p-t-20rpx">
<view v-if="v.orderStatus == 10" class="botder_btn">评价</view>
<view v-if="v.orderStatus == 10" class="botder_btn" @tap.stop="doAppraise">评价</view>
<view v-if="v.orderStatus == 5 && v.orderType == 2" class="botder_btn" @tap.stop="doRefund(v)">退款
</view>
<view v-if="v.orderStatus == 5 && v.orderType == 2" class="m-l-20rpx botder_btn"
@tap.stop="hooks.usePreviewImage(v.orderTypeExtendReserve.qrCode)">
核销码
@@ -121,13 +152,4 @@ const doToDetail = (v: any) => {
</crud-layout>
</template>
<style lang="scss" scoped>
.botder_btn {
border: 1px solid #c4c4c4;
color: #c4c4c4;
font-weight: 500;
font-size: 28rpx;
border-radius: 10rpx;
padding: 8rpx 15rpx;
}
</style>
<style lang="scss" scoped></style>
+33
View File
@@ -0,0 +1,33 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { hooks } from "@@/index"
import { foodApi } from "@@/api"
const data = {
}
const state = reactive<any>({
pa: {
status: 1,
},
})
onLoad(() => {
});
onShow(() => {
})
</script>
<template>
<crud-layout title="订单详情" bg="/static/page/blue-bg.png">
</crud-layout>
</template>
<style lang="scss" scoped></style>
+40 -21
View File
@@ -103,36 +103,55 @@ const doFreeze = async () => {
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<view class="h-30rpx" />
<view v-for="(v, i) in pageHook.list" :key="i" @tap="router.jump('/pages/wallet/detail', { id: v.id })">
<view class="flex-col rounded-20rpx p-x-20rpx p-y-30rpx m-b-30rpx bg-#222222">
<view class="card flex-col rounded-20rpx p-x-30rpx p-y-20rpx m-b-30rpx" v-for="(v, i) in pageHook.list"
:key="i" @tap="router.jump('/pages/wallet/detail', { id: v.id })">
<view v-if="v.cardNumber" class="flex-col" @tap.stop="hooks.useCopy(v.cardNumber)">
<view class="flex-row items-center justify-between">
<view class="flex-row items-center">
<image class="w-52rpx h-52rpx" src="/static/icon/vip.png" mode="aspectFill" />
<text class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ v.walletTypeStr }}
</text>
<text v-if="v.cardNumber" class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ v.cardNumber }}
</text>
</view>
<view class="underline sub-text-28 color-#fbddb0!"
@tap.stop="router.jump('/pages/wallet/recharge', { id: v.id })">
去充值
<view class="flex-row-center">
<text class="second-text-28">卡号: {{ v.cardNumber }}</text>
</view>
<text class="second-text-50 iconfont icon-fuzhi" />
</view>
<view class="flex-row items-center justify-between m-t-30rpx">
<text class="main-text-32 color-#fbddb0!">
余额 ¥{{ hooks.useMoney(v.balance) }}
<view class="h-1px m-t-10rpx bg-#999 bg-opacity-5" />
</view>
<view class="flex-row items-center justify-between m-t-10rpx">
<view class="flex-row items-center">
<image class="size-50rpx rounded-full" :src="v.walletIcon" mode="aspectFill" />
<text class="m-l-25rpx sub-text-28">
{{ v.walletTypeStr }}
</text>
<text v-if="v.walletTypeCode == 1 && !v.cardNumber"
class="iconfont icon-bangding color-#fbddb0!" @tap.stop="openBindDialog(v)" />
<text v-if="v.walletTypeCode == 1 && v.cardNumber" class="iconfont icon-jiebang color-#fbddb0!"
@tap.stop="openFreezeDialog(v)" />
</view>
<view v-if="v.cardNumber">
<tm-tag v-if="v.checkFreezeStatus == 1" size="s" color="info">冻结审核中</tm-tag>
<slot v-else>
<tm-tag v-if="!v.isFreeze" size="s" color="success">正常</tm-tag>
<tm-tag v-else size="s" color="error">已冻结</tm-tag>
</slot>
</view>
</view>
<view class="flex-row items-center justify-between m-t-10rpx">
<text class="sub-text-40 color-red!">
¥{{ hooks.useMoney(v.balance) }}
</text>
</view>
<view class="flex-row items-center justify-end space-x-20rpx m-t-10rpx">
<view v-if="v.walletTypeCode == 1 && !v.cardNumber" class="botder_btn"
@tap.stop="openBindDialog(v)">
绑定
</view>
<view v-if="v.walletTypeCode == 1 && v.cardNumber && v.checkFreezeStatus != 1" class="botder_btn"
@tap.stop="openFreezeDialog(v)">
申请冻结
</view>
<view class="botder_btn" @tap.stop="router.jump('/pages/wallet/recharge', { id: v.id })">
去充值
</view>
</view>
</view>
</z-paging>
</crud-layout>
<tm-drawer z-index="100" v-model:show="state.showBindDialog" :overlayClick="false" title="绑定饭卡" :show-close="true"
position="bottom" size="40%">
<view class="h-50rpx" />
+15 -27
View File
@@ -8,16 +8,16 @@ import { walletApi, payApi } from "@@/api"
const data = {
payType: [
{ text: "模拟支付", disabled: false, type: 0, value: "mock" },
{ text: "微信支付", disabled: true, type: 1, value: "wx_pub" },
{ text: "支付宝支付", disabled: true, type: 2, value: "alipay_wap" },
{ text: "模拟支付", disabled: false, type: "0", value: "mock" },
{ text: "微信支付", disabled: true, type: "1", value: "wx_pub" },
{ text: "支付宝支付", disabled: true, type: "2", value: "alipay_wap" },
]
}
const state = reactive<any>({
walletId: null,
currentPayType: 0,
currentRecharge: -1,
currentPayType: "0",
currentRecharge: 0,
userInfo: {},
detail: {},
rechargeList: []
@@ -35,7 +35,7 @@ onShow(() => {
})
const getDetail = async () => {
const _pa = { walletTypeId: state.walletId }
const _pa = { walletId: state.walletId }
const { data } = await walletApi.detail(_pa)
state.detail = data
}
@@ -98,12 +98,16 @@ const doPay = async () => {
<view class="h-30rpx" />
<view class="flex-row items-center justify-between h-120rpx p-x-30rpx bg-#222222 rounded-20rpx">
<view class="flex-row items-center">
<image class="w-52rpx h-52rpx" src="/static/icon/vip.png" mode="aspectFill" />
<text class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ state.detail.walletTypeStr }}
</text>
<view class="flex-row-center size-60rpx bg-white rounded-full">
<image class="size-50rpx rounded-full" :src="state.detail.walletIcon" mode="aspectFill" />
</view>
<view class="flex-row-center">
<view class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ state.detail.walletTypeStr }}
</view>
</view>
</view>
<view class="main-text-28 color-#fbddb0!">
<view class="main-text-30 color-#fbddb0!">
¥{{ hooks.useMoney(state.detail.balance) }}
</view>
</view>
@@ -130,22 +134,6 @@ const doPay = async () => {
</template>
<style lang="scss" scoped>
.prefix_title {
font-size: 28rpx;
font-weight: 800;
color: #333;
&::before {
content: '';
display: inline-block;
width: 8rpx;
height: 24rpx;
background: #0094ff;
border-radius: 4rpx;
margin-right: 10rpx;
}
}
.recharge_item_active {
background: #e9f5fe;
border: 1px solid #e9f5fe !important;
+27
View File
@@ -10,6 +10,15 @@ export default {
showLoading: false,
},
}),
foreignDetail: (params: any) =>
request({
url: "pay/foreign-ticket/get-detail",
method: "GET",
params,
custom: {
showLoading: false,
},
}),
foreignItems: (params: any) =>
request({
url: "pay/foreign-ticket/get-items",
@@ -37,6 +46,24 @@ export default {
showLoading: false,
},
}),
strideDetail: (params: any) =>
request({
url: "pay/stride-dept/get-detail",
method: "GET",
params,
custom: {
showLoading: false,
},
}),
strideItems: (params: any) =>
request({
url: "pay/stride-dept/get-items",
method: "GET",
params,
custom: {
showLoading: false,
},
}),
strideApply: (data: any) =>
request({
url: "pay/stride-dept/apply",
+1 -1
View File
@@ -3,7 +3,7 @@ import request from "@/sheep/utils/request";
export default {
page: (params: any) =>
request({
url: `/food/api/selectTimeFood`,
url: `/food/api/page`,
method: "GET",
params,
custom: {
+13 -2
View File
@@ -2,11 +2,11 @@ import request from "@/sheep/utils/request";
export default {
// 获得支付订单
getOrder: (id, sync) => {
getOrder: (params) => {
return request({
url: "/pay/order/get",
method: "GET",
params: { id, sync },
params,
});
},
// 提交支付订单
@@ -39,4 +39,15 @@ export default {
},
});
},
// 退款
refundHardwareOrder: (params) => {
return request({
url: "/hardware/order/refund",
method: "GET",
params,
custom: {
showLoading: false,
},
});
},
};
@@ -0,0 +1,330 @@
<template>
<view class="waterfalls-flow">
<view v-for="(item, index) in data.column" :key="index" class="waterfalls-flow-column"
:id="`waterfalls_flow_column_${index + 1}`" :msg="msg"
:style="{ 'width': w, 'margin-left': index == 0 ? 0 : m }">
<view :class="['column-value', { 'column-value-show': item2.o }]"
v-for="(item2, index2) in columnValue(index)" :key="index2" :style="[s1]"
@click.stop="wapperClick(item2)">
<view class="inner" v-if="data.seat == 1">
<!-- #ifdef MP-WEIXIN -->
<!-- #ifdef VUE2 -->
<slot name="slot{{item2.index}}"></slot>
<!-- #endif -->
<!-- #ifdef VUE3 -->
<slot :name="`slot${item2.index}`"></slot>
<!-- #endif -->
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<slot v-bind="item2"></slot>
<!-- #endif -->
</view>
<image
:class="['img', { 'img-hide': item2[hideImageKey] == true || item2[hideImageKey] == 1 }, { 'img-error': !item2[data.imageKey] }]"
:src="item2[data.imageKey]" mode="widthFix" @load="imgLoad(item2, index + 1)"
@error="imgError(item2, index + 1)" @click.stop="imageClick(item2)"></image>
<view class="inner" v-if="data.seat == 2">
<!-- #ifdef MP-WEIXIN -->
<!-- #ifdef VUE2 -->
<slot name="slot{{item2.index}}"></slot>
<!-- #endif -->
<!-- #ifdef VUE3 -->
<slot :name="`slot${item2.index}`"></slot>
<!-- #endif -->
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<slot v-bind="item2"></slot>
<!-- #endif -->
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
value: Array,
column: { // 列的数量
type: [String, Number],
default: 2
},
maxColumn: { // 最大列数
type: [String, Number],
default: 5
},
columnSpace: { // 列之间的间距 百分比
type: [String, Number],
default: 2
},
imageKey: { // 图片key
type: [String],
default: 'image'
},
hideImageKey: { // 隐藏图片key
type: [String],
default: 'hide'
},
seat: { // 文本的位置,1图片之上 2图片之下
type: [String, Number],
default: 2
},
listStyle: { // 单个展示项的样式:eg:{'background':'red'}
type: Object
}
},
data() {
return {
data: {
list: this.value ? this.value : [],
column: this.column < 2 ? 2 : this.column,
columnSpace: this.columnSpace <= 5 ? this.columnSpace : 5,
imageKey: this.imageKey,
seat: this.seat
},
msg: 0,
listInitStyle: {
'border-radius': '12rpx',
'margin-bottom': '20rpx',
'background-color': '#fff'
},
adds: [], //预置数据
isLoaded: true,
curIndex: 0,
isRefresh: true,
flag: false,
refreshDatas: []
}
},
computed: {
// 计算列宽
w() {
const column_rate = `${100 / this.data.column - (+this.data.columnSpace)}%`;
return column_rate;
},
// 计算margin
m() {
const column_margin = `${(100 - (100 / this.data.column - (+this.data.columnSpace)).toFixed(5) * this.data.column) / (this.data.column - 1)}%`;
return column_margin;
},
// list样式
s1() {
return { ...this.listInitStyle, ...this.listStyle };
}
},
created() {
// 初始化
this.refresh();
},
methods: {
// 预加载图片
loadImages(idx = 0) {
let count = 0;
const newList = this.data.list.filter((item, index) => index >= idx);
for (let i = 0; i < newList.length; i++) {
// #ifndef APP-PLUS
uni.getImageInfo({
src: `${newList[i][this.imageKey]}.jpg`,
complete: res => {
count++;
if (count == newList.length) this.initValue(idx);
}
})
// #endif
// #ifdef APP-PLUS
plus.io.getImageInfo({
src: `${newList[i][this.imageKey]}.jpg`,
complete: res => {
count++;
if (count == newList.length) this.initValue(idx);
}
})
// #endif
}
},
// 刷新
refresh() {
if (!this.isLoaded) {
this.refreshDatas = this.value;
return false;
};
setTimeout(() => {
this.refreshDatas = [];
this.isRefresh = true;
this.adds = [];
this.data.list = this.value ? this.value : [];
this.data.column = this.column < 2 ? 2 : this.column >= this.maxColumn ? this.maxColumn : this.column;
this.data.columnSpace = this.columnSpace <= 5 ? this.columnSpace : 5;
this.data.imageKey = this.imageKey;
this.data.seat = this.seat;
this.curIndex = 0;
// 每列的数据初始化
for (let i = 1; i <= this.data.column; i++) {
this.data[`column_${i}_values`] = [];
this.msg++;
}
this.$nextTick(() => {
this.initValue(this.curIndex, 'refresh==>');
})
}, 1)
},
columnValue(index) {
return this.data[`column_${index + 1}_values`];
},
change(newValue) {
for (let i = 0; i < this.data.list.length; i++) {
const cv = this.data[`column_${this.data.list[i].column}_values`];
for (let j = 0; j < cv.length; j++) {
if (newValue[i] && i === cv[j].index) {
this.data[`column_${this.data.list[i].column}_values`][j] = Object.assign(cv[j], newValue[i]);
this.msg++;
break;
}
}
}
},
getMin(a, s) {
let m = a[0][s];
let mo = a[0];
for (var i = a.length - 1; i >= 0; i--) {
if (a[i][s] < m) {
m = a[i][s];
}
}
mo = a.filter(i => i[s] == m);
return mo[0];
},
// 计算每列的高度
getMinColumnHeight() {
return new Promise(resolve => {
const heightArr = [];
for (let i = 1; i <= this.data.column; i++) {
const query = uni.createSelectorQuery().in(this);
query.select(`#waterfalls_flow_column_${i}`).boundingClientRect(data => {
heightArr.push({ column: i, height: data.height });
}).exec(() => {
if (this.data.column <= heightArr.length) {
resolve(this.getMin(heightArr, 'height'));
}
});
}
})
},
async initValue(i, from) {
this.isLoaded = false;
if (i >= this.data.list.length || this.refreshDatas.length) {
this.msg++;
this.loaded();
return false;
}
const minHeightRes = await this.getMinColumnHeight();
const c = this.data[`column_${minHeightRes.column}_values`];
this.data.list[i].column = minHeightRes.column;
c.push({ ...this.data.list[i], cIndex: c.length, index: i, o: 0 });
this.msg++;
},
// 图片加载完成
imgLoad(item, c) {
const i = item.index;
item.o = 1;
this.$set(this.data[`column_${c}_values`], item.cIndex, JSON.parse(JSON.stringify(item)));
this.initValue(i + 1);
},
// 图片加载失败
imgError(item, c) {
const i = item.index;
item.o = 1;
item[this.data.imageKey] = null;
this.$set(this.data[`column_${c}_values`], item.cIndex, JSON.parse(JSON.stringify(item)));
this.initValue(i + 1);
},
// 渲染结束
loaded() {
if (this.refreshDatas.length) {
this.isLoaded = true;
this.refresh();
return false;
}
this.curIndex = this.data.list.length;
if (this.adds.length) {
this.data.list = this.adds[0];
this.adds.splice(0, 1);
this.initValue(this.curIndex);
} else {
if (this.data.list.length) this.$emit('loaded');
this.isLoaded = true;
this.isRefresh = false;
}
},
// 单项点击事件
wapperClick(item) {
this.$emit('wapperClick', item);
},
// 图片点击事件
imageClick(item) {
this.$emit('imageClick', item);
}
},
watch: {
value: {
deep: true,
handler(newValue, oldValue) {
setTimeout(() => {
this.$nextTick(() => {
if (this.isRefresh) return false;
if (this.isLoaded) {
// if (newValue.length <= this.curIndex) return this.refresh();
if (newValue.length <= this.curIndex) return this.change(newValue);
this.data.list = newValue;
this.$nextTick(() => {
this.initValue(this.curIndex, 'watch==>');
})
} else {
this.adds.push(newValue);
}
})
}, 10)
}
},
column(newValue) {
this.refresh();
}
}
}
</script>
<style lang="scss" scoped>
.waterfalls-flow {
overflow: hidden;
&-column {
float: left;
}
}
.column-value {
width: 100%;
font-size: 0;
overflow: hidden;
transition: opacity .4s;
opacity: 0;
&-show {
opacity: 1;
}
.inner {
font-size: 30rpx;
}
.img {
width: 100%;
&-hide {
display: none;
}
&-error {
background: #f2f2f2 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAiAQMAAAAatXkPAAAABlBMVEUAAADMzMzIT8AyAAAAAXRSTlMAQObYZgAAAIZJREFUCNdlzjEKwkAUBNAfEGyCuYBkLyLuxRYW2SKlV1JSeA2tUiZg4YrLjv9PGsHqNTPMSAQuyAJgRDHSyvBPwtZoSJXakeJI9iuRLGDygdl6V0yKDtyMAeMPZySj8yfD+UapvRPj2JOwkyAooSV5IwdDjPdCPspe8LyTl9IKJvDETKKRv6vnlUasgg0fAAAAAElFTkSuQmCC) no-repeat center center;
}
}
}
</style>
+4
View File
@@ -1,7 +1,11 @@
export * from "./use-copy";
export * from "./use-enum";
export * from "./use-img";
export * from "./use-page";
export * from "./use-phone";
export * from "./use-unit";
+5
View File
@@ -0,0 +1,5 @@
export const useCopy = async (str: string | undefined) => {
if (str == undefined) return;
const res = await uni.setClipboardData({ data: str });
uni.showToast({ title: "复制成功", icon: "none" });
};
+4
View File
@@ -0,0 +1,4 @@
export const useMakePhoneCall = (str: string | undefined) => {
if (str == undefined) return;
uni.makePhoneCall({ phoneNumber: str });
};
+15 -11
View File
@@ -1,9 +1,9 @@
@font-face {
font-family: "iconfont";
/* Project id 4740692 */
src: url('//at.alicdn.com/t/c/font_4740692_o39uyvhjlur.woff2?t=1731367840461') format('woff2'),
url('//at.alicdn.com/t/c/font_4740692_o39uyvhjlur.woff?t=1731367840461') format('woff'),
url('//at.alicdn.com/t/c/font_4740692_o39uyvhjlur.ttf?t=1731367840461') format('truetype');
src: url('//at.alicdn.com/t/c/font_4740692_dlzhw41ofij.woff2?t=1731448556379') format('woff2'),
url('//at.alicdn.com/t/c/font_4740692_dlzhw41ofij.woff?t=1731448556379') format('woff'),
url('//at.alicdn.com/t/c/font_4740692_dlzhw41ofij.ttf?t=1731448556379') format('truetype');
}
.iconfont {
@@ -14,6 +14,18 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-fuzhi:before {
content: "\e8b0";
}
.icon-caipu:before {
content: "\e600";
}
.icon-erweima:before {
content: "\e7c1";
}
.icon-biaoqianlanicon_gouwuche-xuanzhong:before {
content: "\e61c";
}
@@ -38,14 +50,6 @@
content: "\e64e";
}
.icon-jiebang:before {
content: "\ee1e";
}
.icon-bangding:before {
content: "\ee1f";
}
.icon-youjiantou:before {
content: "\e928";
}
+2 -2
View File
@@ -1,6 +1,6 @@
export {}
export {};
declare module "vue" {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {}
}
}
+4 -7
View File
@@ -26,16 +26,13 @@ export default {
theme: {
colors: {
blue: {
60: "#f1f7ff",
1000: "#1777FF",
DEFAULT: "#0094ff",
},
red: {
60: "#fef2f2",
1000: "'#F02828'",
DEFAULT: "#f63a36",
},
yellow: {
60: "#fffaf1",
1000: "'#F2A817'",
DEFAULT: "#F2A817",
},
},
},
@@ -63,7 +60,7 @@ export default {
([, d]) => ({
"font-size": `${d}rpx`,
"font-weight": 500,
color: "#c4c4c4",
color: "#999",
"line-height": `1.4em`,
}),
],