//
|
// WelfareFreeVC.swift
|
// WanPai
|
//
|
// Created by 无故事王国 on 2023/6/20.
|
//
|
|
import UIKit
|
import WebKit
|
import JQTools
|
import QMUIKit
|
|
class WelfareFreeVC: BaseVC {
|
|
var storeWalfareModel:StoreWalfareModel?
|
@IBOutlet weak var webView: WKWebView!
|
@IBOutlet weak var btn_call: QMUIButton!
|
|
init(_ model:StoreWalfareModel) {
|
super.init(nibName: nil, bundle: nil)
|
self.storeWalfareModel = model
|
}
|
|
required init?(coder: NSCoder) {
|
fatalError("init(coder:) has not been implemented")
|
}
|
|
override func viewDidLoad() {
|
super.viewDidLoad()
|
title = "免费福利"
|
|
if let m = storeWalfareModel{
|
let html = "<img src='\(m.img)' width='\(JQ_ScreenW)' loading=eager/>"
|
self.webView.loadHTMLString(html.jq_wrapHtml(), baseURL: nil)
|
self.btn_call.isHidden = m.phone.isEmpty
|
}
|
}
|
|
override func setUI() {
|
btn_call.imagePosition = .left
|
btn_call.spacingBetweenImageAndTitle = 13
|
}
|
|
@IBAction func callPhoneAction(_ sender: UIButton) {
|
if let phone = storeWalfareModel?.phone{
|
UIApplication.shared.open(URL(string: "tel://\(phone)")!, options: [:], completionHandler: nil)
|
}
|
}
|
|
}
|