一、apicloud 获取属性

流过昼夜 提交于 2019-12-08 03:33:18

一、设值

    <input class="same big-icon aui-checkbox"  data-prices="{{=it[i].children[j].goodsprices}}" value="{{=it[i].children[j].goodsid}}"  type="checkbox" />

二、取值

$api.val(inputel[j])

$(inputel[j]).data("prices");

三、

            var elnum = $api.domAll('#evaluation-l li');

            var el=$(elnum[0]).data("typedatainfo");
            load_goods_info(el);

            //var elnum = $api.domAll('#evaluation-l li');

            $(".aui-list-item").click(function() {
                for (var i = 0, len = elnum.length; i < len; i++) {
                    if (this == elnum[i]) {
                        //
                        $api.addCls(this, 'selected');

                        var el=$(elnum[i]).data("typedatainfo");
                        console.log("el"+el);
                        load_goods_info(el);

                    }else {
                        $api.removeCls(elnum[i], 'selected');
                    }
                }

            })
    apiready = function() {
        // 登录操作
        $api.addEvt($api.byId("login"), 'click', function() {
            var count = $api.byId("count").value;
            var code = $api.byId("code").value;
            if (count.length == 0) {
                api.toast({
                    msg: '请输入手机号码',
                    duration: 2000,
                    location: 'top'
                });
                return;
            } else {
                if (code.length == 0) {
                    api.toast({
                        msg: '请输入登录密码',
                        duration: 2000,
                        location: 'top'
                    });
                } else {
                    $.ajax({
                        type: "post",
                        url: "http://192.168.2.199:888/Shopsmain/",
                        data: {
                            service: "Users.land",
                            loginname: count,
                            password: code
                        },
                        dataType: "json",
                        success: function(data) {
                            if (data.data.code == 1) {
                              api.toast({
                                  msg: '登录成功',
                                  duration: 2000,
                                  location: 'bottom'
                              });
                                api.openWin({
                                    name: 'mine_win',
                                    url: 'mine_win.html',
                                    reload: true
                                });
                            } else {
                              api.toast({
                                  msg: '账号或密码错误,请重新输入',
                                  duration: 3000,
                                  location: 'bottom'
                              });
                            }
                          // console.log(data);
                        },

                        error: function(data) {
                            api.toast({
                                msg: '服务器出错!',
                                duration: 3000,
                                location: 'bottom'
                            });
                        }
                    });
                }
            }
        })
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!