|
@@ -128,13 +128,54 @@
|
|
|
<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/utils.js?v={{Msg "seo" "version"}}'></script>
|
|
|
<script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>
|
|
|
<script>
|
|
|
-
|
|
|
+ function toastFn(text, duration) {
|
|
|
+ if(!duration) {
|
|
|
+ duration = 2000
|
|
|
+ }
|
|
|
+ if($('.custom-toast')){
|
|
|
+ $('.custom-toast').remove()
|
|
|
+ }
|
|
|
+ var _html = ""
|
|
|
+ _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
|
|
|
+ _html+='<span>' + text + '</span></div></div>'
|
|
|
+ $('body').append(_html)
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".custom-toast").fadeOut().remove();
|
|
|
+ }, duration)
|
|
|
+ }
|
|
|
+ function checkPower(list) {
|
|
|
+ var power = 'bi_yx_wyzb'
|
|
|
+ return Array.isArray(list) && list.indexOf(power) !== -1
|
|
|
+ }
|
|
|
+ function getPowerList() {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/jyapi/resourceCenter/haspowers',
|
|
|
+ type: 'POST',
|
|
|
+ success: function(res) {
|
|
|
+ if (res && Array.isArray(res.data)) {
|
|
|
+ if (checkPower(res.data)) {
|
|
|
+ $('.property-btn').text('请去PC端使用').attr('power', 'bi_yx_wyzb')
|
|
|
+ } else {
|
|
|
+ $('.property-btn').text('立即咨询物业专版').removeAttr('power')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
$(function () {
|
|
|
+ getPowerList()
|
|
|
$('.property-btn').click(function () {
|
|
|
var loginFlag = {{if .T.loginFlag}}{{.T.loginFlag}}{{else}}false{{end}}
|
|
|
if(loginFlag){
|
|
|
- const source = utils.$envs.inH5 ? 'h5_property_consult' : 'app_property_consult'
|
|
|
- window.location.href="/jyapp/frontPage/bigmember/free/perfect_info?source=" + source
|
|
|
+ var source = utils.$envs.inH5 ? 'h5_property_consult' : 'app_property_consult'
|
|
|
+ var power = $(this).attr('power')
|
|
|
+ if(power) {
|
|
|
+ // console.log('请去pc端使用');
|
|
|
+ toastFn('请去PC端使用', 2000)
|
|
|
+ } else {
|
|
|
+ window.location.href="/jyapp/frontPage/bigmember/free/perfect_info?source=" + source
|
|
|
+ }
|
|
|
}else{
|
|
|
window.location.href= "/jyapp/free/login?url=/jyapp/frontPage/bigmember/free/perfect_info?source=" + source
|
|
|
}
|