You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/unpackage/dist/build/mp-weixin/pages/goods/externalCoupon/externalCoupon.js

1 line
3.9 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods/externalCoupon/externalCoupon"],{3569:function(t,e,n){"use strict";n.r(e);var o=n("6ea6"),a=n("4d9b");for(var i in a)"default"!==i&&function(t){n.d(e,t,(function(){return a[t]}))}(i);n("a432");var u,c=n("f0c5"),r=Object(c["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],u);e["default"]=r.exports},"4d9b":function(t,e,n){"use strict";n.r(e);var o=n("e087"),a=n.n(o);for(var i in o)"default"!==i&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e["default"]=a.a},6719:function(t,e,n){},"6ea6":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t._f("formatDate")(t.salesEndTime,"-"));t.$mp.data=Object.assign({},{$root:{f0:n}})},i=[]},a432:function(t,e,n){"use strict";var o=n("6719"),a=n.n(o);a.a},d24d:function(t,e,n){"use strict";(function(t){n("eba6");o(n("66fd"));var e=o(n("3569"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},e087:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("b528"),a=getApp(),i={data:function(){return{minecoupones:[],imageUrl:a.globalData.imgUrl,pageNum:1,pageSize:10,isNoMoreData:!1,couponsDetails:"",salesEndTime:"",codes:""}},filters:{formatDate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=new Date(t),o=n.getFullYear(),a=n.getMonth()+1,i=n.getDate(),u=n.getHours(),c=n.getMinutes(),r=n.getSeconds();return a=a>10?a:"0"+a,i=i>10?i:"0"+i,u=u>10?u:"0"+u,c=c>10?c:"0"+c,r=r>10?r:"0"+r,"".concat(o).concat(e).concat(a).concat(e).concat(i)}},onLoad:function(e){this.codes=decodeURIComponent(e.q);var n=this.codes.split("="),o=n[1];t.showToast({title:o,icon:"none",duration:2e9})},methods:{getDiscountByQrCode:function(){var t=this,e={code:this.codes};(0,o.getDiscountByQrCode)(e).then((function(e){"000000"==e.return_code&&(t.couponsDetails=e.return_data,t.salesEndTime=e.return_data.highDiscount.salesEndTime,t.getCouponByDiscount(e.return_data.highDiscount.id))}))},getCouponByDiscount:function(t){var e=this,n={discountId:t};(0,o.getCouponByDiscount)(n).then((function(t){"000000"==t.return_code&&(e.minecoupones=t.return_data)}))},receiveDiscount:function(){t.showLoading({title:"领取中..."});var e={discountAgentId:this.couponsDetails.id};(0,o.receiveDiscount)(e).then((function(e){"000000"==e.return_code?(t.hideLoading(),t.showToast({icon:"none",title:e.return_data,duration:2e3})):(t.hideLoading(),t.showToast({icon:"none",title:e.return_msg,duration:2e3}))}))},getuserinfo:function(){t.showToast({title:"正常的---",icon:"none",duration:22e6}),t.login({provider:"weixin",success:function(e){a.globalData.code=e.code;var n={code:a.globalData.code};HandleCode(n).then((function(e){if("000000"==e.return_code){t.showToast({title:"正常的",icon:"none",duration:22e6}),a.globalData.openId=e.return_data.openId,t.showLoading({title:"正在登录中"});wx.login({success:function(e){if(e.code){e.code;t.getUserInfo({success:function(e){var n=this,o={openId:a.globalData.openId,iv:e.iv,encryptedData:e.encryptedData};getUserInfo(o).then((function(e){"000000"==e.return_code?(t.hideLoading(),a.globalData.userInfo=e.return_data.object.highUser,a.globalData.token=e.return_data.uniqueCode,t.setStorage({key:"user",data:e.return_data.object.highUser}),t.setStorage({key:"token",data:e.return_data.uniqueCode}),n.receiveDiscount()):t.showToast({title:e.return_msg})}))},fail:function(e){t.showToast({title:"微信登录授权失败",icon:"none"})}})}}})}else t.showToast({title:"报错了",icon:"none",duration:22e6})}))},fail:function(){t.showToast({title:"报错了------------",icon:"none",duration:22e6})}})},toGoods:function(e){t.navigateTo({url:"../goods?id="+e})}}};e.default=i}).call(this,n("543d")["default"])}},[["d24d","common/runtime","common/vendor"]]]);