纸通宝SAAS仓库
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.
 

46 lines
1.1 KiB

// pages/home/customer-info/index.js
import Scene from '../../index/scene'
const util = require('../../../utils/util')
const qrCode = require('../../../utils/weapp-qrcode')
const app = getApp()
Scene({
/**
* 页面的初始数据
*/
data: {
name: '裕隆纸业有限公司',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(!util.isEmpty(options.id)){
this.showQrCode('?mark=ztb_saas&QrCodeRecordId=597399780326510592' + Math.ceil(Math.random() * 100) )
}
},
rpx2px: function(rpx) {
return rpx / 750 * app.globalData.windowWidth
},
showQrCode: function(text){
new qrCode('van-qrcode', {
text: text,
width: this.rpx2px(600),
height: this.rpx2px(600),
colorDark: "#333333",
colorLight: "#FFFFFF",
correctLevel: qrCode.CorrectLevel.H
})
},
previewImage: function(){
wx.canvasToTempFilePath({
canvasId: 'van-qrcode',
success: (res) => {
wx.previewImage({ urls: [res.tempFilePath] })
}
})
},
customerInfo: function(){
}
})