POSCMS 版主:POSCMS负责人
弹窗提示求解
类型:POSCMS 更新时间:2020-11-26 15:01:46

下载文件时积分不足会跳转到新页面提示,请问怎么实现弹窗提示啦 下面积分提示页php文件里的代码


  if (!$data['is_buy']

            && $this->input->get('action') == 'confirm') {

            // 会员未登录

            !$this->member && $this->msg(fc_lang('会话超时,请重新登录'));

            // 积分检查

            -$data['score'] + $this->member['score'] < 0 && $this->msg(fc_lang(SITE_SCORE.'不足!本次需要%s'.SITE_SCORE.',当前余额%s'.SITE_SCORE, $data['score'], $this->member['score']));

            // 扣减积分

            $this->member_model->update_score(1, $this->uid, -$data['score'], '', '购买《'.($data['name'] ? $data['name'] : $data['title']).'》');

            // 记录购买历史

            $insert = array(

                'uid' => $this->uid,

                'url' => $data['url'],

                'score' => $data['score'],

                'thumb' => $data['preview'] ? $data['preview'] : ($data['thumb'] ? $data['thumb'] : ''),

                'inputtime' => SYS_TIME

            );

            if ($id) {

                $insert['cid'] = $id;

                $insert['title'] = $data['title'];

            } else {

                $insert['eid'] = $eid;

                $insert['cid'] = $data['cid'];

                $insert['title'] = ($data['ctitle'] ? $data['ctitle'].' - ' : '').$data['name'];

            }

            $this->db->insert($table, $insert);

            $this->msg(fc_lang('购买成功'), $data['url'], 1);

        } else {

            $this->template->assign($data);

            ob_start();

            $this->template->display($tpl);

            $html = ob_get_contents();

            ob_clean();

            echo $this->input->get('callback', TRUE).'('.json_encode(array('html' => $html)).')';exit;

        }

    }

请问怎么将这个弄成弹窗页提示


回帖
  • 徐树
    #1楼    徐树
    2017-10-11 14:44:02
    0
    应该在模板html里面做弹窗吧,你这个是php里面没办法弹窗
  • 华仔
    #2楼    华仔
    2017-10-11 14:47:27
    0
    下载的提示地址是 <a href="javascript:;" onclick="dr_confirm_url('此操作需要{SITE_SCORE}{$score},您确定购买吗?', '/index.php?s={MOD_DIR}&c=api&m=buy&action=confirm&id={$id}')虚拟币不足的提示链接就是通过这个页面提示的/index.php?s={MOD_DIR}&c=api&m=buy&action=confirm&id={$id}【徐树】1楼
  • 王兴业
    #3楼    王兴业
    2017-10-11 14:57:16
    0
    {if $member.score-$score < 0}
    
    <a href="javascript:alert("虚拟币不足");">购买</a>
    {else}
    <a href="javascript:;" onclick="dr_confirm_url('此操作需要{SITE_SCORE}{$score},您确定购买吗?', '/index.php?s={MOD_DIR}&c=api&m=buy&action=confirm&id={$id}')
    {/if}
    没什么难度
    满意答案
  • 华仔
    #4楼    华仔
    2020-11-26 15:01:46
    Chrome 0
    @王兴业:非常感谢,谢谢