Commit 1113c3e1bc8ef29d2c734ce04923b9dacffaf235
1 parent
a43fce44
Exists in
master
1. 商品隐藏信息界面样式调整,添加物流单号展示
2. 激活商品添加物流单号。
Showing
9 changed files
with
105 additions
and
14 deletions
Show diff stats
app-wx/modules/check/views/default/pages/info-template.php
... | ... | @@ -13,8 +13,10 @@ $baseUrl = Url::base(true); |
13 | 13 | text-align: center; |
14 | 14 | } |
15 | 15 | #info .scan-image { |
16 | - width: 11.25rem; | |
17 | - height: 11.03rem; | |
16 | + width: 85%; | |
17 | + height: auto; | |
18 | + min-height: 16rem; | |
19 | + max-height: 18rem; | |
18 | 20 | margin: 0 auto; |
19 | 21 | } |
20 | 22 | #info .scan-tip { |
... | ... | @@ -78,13 +80,37 @@ $baseUrl = Url::base(true); |
78 | 80 | <div class="title"> |
79 | 81 | 发货地址: |
80 | 82 | </div> |
81 | - <div class="content" id="send_address">{{delivery_address}}</div> | |
83 | + <div class="content" id="send_address"> | |
84 | + {{#js_compare "this.delivery_address != ''"}} | |
85 | + {{delivery_address}} | |
86 | + {{else}} | |
87 | + -- | |
88 | + {{/js_compare}} | |
89 | + </div> | |
90 | + </div> | |
91 | + <div class="scan-tip"> | |
92 | + <div class="title"> | |
93 | + 物流单号: | |
94 | + </div> | |
95 | + <div class="content" id="send_address"> | |
96 | + {{#js_compare "this.logistics_number != ''"}} | |
97 | + {{logistics_number}} | |
98 | + {{else}} | |
99 | + -- | |
100 | + {{/js_compare}} | |
101 | + </div> | |
82 | 102 | </div> |
83 | 103 | <div class="scan-tip"> |
84 | 104 | <div class="title"> |
85 | 105 | 商家留言: |
86 | 106 | </div> |
87 | - <div class="content" id="leavemsg">{{leave_message}}</div> | |
107 | + <div class="content" id="leavemsg"> | |
108 | + {{#js_compare "this.leave_message != ''"}} | |
109 | + {{leave_message}} | |
110 | + {{else}} | |
111 | + -- | |
112 | + {{/js_compare}} | |
113 | + </div> | |
88 | 114 | </div> |
89 | 115 | </div> |
90 | 116 | </div> | ... | ... |
app-wx/modules/smart/controllers/DefaultController.php
... | ... | @@ -64,9 +64,9 @@ class DefaultController extends BaseController |
64 | 64 | |
65 | 65 | // 判断文件大小 |
66 | 66 | $fileSize = $_FILES["file"]["size"] / (1024 * 1024); |
67 | - if (strtoupper($fileExt) == "MP4") { | |
67 | + if (strtoupper($fileExt) == "MP4" || strtoupper($fileExt) == "MOV") { | |
68 | 68 | if ($fileSize > 10) { |
69 | - $e->message = 'MP4视频文件不能大于10M'; | |
69 | + $e->message = '视频文件不能大于10M'; | |
70 | 70 | return $this->renderJson($e); |
71 | 71 | } |
72 | 72 | } else { |
... | ... | @@ -129,6 +129,7 @@ class DefaultController extends BaseController |
129 | 129 | $fileData = $request->post("file_data"); |
130 | 130 | $vedioData = $request->post("vedio_data"); |
131 | 131 | $address = $request->post("address"); |
132 | + $logisticsNumber = $request->post("logistics_number"); | |
132 | 133 | $content = $request->post("content"); |
133 | 134 | $phone = $request->post("phone"); |
134 | 135 | $phoneHeader = $request->post("phone_header"); |
... | ... | @@ -142,7 +143,7 @@ class DefaultController extends BaseController |
142 | 143 | $e->msg = '用户未登录'; |
143 | 144 | return $this->renderJson($e); |
144 | 145 | } |
145 | - $INPUT_VA = ((!empty($fileData) || !empty($address) || !empty($vedioData) || !empty($content)) && (empty($phone) || empty($phoneHeader))); | |
146 | + $INPUT_VA = ((!empty($fileData) || !empty($address) || !empty($logisticsNumber) || !empty($vedioData) || !empty($content)) && (empty($phone) || empty($phoneHeader))); | |
146 | 147 | if ($INPUT_VA || empty($uuid)) { |
147 | 148 | $e->msg = '保存失败缺少必要参数'; |
148 | 149 | return $this->renderJson($e); |
... | ... | @@ -209,6 +210,7 @@ class DefaultController extends BaseController |
209 | 210 | "user_mp_id" => $userId, |
210 | 211 | "leave_message" => $content, |
211 | 212 | "delivery_address" => $address, |
213 | + "logistics_number" => $logisticsNumber, | |
212 | 214 | "product_image_path" => $productImagePath, |
213 | 215 | "product_vedio_path" => $productVedioPath, |
214 | 216 | "buyer_mobile_header" => $phoneHeader, | ... | ... |
app-wx/modules/smart/views/default/pages/enter-template.php
... | ... | @@ -29,7 +29,7 @@ $baseUrl = Url::base(true); |
29 | 29 | <ul id ="vedio-list" style="overflow: hidden;margin-top:0.5rem; margin-bottom: 0.5rem;"> |
30 | 30 | <li class="upload-vedio-li upload-vedio-btn-li"> |
31 | 31 | <div class="upload-vedio-item upload-vedio-btn-cls"> |
32 | - <input type="file" id="upload-vedio-btn" class="upload-vedio-input-cls" name="file" accept="*.mp4,*.MP4"/> | |
32 | + <input type="file" id="upload-vedio-btn" class="upload-vedio-input-cls" name="file" accept="*.mov,*.MOV,*.mp4,*.MP4"/> | |
33 | 33 | </div> |
34 | 34 | <li> |
35 | 35 | </ul> |
... | ... | @@ -45,6 +45,13 @@ $baseUrl = Url::base(true); |
45 | 45 | </div> |
46 | 46 | </div> |
47 | 47 | <div class="space-line"></div> |
48 | + <div class="input-item-cls" style="display:grid;flex-direction: row"> | |
49 | + <label class="pub-title">物流单号</label> | |
50 | + <div class="img-box-cls"> | |
51 | + <input class="input-cls logistics_number" type="text" placeholder="请填写物流单号" /> | |
52 | + </div> | |
53 | + </div> | |
54 | + <div class="space-line"></div> | |
48 | 55 | <div class="input-item-cls" style="display:grid;flex-direction: row;"> |
49 | 56 | <div class="input-item-cls title-cls" style="padding-left: 0px;padding-top: 0px;"> |
50 | 57 | <label class="pub-title" style="display:flex; align-items: center; padding-left: -1rem">商家留言</label> | ... | ... |
app-wx/modules/smart/views/default/pages/styles/_enter-style.php
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | #enter .space-line{height: 1px;background:#D5D5D5;margin-left:1rem; } |
9 | 9 | #enter .up-part .input-item-cls{padding:0.6rem 1rem ;box-sizing: border-box;width: 100%;line-height: 1.35rem;} |
10 | 10 | #enter .up-part .address-input{height:2.81rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; margin: 0.5rem 0;} |
11 | + #enter .up-part .logistics_number{height:2.81rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; margin: 0.5rem 0;} | |
11 | 12 | #enter .up-part .phone-number-header{width: 25%!important;text-align:center;height:2.81rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; margin: 0.5rem 0;} |
12 | 13 | #enter .up-part .phone-number{width: 60%!important; height: 2.81rem; float: right; right: 1rem;position: absolute;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; margin: 0.5rem 0;} |
13 | 14 | #enter .up-part .input-box-cls{width:100%;line-height: 1.25rem;display: inline-flex;} | ... | ... |
app-wx/web/dist/js/check-app.js
1 | -define("check-app",["mk7/app"],function(n){var t=Dom7,e=function(){var n=t(".ui-loading-block");0==n.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var n=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",n&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',n.appendChild(t))},window.waitingTime))},o=!0;return n.name="check",n.routes={index:function(){return o=!1,e(),n.runController("index")},"*":function(){return o=!1,e(),n.runController("index")},"scan-count/:uuid/:scancount":function(t,i){return o=!1,e(),n.runController("scan-count",{uuid:t,scancount:i})},"warning/:uuid":function(t){return o=!1,e(),n.runController("warning",{uuid:t})},"submit/:uuid":function(t){return o=!1,e(),n.runController("submit",{uuid:t})},"error/:uuid":function(t){return o=!1,e(),n.runController("error",{uuid:t})},"success/:uuid":function(t){return o=!1,e(),n.runController("success",{uuid:t})},"info/:uuid/:number_code":function(t,i){return o=!1,e(),n.runController("info",{uuid:t,number_code:i})}},n}),define("check/error-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7;Template7;return n.run=function(){var n=this;n.setPageTitle("验证结果"),n.render()},n.bindEvents=function(){c(".back-button").click(function(){window.history.go(-1)})},n}),define("check/index-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,1),r=0,s=2,u=0;return n.run=function(){var n=this;n.setPageTitle("验证标签"),i.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["openLocation","getLocation","scanQRCode"]}),n.scanQrcode(),n.render(),c(".scan-button").attr("disabled","disabled"),c(".scan-button").text("正在调起扫码……")},n.bindEvents=function(){var n=this;c(".scan-button").click(function(){n.scanQrcode()})},n.scanQrcode=function(){var n=this;i.ready(function(){i.scanQRCode({needResult:1,desc:"scanQRCode desc",success:function(o){var i=o.resultStr,d=c.parseUrlQuery(i);if(null!=d&&void 0!==d&&null!=d.uuid&&void 0!==d.uuid){if(d.uuid.indexOf("@")==-1)return e.toast({content:"该智能防伪二维码无效"}),!1;var d=d.uuid.split("@"),l=t.to("check#warning/"+d[0]),m=t.to("check#scan-count/"+d[0]+"/"+u);c.ajax({method:"POST",url:t.to("check/default/check-active"),data:{uuid:d[0]},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){u=n.scan_count,m=t.to("check#scan-count/"+d[0]+"/"+u),n.success==a?window.location.href=m:n.success==r?window.location.href=l:n.success==s?e.toast({content:"该智能防伪二维码无效"}):e.toast({content:"该智能防伪二维码无效"})},error:function(n){},complete:function(t){n.hideIndicator()}})}else e.toast({content:"请扫描智能防伪二维码"})}}),setTimeout(function(){c(".scan-button").removeAttr("disabled"),c(".scan-button").text("点击扫描标签")},1e3)})},n}),define("check/info-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7;Template7;return n.run=function(){var n=this;n.setPageTitle("隐私信息"),n.loadData(n.params.uuid,n.params.number_code),n.popstate()},n.bindEvents=function(){c(".back-button").click(function(){window.history.go(-1)}),c(".image_button").click(function(){var n=c(this).attr("data-url");return e.isEmpty(n)?(e.toast({content:"该图片不存在",closeDelay:3e3}),!1):void c(".scan-image-div").html('<img src="'+n+'" class="scan-image"/>')}),c(".vedio_button").click(function(){var n=c(this).attr("data-url");if(e.isEmpty(n))return e.toast({content:"该视频不存在",closeDelay:3e3}),!1;var t="<video class='scan-image' style='border: 1px solid #cce1f1;object-fit: fill;' alt='商品视频' ";t+="controls='controls'> <source src='"+n+"' type='video/mp4'>您的浏览器不支持 video 标签。</video>",c(".scan-image-div").html(t)})},n.loadData=function(n,o){var i=this;c.ajax({method:"POST",url:t.to("check/default/get-info"),data:{uuid:n,number_code:o},dataType:"json",beforeSend:function(){i.showIndicator()},success:function(n){try{n.success?i.render(n.data):e.toast({content:n.message,closeDelay:3e3})}catch(t){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(n){i.hideIndicator()}})},n.popstate=function(){window.addEventListener("popstate",function(n){window.location.href=t.to("check#index")},!1)},n}),define("check/scan-count-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,0),r="";return n.run=function(){var n=this;a=parseInt(n.params.scancount),r=n.params.uuid,n.setPageTitle("验证标签"),n.render(),c(".count-num").html(a)},n.bindEvents=function(){c(".scan-button").click(function(){""!=r&&void 0!=r?window.location.href=t.to("check#submit/"+r):window.location.href=t.to("check#index")})},n}),define("check/submit-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证标签"),i.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["chooseImage","previewImage","uploadImage","getLocalImgData"]}),n.render()},n.bindEvents=function(){var n=this;c(".scan-image").click(function(){n.uploadImg(c(this))}),c(".scan-button").click(function(){var o=c(".scan-image").attr("data");return e.isEmpty(o)?(e.toast({content:"请拍照文件上传后再试!"}),!1):void c.ajax({method:"POST",url:t.to("check/default/check-actived"),data:{upload_file:o,uuid:a},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){try{n.success?window.location.href=t.to("check#success/"+a):window.location.href=t.to("check#error/"+a)}catch(o){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(t){n.hideIndicator()}})})},n.uploadImg=function(n){var t=this;i.ready(function(){i.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(e){e.localIds.length>0&&t.upload(e.localIds,n)}})})},n.upload=function(n,o){var r=this;return void 0==n[0]?"":void i.uploadImage({localId:n[0],isShowProgressTips:1,success:function(n){c.ajax({method:"POST",url:t.to("check/default/update-serviceid"),data:{service_id:n.serverId,uuid:a},dataType:"json",beforeSend:function(){r.showIndicator()},success:function(n){try{if(n.success){var t=n.img_path;o.attr("data",t),o.attr("src",n.show_path)}else e.toast({content:n.message,closeDelay:3e3})}catch(i){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(n){r.hideIndicator()}})},fail:function(n){r.app.alert(JSON.stringify(n))}})},n}),define("check/success-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证结果"),n.render()},n.bindEvents=function(){var n=this;c(".btn-submit").click(function(){var o=c(".input-num").val();return e.isEmpty(o)?(e.toast({content:"请填写提取码"}),c(".input-num").focus(),!1):e.isEmpty(a)?(e.toast({content:"缺少必要参数请退出重试"}),!1):void c.ajax({method:"POST",url:t.to("check/default/get-info"),data:{uuid:a,number_code:o},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){try{n.success?window.location.href=t.to("check#info/"+a+"/"+o):e.toast({content:n.message,closeDelay:3e3})}catch(i){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(t){n.hideIndicator()}})})},n}),define("check/warning-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证标签"),n.render()},n.bindEvents=function(){c(".scan-jump-button").click(function(){""!=a&&void 0!=a?window.location.href=t.to("smart#enter/"+a):window.location.href=t.to("check#index")})},n}); | |
2 | 1 | \ No newline at end of file |
2 | +define("check-app",["mk7/app"],function(n){var t=Dom7,e=function(){var n=t(".ui-loading-block");0==n.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var n=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",n&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',n.appendChild(t))},window.waitingTime))},o=!0;return n.name="check",n.routes={index:function(){return o=!1,e(),n.runController("index")},"*":function(){return o=!1,e(),n.runController("index")},"scan-count/:uuid/:scancount":function(t,i){return o=!1,e(),n.runController("scan-count",{uuid:t,scancount:i})},"warning/:uuid":function(t){return o=!1,e(),n.runController("warning",{uuid:t})},"submit/:uuid":function(t){return o=!1,e(),n.runController("submit",{uuid:t})},"error/:uuid":function(t){return o=!1,e(),n.runController("error",{uuid:t})},"success/:uuid":function(t){return o=!1,e(),n.runController("success",{uuid:t})},"info/:uuid/:number_code":function(t,i){return o=!1,e(),n.runController("info",{uuid:t,number_code:i})}},n}),define("check/error-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7;Template7;return n.run=function(){var n=this;n.setPageTitle("验证结果"),n.render()},n.bindEvents=function(){c(".back-button").click(function(){window.history.go(-1)})},n}),define("check/index-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,1),r=0,s=2,u=0;return n.run=function(){var n=this;n.setPageTitle("验证标签"),i.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["openLocation","getLocation","scanQRCode"]}),n.scanQrcode(),n.render(),c(".scan-button").attr("disabled","disabled"),c(".scan-button").text("正在调起扫码……")},n.bindEvents=function(){var n=this;c(".scan-button").click(function(){n.scanQrcode()})},n.scanQrcode=function(){var n=this;i.ready(function(){i.scanQRCode({needResult:1,desc:"scanQRCode desc",success:function(o){var i=o.resultStr,d=c.parseUrlQuery(i);if(null!=d&&void 0!==d&&null!=d.uuid&&void 0!==d.uuid){if(d.uuid.indexOf("@")==-1)return e.toast({content:"该智能防伪二维码无效"}),!1;var d=d.uuid.split("@"),l=t.to("check#warning/"+d[0]),m=t.to("check#scan-count/"+d[0]+"/"+u);c.ajax({method:"POST",url:t.to("check/default/check-active"),data:{uuid:d[0]},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){u=n.scan_count,m=t.to("check#scan-count/"+d[0]+"/"+u),n.success==a?window.location.href=m:n.success==r?window.location.href=l:n.success==s?e.toast({content:"该智能防伪二维码无效"}):e.toast({content:"该智能防伪二维码无效"})},error:function(n){},complete:function(t){n.hideIndicator()}})}else e.toast({content:"请扫描智能防伪二维码"})}}),setTimeout(function(){c(".scan-button").removeAttr("disabled"),c(".scan-button").text("点击扫描标签")},1e3)})},n}),define("check/info-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7;Template7;return i.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["previewImage"]}),n.run=function(){var n=this;n.setPageTitle("隐私信息"),n.loadData(n.params.uuid,n.params.number_code),n.popstate()},n.bindEvents=function(){c(".back-button").click(function(){window.history.go(-1)}),c(".image_button").click(function(){var n=c(this).attr("data-url");return e.isEmpty(n)?(e.toast({content:"该图片不存在",closeDelay:3e3}),!1):(c(".scan-image-div").html('<img src="'+n+'" class="scan-image"/>'),void c(".scan-image").click(function(){var n=[],t=c("#info").find(".image_button");c.each(t,function(t,e){var o=c(e).attr("data-url");n.push(o)});var e=c(this).attr("src");i.previewImage({current:e,urls:n})}))}),c(".scan-image").click(function(){var n=[],t=c("#info").find(".image_button");c.each(t,function(t,e){var o=c(e).attr("data-url");n.push(o)});var e=c(this).attr("src");i.previewImage({current:e,urls:n})}),c(".vedio_button").click(function(){var n=c(this).attr("data-url");if(e.isEmpty(n))return e.toast({content:"该视频不存在",closeDelay:3e3}),!1;var t="<video class='scan-image' style='border: 1px solid #cce1f1;object-fit: fill;height:15rem;' alt='商品视频' ";t+="controls='controls'> <source src='"+n+"' type='video/mp4'>您的浏览器不支持 video 标签。</video>",c(".scan-image-div").html(t)})},n.loadData=function(n,o){var i=this;c.ajax({method:"POST",url:t.to("check/default/get-info"),data:{uuid:n,number_code:o},dataType:"json",beforeSend:function(){i.showIndicator()},success:function(n){try{n.success?i.render(n.data):e.toast({content:n.message,closeDelay:3e3})}catch(t){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(n){i.hideIndicator()}})},n.popstate=function(){window.addEventListener("popstate",function(n){window.location.href=t.to("check#index")},!1)},n}),define("check/scan-count-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,0),r="";return n.run=function(){var n=this;a=parseInt(n.params.scancount),r=n.params.uuid,n.setPageTitle("验证标签"),n.render(),c(".count-num").html(a)},n.bindEvents=function(){c(".scan-button").click(function(){""!=r&&void 0!=r?window.location.href=t.to("check#submit/"+r):window.location.href=t.to("check#index")})},n}),define("check/submit-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证标签"),i.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["chooseImage","previewImage","uploadImage","getLocalImgData"]}),n.render()},n.bindEvents=function(){var n=this;c(".scan-image").click(function(){n.uploadImg(c(this))}),c(".scan-button").click(function(){var o=c(".scan-image").attr("data");return e.isEmpty(o)?(e.toast({content:"请拍照文件上传后再试!"}),!1):void c.ajax({method:"POST",url:t.to("check/default/check-actived"),data:{upload_file:o,uuid:a},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){try{n.success?window.location.href=t.to("check#success/"+a):window.location.href=t.to("check#error/"+a)}catch(o){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(t){n.hideIndicator()}})})},n.uploadImg=function(n){var t=this;i.ready(function(){i.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(e){e.localIds.length>0&&t.upload(e.localIds,n)}})})},n.upload=function(n,o){var r=this;return void 0==n[0]?"":void i.uploadImage({localId:n[0],isShowProgressTips:1,success:function(n){c.ajax({method:"POST",url:t.to("check/default/update-serviceid"),data:{service_id:n.serverId,uuid:a},dataType:"json",beforeSend:function(){r.showIndicator()},success:function(n){try{if(n.success){var t=n.img_path;o.attr("data",t),o.attr("src",n.show_path)}else e.toast({content:n.message,closeDelay:3e3})}catch(i){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(n){r.hideIndicator()}})},fail:function(n){r.app.alert(JSON.stringify(n))}})},n}),define("check/success-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证结果"),n.render()},n.bindEvents=function(){var n=this;c(".btn-submit").click(function(){var o=c(".input-num").val();return e.isEmpty(o)?(e.toast({content:"请填写提取码"}),c(".input-num").focus(),!1):e.isEmpty(a)?(e.toast({content:"缺少必要参数请退出重试"}),!1):void c.ajax({method:"POST",url:t.to("check/default/get-info"),data:{uuid:a,number_code:o},dataType:"json",beforeSend:function(){n.showIndicator()},success:function(n){try{n.success?window.location.href=t.to("check#info/"+a+"/"+o):e.toast({content:n.message,closeDelay:3e3})}catch(i){e.toast({content:"出错",closeDelay:3e3})}},error:function(n){e.toast({content:"提交出错,请联系系统管理员"})},complete:function(t){n.hideIndicator()}})})},n}),define("check/warning-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(n,t,e,o,i){var n=new n,c=Dom7,a=(Template7,"");return n.run=function(){var n=this;a=n.params.uuid,n.setPageTitle("验证标签"),n.render()},n.bindEvents=function(){c(".scan-jump-button").click(function(){""!=a&&void 0!=a?window.location.href=t.to("smart#enter/"+a):window.location.href=t.to("check#index")})},n}); | |
3 | 3 | \ No newline at end of file | ... | ... |
app-wx/web/dist/js/smart-app.js
1 | -define("smart/actived-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活标签"),e.render()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e}),define("smart-app",["mk7/app"],function(e){var t=Dom7,n=function(){var e=t(".ui-loading-block");0==e.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var e=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",e&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',e.appendChild(t))},window.waitingTime))},i=!0;return e.name="smart",e.routes={index:function(){return i=!1,n(),e.runController("index")},"enter/:uuid":function(t){i=!1,n();var o={uuid:t};return e.runController("enter",o)},"*":function(){return i=!1,n(),e.runController("index")},actived:function(){return i=!1,n(),e.runController("actived")},error:function(){return i=!1,n(),e.runController("error")},success:function(){return i=!1,n(),e.runController("success")},"error-url":function(){return i=!1,n(),e.runController("error-url")}},e}),define("smart/enter-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin","mk7/uploadjs"],function(e,t,n,i,o,r){var e=new e,s=Dom7,a=(Template7,"smart/default/upload-img"),l="smart/default/submit",d=3,c=1,u="",m=!1;return e.run=function(){var e=this;e.setPageTitle("激活标签"),o.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["chooseImage","previewImage","uploadImage","getLocalImgData"]}),u=e.params.uuid,e.hideAllNonBaseMenuItem(window.$site),e.render(),e.loadAddress()},e.bindEvents=function(){var e=this;s("#upload-btn").change(function(){if(""!=s(this).val()&&null!=s(this).val()){if(d==s("#image-list").find(".up-img").length)return n.toast({content:"最多只能上传三张商品图片",closeDelay:3e3}),!1;var e=s(this).parents("li");r.uploadFile({selector:"#upload-btn",url:a,processAppendTo:"#enter",success:function(t,i){try{if(t.success){var o=t.tmpUrl,r="";0==s("#image-list").find(".convert-img").length&&(r='<div class="convert-img">封面</div>'),s('<li class="upload-li up-img"><div data="'+t.tmpFile+'" data-url="'+o+'" class="upload-item" style="background-image:url('+t.tmpMinUrl+')">'+r+'</div><span class="del-img"></span></li>').insertBefore(e),d==s("#image-list").find(".up-img").length&&s(".upload-btn-li").hide()}else n.toast({content:t.message,closeDelay:5e3})}catch(a){console.log(a),n.toast({content:"出错",closeDelay:5e3})}}})}}),s("#upload-vedio-btn").change(function(){if(""!=s(this).val()&&null!=s(this).val()){if(c==s("#vedio-list").find(".up-vedio-img").length)return n.toast({content:"只能上传一个商品视频",closeDelay:3e3}),!1;var e=s(this).parents("li");r.uploadFile({selector:"#upload-vedio-btn",url:a,processAppendTo:"#enter",success:function(t,i){try{if(t.success){var o=t.tmpUrl,r="";0==s("#vedio-list").find(".convert-img").length&&(r='<div class="convert-img">封面</div>'),s('<li class="upload-vedio-li up-vedio-img"><div data="'+t.tmpFile+'" data-url="'+o+'" class="upload-vedio-item" style="background-image:url('+t.tmpMinUrl+')">'+r+'</div><span class="del-vedio-img"></span></li>').insertBefore(e),c==s("#vedio-list").find(".up-vedio-img").length&&s(".upload-vedio-btn-li").hide()}else n.toast({content:t.message,closeDelay:5e3})}catch(a){console.log(a),n.toast({content:"出错",closeDelay:5e3})}}})}}),s("#enter").on("click",".del-img",function(e){s(this).parent().remove(),d>=s("#image-list").find(".up-img").length&&s(".upload-btn-li").show()}),s("#enter").on("click",".del-vedio-img",function(e){s(this).parent().remove(),c>=s("#vedio-list").find(".up-vedio-img").length&&s(".upload-vedio-btn-li").show()}),s("#enter").on("click","#dropdown-address",function(e){s(".address-input").val(s(this).html())}),s("#enter").on("click",".submit-btn",function(){if(n.isEmpty(u))return n.toast({content:"进入方式不对,请从新扫码激活",closeDelay:3e3}),!1;var i=s(".upload-vedio-item").attr("data"),o="";s(".upload-item").each(function(){var e=s(this).attr("data");n.isEmpty(e)||(o+=s(this).attr("data")+",")}),""!=o&&(o=o.substring(0,o.length-1));var r=s(".address-input").val(),a=s(".content-cls").val(),d=s(".phone-number").val(),c=s(".phone-number-header").val();if(!(n.isEmpty(i)&&n.isEmpty(o)&&n.isEmpty(r)&&n.isEmpty(a))){if(n.isEmpty(c))return n.toast({content:"请填写国家区号",closeDelay:3e3}),s(".phone-number-header").focus(),!1;if("86"==c&&!n.isMobile(d))return n.toast({content:"请填写正确手机号码",closeDelay:3e3}),s(".phone-number").focus(),!1}s(".submit-btn").attr("disabled","disabled"),s.ajax({method:"POST",url:l,data:{file_data:o,vedio_data:i,address:r,content:a,phone:d,phone_header:c,uuid:u},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success?(s(".submit-btn").removeAttr("disabled"),window.location.href=t.to("smart#success")):window.location.href=t.to("smart#error")},error:function(e){n.alert(e.responseText)},complete:function(t){s(".submit-btn").removeAttr("disabled"),e.hideIndicator()}})})},e.uploadImg=function(e){var t=this;o.ready(function(){o.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(n){n.localIds.length>0&&t.upload(n.localIds,e)}})})},e.upload=function(e,i){var r=this;return void 0==e[0]?"":void o.uploadImage({localId:e[0],isShowProgressTips:1,success:function(e){s.ajax({method:"POST",url:t.to("smart/default/update-serviceid"),data:{service_id:e.serverId},dataType:"json",beforeSend:function(){r.showIndicator()},success:function(e){try{if(e.success){var t=e.img_path,o="";0==s("#image-list").find(".convert-img").length&&(o='<div class="convert-img">封面</div>'),s('<li class="upload-li up-img"><div data="'+e.img_path+'" data-url="'+t+'" class="upload-item" style="background-image:url('+e.show_path+')">'+o+'</div><span class="del-img"></span></li>').insertBefore(i),d==s("#image-list").find(".up-img").length&&s(".upload-btn-li").hide()}else n.toast({content:e.message,closeDelay:3e3})}catch(r){n.toast({content:"出错",closeDelay:3e3})}},error:function(e){alert(e.responseText),n.toast({content:"提交出错,请联系系统管理员"+e.responseText})},complete:function(e){r.hideIndicator()}})},fail:function(e){r.app.alert(JSON.stringify(e))}})},e.loadAddress=function(){var e=this;s.ajax({method:"POST",url:t.to("smart/default/select-address"),data:{},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){try{e.success&&""!=e.address&&(m=!0,s("#dropdown-address").html(e.address),s(".address-input").focus(function(e){m&&s("#dropdown-address").show()}),s(".address-input").blur(function(e){m&&s("#dropdown-address").hide()}))}catch(t){}},error:function(e){},complete:function(t){e.hideIndicator()}})},e}),define("smart/error-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活结果"),e.render(),e.setTimer()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e.setTimer=function(){var e=4,i=window.setInterval(function(){return 0==e?(window.location.href=t.to("smart#index"),void(n.isEmpty(i)||clearInterval(i))):(r("#timerDiv").html(e+"秒后跳转到激活扫码页"),void e--)},1e3)},e}),define("smart/error-url-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活标签"),e.render()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e}),define("smart/index-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7,s=(Template7,1),a=0,l=2;return e.run=function(){var e=this;e.setPageTitle("智能防伪扫码"),o.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["openLocation","getLocation","scanQRCode"]}),e.scanQrcode(),e.render(),r(".scan-button").attr("disabled","disabled"),r(".scan-button").text("正在调起扫码……")},e.bindEvents=function(){var e=this;r(".scan-button").click(function(){e.scanQrcode()})},e.scanQrcode=function(){var e=this;o.ready(function(){o.scanQRCode({needResult:1,desc:"scanQRCode desc",success:function(i){var o=i.resultStr,d=r.parseUrlQuery(o);if(null!=d&&void 0!==d&&null!=d.uuid&&void 0!==d.uuid){if(d.uuid.indexOf("@")==-1)return n.toast({content:"该智能防伪二维码无效"}),!1;var d=d.uuid.split("@"),c=t.to("smart#enter/"+d[0]),u=t.to("smart#actived"),m=t.to("smart#error-url");r.ajax({method:"POST",url:t.to("smart/default/check-active"),data:{uuid:d[0]},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success==s?window.location.href=u:e.success==a?window.location.href=c:e.success==l?window.location.href=m:window.location.href=m},error:function(e){},complete:function(t){e.hideIndicator()}})}else n.toast({content:"请扫描智能防伪二维码"})}}),setTimeout(function(){r(".scan-button").removeAttr("disabled"),r(".scan-button").text("点击扫描标签")},1e3)})},e}),define("smart/success-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活结果"),e.render(),e.setTimer()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e.setTimer=function(){var e=4,i=window.setInterval(function(){return 0==e?(window.location.href=t.to("smart#index"),void(n.isEmpty(i)||clearInterval(i))):(r("#timerDiv").html(e+"秒后跳转到激活扫码页"),void e--)},1e3)},e}); | |
2 | 1 | \ No newline at end of file |
2 | +define("smart/actived-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活标签"),e.render()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e}),define("smart-app",["mk7/app"],function(e){var t=Dom7,n=function(){var e=t(".ui-loading-block");0==e.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var e=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",e&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',e.appendChild(t))},window.waitingTime))},i=!0;return e.name="smart",e.routes={index:function(){return i=!1,n(),e.runController("index")},"enter/:uuid":function(t){i=!1,n();var o={uuid:t};return e.runController("enter",o)},"*":function(){return i=!1,n(),e.runController("index")},actived:function(){return i=!1,n(),e.runController("actived")},error:function(){return i=!1,n(),e.runController("error")},success:function(){return i=!1,n(),e.runController("success")},"error-url":function(){return i=!1,n(),e.runController("error-url")}},e}),define("smart/enter-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin","mk7/uploadjs"],function(e,t,n,i,o,r){var e=new e,s=Dom7,a=(Template7,"smart/default/upload-img"),l="smart/default/submit",d=3,c=1,u="",m=!1;return e.run=function(){var e=this;e.setPageTitle("激活标签"),o.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["chooseImage","previewImage","uploadImage","getLocalImgData"]}),u=e.params.uuid,e.hideAllNonBaseMenuItem(window.$site),e.render(),e.loadAddress()},e.bindEvents=function(){var e=this;s("#upload-btn").change(function(e){if(""!=s(this).val()&&null!=s(this).val()){var t=e.currentTarget.files[0].name,i=t.lastIndexOf("."),o=t.substr(i+1);if("jpg"!=o&&"gif"!=o&&"png"!=o&&"jpeg"!=o&&"ico"!=o&&"bmp"!=o)return n.toast({content:"该文件不能作为商品图片",closeDelay:3e3}),!1;if(d==s("#image-list").find(".up-img").length)return n.toast({content:"最多只能上传三张商品图片",closeDelay:3e3}),!1;var l=s(this).parents("li");r.uploadFile({selector:"#upload-btn",url:a,processAppendTo:"#enter",success:function(e,t){try{if(e.success){var i=e.tmpUrl,o="";0==s("#image-list").find(".convert-img").length&&(o='<div class="convert-img">封面</div>'),s('<li class="upload-li up-img"><div data="'+e.tmpFile+'" data-url="'+i+'" class="upload-item" style="background-image:url('+e.tmpMinUrl+')">'+o+'</div><span class="del-img"></span></li>').insertBefore(l),d==s("#image-list").find(".up-img").length&&s(".upload-btn-li").hide()}else n.toast({content:e.message,closeDelay:5e3})}catch(r){console.log(r),n.toast({content:"出错",closeDelay:5e3})}}})}}),s("#upload-vedio-btn").change(function(e){if(""!=s(this).val()&&null!=s(this).val()){var t=e.currentTarget.files[0].name,i=t.lastIndexOf("."),o=t.substr(i+1);if("mp4"!=o&&"mov"!=o)return n.toast({content:"商品视频格式只支持mov或mp4",closeDelay:3e3}),!1;if(c==s("#vedio-list").find(".up-vedio-img").length)return n.toast({content:"只能上传一个商品视频",closeDelay:3e3}),!1;var l=s(this).parents("li");r.uploadFile({selector:"#upload-vedio-btn",url:a,processAppendTo:"#enter",success:function(e,t){try{if(e.success){var i=e.tmpUrl,o="";0==s("#vedio-list").find(".convert-img").length&&(o='<div class="convert-img">封面</div>'),s('<li class="upload-vedio-li up-vedio-img"><div data="'+e.tmpFile+'" data-url="'+i+'" class="upload-vedio-item" style="background-image:url('+e.tmpMinUrl+')">'+o+'</div><span class="del-vedio-img"></span></li>').insertBefore(l),c==s("#vedio-list").find(".up-vedio-img").length&&s(".upload-vedio-btn-li").hide()}else n.toast({content:e.message,closeDelay:5e3})}catch(r){console.log(r),n.toast({content:"出错",closeDelay:5e3})}}})}}),s("#enter").on("click",".del-img",function(e){s(this).parent().remove(),d>=s("#image-list").find(".up-img").length&&s(".upload-btn-li").show()}),s("#enter").on("click",".del-vedio-img",function(e){s(this).parent().remove(),c>=s("#vedio-list").find(".up-vedio-img").length&&s(".upload-vedio-btn-li").show()}),s("#enter").on("click","#dropdown-address",function(e){s(".address-input").val(s(this).html())}),s("#enter").on("click",".submit-btn",function(){if(n.isEmpty(u))return n.toast({content:"进入方式不对,请从新扫码激活",closeDelay:3e3}),!1;var i=s(".upload-vedio-item").attr("data"),o="";s(".upload-item").each(function(){var e=s(this).attr("data");n.isEmpty(e)||(o+=s(this).attr("data")+",")}),""!=o&&(o=o.substring(0,o.length-1));var r=s(".address-input").val(),a=s(".logistics_number").val(),d=s(".content-cls").val(),c=s(".phone-number").val(),m=s(".phone-number-header").val();if(!(n.isEmpty(i)&&n.isEmpty(o)&&n.isEmpty(r)&&n.isEmpty(a)&&n.isEmpty(d))){if(n.isEmpty(m))return n.toast({content:"请填写国家区号",closeDelay:3e3}),s(".phone-number-header").focus(),!1;if("86"==m&&!n.isMobile(c))return n.toast({content:"请填写正确手机号码",closeDelay:3e3}),s(".phone-number").focus(),!1}s(".submit-btn").attr("disabled","disabled"),s.ajax({method:"POST",url:l,data:{file_data:o,vedio_data:i,address:r,content:d,phone:c,logistics_number:a,phone_header:m,uuid:u},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success?(s(".submit-btn").removeAttr("disabled"),window.location.href=t.to("smart#success")):window.location.href=t.to("smart#error")},error:function(e){n.alert(e.responseText)},complete:function(t){s(".submit-btn").removeAttr("disabled"),e.hideIndicator()}})})},e.uploadImg=function(e){var t=this;o.ready(function(){o.chooseImage({count:1,sizeType:["compressed"],sourceType:["album","camera"],success:function(n){n.localIds.length>0&&t.upload(n.localIds,e)}})})},e.upload=function(e,i){var r=this;return void 0==e[0]?"":void o.uploadImage({localId:e[0],isShowProgressTips:1,success:function(e){s.ajax({method:"POST",url:t.to("smart/default/update-serviceid"),data:{service_id:e.serverId},dataType:"json",beforeSend:function(){r.showIndicator()},success:function(e){try{if(e.success){var t=e.img_path,o="";0==s("#image-list").find(".convert-img").length&&(o='<div class="convert-img">封面</div>'),s('<li class="upload-li up-img"><div data="'+e.img_path+'" data-url="'+t+'" class="upload-item" style="background-image:url('+e.show_path+')">'+o+'</div><span class="del-img"></span></li>').insertBefore(i),d==s("#image-list").find(".up-img").length&&s(".upload-btn-li").hide()}else n.toast({content:e.message,closeDelay:3e3})}catch(r){n.toast({content:"出错",closeDelay:3e3})}},error:function(e){alert(e.responseText),n.toast({content:"提交出错,请联系系统管理员"+e.responseText})},complete:function(e){r.hideIndicator()}})},fail:function(e){r.app.alert(JSON.stringify(e))}})},e.loadAddress=function(){var e=this;s.ajax({method:"POST",url:t.to("smart/default/select-address"),data:{},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){try{e.success&&""!=e.address&&(m=!0,s("#dropdown-address").html(e.address),s(".address-input").focus(function(e){m&&s("#dropdown-address").show()}),s(".address-input").blur(function(e){m&&s("#dropdown-address").hide()}))}catch(t){}},error:function(e){},complete:function(t){e.hideIndicator()}})},e}),define("smart/error-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活结果"),e.render(),e.setTimer()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e.setTimer=function(){var e=4,i=window.setInterval(function(){return 0==e?(window.location.href=t.to("smart#index"),void(n.isEmpty(i)||clearInterval(i))):(r("#timerDiv").html(e+"秒后跳转到激活扫码页"),void e--)},1e3)},e}),define("smart/error-url-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活标签"),e.render()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e}),define("smart/index-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7,s=(Template7,1),a=0,l=2;return e.run=function(){var e=this;e.setPageTitle("智能防伪扫码"),o.config({debug:!1,appId:window.$site.appid,timestamp:window.$site.timestamp,nonceStr:window.$site.noncestr,signature:window.$site.signature,jsApiList:["openLocation","getLocation","scanQRCode"]}),e.scanQrcode(),e.render(),r(".scan-button").attr("disabled","disabled"),r(".scan-button").text("正在调起扫码……")},e.bindEvents=function(){var e=this;r(".scan-button").click(function(){e.scanQrcode()})},e.scanQrcode=function(){var e=this;o.ready(function(){o.scanQRCode({needResult:1,desc:"scanQRCode desc",success:function(i){var o=i.resultStr,d=r.parseUrlQuery(o);if(null!=d&&void 0!==d&&null!=d.uuid&&void 0!==d.uuid){if(d.uuid.indexOf("@")==-1)return n.toast({content:"该智能防伪二维码无效"}),!1;var d=d.uuid.split("@"),c=t.to("smart#enter/"+d[0]),u=t.to("smart#actived"),m=t.to("smart#error-url");r.ajax({method:"POST",url:t.to("smart/default/check-active"),data:{uuid:d[0]},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success==s?window.location.href=u:e.success==a?window.location.href=c:e.success==l?window.location.href=m:window.location.href=m},error:function(e){},complete:function(t){e.hideIndicator()}})}else n.toast({content:"请扫描智能防伪二维码"})}}),setTimeout(function(){r(".scan-button").removeAttr("disabled"),r(".scan-button").text("点击扫描标签")},1e3)})},e}),define("smart/success-controller",["mk7/controller","mk7/url","mk7/utils","mk7/modals","mk7/jweixin"],function(e,t,n,i,o){var e=new e,r=Dom7;Template7;return e.run=function(){var e=this;e.setPageTitle("激活结果"),e.render(),e.setTimer()},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e.setTimer=function(){var e=4,i=window.setInterval(function(){return 0==e?(window.location.href=t.to("smart#index"),void(n.isEmpty(i)||clearInterval(i))):(r("#timerDiv").html(e+"秒后跳转到激活扫码页"),void e--)},1e3)},e}); | |
3 | 3 | \ No newline at end of file | ... | ... |
app-wx/web/src/js/check/info-controller.js
... | ... | @@ -15,6 +15,14 @@ define( |
15 | 15 | var $$ = Dom7; |
16 | 16 | var t7 = Template7; |
17 | 17 | |
18 | + jweixin.config({ | |
19 | + debug: false, | |
20 | + appId: window.$site.appid, // 必填,公众号的唯一标识 | |
21 | + timestamp: window.$site.timestamp, // 必填,生成签名的时间戳 | |
22 | + nonceStr: window.$site.noncestr, // 必填,生成签名的随机串 | |
23 | + signature: window.$site.signature,// 必填,签名,见附录1 | |
24 | + jsApiList: ['previewImage'] | |
25 | + }); | |
18 | 26 | ctrl.run = function () { |
19 | 27 | var me = this; |
20 | 28 | me.setPageTitle("隐私信息"); |
... | ... | @@ -34,6 +42,32 @@ define( |
34 | 42 | return false; |
35 | 43 | } |
36 | 44 | $$(".scan-image-div").html("<img src=\"" + showUrl + "\" class=\"scan-image\"/>"); |
45 | + $$(".scan-image").click(function () { | |
46 | + var urls=[]; | |
47 | + var images = $$('#info').find('.image_button'); | |
48 | + $$.each(images,function(i,n){ | |
49 | + var src =$$(n).attr('data-url'); | |
50 | + urls.push(src) | |
51 | + }) | |
52 | + var imgUrl = $$(this).attr("src"); | |
53 | + jweixin.previewImage({ | |
54 | + current:imgUrl, | |
55 | + urls:urls | |
56 | + }) | |
57 | + }); | |
58 | + }); | |
59 | + $$(".scan-image").click(function () { | |
60 | + var urls=[]; | |
61 | + var images = $$('#info').find('.image_button'); | |
62 | + $$.each(images,function(i,n){ | |
63 | + var src =$$(n).attr('data-url'); | |
64 | + urls.push(src) | |
65 | + }) | |
66 | + var imgUrl = $$(this).attr("src"); | |
67 | + jweixin.previewImage({ | |
68 | + current:imgUrl, | |
69 | + urls:urls | |
70 | + }) | |
37 | 71 | }); |
38 | 72 | $$(".vedio_button").click(function () { |
39 | 73 | var showUrl = $$(this).attr("data-url"); |
... | ... | @@ -41,7 +75,7 @@ define( |
41 | 75 | utils.toast({content:'该视频不存在', closeDelay:3000}); |
42 | 76 | return false; |
43 | 77 | } |
44 | - var insertHtmlContent = "<video class='scan-image' style='border: 1px solid #cce1f1;object-fit: fill;' alt='商品视频' "; | |
78 | + var insertHtmlContent = "<video class='scan-image' style='border: 1px solid #cce1f1;object-fit: fill;height:15rem;' alt='商品视频' "; | |
45 | 79 | insertHtmlContent += "controls='controls'> <source src='" + showUrl + "' type='video/mp4'>您的浏览器不支持 video 标签。</video>"; |
46 | 80 | $$(".scan-image-div").html(insertHtmlContent); |
47 | 81 | }); | ... | ... |
app-wx/web/src/js/smart/enter-controller.js
... | ... | @@ -42,10 +42,19 @@ define( |
42 | 42 | ctrl.bindEvents = function () { |
43 | 43 | var me = this; |
44 | 44 | // 上传商品图片 |
45 | - $$('#upload-btn').change(function() { | |
45 | + $$('#upload-btn').change(function(e) { | |
46 | 46 | if ('' == $$(this).val() || null == $$(this).val()) { |
47 | 47 | return ; |
48 | 48 | } |
49 | + | |
50 | + var filename = e.currentTarget.files[0].name; | |
51 | + var index = filename.lastIndexOf("."); | |
52 | + var suffix = filename.substr(index+1); | |
53 | + if ("jpg" != suffix && "gif" != suffix && "png" != suffix && "jpeg" != suffix && "ico" != suffix && "bmp" != suffix) { | |
54 | + utils.toast({content:'该文件不能作为商品图片', closeDelay:3000}); | |
55 | + return false; | |
56 | + } | |
57 | + | |
49 | 58 | if (imgLimit == $$('#image-list').find('.up-img').length) { |
50 | 59 | utils.toast({content:'最多只能上传三张商品图片', closeDelay:3000}); |
51 | 60 | return false; |
... | ... | @@ -81,10 +90,19 @@ define( |
81 | 90 | }) |
82 | 91 | |
83 | 92 | // 上传商品视频 |
84 | - $$('#upload-vedio-btn').change(function() { | |
93 | + $$('#upload-vedio-btn').change(function(e) { | |
85 | 94 | if ('' == $$(this).val() || null == $$(this).val()) { |
86 | 95 | return ; |
87 | 96 | } |
97 | + | |
98 | + var filename = e.currentTarget.files[0].name; | |
99 | + var index = filename.lastIndexOf("."); | |
100 | + var suffix = filename.substr(index+1); | |
101 | + if ("mp4" != suffix && "mov" != suffix) { | |
102 | + utils.toast({content:'商品视频格式只支持mov或mp4', closeDelay:3000}); | |
103 | + return false; | |
104 | + } | |
105 | + | |
88 | 106 | if (vedioLimit == $$('#vedio-list').find('.up-vedio-img').length) { |
89 | 107 | utils.toast({content:'只能上传一个商品视频', closeDelay:3000}); |
90 | 108 | return false; |
... | ... | @@ -154,10 +172,11 @@ define( |
154 | 172 | fileData = fileData.substring(0, fileData.length - 1); |
155 | 173 | } |
156 | 174 | var address = $$(".address-input").val(); |
175 | + var logisticsNumber = $$(".logistics_number").val(); | |
157 | 176 | var content = $$(".content-cls").val(); |
158 | 177 | var phoneNumber = $$(".phone-number").val(); |
159 | 178 | var phoneNumberHeader = $$(".phone-number-header").val(); |
160 | - if (!utils.isEmpty(fileVedioData) || !utils.isEmpty(fileData) || !utils.isEmpty(address)|| !utils.isEmpty(content)) { | |
179 | + if (!utils.isEmpty(fileVedioData) || !utils.isEmpty(fileData) || !utils.isEmpty(address) || !utils.isEmpty(logisticsNumber) || !utils.isEmpty(content)) { | |
161 | 180 | if (utils.isEmpty(phoneNumberHeader)) { |
162 | 181 | utils.toast({content: '请填写国家区号', closeDelay: 3000}); |
163 | 182 | $$(".phone-number-header").focus(); |
... | ... | @@ -181,6 +200,7 @@ define( |
181 | 200 | address: address, |
182 | 201 | content: content, |
183 | 202 | phone: phoneNumber, |
203 | + logistics_number: logisticsNumber, | |
184 | 204 | phone_header: phoneNumberHeader, |
185 | 205 | uuid: uuid |
186 | 206 | }, | ... | ... |
domain/smart/SellerInputRecord.php
... | ... | @@ -24,6 +24,7 @@ class SellerInputRecord |
24 | 24 | $sellerInputRecordModel->user_mp_id = trim($item["user_mp_id"]); // 用户编号 |
25 | 25 | $sellerInputRecordModel->leave_message = isset($item['leave_message']) ? trim($item['leave_message']) : ""; // 商家留言 |
26 | 26 | $sellerInputRecordModel->delivery_address = isset($item['delivery_address']) ? trim($item['delivery_address']) : ""; // 发货地址 |
27 | + $sellerInputRecordModel->logistics_number = isset($item['logistics_number']) ? trim($item['logistics_number']) : ""; // 物流单号 | |
27 | 28 | $sellerInputRecordModel->product_image_path = isset($item['product_image_path']) ? trim($item['product_image_path']) : ""; // 商品图片 |
28 | 29 | $sellerInputRecordModel->product_vedio_path = isset($item['product_vedio_path']) ? trim($item['product_vedio_path']) : ""; // 商品视频 |
29 | 30 | $sellerInputRecordModel->buyer_mobile_header = isset($item['buyer_mobile_header']) ? trim($item['buyer_mobile_header']) : ""; // 买家手机号开头 | ... | ... |