| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>请填写资料</title>
- <link href="/css/join/style.css?version=<?= $this->context->version ?>" rel="stylesheet" type="text/css">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="format-detection" content="telephone=no, email=no" />
- <link rel="stylesheet" href="/css/bootstrap.css?version=<?= $this->context->version ?>">
- <link rel="stylesheet" href="/css/custom.css?version=<?= $this->context->version ?>">
- <script src="/js/jquery-1.11.1.min.js?version=<?= $this->context->version ?>"></script>
- <script src="/js/bootstrap.min.js?version=<?= $this->context->version ?>"></script>
- <script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&libraries=geometry&key=OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH"></script>
- <script type="text/javascript" src="/js/jweixin-1.0.0.js?version=<?= $this->context->version ?>" ></script>
- <style>
- label{
- font-weight:normal;
- }
- .xhMask{position:fixed;left:0;top:0;width:100%;height:100%;z-index:99;background-color:gray;filter:alpha(opacity=25);opacity:0.2;display:none;}
- .xhBeCenterBox{position:fixed;width:40px;height:40px;display:block;z-index:999;display:none;}
- .hintMention{position:fixed;width:200px;height:120px;display:block;z-index:999;background:white;border-radius:10px;display:none;}
- .xhCenterModal{
- background-color: #8dc63f;
- border-color: #8dc63f;
- color: #ffffff;
- position:fixed;
- width:20%;
- font-size:12px;
- height:auto;
- padding:15px;
- z-index:999;
- display:none;
- width:180px;
- text-align:center;
- border-radius:4px;
- }
- </style>
- </head>
- <body>
- <div name="xhCenterModal" class="xhCenterModal"></div>
- <div name="applyBeCenterMask" class="xhMask"></div>
- <div class="xhBeCenterBox" name="applyBeCenter"><img src="/images/loader.gif" style="width:42px;" /></div>
- <div class="hintMention" name="hintMention" style="text-align:center;padding-top:15px;">
- <p>恭喜!邀请码有效</p>
- <p>优惠<span name="favorable" style="color:red;">0</span>元</p>
- <button name="closeHint" type="button" class="btn btn-info btn-single" style="background-color:#68b828;border-color: #e5e5e5;padding:4px 6px;margin:0 auto;">确认</button>
- </div>
- <div class="panel panel-default">
- <div class="panel-body">
- <form role="form">
- <div class="form-group">
- <label class="col-sm-2 control-label">*花店名称:</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" name="merchantName" placeholder="" <?php if($merchantName == $demoName){ ?>readonly="readonly"<?php } ?> value="<?= $merchantName ?>">
- <p></p>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">*花店地址:</label>
- <div id="citySelect" class="col-sm-10" style="padding-bottom:5px;">
- <select class="form-control prov" name="province" style="width:auto;display:inline;">
- <option value="福建">福建</option>
- </select>
- <select name="city" class="form-control city" style="width:auto;display:inline;">
- <option value="厦门">厦门</option>
- </select>
- <input type="text" style="margin-top:4px;" class="form-control" isSelect="false" oninput="getArea(this.value);" onpropertychange="getArea(this.value)" name="shopAddress" placeholder="所在街道、小区或商场">
- <div style="z-index: 999; background: rgb(243, 243, 243);margin-top:4px;" id="infoDiv">
- <div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; color: rgb(51, 51, 51); line-height: 20px; font-family: 'Tahoma 宋体 Arial'; border: 0px none;">
- </div>
- </div>
- <input type="text" class="form-control" name="shopAddressFloor" placeholder="楼号或门牌号(选填)">
- <p></p>
- </div>
- </div>
- <div style="margin-left:14px;">
- <div class="form-group" style="display:inline-block;padding:0;margin-right:8px;margin-bottom:0px;">
- <label class="col-sm-2 control-label" style="padding:0px;" >*店门照片</label>
- <div class="col-sm-10" style="padding:0px;">
- <div style="width:81px;height:100px;display:inline-block;">
- <a href="javascript:;" class="a-upload" name="shopImg">选择图片</a>
- <div style="width:80px;height:50px;display:inline-block;margin-bottom:4px;margin-top:3px;border:1px solid #CCC;overflow:hidden;">
- <img src="/images/nopicture2.png" name="shopImg" style="width:80px;" />
- </div>
- </div>
- <input type="hidden" name="shopImg" value="" />
- <p></p>
- </div>
- </div>
- <div class="form-group" style="display:inline-block;padding:0;margin-right:8px;margin-bottom:0px;">
- <label class="col-sm-2 control-label" style="padding:0px;">*店内照片</label>
- <div class="col-sm-10" style="padding:0px;">
- <div style="width:81px;height:100px;display:inline-block;">
- <a href="javascript:;" class="a-upload" name="shopImg2">选择图片</a>
- <div style="width:80px;height:50px;display:inline-block;margin-bottom:3px;margin-top:3px;border:1px solid #CCC;overflow:hidden;">
- <img src="/images/nopicture2.png" name="shopImg2" style="width:80px;" />
- </div>
- </div>
- <input type="hidden" name="shopImg2" value="" />
- <p></p>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">*支付宝帐号:</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" name="alipayAccount" placeholder="户主支付宝或公司支付宝帐号" value="">
- <p></p>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">*支付宝帐号姓名:</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" name="alipayAccountName" placeholder="请填写真实姓名,否则提现等会失败" value="">
- <p></p>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">*主营业务(选择后不可修改):</label>
- <div class="col-sm-10">
- <label><input name="manageStyle" type="radio" checked="checked" value="0" />零售</label>
- <label><input name="manageStyle" type="radio" value="1" />培训兼零售</label>
- <label><input name="manageStyle" type="radio" value="2" />鲜花批发</label>
- <p name="mobileHint"></p>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-sm-2 control-label">邀请码:</label>
- <div class="col-sm-10">
- <input type="text" class="form-control" name="inviteCode" placeholder="选填">
- <p name="mobileHint"></p>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-sm-2 control-label" style="color:#68b828;font-size:15px;">
- 年服务费:¥<span name="setPrice" pre-price="<?= $set['price'] ?>"><?= $set['price'] ?></span>元
- </label>
- </div>
- <div class="form-group-separator"></div>
- <div class="form-group" style="text-align:center;">
- <button type="button" name="applySubmit" class="btn btn-info btn-single">确认</button>
- </div>
- </form>
- </div>
- </div>
- <script type="text/javascript" src="/js/city/jquery.cityselect.js?version=<?= $this->context->version ?>"></script>
- <script src="/js/util.js?version=<?= $this->context->version ?>"></script>
- <script>
- var searchService = null;
- $(window).load(function() {
- //调用Poi检索类
- searchService = new qq.maps.SearchService({
- complete: function(results) {
- //设置回调函数参数
- var pois = results.detail.pois;
-
- if(pois == undefined ){
- $("#infoDiv div").html('');
- return;
- }
- var html = '<div style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; color: rgb(51, 51, 51); line-height: 20px; font-family:"Tahoma 宋体 Arial"; border: 0px none;">';
- html += '<div style="position: relative; height: 20px; line-height: 20px; font-size: 12px; color: rgb(153, 153, 153); padding: 0px 5px; background-color: rgb(243, 243, 243);">';
- html += '<span>搜索结果</span>';
- html += '</div>';
- html += '<ol style="list-style: none; padding: 0px; margin: 0px;">';
- for (var i = 0, l = pois.length; i < l; i++) {
- var poi = pois[i];
- (function(n) {
- var address = '';
- if(pois[n].address != undefined){//腾讯地图 搜索出来的地址,下方有解释地址,有可能为空的情况,如搜索 思明区
- address = pois[n].address;
- }
- var no = i+1;
- html += '<li onclick="getSearchArea(\''+pois[n].latLng+'\',\''+pois[n].name+'\')" style="margin: 2px 0; padding: 0 5px; cursor: pointer; zoom: 1;">';
- html += '<div style="float: left; display: inline; width: 20px; height: 20px; line-height: 20px; overflow: hidden; text-align: center;">'+no+'.</div>';
- html += '<div style="overflow: hidden; padding: 0 5px; zoom: 1;">';
- html += '<div style="color: #0059B3;">'+pois[n].name+'</div>';
- html += '<div>';
- html += '<div>';
- html += '<span style="color: #999999; font-size: 12px;">'+address+'</span>';
- html += '</div>';
- html += '<div>';
- html += '<span style="color: #999999; font-size: 12px;"> </span>';
- html += '</div>';
- html += '</div>';
- html += '</div>';
- html += '</li>';
-
- })(i);
- }
- html += '</ol>';
- html += '</div>';
- $("#infoDiv div").html(html);
- $("input[name=shopAddress]").attr("isSelect","false");//还没有选择搜索出来的内容
- },
- error: function() {
- $("#infoDiv div").html('');
- $("input[name=shopAddress]").attr("isSelect","false");//还没有选择搜索出来的内容
- }
- });
-
- });
- $("#citySelect").citySelect({
- prov: '福建',
- city: '厦门',
- nodata: "none"
- });
- //根据输入的去搜索
- function getArea()
- {
- var poiText = arguments[0];
- var city = $("select[name=city]").find("option:selected").val();
- if(city.length <= 0){
- return;
- }
- $("input[name=shopAddress]").attr("isSelect","false");
- searchService.setLocation(city);
- searchService.search(poiText);
- searchService.setPageIndex(0);
- searchService.setPageCapacity(10);
- }
- var shopLat,shopLong;
- //选择搜索的地址结果
- function getSearchArea()
- {
- var latLng = arguments[0];
- var area = arguments[1];
- $("input[name=shopAddress]").val(area).attr("isSelect","true").siblings('p').html('');
- var arr = latLng.split(",");
- shopLat = $.trim(arr[0]);//收件人纬度
- shopLong = $.trim(arr[1]);//收件人经度
- $("#infoDiv div").html('');
- }
- var merchantName = $("input[name=merchantName]");
- var shopAddress = $("input[name=shopAddress]");
- var inviteCode = $("input[name=inviteCode]");
- var shopImg = $("input[name=shopImg]");
- var shopImg2 = $("input[name=shopImg2]");
- var alipayAccount = $(":input[name=alipayAccount]");
- var alipayAccountName = $(":input[name=alipayAccountName]");
- var applyCheck = [merchantName,shopAddress,shopImg,shopImg2,alipayAccount];
- var wWidth = $(window).width();
- var wHeight = $(window).height();
- var scrollHeight = $(document).scrollTop();//获取当前窗口距离页面顶部高度
- var applyBeCenter = $("div[name=applyBeCenter]");
- var applyBeCenterMask = $("div[name=applyBeCenterMask]");
- var applyHeight = applyBeCenter.outerHeight();//取div高
- var applyWidth = applyBeCenter.outerWidth();//取div宽
- var rH = (wHeight - applyHeight) / 2 + scrollHeight;
- var rW = (wWidth - applyWidth) /2;
- applyBeCenter.css({"z-index":998,"position":"absolute","left":rW,"top":rH,});
- var hintMention = $("div[name=hintMention]");
- var hintHeight = hintMention.outerHeight();//取div高
- var hintWidth = hintMention.outerWidth();//取div宽
- var tH = (wHeight - hintHeight) / 2 + scrollHeight;
- var tW = (wWidth - hintWidth) /2;
- hintMention.css({"z-index":998,"position":"absolute","left":tW,"top":tH,});
- //浏览器有滚动条时的操作
- $(window).scroll(function() {
- scrollHeight = $(document).scrollTop();
- rH = (wHeight - applyHeight) / 2 + scrollHeight;
- rW = (wWidth - applyWidth) /2;
- applyBeCenter.css({"z-index":998,"position":"absolute","left":rW,"top":rH,});
- tH = (wHeight - hintHeight) / 2 + scrollHeight;
- tW = (wWidth - hintWidth) /2;
- hintMention.css({"z-index":998,"position":"absolute","left":tW,"top":tH,});
- });
- function showPop()
- {
- applyBeCenterMask.css('display','block');
- applyBeCenter.css("display","block");
- }
- function hidePop()
- {
- applyBeCenterMask.css('display','none');
- applyBeCenter.css("display","none");
- }
- wx.config({
- debug:false,
- appId: '',
- timestamp: 0,
- nonceStr: '',
- signature: '',
- jsApiList: [
- 'checkJsApi',
- 'onMenuShareTimeline',
- 'onMenuShareAppMessage',
- 'onMenuShareQQ',
- 'onMenuShareWeibo',
- 'chooseImage',
- 'uploadImage',
- ]
- });
- //选择图片
- $("a[name=shopImg]").click(function(){
- wx.chooseImage({
- count: 1, // 默认9
- sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
- success: function (res) {
- localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
- var myLocalId = localIds[0];
- showPop();
- wx.uploadImage({
- localId: myLocalId, // 需要上传的图片的本地ID,由chooseImage接口获得
- isShowProgressTips: 0, // 默认为1,显示进度提示
- success: function (res) {
- var serverId = res.serverId; // 返回图片的服务器端ID mediaId 图片有效期3天
- $.ajax({type:"GET",url:'/join/download-wx-img?mediaId='+serverId,dataType:'json',async:false,success:function(data){
- if(data.code == 'A0001'){
- $("input[name=shopImg]").val(data.data['large']).attr('applyInputStatus','yes').siblings('p').html('');
- $("img[name=shopImg]").attr('src','<?= Yii::$app->params['imgUrl'] ?>'+data.data['medium']);
- hidePop();//隐藏浮层
- }
- }
- });
- }
- });
- }
- });
- });
- //选择图片
- $("a[name=shopImg2]").click(function(){
- wx.chooseImage({
- count: 1, // 默认9
- sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
- success: function (res) {
- localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
- var myLocalId = localIds[0];
- showPop();
- wx.uploadImage({
- localId: myLocalId, // 需要上传的图片的本地ID,由chooseImage接口获得
- isShowProgressTips: 0, // 默认为1,显示进度提示
- success: function (res) {
- var serverId = res.serverId; // 返回图片的服务器端ID mediaId 图片有效期3天
- $.ajax({type:"GET",url:'/join/download-wx-img?mediaId='+serverId,dataType:'json',async:false,success:function(data){
- if(data.code == 'A0001'){
- $("input[name=shopImg2]").val(data.data['large']).attr('applyInputStatus','yes').siblings('p').html('');
- $("img[name=shopImg2]").attr('src','<?= Yii::$app->params['imgUrl'] ?>'+data.data['medium']);
- hidePop();//隐藏浮层
- }
- }
- });
- }
- });
- }
- });
- });
- setApplyStats(merchantName, '请填花店名称', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请填花店名称';
- }else if(getLength(val) >=0 && getLength(val) <=20){
- $.ajax({type:"GET",url:"/join/check-merchant-name?merchantName="+val,dataType:'json',async:false,success:function(data){
- if(data.code == 'A0001'){
- info[0] = true;
- }else{
- info[1] = data.msg;
- }
- }});
-
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(shopAddress, '请填写选择地址', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请填写选择地址';
- }else if(getLength(val) >=0 && getLength(val) <=20){
- info[0] = true;
- info[1] = '填写正确';
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(shopImg, '请上传照片', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请上传照片';
- }else if(getLength(val) >=0 && getLength(val) <=20){
- info[0] = true;
- info[1] = '填写正确';
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(shopImg2, '请上传照片', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请上传照片';
- }else if(getLength(val) >=0 && getLength(val) <=20){
- info[0] = true;
- info[1] = '填写正确';
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(inviteCode, '请填写邀请码', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[0] = true;
- }else if(val.length > 0){
- showPop();//显示浮层
- $.ajax({type:"GET",url:"/join/check-invite-code?code="+val,dataType:'json',async:false,success:function(data){
- if(data.code == 'A0001'){
- info[0] = true;
- applyBeCenter.css("display","none");
- hintMention.css("display","block");
- $("span[name=favorable]").html(data.data.save);
- var prePrice = $("span[name=setPrice]").attr('pre-price');
- var newPrice = calcSub(prePrice,data.data.save);//减去邀请码价值
- $("span[name=setPrice]").html(newPrice);
-
- }else{
- info[1] = data.msg;
- hidePop();//隐藏浮层
- }
- }});
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(alipayAccount, '请填写支付宝帐号', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请填写支付宝帐号';
- }else if(getLength(val) >=0 && getLength(val) <=100){
- info[0] = true;
- }else{
- info[0] = false;
- }
- return info;
- });
- setApplyStats(alipayAccountName, '请填写支付宝帐号姓名', function(val, mess){
- var info=[false, mess];
- if(val.length <= 0){
- info[1] = '请填写支付宝帐号姓名';
- }else if(getLength(val) >=0 && getLength(val) <=1000){
- info[0] = true;
- }else{
- info[0] = false;
- }
- return info;
- });
-
- $("button[name=applySubmit]").click(function(){
- var submitButtonObj = $(this);
- if(submitButtonObj.attr('submitStatus') == 'yes'){
- xhPopMsg('请稍候…',1000);
- return;
- }
- submitButtonObj.attr('submitStatus','yes');
- setTimeout(function(){
- submitButtonObj.attr('submitStatus','no');
- },3000);
- var applySubmitStatus = true;
- for(var om=0;om<applyCheck.length;om++){
- var singleObj = applyCheck[om]
- if(singleObj.attr('applyInputStatus') == undefined){
- singleObj.blur();
- }
- if(singleObj.attr('applyInputStatus') == 'no'){
- applySubmitStatus = false;
- }
- }
- var shopAddressVal = shopAddress.val();
- if(shopAddressVal.length > 0 && shopAddress.attr('isSelect') == 'false'){
- shopAddress.next('p').css("color","red").html('请选择下面的地址,或重新搜索选择');
- return;
- }
- if(applySubmitStatus == false){
- return;
- }
- shopAddressVal += $(":input[name=shopAddressFloor]").val();//楼号、门牌
- var province = $("select[name=province] option:selected").val();
- var city = $("select[name=city] option:selected").val();
- var manageStyle = $(':radio[name=manageStyle]:checked').val();
- params = "shopLong="+shopLong+"&shopLat="+shopLat+"&merchantName="+merchantName.val();
- params += "&shopAddress="+shopAddressVal+"&shopCity="+city+"&shopProvince="+province;
- params += "&inviteCode="+inviteCode.val()+"&shopImg="+shopImg.val()+"&shopImg2="+shopImg2.val()+"&manageStyle="+manageStyle;
- params += "&_csrf=<?= Yii::$app->request->csrfToken ?>&alipayAccount="+alipayAccount.val()+"&alipayAccountName="+alipayAccountName.val();
- $.ajax({type:"POST",url:'/join/add-merchant',dataType:'json',data:params,async:false,success:function(data){
- xhPopMsg(data.msg,1800);
- if(data.code == 'A0001'){
- if(data.data.toPay == 'yes'){
- setTimeout(function(){
- window.location.href="/pay/apply?orderId="+data.data.orderId;
- },1500);
- }else{
- setTimeout(function(){
- window.location.href='<?= Yii::$app->params['adminUrl'] ?>/admin/generate?account='+data.data.account+'&newAccount='+data.data.newAccount;
- },1500);
- }
- }
- }});
- });
- function setApplyStats(obj,mess,check)
- {
- obj.focus(function(){
- $(this).removeAttr('applyInputStatus');
- $(this).siblings('p').html('');
- });
- obj.blur(function(){
- var objVal = obj.val();
- var info = check(objVal,mess);
- if(info[0]){
- $(this).attr('applyInputStatus','yes');
- }else{
- $(this).attr('applyInputStatus','no');
- $(this).siblings('p').css("color","red").html(info[1]);
- }
- });
- }
- $('input:radio[name=accountStyle]').click(function(){
- var num = $(this).val();
- if(num == 3){
- $("div[name=accountStyle]").css("display","block");
- }else{
- $("div[name=accountStyle]").css("display","none");
- needValidate = [];
- }
- });
- //关闭邀请码的提示
- $("button[name=closeHint]").click(function(){
- applyBeCenterMask.css("display","none");
- hintMention.css("display","none");
- });
- </script>
- </body>
- </html>
|