123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <template>
- <div>
- <div class="tabbar" :class="{dark: handleType}">
- <div
- class="tabbarItem"
- @click="handleItem(item, index)"
- :class="{ activeMenu: active == index }"
- v-for="(item, index) in list"
- :key="index"
- >
- <div :class="{ aotoImg: index == 2 }">
- <img
- :src="active == index ? item.active : handleType ? item.dark : item.light"
- :width="index == 2 ? '50px' : '48px'"
- :height="index == 2 ? '50px' : '48px'"
- ></img>
- </div>
- <div class="hightImg" v-show="active == index">
- <img
- src="/static/img/icon_active@2x.png"
- width="68px"
- height="81px"
- ></img>
- </div>
- <div class="tabbarItemText" :class="{ active: active == index }">{{
- item.name
- }}</div>
- </div>
- </div>
- <van-popup
- closeIconPos="bottom-right"
- v-model="show"
- position="center"
- round
- bgColor="transparent"
- style="background: transparent"
- @close="close"
- @open="open"
- >
- <div class="codeData" ref="downDiv">
- <div class="close" @click="close">
- <img
- width="42px"
- height="42px"
- src="/static/img/icon_cancel@2x.png"
- ></img>
- </div>
- <div class="text">
- <img
- width="100%"
- height="185px"
- src="https://4dscene.4dage.com/new4dkk/v2/lang/images/solutions/government/survey1.png"
- ></img>
- <div class="text-center pt-20px pb-8px text-2xl">一花五叶</div>
- <img
- width="100%"
- height="10px"
- src="https://4dscene.4dage.com/new4dkk/deng/static/img/line@2x.png"
- ></img>
- <div class="codeDataText">
- 此灯组以禅宗“一花五叶”为主题,传承禅宗经典。您可欣赏花开五叶的意象,感受南宗禅衍化出临济、曹洞、法眼、沩仰和云门五家,发展壮大的辉煌历史,领悟慧能大师法脉的深邃智慧。
- </div>
- <div class="codeImg flex justify-end items-center">
- <div class="qrcode" ref="qrCodeUrl1"></div>
- <div class="qrcode" ref="qrCodeUrl2"></div>
- </div>
- </div>
- </div>
- <div class="codebutList">
- <!-- <div class="downText" v-if="false">
- <div class="img flex justify-center items-center">
- <div style="width: 36px; height: 36px">
- <img
- width="36px"
- height="36px"
- src="https://4dscene.4dage.com/new4dkk/deng/static/img/icon_download@2x.png"
- ></img>
- </div>
- <div class="pl-10">下载图片</div>
- </div>
- <div class="tips">完成6处打卡,即可点灯祈愿</div>
- </div> -->
- <div class="downButtom flex justify-center">
- <div class="downButtomItem" @click="handleDown">下载图片</div>
- <div class="downButtomItem" @click="handleqiyuan">去祈愿</div>
- </div>
- </div>
- </van-popup>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex'
- import QRCode from 'qrcodejs2'
- let wx = window.wx
- // import QiyanQrcode from '@/components/qiyan-qrcode/qiyan-qrcode.vue'
- // import uButton from "udiv-ui/components/u-button/u-button.vue";
- export default {
- components: {
- // QiyanQrcode
- },
- data() {
- return {
- show: false,
- qrcode1: null,
- qrcode2: null,
- title1: '1.现在时间戳:' + Date.now(),
- list: [
- {
- active: '/static/img/icon_home_active.png',
- dark: '/static/img/icon_home_dark.png',
- light: '/static/img/icon_home_light.png',
- name: '首页',
- path: '/home'
- },
- {
- active: '/static/img/icon_scan_active@2x.png',
- dark: '/static/img/icon_scan_dark@2x.png',
- light: '/static/img/icon_scan_light@2x.png',
- name: '扫码打卡'
- },
- {
- active: '/static/img/icon_map_active@2x.png',
- dark: '/static/img/icon_map_dark@2x.png',
- light: '/static/img/icon_map_light@2x.png',
- name: '地图',
- path: '/map'
- },
- {
- active: '/static/img/icon_ai_active@2x.png',
- dark: '/static/img/icon_ai_dark@2x.png',
- light: '/static/img/icon_ai_light@2x.png',
- name: '妙笔生花',
- path: '/composite'
- },
- {
- active: '/static/img/icon_lotus_active@2x.png',
- dark: '/static/img/icon_lotus_dark@2x.png',
- light: '/static/img/icon_lotus_light@2x.png',
- name: '点亮',
- path: '/prayers/clocked'
- },
- // {
- // active: '/static/img/icon_user_active@2x.png',
- // dark: '/static/img/icon_user_dark@2x.png',
- // light: '/static/img/icon_user_light@2x.png',
- // name: '我的',
- // path: '/my'
- // }
- ],
- title: 'Hello'
- }
- },
- computed: {
- ...mapState('home', ['active']),
- handleType() {
- return this.$route.name == 'PrayersClocked'? true : false
- }
- },
- watch: {
- $route(to, from) {
- let path = to.path
- console.log('handleItem', path)
- this.list.map((item, index) => {
- if (to.path == item.path) {
- this.$store.commit('home/changeActive', index)
- }
- })
- }
- },
- mounted() {
- // let path = this.$route.path
- // this.list.map((item, index) => {
- // if (path == item.path) {
- // console.log('path', path, item, index)
- // this.$store.commit('home/changeActive', index)
- // }
- // })
- },
- methods: {
- handleItem(item, index) {
- console.log('handleItem', item, index)
- let that = this
- if (item.name == '扫码打卡') {
- // 只允许通过相机扫码
- // uni.scanCode({
- // onlyFromCamera: true,
- // success: function (res) {
- // console.log('条码类型:' + res.scanType)
- // console.log('条码内容:' + res.result)
- // wx.miniProgram.postMessage({ data: { foo: 'scanCode', type: 'tabbar' } })
- wx.miniProgram.navigateTo({
- url: '/pages/my/index?scanCode=true'
- })
- // that.show = true
- // that.$store.commit('home/changeActive', index)
- // setTimeout(() => {
- // this.creatQrCode()
- // }, 200)
- // },
- // fail: function (e) {
- // console.log('扫码失败', e)
- // that.show = true
- // }
- // })
- return
- }else if (item.name == '我的') {
- this.$store.commit('home/changeActive', 4)
- wx.miniProgram.navigateTo({
- url: '/pages/my/index',
- active: 4
- })
- return
- }
- console.log('handleItem', item, index, this.active)
- if(this.active == index) return
- // that.$store.commit('home/changeActive', index)
- if (item.path) {
- this.$router.push(item.path)
- }
- },
- handleHome() {
- console.log('开启云上观灯', uni)
- // uni.$u.route('/pages/home/home')
- },
- handleDown() {
- this.$store.dispatch('home/saveImage', this.$refs.downDiv)
- },
- handleqiyuan() {
- this.show = false
- this.$router.push('/prayers/list')
- },
- close() {
- console.log('close', this.qrcode1, this.qrcode2)
- this.show = false
- // console.log('close');
- },
- open() {},
- creatQrCode() {
- if (this.qrcode1) {
- this.qrcode1 && this.qrcode1.clear() //清除二维码
- this.qrcode2 && this.qrcode2.clear() //清除二维码
- this.qrcode1.makeCode('xxxxx')
- this.qrcode2.makeCode('ssssss')
- } else {
- this.qrcode1 = new QRCode(this.$refs.qrCodeUrl1, {
- text: 'xxxx', // 需要转换为二维码的内容
- width: 72,
- height: 72,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.H
- })
- this.qrcode2 = new QRCode(this.$refs.qrCodeUrl2, {
- text: 'xxxx', // 需要转换为二维码的内容
- width: 72,
- height: 72,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.H
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .tabbar {
- display: flex;
- align-items: center;
- justify-content: space-around;
- position: fixed;
- bottom: 0;
- width: 100vw;
- z-index: 1000;
- height: 81px;
- left: 0;
- padding: -2px 0 16px 0;
- background-image: url(https://4dscene.4dage.com/new4dkk/deng/static/img/menu_light@2x.png);
- background-size: 100% 100%;
- background-repeat: no-repeat;
- .tabbarbg {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- }
- .tabbarItem {
- text-align: center;
- width: 50px;
- font-weight: 400;
- font-size: 11px;
- color: #303030;
- line-height: 13px;
- text-align: center;
- position: relative;
- z-index: 1;
- .hightImg {
- position: absolute;
- z-index: 2;
- top: 0;
- left: -10px;
- }
- .aotoImg {
- position: relative;
- top: -5px;
- }
- }
- }
- .dark {
- background-image: url(https://4dscene.4dage.com/new4dkk/deng/static/img/menu_dark@2x.png);
- .tabbarItem{
- color: #fff;
- }
- }
- .codebutList {
- text-align: center;
- position: relative;
- width: 100%;
- // top: 76px;
- .downText {
- .img {
- margin-right: 10px;
- font-weight: 400;
- font-size: 16px;
- color: #ffffff;
- line-height: 19px;
- text-align: center;
- }
- .tips {
- padding-top: 10px;
- font-weight: 400;
- font-size: 16px;
- color: #a49d94;
- line-height: 19px;
- text-align: center;
- }
- }
- .downButtom {
- .downButtomItem {
- width: 140px;
- height: 42px;
- background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/btn01@2x.png) 100% 100%
- no-repeat;
- background-size: cover;
- font-weight: 400;
- font-size: 16px;
- color: #ffffff;
- line-height: 19px;
- font-style: normal;
- margin: 0 5px;
- line-height: 42px;
- text-align: center;
- }
- }
- }
- .codeData {
- // background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/pop2@2x.png) no-repeat cover;
- background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/pop2@2x.png) 100% 100% no-repeat;
- background-size: 100% 100%;
- width: calc(100vw - 108px);
- height: 490px;
- padding: 48px 52px 30px 36px;
- position: relative;
- .close {
- position: absolute;
- right: -0px;
- top: -0px;
- width: 42px;
- height: 42px;
- }
- .text {
- font-weight: 400;
- font-size: 24px;
- color: #d86332;
- line-height: 29px;
- position: relative;
- padding-bottom: 72px;
- .codeDataText {
- padding: 8px 0 16px 0;
- font-weight: 400;
- font-size: 14px;
- color: #b1967b;
- line-height: 18px;
- text-align: left;
- }
- .codeImg {
- text-align: right;
- width: 100%;
- height: 72px;
- // float: right;
- .qrcode {
- padding: 5px;
- margin: 0 5px;
- background: #fff;
- }
- }
- }
- }
- </style>
|