作者 王晓刚
1 个管道 的构建 通过 耗费 2 秒

我的分享

@@ -32,6 +32,31 @@ class Merchant extends WechatBase @@ -32,6 +32,31 @@ class Merchant extends WechatBase
32 return $this->fetch(); 32 return $this->fetch();
33 } 33 }
34 public function enter_view(){ 34 public function enter_view(){
  35 + $domain_name = $this->request->domain();//域名
  36 + $data = Db::name('merchant_audit')->where(['user_id'=>$this->user_id])->find();
  37 + if(!empty($data)){
  38 + if($data['status'] == 1){
  39 + //审核中
  40 + $this->redirect('audit1');
  41 + }else if($data['status'] == 2){
  42 + //审核通过
  43 + $this->redirect('audit2');
  44 + }
  45 + $business_images = explode(',',$data['business_images']);
  46 + foreach($business_images as $key => $b_i){
  47 + $business_images[$key] = $domain_name.$b_i;
  48 + }
  49 + $data['business_images'] = $business_images;
  50 +
  51 + $other_images = explode(',',$data['other_images']);
  52 + foreach($other_images as $key => $o_i){
  53 + $other_images[$key] = $domain_name.$o_i;
  54 + }
  55 + $data['other_images'] = $other_images;
  56 + }
  57 + $this->assign('user_id',$this->user_id);
  58 + $this->assign('data',$data);
  59 + $this->assign('title','商家入驻');
35 $options = [ 60 $options = [
36 'app_id' => config('wechat.app_id'), 61 'app_id' => config('wechat.app_id'),
37 'secret' => config('wechat.secret'), 62 'secret' => config('wechat.secret'),
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 营业执照<i>*</i> 38 营业执照<i>*</i>
39 </div> 39 </div>
40 <div class="submit_img"> 40 <div class="submit_img">
41 - <div class="submit_img_add"> 41 + <div class="submit_img_add upload_one">
42 <img src="__CDN__/assets/advertising/img/add.png" alt=""> 42 <img src="__CDN__/assets/advertising/img/add.png" alt="">
43 </div> 43 </div>
44 {foreach name="$data.business_images" item="b_i"} 44 {foreach name="$data.business_images" item="b_i"}
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 其他证件 57 其他证件
58 </div> 58 </div>
59 <div class="submit_img"> 59 <div class="submit_img">
60 - <div class="submit_img_add"> 60 + <div class="submit_img_add upload_two">
61 <img src="__CDN__/assets/advertising/img/add.png" alt=""> 61 <img src="__CDN__/assets/advertising/img/add.png" alt="">
62 </div> 62 </div>
63 {foreach name="$data.other_images" item="o_i"} 63 {foreach name="$data.other_images" item="o_i"}
@@ -83,19 +83,31 @@ @@ -83,19 +83,31 @@
83 {$jssdk} 83 {$jssdk}
84 ); 84 );
85 wx.ready(function () { 85 wx.ready(function () {
86 - $('.upload').click(function () { 86 + $('.upload_one').click(function () {
87 wx.chooseImage({ 87 wx.chooseImage({
88 count: 1, // 默认9 88 count: 1, // 默认9
89 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 89 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
90 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 90 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
91 success: function (res) { 91 success: function (res) {
92 $(res.localIds).each(function (key, localId) { 92 $(res.localIds).each(function (key, localId) {
93 - uploadImages(localId); 93 + uploadImages(localId,1);
94 }); 94 });
95 } 95 }
96 }); 96 });
97 }); 97 });
98 - function uploadImages(localId) { 98 + $('.upload_two').click(function () {
  99 + wx.chooseImage({
  100 + count: 1, // 默认9
  101 + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
  102 + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
  103 + success: function (res) {
  104 + $(res.localIds).each(function (key, localId) {
  105 + uploadImages(localId,2);
  106 + });
  107 + }
  108 + });
  109 + });
  110 + function uploadImages(localId,type) {
99 wx.uploadImage({ 111 wx.uploadImage({
100 localId: localId, 112 localId: localId,
101 isShowProgressTips: 1, 113 isShowProgressTips: 1,
@@ -108,6 +120,11 @@ @@ -108,6 +120,11 @@
108 success:function(res){ 120 success:function(res){
109 console.log(res); 121 console.log(res);
110 if(res.code == 1){ 122 if(res.code == 1){
  123 + if(type == 1){
  124 +
  125 + }else if(type == 2){
  126 +
  127 + }
111 $('.upload').find('img').attr('src',res.data); 128 $('.upload').find('img').attr('src',res.data);
112 $('#avatar').val(res.data); 129 $('#avatar').val(res.data);
113 } 130 }