提交 0a2e53c5 编写于 作者: zhangzhiwei's avatar zhangzhiwei

.

上级 227b065b
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
}, },
}) })
const that = reactive({ const that = reactive({
temId:null,
inited:false, inited:false,
temMuneId:null, temMuneId:null,
good: { good: {
...@@ -135,7 +136,9 @@ ...@@ -135,7 +136,9 @@
if (!data||!data.hasNextPage){ if (!data||!data.hasNextPage){
that.good.finished = true that.good.finished = true
} }
if(that.temId==that.temMuneId){
that.good.list.push(...data.list) that.good.list.push(...data.list)
}
}) })
.catch(() => { .catch(() => {
that.good.fail = true that.good.fail = true
...@@ -150,6 +153,7 @@ ...@@ -150,6 +153,7 @@
if(res.benDiMenu&&res.benDiMenu.length>0){ if(res.benDiMenu&&res.benDiMenu.length>0){
that.getList(res.benDiMenu[0].id) that.getList(res.benDiMenu[0].id)
that.temMuneId=res.benDiMenu[0].id that.temMuneId=res.benDiMenu[0].id
that.temId=res.benDiMenu[0].id
} }
}) })
}, },
...@@ -161,10 +165,13 @@ ...@@ -161,10 +165,13 @@
pageSize: 20, pageSize: 20,
link: uni.getStorageSync("subdomain") ? uni.getStorageSync("subdomain") : 'alisa' link: uni.getStorageSync("subdomain") ? uni.getStorageSync("subdomain") : 'alisa'
}).then((data: any) => { }).then((data: any) => {
if(that.temId==menuId){
that.good.list=data.list that.good.list=data.list
}
}) })
}, },
onChange: (e) => { onChange: (e) => {
that.temId=e
that.good.page=1 that.good.page=1
that.good.list=[] that.good.list=[]
that.getList(e) that.getList(e)
......
<template> <template>
<view class="bg-max bg-gray" style="background: #ffffff;height: 100vh"> <view class="bg-max bg-gray" style="background: #ffffff;height: 100vh">
<van-sticky> <van-sticky>
<view class="justify-center bg-white sh pd-px-20 mg-b-20"> <view class="justify-center bg-white sh pd-px-20 mg-b-20" >
<van-icon class="top-left" name="arrow-left" @tap="goBack" /> <van-icon class="top-left" name="arrow-left" @tap="goBack" />
<view class="top-center">店铺名片</view> <view class="top-center">店铺名片</view>
</view> </view>
</van-sticky> </van-sticky>
<view style="margin: 20rpx 30rpx"> <view id="aa" style="position: relative;margin: 20rpx 30rpx">
<van-image src="../../static/haibao1.png"/> <van-image src="../../static/haibao1.png"/>
<!--<view style="position: absolute;top: 120px;left: 450rpx">-->
<!--<van-image src="../../static/img/dz/jyx-logo.jpg" alt=""/>-->
<!--</view>-->
</view> </view>
<!--<view style="margin: 20rpx 30rpx">-->
<!--<img :src="state.temIMg" alt="" style="width: 100%">-->
<!--</view>-->
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { reactive } from 'vue';
const state = reactive({
temIMg:''
})
import html2Canvas from "html2canvas"
import { PageUtils } from '@/utils/utils'; import { PageUtils } from '@/utils/utils';
function goBack() { function goBack() {
PageUtils.goBack() PageUtils.goBack()
} }
// 再画卡片
function drawBg() {
const ctx = uni.createCanvasContext('cardbg')
ctx.drawImage('../../static/haibao1.png', 0, 0, 320, 314)
ctx.draw()
// 等待1s画完卡片
setTimeout(() => {
const cardDom = document.getElementById("aa")
if (!cardDom) return
html2Canvas(cardDom, { useCORS: false }).then(canvas => {
state.temIMg=canvas.toDataURL("image/png")
})
}, 500);
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册