作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

1

... ... @@ -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,10 +125,12 @@
// }
//
// }
wx.config(
{$js}
);
var serverIds = '';
wx.ready(function () {
wx.ready(function () {
$('#imghead').click(function () {
// var id = $(this).attr('id');
// if ($(this).find('img').length=="") {
wx.chooseImage({
count: 1, // 默认9
... ... @@ -139,27 +138,26 @@ wx.ready(function () {
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
$('#imghead').attr('src',res.localIds)
uploadImages(res.localIds, id)
uploadImages(res.localIds)
}
});
// }
});
function uploadImages(localIds) {
// var localId = localIds.pop();
var localId = localIds.pop();
wx.uploadImage({
localId: localIds,
localId: localId,
isShowProgressTips: 1,
success: function (res) {
serverIds = res.serverId; // 返回图片的服务器端ID
alert(serverIds)
var serverId = res.serverId; // 返回图片的服务器端ID
serverIds += id+':'+serverId + ',';
},
fail: function (res) {
alert(res)
$modal.toast(JSON.stringify(res));
}
});
}
});
});
//确定上传小票
$(".footer").click(function(){
$.ajax({
... ...