diff --git a/scanner/pages/index/index.js b/scanner/pages/index/index.js
index 2027a5b..15fdb4d 100644
--- a/scanner/pages/index/index.js
+++ b/scanner/pages/index/index.js
@@ -17,6 +17,8 @@ Page({
userInfo: {},
content: {},
background_style: '',
+ scan_button_text: '开启AI验证',
+ scan_button_style: '',
},
goto_link(e) {
var link = e.currentTarget.dataset.link;
@@ -42,6 +44,7 @@ Page({
this.patch_url([c.video]);
this.patch_url(c.icons);
this.patch_url(c.static);
+ this.gen_scan_button_props(c);
return c;
},
load_content(tenant_id, code) {
@@ -129,6 +132,32 @@ Page({
});
},
+ gen_scan_button_props: function(content) {
+ var scan_button = content.scan_button;
+ var text = '开启AI验证';
+ var style = '';
+
+ if (scan_button) {
+ if (scan_button.text) {
+ text = scan_button.text;
+ }
+
+ var styles = [];
+ if (scan_button.color) {
+ styles.push('background-color: ' + scan_button.color);
+ }
+ if (scan_button.text_color) {
+ styles.push('color: ' + scan_button.text_color);
+ }
+ style = styles.join('; ');
+ }
+
+ this.setData({
+ scan_button_text: text,
+ scan_button_style: style,
+ });
+ },
+
gen_background_style: function(content) {
var bg = content.background;
var ret = '';
diff --git a/scanner/pages/index/index.wxml b/scanner/pages/index/index.wxml
index a40535c..b9cfa8a 100644
--- a/scanner/pages/index/index.wxml
+++ b/scanner/pages/index/index.wxml
@@ -23,7 +23,7 @@ loading...
{{ item.title }}
-
+