From 19086b4a43a6b8d9aab521a13b579d9b69d75f52 Mon Sep 17 00:00:00 2001 From: 潘浩文 <phw@bronet.cn> Date: Mon, 22 Oct 2018 17:20:34 +0800 Subject: [PATCH] 1 --- public/themes/simpleboot3/portal/prize/getScore.html | 58 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/public/themes/simpleboot3/portal/prize/getScore.html b/public/themes/simpleboot3/portal/prize/getScore.html index bad3b78..eef2c9e 100644 --- a/public/themes/simpleboot3/portal/prize/getScore.html +++ b/public/themes/simpleboot3/portal/prize/getScore.html @@ -68,9 +68,6 @@ <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script> <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <script> - wx.config( - {$js} - ); // function clacImgZoomParam(maxWidth, maxHeight, width, height) { // var param = { // top: 0, @@ -128,38 +125,39 @@ // } // // } + wx.config( + {$js} + ); var serverIds = ''; -wx.ready(function () { - $('#imghead').click(function () { -// var id = $(this).attr('id'); + wx.ready(function () { + $('#imghead').click(function () { // if ($(this).find('img').length=="") { - wx.chooseImage({ - count: 1, // 默认9 - sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 - sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 - success: function (res) { - $('#imghead').attr('src',res.localIds) - uploadImages(res.localIds, id) - } - }); + wx.chooseImage({ + count: 1, // 默认9 + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 + success: function (res) { + $('#imghead').attr('src',res.localIds) + uploadImages(res.localIds) + } + }); // } - }); - function uploadImages(localIds) { -// var localId = localIds.pop(); - wx.uploadImage({ - localId: localIds, - isShowProgressTips: 1, - success: function (res) { - serverIds = res.serverId; // 返回图片的服务器端ID - alert(serverIds) - }, - fail: function (res) { - alert(res) - $modal.toast(JSON.stringify(res)); + }); + function uploadImages(localIds) { + var localId = localIds.pop(); + wx.uploadImage({ + localId: localId, + isShowProgressTips: 1, + success: function (res) { + var serverId = res.serverId; // 返回图片的服务器端ID + serverIds += id+':'+serverId + ','; + }, + fail: function (res) { + $modal.toast(JSON.stringify(res)); + } + }); } }); - } -}); //确定上传小票 $(".footer").click(function(){ $.ajax({ -- libgit2 0.24.0