12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- // components/zyh_card/zyh_card.js
- Component({
- options: {
- observers: true
- },
- /**
- * 组件的属性列表
- */
- properties: {
- // 预约时间-label
- labelTitle: {
- type: String,
- value: "预约时间"
- },
- // 预约时间-value
- valueTitle: {
- type: String,
- value: "****-**-** **:**-**:**"
- },
- // 姓名
- labelName: {
- type: String,
- value: "****: ***"
- },
- // 姓名
- labelPhone: {
- type: String,
- value: "****: ****"
- },
- // 类型
- type: {
- type: Number,
- value: 1
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- classType: "wait",
- text: "待审"
- },
- /**
- * 组件的方法列表
- */
- methods: {
- onClick(e) {
- this.triggerEvent("click")
- },
- //通过类型判断样式
- compareType(type) {
- var classType = "";
- var text = "";
- switch (type) {
- case 0:
- classType = "wait";
- text = "待审";
- break;
- case 2:
- classType = "pass";
- text = "同意";
- break;
- case 1:
- classType = "reject";
- text = "已拒";
- break;
- case 3:
- classType = "entrance";
- text = "入场";
- break;
- default:
- break;
- }
- this.setData({
- classType: classType,
- text: text
- });
- }
- },
- observers: {
- type: function(type) {
- this.compareType(type);
- }
- }
- });
|