作者 anyv
1 个管道 的构建 通过 耗费 0 秒

5

... ... @@ -141,6 +141,8 @@ class PersonalcenterController extends WeChatBaseController{
*/
public function shop_address(){
$data = Db::name('address') -> select();
$this -> assign('data',$data);
return $this -> fetch();
}
... ... @@ -151,7 +153,12 @@ class PersonalcenterController extends WeChatBaseController{
public function add_shop_address(){
if($this -> request -> isPost()){
$add = Db::name('address') -> insert($_POST);
if($add){
return true;
}else{
return false;
}
}else{
return $this -> fetch();
}
... ...
... ... @@ -77,9 +77,13 @@
address_content = $('#address_content').val();
address_content_con = $('#address_content_con').val();
detailed = address_content+address_content_con;
console.log(detailed);
$.post("{:url('Personalcenter/add_shop_address')}",{},function(){
$.post("{:url('Personalcenter/add_shop_address')}",{name:name,phone:phone,region:region,detailed:detailed},function(data){
if(data){
window.location.href = "{:url('Personalcenter/add_shop_address')}";
}else{
alert('保存失败!');
}
});
}
}
... ...
... ... @@ -23,36 +23,23 @@
<!-- 内容 -->
<div class="ad_content">
<ul id="ad_contentUl">
<li>
<div class="ad_conBox">
<div class="ad_con1">
<p class="ad_conName">孙骁骁</p>
<p class="ad_conMo">默认</p>
<p class="ad_conPhone">15222354896</p>
<img class="ad_conImg" src="__TMPL__/public/assets/images/35.png" alt="">
<volist name="data" id="vo">
<li>
<div class="ad_conBox">
<div class="ad_con1">
<p class="ad_conName">{$data.name}</p>
<p class="ad_conMo">默认</p>
<p class="ad_conPhone">{$data.phone}</p>
<img class="ad_conImg" src="__TMPL__/public/assets/images/35.png" alt="">
</div>
</div>
</div>
<p class="ad_conAddress">收货地址:天津市西青区红磡领事郡道与解放南路交口开运大厦18-7-2033白城科技公司</p>
<div class="ad_MoRemove">
<div class="ad_mo">设为默认</div>
<div class="ad_move">删除</div>
</div>
</li>
<li>
<div class="ad_conBox">
<div class="ad_con1">
<p class="ad_conName">孙骁骁</p>
<p class="ad_conMo">默认</p>
<p class="ad_conPhone">15222354896</p>
<img class="ad_conImg" src="__TMPL__/public/assets/images/35.png" alt="">
<p class="ad_conAddress">收货地址:{$data.region}{$data.detailed}</p>
<div class="ad_MoRemove">
<div class="ad_mo">设为默认</div>
<div class="ad_move">删除</div>
</div>
</div>
<p class="ad_conAddress">收货地址:天津市西青区红磡领事郡道与解放南路交口开运大厦18-7-2033白城科技公司</p>
<div class="ad_MoRemove">
<div class="ad_mo">设为默认</div>
<div class="ad_move">删除</div>
</div>
</li>
</li>
</volist>
</ul>
</div>
</div>
... ...