const core = getApp().globalData.requirejs("core") import getMerchFn from './getMerchFn' module.exports = { init: function(that) { console.log("thatthatthatthat",that); getApp().globalData.util.loginByCode().then(loginByCode => { console.log("loginByCodeloginByCodeloginByCode",loginByCode); if (!that.merch) { uni.showLoading({ title: '拼命加载中...' }); } that.credit1 = loginByCode.credit1 let optionsScen = that.option; //#ifdef MP-WEIXIN let scene = ';' if (typeof optionsScen != 'undefined' && typeof optionsScen.q != 'undefined' && optionsScen .q) { let url = decodeURIComponent(optionsScen.q); //解码 scene = getApp().globalData.util.getQueryVariable('scene', url); //从URL 中提取参数scene参数 scene = core.str2Obj(decodeURIComponent(scene)); //将url解码并转换成对象 } else if (optionsScen && typeof(optionsScen.scene) != "undefined" && optionsScen.scene) { scene = core.str2Obj(decodeURIComponent(optionsScen.scene)); } else { uni.showModal({ title: '提示', content: '不小心崩溃了,重新扫码试试吧234234', success: function() { // uni.navigateBack({ // delta: 2 // }) } }) } that.option = scene // getMerchFn.getMerchID(that, scene) //#endif //#ifdef MP-ALIPAY // 这是之前的版本 无法使用 支付宝小程序 function getAlipayQRCode() { let queryDataTmp = uni.getStorageSync('qr_scan_data') if (typeof(queryDataTmp) != 'undefined' && queryDataTmp) { getMerchFn.getMerchID(that, queryDataTmp) that.option = queryDataTmp uni.removeStorageSync('qr_scan_data') } else { uni.hideLoading() uni.showModal({ title: '提示', content: '网络开小差啦,重新扫码试试吧!00000000' }); return; } } getAlipayQRCode() /* let scene = ';' if (typeof optionsScen != 'undefined' && typeof optionsScen.q != 'undefined' && optionsScen .q) { let url = decodeURIComponent(optionsScen.q); scene = getApp().globalData.util.getQueryVariable('scene', url); scene = core.str2Obj(decodeURIComponent(scene)); } else if (optionsScen && typeof(optionsScen.scene) != "undefined" && optionsScen.scene) { scene = core.str2Obj(decodeURIComponent(optionsScen.scene)); } else { uni.showModal({ title: '提示', content: '不小心崩溃了,重新扫码试试吧', success: function() { uni.navigateBack({ delta: 2 }) } }) } that.option = scene getMerchFn.getMerchID(that, scene) */ //#endif //#ifdef H5 getMerchFn.getMerchID(that, that.option) // #endif }) } }