123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- // components/detailsCard/index.js
- import international from '../../international/appointment_scence/index'
- const app = getApp()
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- // 标题
- title: {
- type: String,
- value: '认证信息'
- },
- //单子状态
- status: {
- type: Number,
- value: null
- },
- //内容
- msg: {
- type: Array,
- value: []
- },
- // 语言
- language: {
- type: String,
- value: 'ch'
- },
- userInfo: {
- type: Object,
- value: {}
- },
- //单子信息
- regularList: {
- type: Object,
- value: {}
- },
- isRegular: {
- type: Boolean,
- value: true
- },
- type: {
- type: String,
- },
- clickPage: {
- type: String,
- },
- pageType: {
- type: String
- },
- //通用二维码
- qrCode1: {
- type: String
- },
- //梯控二维码
- qrCode2: {
- type: String
- },
- //时效类型 1-已失效 2-未到时间 3-正常
- qrCodeType: {
- type: Number
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- international: international, //国际化语言包
- imageUrl: '',
- qrCodeOne: null,
- qrCodeTwo: null,
- qrCodeShowType: null, //1已失效2未到时间3允许通行
- recordInfo: {}
- },
- /**
- * 组件的方法列表
- */
- methods: {
- preview(event) {
- let currentUrl = event.currentTarget.dataset.src
- wx.previewImage({
- current: currentUrl,
- urls: [currentUrl]
- })
- },
- },
- observers: {
- 'regularList': function (regularList) {
- if(!regularList) {
- return;
- }
- var {
- imageUrl
- } = this.data;
- switch (regularList.reviewStatus) {
- case 0:
- imageUrl = 'wait'
- break;
- case 1:
- imageUrl = 'reject'
- break;
- case 2:
- imageUrl = 'pass'
- break;
- case 3:
- imageUrl = 'entrance'
- break;
- default:
- break;
- };
- this.setData({
- imageUrl,
- recordInfo: regularList
- })
- },
- 'qrCodeType': function (qrCodeType) {
- this.setData({
- qrCodeShowType: qrCodeType
- })
- },
- 'qrCode1': function(qrCode1) {
- this.setData({
- qrCodeOne: qrCode1
- })
- },
- 'qrCode2': function(qrCode2) {
- this.setData({
- qrCodeTwo: qrCode2
- })
- }
- },
- lifetimes: {
- created: function (e) {
- // 在组件实例刚刚被创建时执行,该节点不能使用this.setData({}),
- },
- ready: function () {
- // 在组件实例进入页面节点树时执行,该节点可以开始使用this,setData({})
- },
- attached: function () {
- // 在组件实例进入页面节点树时执行,该节点可以开始使用
- },
- detached: function () {
- // 移除
- clearInterval(app.data.timer)
- }
- }
- })
|