|
- // components/advertisement.js
- const Http = require("../../utils/HttpBasics");
- var config = require("../../config/config.js");
- Component({
- properties: {
- ggdata: {
- type: Object,
- value: {}
- }
- },
- data: {
- flag: false,
- alphaData: null,
- gameUrl: ''
- },
- methods: {
- gotoGg: function (e) {
- let that = this;
- Http.get({
- url: config.api.checkPhoneStatus,
- data: {}
- })
- .then(res => {
- console.log(e.currentTarget.dataset)
- wx.navigateTo({
- url: '/pages/coupon/detail/index?couponChannelId=' + e.currentTarget.dataset.data.produceId ,
- })
- })
- .catch(err => {
- if (err.code == 11005) {
- // 用户手机未授权
- /**
- * 将值传到用户手机号授权的页面
- *
- */
- wx.redirectTo({
- url: "/pages/getphoneInfo/index?path=index&pagePath=" + e.currentTarget.dataset.data.pagePath + "&id=" + e.currentTarget.dataset.data.id + "&couponChannelId=" + e.currentTarget.dataset.data.produceId
- });
- } else if (err.code == 11006) {
- // 用户手机已加密
- wx.redirectTo({
- url: "/pages/phoneinput/phoneinput?path=index&pagePath=" + e.target.dataset.data.pagePath + "&id=" + e.currentTarget.dataset.data.id + "&couponChannelId=" + e.currentTarget.dataset.data.produceId
- });
- } else {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- });
- }
- })
- },
- a: function () {
- this.setData({ flag: false })
- },
- closeGg: function () {
- let that = this;
- var animation = wx.createAnimation({})
- // animation.opacity(0).step({ duration: 1000 })
- setTimeout(function () {
- that.setData({ flag: true })
- }, 500)
- animation.rotateZ(180).scale(0).opacity(0.5).step({ duration: 1000 })
- that.setData({ alphaData: animation.export() });
- },
- },
- });
|