Commit cbdbf588e7e04e5291632ce0acd94f9077d92d7a
1 parent
d7dbbd17
Exists in
master
1.客户第一次反馈修改
Showing
18 changed files
with
297 additions
and
19 deletions
Show diff stats
app-wx/controllers/AppController.php
... | ... | @@ -0,0 +1,84 @@ |
1 | +<?php | |
2 | +namespace app\wx\controllers; | |
3 | + | |
4 | +use domain\smart\ScanRecords; | |
5 | +use domain\smart\SellerInputRecordRepository; | |
6 | +use Yii; | |
7 | +use stdClass; | |
8 | + | |
9 | +/** | |
10 | + * qrcode-控制器 | |
11 | + * Class QrcodeController | |
12 | + * @package app\wx\controllers | |
13 | + */ | |
14 | +class QrcodeController extends BaseController | |
15 | +{ | |
16 | + /** | |
17 | + * @throws yii\web\BadRequestHttpException | |
18 | + */ | |
19 | + public function init() | |
20 | + { | |
21 | + parent::init(); // TODO: Change the autogenerated stub | |
22 | + $this->checkClientStatus(); | |
23 | + $this->handleMallAccessCtrl(); | |
24 | + } | |
25 | + /** | |
26 | + * @return string | |
27 | + * @return string HTML | |
28 | + */ | |
29 | + public function actionIndex() | |
30 | + { | |
31 | + $uuid = Yii::$app->request->get("uuid"); | |
32 | + // 判断路径中是否存在UUID | |
33 | + if (empty($uuid)) { | |
34 | + $this->jumpError(); | |
35 | + } | |
36 | + if (strstr($uuid, "@") === false) { | |
37 | + $this->jumpError(); | |
38 | + } | |
39 | + $explodArrar = explode("@", $uuid); | |
40 | + if (empty($explodArrar)) { | |
41 | + $this->jumpError(); | |
42 | + } | |
43 | + $uuid = $explodArrar[0]; | |
44 | + // @todo 校验UUID是否有效 2 无效 0 有效未激活 1 有效已激活 | |
45 | + $hasRecord = SellerInputRecordRepository::findOne(["uuid" => $uuid]); | |
46 | + if (empty($hasRecord)) { | |
47 | + $this->jumpActive($uuid); | |
48 | + } else { | |
49 | + // 记录扫码次数 | |
50 | + $scanCount = ScanRecords::updateCount($uuid); | |
51 | + $scanCount = $scanCount ? $scanCount : 1; | |
52 | + $this->jumpScanCount($uuid, $scanCount); | |
53 | + } | |
54 | + | |
55 | + | |
56 | + } | |
57 | + | |
58 | + /** | |
59 | + * 跳转到错误页面 | |
60 | + */ | |
61 | + private function jumpError() | |
62 | + { | |
63 | + $jumpUrl = Yii::$app->params["baseUrl"]."/check#error/0"; | |
64 | + header("Location: $jumpUrl");exit; | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * 跳转到扫码次数页面 | |
69 | + */ | |
70 | + private function jumpScanCount($uuid, $scanCount) | |
71 | + { | |
72 | + $jumpUrl = Yii::$app->params["baseUrl"] . "?jumpmodel=check&jumppath=scan-count/" . $uuid . "/" . $scanCount; | |
73 | + header("Location: $jumpUrl");exit; | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * 跳转到激活页面 | |
78 | + */ | |
79 | + private function jumpActive($uuid) | |
80 | + { | |
81 | + $jumpUrl = Yii::$app->params["baseUrl"] . "?jumpmodel=check&jumppath=warning/" . $uuid ; | |
82 | + header("Location: $jumpUrl");exit; | |
83 | + } | |
84 | +} | ... | ... |
app-wx/modules/check/views/default/pages/scan-count-template.php
app-wx/modules/check/views/default/pages/success-template.php
... | ... | @@ -49,7 +49,7 @@ $baseUrl = Url::base(true); |
49 | 49 | color:rgba(255,255,255,1); |
50 | 50 | } |
51 | 51 | #success .input-num { |
52 | - line-height: 2rem;height: 2.41rem;width: 65%; background-color: #fff;float: left;padding-left: 0.5rem;font-size:1rem; | |
52 | + line-height: 2rem;height: 2.41rem;width: 60%; background-color: #fff;float: left;padding-left: 0.5rem;font-size:1rem; | |
53 | 53 | font-weight:400; |
54 | 54 | /*color:rgba(177,177,177,1);*/ |
55 | 55 | } |
... | ... | @@ -68,7 +68,7 @@ $baseUrl = Url::base(true); |
68 | 68 | </div> |
69 | 69 | <div style="background: #fff; margin-top:0.5rem"> |
70 | 70 | <div class="scan-tip" style="padding-top: 1rem"> |
71 | - 您可以继续输入商品提取码,查看商家录入的隐私信息。 | |
71 | + 您可以继续输入校验提取码,查看商家为您录入的商品和包裹等隐私信息。 | |
72 | 72 | </div> |
73 | 73 | <div class="scan-tip" style="padding-bottom: 1rem"> |
74 | 74 | <input class="input-num" placeholder="输入商品提取码"/> | ... | ... |
app-wx/modules/smart/controllers/DefaultController.php
... | ... | @@ -36,6 +36,7 @@ class DefaultController extends BaseController |
36 | 36 | $address = $request->post("address"); |
37 | 37 | $content = $request->post("content"); |
38 | 38 | $phone = $request->post("phone"); |
39 | + $phoneHeader = $request->post("phone_header"); | |
39 | 40 | $uuid = $request->post("uuid"); |
40 | 41 | $userId = Yii::$app->user->getId(); |
41 | 42 | $e = new stdClass(); |
... | ... | @@ -47,7 +48,7 @@ class DefaultController extends BaseController |
47 | 48 | return $this->renderJson($e); |
48 | 49 | } |
49 | 50 | |
50 | - if (empty($fileData) || empty($address) || empty($content) || empty($phone) || empty($uuid)) { | |
51 | + if (empty($fileData) || empty($address) || empty($content) || empty($phoneHeader) || empty($phone) || empty($uuid)) { | |
51 | 52 | $e->msg = '保存失败缺少必要参数'; |
52 | 53 | return $this->renderJson($e); |
53 | 54 | } |
... | ... | @@ -104,6 +105,7 @@ class DefaultController extends BaseController |
104 | 105 | "delivery_address" => $address, |
105 | 106 | "product_image_path" => $productImagePath, |
106 | 107 | "product_vedio_path" => $productVedioPath, |
108 | + "buyer_mobile_header" => $phoneHeader, | |
107 | 109 | "buyer_mobile" => $phone, |
108 | 110 | "extraction_code" => $getCode, |
109 | 111 | "uuid" => $uuid |
... | ... | @@ -112,7 +114,7 @@ class DefaultController extends BaseController |
112 | 114 | if ($result) { |
113 | 115 | try { |
114 | 116 | $sms = new SmsMessage(); |
115 | - $sms->sendGetCode($phone, $getCode); | |
117 | + $sms->sendGetCode($phoneHeader.$phone, $getCode); | |
116 | 118 | } catch (\Exception $e) { } |
117 | 119 | $e->success = true; |
118 | 120 | $e->msg = '激活成功!'; | ... | ... |
app-wx/modules/smart/views/default/index.php
... | ... | @@ -25,6 +25,8 @@ $redirectInfo=$this->context->checkUserLevel('', true, "none"); |
25 | 25 | <?=$this->render('pages/enter-template', ['asset' => $asset])?> |
26 | 26 | <?=$this->render('pages/actived-template', ['asset' => $asset])?> |
27 | 27 | <?=$this->render('pages/error-url-template', ['asset' => $asset])?> |
28 | +<?=$this->render('pages/error-template', ['asset' => $asset])?> | |
29 | +<?=$this->render('pages/success-template', ['asset' => $asset])?> | |
28 | 30 | |
29 | 31 | <script> |
30 | 32 | var redirect="<?=$redirectInfo['redirect_url']?>"; | ... | ... |
app-wx/modules/smart/views/default/pages/enter-template.php
... | ... | @@ -44,7 +44,8 @@ $baseUrl = Url::base(true); |
44 | 44 | <div class="input-item-cls" style="display:grid;flex-direction: row"> |
45 | 45 | <label class="pub-title">手机号<span class="require-cls">(用于接收“提取码”短信)</span></label> |
46 | 46 | <div class="input-box-cls"> |
47 | - <input class="input-cls phone-number" type="number" placeholder="请输入手机号" maxlength="11"/> | |
47 | + <input class="input-cls phone-number-header" type="number" placeholder="开头(86)" maxlength="6"/> | |
48 | + <input class="input-cls phone-number" type="number" placeholder="请输入手机号" maxlength="15"/> | |
48 | 49 | </div> |
49 | 50 | </div> |
50 | 51 | </div> | ... | ... |
app-wx/modules/smart/views/default/pages/error-template.php
0 → 100644
... | ... | @@ -0,0 +1,53 @@ |
1 | +<?php | |
2 | + | |
3 | +use yii\helpers\Url; | |
4 | + | |
5 | +$baseUrl = Url::base(true); | |
6 | +?> | |
7 | +<style> | |
8 | + #error .page-content { | |
9 | + background-color: #fff; | |
10 | + } | |
11 | + #error .scan-image-div { | |
12 | + padding-top: 7.41rem; | |
13 | + text-align: center; | |
14 | + } | |
15 | + #error .scan-image { | |
16 | + width: 2.5rem; | |
17 | + height: 2.5rem; | |
18 | + margin: 0 auto; | |
19 | + } | |
20 | + #error .scan-button { | |
21 | + margin: 0 auto; | |
22 | + width: 15.75rem; | |
23 | + height: 2.81rem; | |
24 | + text-align: center; | |
25 | + line-height: 2.81rem; | |
26 | + font-size:1.13rem; | |
27 | + font-weight:400; | |
28 | + color:rgba(0,0,0,1); | |
29 | + } | |
30 | + #error .tip-bottom { | |
31 | + font-size:1rem; | |
32 | + font-weight:400; | |
33 | + color:rgba(106,106,106,1); | |
34 | + line-height:1.5rem; | |
35 | + } | |
36 | +</style> | |
37 | +<script id="error-template" type="text/template"> | |
38 | + <div class="pages" id="error"> | |
39 | + <div class="page"> | |
40 | + <div class="page-content"> | |
41 | + <div class="scan-image-div"> | |
42 | + <img src="<?=$baseUrl?>/i/enter/error.png" class="scan-image"/> | |
43 | + </div> | |
44 | + <div class="scan-button"> | |
45 | + 该标签无效 | |
46 | + </div> | |
47 | + <div class="scan-button tip-bottom"> | |
48 | + 请联系标签客服 | |
49 | + </div> | |
50 | + </div> | |
51 | + </div> | |
52 | + </div> | |
53 | +</script> | ... | ... |
app-wx/modules/smart/views/default/pages/styles/_enter-style.php
... | ... | @@ -8,10 +8,11 @@ |
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 .phone-number{height:2.81rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; margin: 0.5rem 0;} | |
12 | - #enter .up-part .input-box-cls{width:100%;line-height: 1.25rem;} | |
11 | + #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 | + #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 | + #enter .up-part .input-box-cls{width:100%;line-height: 1.25rem;display: inline-flex;} | |
13 | 14 | #enter .up-part .input-cls{width: 98.5%;line-height: inherit;font-size: 1rem;border:0} |
14 | - #enter .up-part .content-cls{width:100%;border:0;line-height: 1.8rem;height: 6.5rem;font-size: 1rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; } | |
15 | + #enter .up-part .content-cls{resize:none;width:100%;border:0;line-height: 1.8rem;height: 6.5rem;font-size: 1rem;background:rgba(242,242,242,1);border-radius:0rem;padding-left: 0.5rem; } | |
15 | 16 | #enter .up-part .upload-li{width:25%;float:left;/*padding:0.3rem 0.4rem;*/padding-left:0;box-sizing: border-box; } |
16 | 17 | #enter .up-part .upload-item{width:100%;height:0;padding-bottom: 100%;overflow:hidden; |
17 | 18 | background-position: center center; | ... | ... |
app-wx/modules/smart/views/default/pages/success-template.php
0 → 100644
... | ... | @@ -0,0 +1,44 @@ |
1 | +<?php | |
2 | + | |
3 | +use yii\helpers\Url; | |
4 | + | |
5 | +$baseUrl = Url::base(true); | |
6 | +?> | |
7 | +<style> | |
8 | + #success .page-content { | |
9 | + background-color: #fff; | |
10 | + } | |
11 | + #success .scan-image-div { | |
12 | + padding-top: 7.41rem; | |
13 | + text-align: center; | |
14 | + } | |
15 | + #success .scan-image { | |
16 | + width: 2.5rem; | |
17 | + height: 2.5rem; | |
18 | + margin: 0 auto; | |
19 | + } | |
20 | + #success .scan-button { | |
21 | + margin: 0 auto; | |
22 | + width: 15.75rem; | |
23 | + height: 2.81rem; | |
24 | + text-align: center; | |
25 | + line-height: 2.81rem; | |
26 | + font-size:1.13rem; | |
27 | + font-weight:400; | |
28 | + color:rgba(0,0,0,1); | |
29 | + } | |
30 | +</style> | |
31 | +<script id="success-template" type="text/template"> | |
32 | + <div class="pages" id="success"> | |
33 | + <div class="page"> | |
34 | + <div class="page-content"> | |
35 | + <div class="scan-image-div"> | |
36 | + <img src="<?=$baseUrl?>/i/enter/success.png" class="scan-image"/> | |
37 | + </div> | |
38 | + <div class="scan-button"> | |
39 | + 激活成功! | |
40 | + </div> | |
41 | + </div> | |
42 | + </div> | |
43 | + </div> | |
44 | +</script> | ... | ... |
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-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/submit"),d=1,c="",l=!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"]}),c=e.params.uuid,e.hideAllNonBaseMenuItem(window.$site),e.render(),e.loadAddress()},e.bindEvents=function(){var e=this;s("#enter").on("click",".upload-btn-cls",function(){var t=s(this).parents("li");e.uploadImg(t)}),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",".up-img .upload-item",function(e){var t=s(this).attr("data-url");s("#img-mask").remove();var n='<div id="img-mask" style="z-index:2;background:#000;justify-content:center;position: absolute;bottom:0;top:0;width:100%;display:flex;flex-direction: column;align-items: center"><div style="width:100%;"> <img width="100%" src="'+t+'" /></div><div id="set-convert-btn" style="position: absolute;bottom: 0;width: 100%;color: #000;text-align: center;padding: 1rem 0;z-index: 2;background: rgba(255,255,255,0.5)">设置为封面</div></div>';s("#publish").append(n)}),s("#enter").on("click","#dropdown-address",function(e){s(".address-input").val(s(this).html())}),s("#enter").on("click","#set-convert-btn",function(e){var t=s(this).parent().find("img").attr("src");s("#publish .convert-img").remove(),s('div[data-url="'+t+'"]').append('<div class="convert-img">封面</div>'),s("#img-mask").remove()}),s("#enter").on("click","#img-mask, #img-mask img",function(e){s("#img-mask").remove()}),s("#enter").on("click",".submit-btn",function(){if(n.isEmpty(c))return n.toast({content:"进入方式不对,请从新扫码激活",closeDelay:3e3}),!1;var i=s(".upload-item").attr("data"),o=s(".address-input").val(),r=s(".content-cls").val(),d=s(".phone-number").val();return n.isEmpty(i)?(n.toast({content:"请选择商品图片或视频",closeDelay:3e3}),!1):n.isEmpty(o)?(n.toast({content:"请填写发货地址",closeDelay:3e3}),s(".address-input").focus(),!1):n.isEmpty(r)?(n.toast({content:"请填写商家留言",closeDelay:3e3}),s(".content-cls").focus(),!1):n.isMobile(d)?(s(".submit-btn").attr("disabled","disabled"),void s.ajax({method:"POST",url:a,data:{file_data:i,address:o,content:r,phone:d,uuid:c},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success?(s(".submit-btn").removeAttr("disabled"),n.toast({content:e.msg}),setTimeout(function(){redirectUrl=t.to("smart#index"),window.location.href=redirectUrl},2e3)):n.toast({content:e.msg})},error:function(e){n.alert(e.responseText)},complete:function(t){s(".submit-btn").removeAttr("disabled"),e.hideIndicator()}})):(n.toast({content:"请填写正确手机号码",closeDelay:3e3}),s(".phone-number").focus(),!1)})},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&&(l=!0,s("#dropdown-address").html(e.address),s(".address-input").focus(function(e){l&&s("#dropdown-address").show()}),s(".address-input").blur(function(e){l&&s("#dropdown-address").hide()}))}catch(t){}},error:function(e){},complete:function(t){e.hideIndicator()}})},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,d=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,c=r.parseUrlQuery(o);if(null!=c&&void 0!==c&&null!=c.uuid&&void 0!==c.uuid){if(c.uuid.indexOf("@")==-1)return n.toast({content:"该智能防伪二维码无效"}),!1;var c=c.uuid.split("@"),l=t.to("smart#enter/"+c[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:c[0]},dataType:"json",beforeSend:function(){e.showIndicator()},success:function(e){e.success==s?window.location.href=u:e.success==a?window.location.href=l:e.success==d?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}); | |
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/submit"),c=1,d="",u=!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"]}),d=e.params.uuid,e.hideAllNonBaseMenuItem(window.$site),e.render(),e.loadAddress()},e.bindEvents=function(){var e=this;s("#enter").on("click",".upload-btn-cls",function(){var t=s(this).parents("li");e.uploadImg(t)}),s("#enter").on("click",".del-img",function(e){s(this).parent().remove(),c>=s("#image-list").find(".up-img").length&&s(".upload-btn-li").show()}),s("#enter").on("click",".up-img .upload-item",function(e){var t=s(this).attr("data-url");s("#img-mask").remove();var n='<div id="img-mask" style="z-index:2;background:#000;justify-content:center;position: absolute;bottom:0;top:0;width:100%;display:flex;flex-direction: column;align-items: center"><div style="width:100%;"> <img width="100%" src="'+t+'" /></div><div id="set-convert-btn" style="position: absolute;bottom: 0;width: 100%;color: #000;text-align: center;padding: 1rem 0;z-index: 2;background: rgba(255,255,255,0.5)">设置为封面</div></div>';s("#publish").append(n)}),s("#enter").on("click","#dropdown-address",function(e){s(".address-input").val(s(this).html())}),s("#enter").on("click","#set-convert-btn",function(e){var t=s(this).parent().find("img").attr("src");s("#publish .convert-img").remove(),s('div[data-url="'+t+'"]').append('<div class="convert-img">封面</div>'),s("#img-mask").remove()}),s("#enter").on("click","#img-mask, #img-mask img",function(e){s("#img-mask").remove()}),s("#enter").on("click",".submit-btn",function(){if(n.isEmpty(d))return n.toast({content:"进入方式不对,请从新扫码激活",closeDelay:3e3}),!1;var i=s(".upload-item").attr("data"),o=s(".address-input").val(),r=s(".content-cls").val(),c=s(".phone-number").val(),u=s(".phone-number-header").val();return n.isEmpty(i)?(n.toast({content:"请选择商品图片或视频",closeDelay:3e3}),!1):n.isEmpty(o)?(n.toast({content:"请填写发货地址",closeDelay:3e3}),s(".address-input").focus(),!1):n.isEmpty(r)?(n.toast({content:"请填写商家留言",closeDelay:3e3}),s(".content-cls").focus(),!1):n.isEmpty(u)?"86"!=u||n.isMobile(c)?(s(".submit-btn").attr("disabled","disabled"),void s.ajax({method:"POST",url:a,data:{file_data:i,address:o,content:r,phone:c,phone_header:u,uuid:d},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()}})):(n.toast({content:"请填写正确手机号码",closeDelay:3e3}),s(".phone-number").focus(),!1):(n.toast({content:"请填写手机号码开头",closeDelay:3e3}),s(".phone-number-header").focus(),!1)})},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),c==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&&(u=!0,s("#dropdown-address").html(e.address),s(".address-input").focus(function(e){u&&s("#dropdown-address").show()}),s(".address-input").blur(function(e){u&&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(),setTimeout(function(){window.location.href=t.to("smart#index")},5e3)},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},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,c=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("@"),u=t.to("smart#enter/"+d[0]),l=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=l:e.success==a?window.location.href=u:e.success==c?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(),setTimeout(function(){window.location.href=t.to("smart#index")},5e3)},e.bindEvents=function(){r(".back-button").click(function(){window.history.go(-1)})},e}); | |
3 | 3 | \ No newline at end of file | ... | ... |
2.43 KB
2.54 KB
app-wx/web/src/js/smart/app.js
... | ... | @@ -58,6 +58,16 @@ define( |
58 | 58 | _autoLoading(); |
59 | 59 | return app.runController('actived'); |
60 | 60 | }, |
61 | + 'error': function () { | |
62 | + fromOutside = false; | |
63 | + _autoLoading(); | |
64 | + return app.runController('error'); | |
65 | + }, | |
66 | + 'success': function () { | |
67 | + fromOutside = false; | |
68 | + _autoLoading(); | |
69 | + return app.runController('success'); | |
70 | + }, | |
61 | 71 | 'error-url': function () { |
62 | 72 | fromOutside = false; |
63 | 73 | _autoLoading(); | ... | ... |
app-wx/web/src/js/smart/enter-controller.js
... | ... | @@ -113,6 +113,7 @@ define( |
113 | 113 | var address = $$(".address-input").val(); |
114 | 114 | var content = $$(".content-cls").val(); |
115 | 115 | var phoneNumber = $$(".phone-number").val(); |
116 | + var phoneNumberHeader = $$(".phone-number-header").val(); | |
116 | 117 | if (utils.isEmpty(fileData)) { |
117 | 118 | utils.toast({content:'请选择商品图片或视频', closeDelay:3000}); |
118 | 119 | return false; |
... | ... | @@ -127,11 +128,18 @@ define( |
127 | 128 | $$(".content-cls").focus(); |
128 | 129 | return false; |
129 | 130 | } |
130 | - if (!utils.isMobile(phoneNumber)) { | |
131 | - utils.toast({content:'请填写正确手机号码', closeDelay:3000}); | |
132 | - $$(".phone-number").focus(); | |
131 | + if (!utils.isEmpty(phoneNumberHeader)) { | |
132 | + utils.toast({content:'请填写手机号码开头', closeDelay:3000}); | |
133 | + $$(".phone-number-header").focus(); | |
133 | 134 | return false; |
134 | 135 | } |
136 | + if (phoneNumberHeader == "86") { | |
137 | + if (!utils.isMobile(phoneNumber)) { | |
138 | + utils.toast({content:'请填写正确手机号码', closeDelay:3000}); | |
139 | + $$(".phone-number").focus(); | |
140 | + return false; | |
141 | + } | |
142 | + } | |
135 | 143 | $$('.submit-btn').attr("disabled", "disabled"); |
136 | 144 | $$.ajax({ |
137 | 145 | method : "POST", |
... | ... | @@ -141,6 +149,7 @@ define( |
141 | 149 | address: address, |
142 | 150 | content: content, |
143 | 151 | phone: phoneNumber, |
152 | + phone_header: phoneNumberHeader, | |
144 | 153 | uuid: uuid |
145 | 154 | }, |
146 | 155 | dataType : "json", |
... | ... | @@ -150,13 +159,15 @@ define( |
150 | 159 | success : function(res){ |
151 | 160 | if(res.success){ |
152 | 161 | $$('.submit-btn').removeAttr("disabled"); |
153 | - utils.toast({content:res.msg}); | |
162 | + /* utils.toast({content:res.msg}); | |
154 | 163 | setTimeout(function () { |
155 | - redirectUrl = url.to('smart#index'); | |
156 | - window.location.href = redirectUrl; | |
157 | - },2000); | |
164 | + redirectUrl = url.to('smart#index'); | |
165 | + window.location.href = redirectUrl; | |
166 | + },2000);*/ | |
167 | + window.location.href = url.to('smart#success'); | |
158 | 168 | }else{ |
159 | - utils.toast({content:res.msg}); | |
169 | + //utils.toast({content:res.msg}); | |
170 | + window.location.href = url.to('smart#error'); | |
160 | 171 | } |
161 | 172 | }, |
162 | 173 | error : function(e){ | ... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +/** | |
2 | + * 激活失败控制器 | |
3 | + */ | |
4 | +define( | |
5 | + "smart/error-controller", | |
6 | + [ | |
7 | + 'mk7/controller', | |
8 | + 'mk7/url', | |
9 | + 'mk7/utils', | |
10 | + 'mk7/modals', | |
11 | + 'mk7/jweixin' | |
12 | + ], | |
13 | + function (ctrl, url, utils, modals, jweixin) { | |
14 | + var ctrl = new ctrl(); | |
15 | + var $$ = Dom7; | |
16 | + var t7 = Template7; | |
17 | + | |
18 | + ctrl.run = function () { | |
19 | + var me = this; | |
20 | + me.setPageTitle("激活结果"); | |
21 | + me.render(); | |
22 | + setTimeout(function () { | |
23 | + window.location.href = url.to('smart#index'); | |
24 | + },5000); | |
25 | + }; | |
26 | + | |
27 | + ctrl.bindEvents = function () { | |
28 | + var me = this; | |
29 | + $$(".back-button").click(function () { | |
30 | + window.history.go(-1); | |
31 | + }); | |
32 | + }; | |
33 | + return ctrl; | |
34 | + } | |
35 | +); | |
0 | 36 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +/** | |
2 | + * 激活成功控制器 | |
3 | + */ | |
4 | +define( | |
5 | + "smart/success-controller", | |
6 | + [ | |
7 | + 'mk7/controller', | |
8 | + 'mk7/url', | |
9 | + 'mk7/utils', | |
10 | + 'mk7/modals', | |
11 | + 'mk7/jweixin' | |
12 | + ], | |
13 | + function (ctrl, url, utils, modals, jweixin) { | |
14 | + var ctrl = new ctrl(); | |
15 | + var $$ = Dom7; | |
16 | + var t7 = Template7; | |
17 | + | |
18 | + ctrl.run = function () { | |
19 | + var me = this; | |
20 | + me.setPageTitle("激活结果"); | |
21 | + me.render(); | |
22 | + setTimeout(function () { | |
23 | + window.location.href = url.to('smart#index'); | |
24 | + },5000); | |
25 | + }; | |
26 | + | |
27 | + ctrl.bindEvents = function () { | |
28 | + var me = this; | |
29 | + $$(".back-button").click(function () { | |
30 | + window.history.go(-1); | |
31 | + }); | |
32 | + }; | |
33 | + return ctrl; | |
34 | + } | |
35 | +); | |
0 | 36 | \ No newline at end of file | ... | ... |
domain/smart/SellerInputRecord.php
... | ... | @@ -26,6 +26,7 @@ class SellerInputRecord |
26 | 26 | $sellerInputRecordModel->delivery_address = trim($item['delivery_address']); // 发货地址 |
27 | 27 | $sellerInputRecordModel->product_image_path = trim($item['product_image_path']); // 商品图片 |
28 | 28 | $sellerInputRecordModel->product_vedio_path = trim($item['product_vedio_path']); // 商品视频 |
29 | + $sellerInputRecordModel->buyer_mobile_header = trim($item['buyer_mobile_header']); // 买家手机号开头 | |
29 | 30 | $sellerInputRecordModel->buyer_mobile = trim($item['buyer_mobile']); // 买家手机号 |
30 | 31 | $sellerInputRecordModel->uuid = trim($item['uuid']); // 验证编号 |
31 | 32 | $sellerInputRecordModel->extraction_code = trim($item['extraction_code']); // 提取码 | ... | ... |