From c4d77059b31c5f0c309ff5e4b287313040dfc98c Mon Sep 17 00:00:00 2001 From: luo <17530855@qq.com> Date: Tue, 16 Apr 2024 09:49:13 +0800 Subject: [PATCH] 中奖提示组件 --- components/show_encourage/show_encourage.js | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ components/show_encourage/show_encourage.json | 4 ++++ components/show_encourage/show_encourage.wxml | 5 +++++ components/show_encourage/show_encourage.wxss | 20 ++++++++++++++++++++ 4 files changed, 102 insertions(+), 0 deletions(-) create mode 100644 components/show_encourage/show_encourage.js create mode 100644 components/show_encourage/show_encourage.json create mode 100644 components/show_encourage/show_encourage.wxml create mode 100644 components/show_encourage/show_encourage.wxss diff --git a/components/show_encourage/show_encourage.js b/components/show_encourage/show_encourage.js new file mode 100644 index 0000000..1e70c70 --- /dev/null +++ b/components/show_encourage/show_encourage.js @@ -0,0 +1,73 @@ +// components/show_encourage/show_encourage.js +var setting = getApp().globalData.setting + +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + url: setting.imghost, + show:false, + itemobj:null, + }, + pageLifetimes: { + show: function() { + // console.error('show'); + // this.get_encourage() + // 页面被展示 + }, + hide: function() { + // 页面被隐藏 + }, + resize: function(size) { + // 页面尺寸变化 + } + }, + /** + * 组件的方法列表 + */ + methods: { + async get_encourage(){ + let user_id = getApp().globalData.user_id; + let store_id= getApp().globalData.setting.stoid + console.error('获取大转盘'); + if (!user_id) { + return + } + await getApp().request.promiseGet(`/api/weshop/marketing/marketingLuckForm/getPayTopLuckInfo/${store_id}/${user_id}`, {}).then(res => { + if (res.data.code==0 && res.data.data) { + let gd_category = res.data.data; + this.setData({ + itemobj: gd_category, + show:true, + }); + } + }) + }, + close_disgraceful(){ + this.setData({ + show:false + }) + }, + goto(){ + let item = this.data.itemobj + let id = item.id; + let title = item.act_name; + if (!id) { + this.setData({ + show:false + }) + return + } + let url = `/packageB/pages/luckactivity/luckinfo/luckinfo?id=${id}&title=${title}`; + getApp().goto(url); + } + } +}) diff --git a/components/show_encourage/show_encourage.json b/components/show_encourage/show_encourage.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/show_encourage/show_encourage.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/show_encourage/show_encourage.wxml b/components/show_encourage/show_encourage.wxml new file mode 100644 index 0000000..a4f0897 --- /dev/null +++ b/components/show_encourage/show_encourage.wxml @@ -0,0 +1,5 @@ + + + + + diff --git a/components/show_encourage/show_encourage.wxss b/components/show_encourage/show_encourage.wxss new file mode 100644 index 0000000..4a57bc6 --- /dev/null +++ b/components/show_encourage/show_encourage.wxss @@ -0,0 +1,20 @@ +/* components/show_encourage/show_encourage.wxss */ + +.encourage{ + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 99999; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: rgba(0, 0, 0, .3); +} +.close { + width: 60rpx; + height: 60rpx; + +} \ No newline at end of file -- libgit2 0.21.4