12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- Component({
- properties: {
- show:{
- type: Boolean,
- observer: function (newVal) {
- this.setData({ show: newVal });
- this.statusToView()
- }
- },
- status:{
- type: Number,
- observer: function (newVal) {
- this.setData({ status: newVal });
- }
- },
- theam:{
- type: String,
- value:'redContent',
- observer: function (newVal) {
- this.setData({ theam: newVal });
- }
- }
- },
- data: {
- show:false,
- status:1,
- info:{
- imgsrc:'',
- art:''
- },
- theam:''
- },
- methods: {
- // 通过状态判断显示效果
- statusToView(){
- let url='',str='',that= this;
- switch (this.data.status) {
- case 0: //未开始
- url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830185869027775.png';
- str='活动尚未开始,先去积累抽奖机会吧!'
- break;
- case 4: //已结束
- url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830371608071320.png';
- str='本次大转盘已结束,下次早点来参与~'
- break;
- case 3: //机会不足
- url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830429832090767.png';
- str='您的转盘机会不够了,去获取更多机会吧!'
- break;
- case 2: //无奖品
- url = 'http://img.bbztx.com/image_test/upload/thumbs/20210304/logo/1614830481202038339.png';
- str='您来晚了一步,奖品已派完'
- break;
- }
- this.setData({
- 'info.imgsrc':url,
- 'info.art':str
- })
- },
- // 获取更多机会
- getMoreChange(){
- this.triggerEvent("getMoreChange");
- },
- // 关闭弹窗
- closeTip(e){
- this.close(e.detail)
- },
- // 确定
- closePopup(){
- this.close(false)
- },
- close(data){
- this.triggerEvent("close", {
- status:data,
- type:'table'
- });
- }
- }
- })
|