Commit acad799b by wangshuo

APP保存图片

parent 16e735cb
......@@ -17,7 +17,8 @@ class Live extends Component {
lives: {},
preheatLives: [],
today: '',
isApp: getParam('version')
isApp: getParam('version'),
QRCodeUrl: '',
}
......@@ -87,11 +88,12 @@ class Live extends Component {
saveImage = () => {
let version = getParam('version')
version = typeof version === 'string' ? version.replace('.', '').slice(0, 3) : ''
version = typeof version === 'string' ? version.replace('.', '').replace('.', '').slice(0, 3) : ''
const {QRCodeUrl} = this.state;
if (version && parseInt(version) < 451) {
Toast.info('当前不支持此功能,升级到最新版本app可以点击保存二维码!', 2, null, false)
} else {
// Toast.info('当前不支持此功能,升级到最新版本app可以点击保存二维码!', 2, null, false)
SendMessageToApp('generateQRCode', QRCodeUrl);
}
}
......@@ -104,6 +106,9 @@ class Live extends Component {
.then(res => {
const {data} = res
if (data.errno == 200) {
this.setState(()=>({
QRCodeUrl: data.data.url,
}));
QRCode.toDataURL(data.data.url, (err, url) => {
Popup({
title: '扫码关注“七月在线”服务号即可预约',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment