|
@@ -91,6 +91,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
+ <van-popup
|
|
|
+ closeIconPos="bottom-right"
|
|
|
+ v-model="showOperation"
|
|
|
+ position="center"
|
|
|
+ round
|
|
|
+ @close="czzyclose"
|
|
|
+ bgColor="transparent"
|
|
|
+ style="background: transparent"
|
|
|
+ >
|
|
|
+ <div class="codeData">
|
|
|
+ <div class="close" @click="czzyclose">
|
|
|
+ <img
|
|
|
+ width="42px"
|
|
|
+ height="42px"
|
|
|
+ src="/static/img/icon_cancel@2x.png"
|
|
|
+ ></img>
|
|
|
+ </div>
|
|
|
+ <!-- <van-dialog v-model="showOperation" :width="'calc(100vw - 20px)'" @confirm="handleConfirm" title="操作指引"> -->
|
|
|
+ <img style="width: 100%;" src="https://4dscene.4dage.com/new4dkk/deng/static/img/czzy.png" />
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -100,7 +121,7 @@ import QRCode from 'qrcodejs2'
|
|
|
import wx from 'weixin-js-sdk'
|
|
|
import { Toast } from 'vant'
|
|
|
import Bus from '@/utils/bus.js'
|
|
|
-
|
|
|
+import { Dialog } from 'vant'
|
|
|
// import QiyanQrcode from '@/components/qiyan-qrcode/qiyan-qrcode.vue'
|
|
|
// import uButton from "udiv-ui/components/u-button/u-button.vue";
|
|
|
export default {
|
|
@@ -110,21 +131,22 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
show: false,
|
|
|
+ showOperation: false,
|
|
|
qrcode1: null,
|
|
|
qrcode2: null,
|
|
|
- codeImg: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
|
|
|
+ codeImg: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01@2x.png',
|
|
|
title1: '1.现在时间戳:' + Date.now(),
|
|
|
- codeListok:[],
|
|
|
- codeList:{
|
|
|
- code1: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
|
|
|
- code2: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/02.png',
|
|
|
- code3: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/04.png',
|
|
|
- code4: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/05.png',
|
|
|
- code5: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/06.png',
|
|
|
- code6: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/07.png',
|
|
|
- code7: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/11.png',
|
|
|
- code8: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/12.png',
|
|
|
- code9: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/13.png',
|
|
|
+ codeListok: [],
|
|
|
+ codeList: {
|
|
|
+ code1: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01@2x.png',
|
|
|
+ code2: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/02@2x.png',
|
|
|
+ code3: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/03@2x.png',
|
|
|
+ code4: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/04@2x.png',
|
|
|
+ code5: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/05@2x.png',
|
|
|
+ code6: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/06@2x.png',
|
|
|
+ code7: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/07@2x.png',
|
|
|
+ code8: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/08@2x.png',
|
|
|
+ code9: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/09@2x.png'
|
|
|
},
|
|
|
list: [
|
|
|
{
|
|
@@ -160,7 +182,7 @@ export default {
|
|
|
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',
|
|
@@ -175,7 +197,7 @@ export default {
|
|
|
computed: {
|
|
|
...mapState('home', ['active']),
|
|
|
handleType() {
|
|
|
- return this.$route.name == 'PrayersClocked'? true : false
|
|
|
+ return this.$route.name == 'PrayersClocked' ? true : false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -200,25 +222,30 @@ export default {
|
|
|
// })
|
|
|
},
|
|
|
methods: {
|
|
|
+ czzyclose(){
|
|
|
+ this.showOperation = false
|
|
|
+ localStorage.setItem('isShow', true)
|
|
|
+ this.handlescanQRCode()
|
|
|
+ },
|
|
|
getloadlist() {
|
|
|
- this.getRequest('/api/wx/getCode').then((res) => {
|
|
|
+ this.getRequest('/api/wx/getCode').then(res => {
|
|
|
this.codeListok = res.data || []
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
handleItem(item, index) {
|
|
|
- let obj = {
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':this.codeList.code1,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':this.codeList.code2,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':this.codeList.code3,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4':this.codeList.code4,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5':this.codeList.code5,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6':this.codeList.code6,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7':this.codeList.code7,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8':this.codeList.code8,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9':this.codeList.code9,
|
|
|
- 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=10':this.codeList.code9,
|
|
|
- };
|
|
|
- // let objclockIn = {
|
|
|
+ let obj = {
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1': this.codeList.code1,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2': this.codeList.code2,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3': this.codeList.code3,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4': this.codeList.code4,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5': this.codeList.code5,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6': this.codeList.code6,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7': this.codeList.code7,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8': this.codeList.code8,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9': this.codeList.code9,
|
|
|
+ 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=10': this.codeList.code9
|
|
|
+ }
|
|
|
+ // let objclockIn = {
|
|
|
// 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':'SG-PHP2F5mD35e',
|
|
|
// 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':'SG-PHP2F5mD35e',
|
|
|
// 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':'SG-PHP2F5mD35e',
|
|
@@ -233,52 +260,9 @@ export default {
|
|
|
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
|
|
|
- // }
|
|
|
- // })
|
|
|
- wx.scanQRCode({
|
|
|
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
- scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
- success: function (res) {
|
|
|
- console.log(res, 'scanQRCode');
|
|
|
- var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
|
|
|
- if(!result || (result && result.indexOf('https://houseoss.4dkankan.com/project/nanHua/index.html') == -1)){
|
|
|
- return Toast('无效二维码')
|
|
|
- }
|
|
|
- if(result == 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=10'){//线下祈福
|
|
|
- that.$router.push('/prayers/list')
|
|
|
- return
|
|
|
- }
|
|
|
- that.show = true;
|
|
|
- that.codeImg = obj[result];
|
|
|
- // that.$store.commit("changeActive", index);
|
|
|
- if(!that.codeListok.includes(result)){
|
|
|
- that.getRequest('/api/wx/clockIn', {code: result}).then(res => {
|
|
|
- Bus.emit('handleItem', result)
|
|
|
- that.getloadlist()
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ that.handleCode()
|
|
|
return
|
|
|
- }else if (item.name == '我的') {
|
|
|
+ } else if (item.name == '我的') {
|
|
|
this.$store.commit('home/changeActive', 4)
|
|
|
wx.miniProgram.navigateTo({
|
|
|
url: '/pages/my/index',
|
|
@@ -287,12 +271,71 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
console.log('handleItem', item, index, this.active)
|
|
|
- if(this.active == index) return
|
|
|
+ if (this.active == index) return
|
|
|
// that.$store.commit('home/changeActive', index)
|
|
|
if (item.path) {
|
|
|
this.$router.push(item.path)
|
|
|
}
|
|
|
},
|
|
|
+ handleConfirm() {
|
|
|
+ this.showOperation = false
|
|
|
+ this.handlescanQRCode()
|
|
|
+ },
|
|
|
+ handlescanQRCode() {
|
|
|
+ console.log('handlescanQRCode')
|
|
|
+ let that = this
|
|
|
+ wx.scanQRCode({
|
|
|
+ needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
|
|
+ scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res, 'scanQRCode')
|
|
|
+ var result = res.resultStr // 当needResult 为 1 时,扫码返回的结果
|
|
|
+ if (
|
|
|
+ !result ||
|
|
|
+ (result &&
|
|
|
+ result.indexOf('https://houseoss.4dkankan.com/project/nanHua/index.html') == -1)
|
|
|
+ ) {
|
|
|
+ return Toast('无效二维码')
|
|
|
+ }
|
|
|
+ if (result == 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=10') {
|
|
|
+ //线下祈福
|
|
|
+ that.$router.push('/prayers/list')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ that.show = true
|
|
|
+ that.codeImg = obj[result] + '?m=' + new Date().getTime()
|
|
|
+ // that.$store.commit("changeActive", index);
|
|
|
+ if (!that.codeListok.includes(result)) {
|
|
|
+ Toast('打卡成功')
|
|
|
+ that.getRequest('/api/wx/clockIn', { code: result }).then(res => {
|
|
|
+ Bus.emit('handleItem', result)
|
|
|
+ that.getloadlist()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Toast('已打卡')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCode() {
|
|
|
+ let that = this
|
|
|
+ let isShow = localStorage.getItem('isShow')
|
|
|
+ if (isShow) {
|
|
|
+ this.handlescanQRCode()
|
|
|
+ } else {
|
|
|
+ this.showOperation = true
|
|
|
+ }
|
|
|
+ // Dialog.confirm({
|
|
|
+ // title: '温馨提示',
|
|
|
+ // message: '是否查看操作指引',
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // that.$router.push('/prayers/operation')
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // that.handlescanQRCode()
|
|
|
+ // });
|
|
|
+ },
|
|
|
handleHome() {
|
|
|
console.log('开启云上观灯', uni)
|
|
|
// uni.$u.route('/pages/home/home')
|
|
@@ -302,7 +345,7 @@ export default {
|
|
|
},
|
|
|
handleqiyuan() {
|
|
|
this.show = false
|
|
|
- this.$router.push('/prayers/list')
|
|
|
+ this.$router.push('/prayers/clocked')
|
|
|
},
|
|
|
close() {
|
|
|
console.log('close', this.qrcode1, this.qrcode2)
|
|
@@ -384,7 +427,7 @@ export default {
|
|
|
}
|
|
|
.dark {
|
|
|
background-image: url(https://4dscene.4dage.com/new4dkk/deng/static/img/menu_dark@2x.png);
|
|
|
- .tabbarItem{
|
|
|
+ .tabbarItem {
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
@@ -446,7 +489,7 @@ export default {
|
|
|
position: absolute;
|
|
|
right: -0px;
|
|
|
top: -0px;
|
|
|
- img{
|
|
|
+ img {
|
|
|
width: 42px;
|
|
|
height: 42px;
|
|
|
}
|