detail.js 790 Bytes
import wx from '../../../utils/wx';
import wxqrcode from '../../../vendors/wxqrcode';
import Yas from '../../../common/yas';
import { parse, stringify } from '../../../vendors/query-stringify';

let app = getApp();
let yas;

Page({
    /**
   * 生命周期函数--监听页面加载
   */
    onLoad: function(options) {
        let newOptions = decodeURIComponent(stringify(options)); // 先把url参数解码,防止乱码,然后再编码

        yas = new Yas(app);
        yas.pageOpenReport(); // 页面加载完成上报

        wx.showLoading({title: '正在加载中...'});

        options = parse(newOptions);

        options.qrSrc = wxqrcode.createQrCodeImg(options.qrcode, { size: 225, errorCorrectLevel: 'H' });

        this.setData(options, wx.hideLoading);
    }
});