1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- mui.init();
- mui.ready(function() {
- getUserInfo();
- mobile.getCartNum();
- getNum();
- getIntegral();
- getMoney();
- $('.icon-kefu').parents('a').attr('href','tel:'+mobile.getParam('customer_tel'));
- $('.icon-kefu').parents('a').find('.pr15').html(mobile.getParam('customer_tel'));
- $('.mui-bar-tab').on('tap', 'a', function(e) {
- location.href=$(this).attr("href");
- });
- $('.mui-table-view').on('tap', 'li', function(e) {
- if($(this).attr("data-url")){
- location.href=$(this).attr("data-url");
- }
- });
- $('.mui-table').on('tap', '.mui-table-cell', function(e) {
- if($(this).attr("data-url")){
- location.href=$(this).attr("data-url");
- }
- });
- });
- //获取用户信息
- function getUserInfo() {
- if(user.is_share=="1"){
- $("#share-div").removeClass("mui-hidden");
- }
- if(user.username){
- $("#userName").html(user.username);
- }else{
- $("#userName").html(user.nickname);
- }
- if(user.headimgurl){
- $(".user-avatar").css("background-image","url("+user.headimgurl+")");
- }
- }
- //获取各类型订单数量
- function getNum() {
- mobile.ajaxPost(base + '/userOrder/getNum', {}, function(json) {
- if (json.data) {
- $.each(json.data, function(key, value) {
- if ($('#' + key)) {
- if (value != 0) {
- $('#' + key).html(value);
- $('#' + key).removeClass('mui-hidden');
- }
- }
- });
- }
- },"");
- }
- //获取积分
- function getIntegral() {
- mobile.ajaxPost(base + '/userIntegral/getIntegral', {}, function(json) {
- $('#integral').html(json.data);
- },"");
- }
- //获取余额
- function getMoney() {
- mobile.ajaxPost(base + '/userMoney/getMoney', {}, function(json) {
- $('#money').html("¥"+json.data);
- },"");
- }
|