作者 lihan

首页、列表页、详情页、个人中心

... ... @@ -59,7 +59,7 @@ $configs = [
// | 模块设置
// +----------------------------------------------------------------------
// 默认模块名
'default_module' => 'portal',
'default_module' => 'index',
// 禁止访问模块
'deny_module_list' => ['common'],
// 默认控制器名
... ...
<?php
namespace app\goods\controller;
use app\goods\model\GoodsModel;
use cmf\controller\HomeBaseController;
use think\Db;
class GoodsController extends HomeBaseController
{
public function goodsList()
{
$request = request();
$cid = $request->param('cid');
$category = [];
if (!$request->isAjax()) {
$category = $this->getCategory($cid);
$cid = $category[0]['id'];
}
$goods = new GoodsModel;
$goodsList = $goods->getGoods(null, $cid);
if ($request->isAjax()) {
$html = '';
if (!empty($goodsList)) {
foreach ($goodsList as $item) {
$html .= '
<a href="' . url('goods/Goods/detail', ['id' => $item['id']]) . '">
<div class="container_list">
<div class="text_img">
<img src="' . $item['thumb'] . '" alt="">
</div>
<div class="container_info">
<p class="info_name">
' . $item['name'] . '
</p>
<p class="info_num">
' . $item['intro'] . '
</p>
<div class="people">
<p class="people_weight">
购买可获得40积分
</p>
<p class="people_money">¥<span class="money">' . $item['price'] . '</span></p>
</div>
</div>
</div>
</a>
';
}
} else {
$html = '<div style="width: 100%; text-align: center; font-size: small">暂无商品</div>';
}
$this->success('', '', $html);
} else {
return $this->fetch(':list', [
'category' => $category,
'goodsList' => $goodsList
]);
}
}
public function detail()
{
$id = request()->param('id');
$data = Db::name('zj_goods')->field('thumb,name,intro,price,content')->where(['id' => $id])->find();
return $this->fetch(':detail', [
'data' => $data
]);
}
private function getCategory($cid)
{
return Db::name('zj_category')->field('id,name')->where(['cid' => $cid])->select()->toArray();
}
}
\ No newline at end of file
... ...
<?php
namespace app\goods\model;
use think\Model;
use think\Db;
class GoodsModel extends Model
{
public function getGoods($is_shove = null, $cid = null)
{
$map['is_sta'] = ['eq', 1];
$map['delete_time'] = ['eq', 0];
if ($cid != null) {
$map['cid'] = ['eq', $cid];
}
if($is_shove != null) {
$map['is_shove'] = ['eq', $is_shove];
}
$res = Db::name('zj_goods')->field('id,name,intro,price,thumb')
->where($map)
->select()->toArray();
foreach ($res as $k => $v) {
$res[$k]['thumb'] = cmf_get_image_url($v['thumb']);
}
return $res;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: yhbr
* Date: 2018/9/27
* Time: 9:58
*/
namespace app\index\controller;
use app\goods\model\GoodsModel;
use cmf\controller\HomeBaseController;
use think\Db;
class IndexController extends HomeBaseController
{
public function index()
{
return $this->fetch();
$goods = new GoodsModel;
$goodsList = $goods->getGoods(2);
$return = [
'banner' => getBanner(),
'goodsList' => $goodsList
];
return $this->fetch('', [
'data' => $return
]);
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: yhbr
* Date: 2018/9/27
* Time: 15:18
*/
namespace app\user\controller;
use cmf\controller\HomeBaseController;
use think\Db;
class CenterController extends HomeBaseController
{
function _initialize()
{
if (empty(session('user.id'))) {
$this->error('登录失败');
}
}
/**
* 个人中心首页
*/
public function index()
{
$userInfo = Db::name('user')->field('user_nickname,avatar,balance')->where(['id' => session('user.id')])->find();
return $this->fetch('index', [
'data' => $userInfo
]);
}
/**
* 个人信息
*/
public function userInfo()
{
$userInfo = Db::name('user')->field('user_nickname,avatar,sex,mobile')->where(['id' => session('user.id')])->find();
return $this->fetch('info', [
'data' => $userInfo
]);
}
public function editName()
{
$request = request();
if ($request->isAjax()) {
if (Db::name('user')->update(['id' => session('user.id'), 'user_nickname' => $request->param('user_nickname')])) {
$this->success('编辑成功', url('user/Center/userInfo'));
}
} else {
return $this->fetch('edit_name', [
'nickname' => Db::name('user')->where(['id' => session('user.id')])->value('user_nickname')
]);
}
}
public function editPhone()
{
$request = request();
if ($request->isAjax()) {
if (Db::name('user')->update(['id' => session('user.id'), 'mobile' => $request->param('mobile')])) {
$this->success('编辑成功', url('user/Center/userInfo'));
}
} else {
return $this->fetch('edit_phone', [
'mobile' => Db::name('user')->where(['id' => session('user.id')])->value('mobile')
]);
}
}
public function aboutUs()
{
$request = request();
if ($request->isAjax()) {
$data = [
'uid' => session('user.id'),
'content' => $request->param('content'),
'create_time' => time()
];
if (Db::name('zj_msg')->insert($data)) {
$this->success('感谢您的反馈', url('user/Center/userInfo'));
}
} else {
return $this->fetch('about_us', [
'data' => html_entity_decode(Db::name('zj_system')->value('about')),
'mobile' => Db::name('zj_system')->value('mobile')
]);
}
}
/**
* 地址管理
*/
public function addressManage() {
$address = Db::name('zj_user_place')
->field('id,name,province,city,county,mobile,is_sta')
->where(['uid'=>session('user.id')])
->select()
->toArray();
print_r($address);exit();
return $this->fetch('address_manage', [
'data' => $address
]);
}
}
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_9xhwk34nlhw.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/goodinfo_detail.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js" charset="utf-8"></script>
<title>商品详情</title>
</head>
<body>
<div class="container">
<div class="good_head">
<img src="{$data.thumb}" alt="">
</div>
<div class="good_info">
<p class="good_name">
{$data.name}
</p>
<p class="good_num">
{$data.intro}
</p>
<div class="people">
<p class="people_weight">
购买可获得40积分
</p>
<p class="people_money">
¥{$data.price}
</p>
</div>
</div>
<div class="line"></div>
<div class="good_content">
<p class="active" id="1">
<em></em>
图文详情
</p>
<p id="2">
<em></em>
评价
</p>
</div>
<div class="goodinfodetail">
<div class="good_detail_info">
<p class="product">商品信息</p>
<div class="good_info_img">
{$data.content}
</div>
</div>
</div>
<div class="evalute" style="display:none">
<div class="evalute_list">
<div class="evalute_people">
<p class="people_img">
<img src="__INDEX__/img/people.png" alt="">
</p>
<div class="people_info">
<p class="people_name">向昱筱</p>
<p class="people_date">2018-03-09</p>
</div>
</div>
<div class="evalute_text">
颜值高口感好,很新鲜,奶油一点都不腻,超清爽的口
感,奶香味很浓,非常喜欢。
</div>
</div>
<div class="evalute_list">
<div class="evalute_people">
<p class="people_img">
<img src="__INDEX__/img/people.png" alt="">
</p>
<div class="people_info">
<p class="people_name">向昱筱</p>
<p class="people_date">2018-03-09</p>
</div>
</div>
<div class="evalute_text">
质量很好,很好的一次购物,味道不错!
</div>
</div>
</div>
<div class="foot">
<div class="cartnum">
<p class="goodcart">
<img src="__INDEX__/img/goodcart.png" alt="">
<p class="num">12</p>
</p>
</div>
<p class="addcart">加入购物车</p>
<p class="buynow">立即购买</p>
</div>
</div>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".good_content p").click(function(){
console.log($(this).html())
$(this).addClass("active");
$(this).siblings("p").removeClass("active");
if($(this).attr("id")==1){
$(".goodinfodetail").css("display","block");
$(".evalute").css("display","none")
}else if($(this).attr("id")==2){
$(".evalute").css("display","block");
$(".goodinfodetail").css("display","none");
}
})
//立即购买
$(".buynow").click(function(){
window.location.href='order.html'
})
//加入购物车
$(".addcart").click(function(){
window.location.href='__INDEX__/shopcar/cart.html'
})
</script>
</body>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/dinnerpart.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js" charset="utf-8"></script>
<title>套餐专区</title>
<style>
a{text-decoration: none}
</style>
</head>
<body>
<div class="container">
<div class="navigation">
<ul class="goodlist">
<volist name="category" id="vo" key="k">
<li data-id="{$vo.id}" <if condition="$k eq '1'">class="left active"<else/>class="left"</if>>
<em></em>
{$vo.name}
</li>
</volist>
</ul>
</div>
<div class="goodinfo">
<volist name="goodsList" id="vo">
<a href="{:url('goods/Goods/detail',['id'=>$vo['id']])}">
<div class="container_list">
<div class="text_img">
<img src="{$vo.thumb}" alt="">
</div>
<div class="container_info">
<p class="info_name">
{$vo.name}
</p>
<p class="info_num">
{$vo.intro}
</p>
<div class="people">
<p class="people_weight">
购买可获得40积分
</p>
<p class="people_money"><span class="money">{$vo.price}</span></p>
</div>
</div>
</div>
</a>
</volist>
</div>
</div>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".goodlist li").click(function(){
$(this).addClass("active");
$(this).siblings("li").removeClass("active");
var cid=$(this).attr('data-id');
$.ajax({
url:"{:url('goods/Goods/goodsList')}",
data:{
cid:cid
},
type:"POST",
dataType:"JSON",
success: function (data) {
$(".goodinfo").html(data.data);
}
})
})
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -29,15 +29,11 @@
<div class="head">
<div class="swiper-container">
<div class="swiper-wrapper">
<volist name="data.banner" id="vo">
<div class="swiper-slide">
<img src="__INDEX__/img/abanner@2x.png" alt="" >
</div>
<div class="swiper-slide">
<img src="__INDEX__/img/abanner@2x.png" alt="" >
</div>
<div class="swiper-slide">
<img src="__INDEX__/img/abanner@2x.png" alt="" >
<a href="{$vo.url}"><img src="{$vo.image}" alt="" ></a>
</div>
</volist>
</div>
<div class="swiper-pagination"></div>
</div>
... ... @@ -48,13 +44,13 @@
</div>
<div class="special">
<p class="memberarea">
<img src="__INDEX__/img/aicon01@2x.png" alt="">
<a href="{:url('goods/Goods/goodsList',['cid'=>1])}"><img src="__INDEX__/img/aicon01@2x.png" alt=""></a>
</p>
<p class="cashzone">
<img src="__INDEX__/img/aicon02@2x.png" alt="">
<a href="{:url('goods/Goods/goodsList',['cid'=>2])}"><img src="__INDEX__/img/aicon02@2x.png" alt=""></a>
</p>
<p class="intergralarea">
<img src="__INDEX__/img/money.png" alt="">
<a href="{:url('goods/Goods/goodsList',['cid'=>3])}"><img src="__INDEX__/img/money.png" alt=""></a>
</p>
</div>
<div class="specialword">
... ... @@ -70,121 +66,26 @@
</div>
<div class="remmond">RECOMMEND</div>
<div class="text_body">
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
<div class="good">
<div class="good_img">
<img src="__INDEX__/img/apic01@2x.png" alt="">
</div>
<p class="good_name">
红枣酿造酒贵族经典
</p>
<p class="good_tast">
奶油味夏威夷果200g/袋
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">30</span></p>
<p class="people_comment">40人好评</p>
<volist name="data.goodsList" id="vo">
<div class="good" data-url="{:url('goods/Goods/detail',['id'=>$vo['id']])}">
<div class="good_img">
<img src="{$vo.thumb}" alt="">
</div>
<p class="good_name">
{$vo.name}
</p>
<p class="good_tast">
{$vo.intro}
</p>
<p class="good_points">
购买可获得40积分
</p>
<div class="people">
<p class="people_price"><span class="money">{$vo.price}</span></p>
<p class="people_comment">40人好评</p>
</div>
</div>
</div>
</volist>
</div>
<div class="line"></div>
<div class="foot">
... ... @@ -223,12 +124,6 @@
autoplay: true,//可选选项,自动滑动
})
//商品详情
$(".good").click(function(){
window.location.href='../homepage/goodinfo_detail.html'
})
//进入套餐专区
$(".memberarea").click(function(){
window.location.href='homepage/dinnerpart.html'
... ... @@ -239,13 +134,15 @@
$(".intergralarea").click(function(){
window.location.href='homepage/dinnerpart.html'
});
$(".good").click(function () {
window.location.href=$(this).attr('data-url');
})
$(".shopcart").click(function(){
window.location.href='shopcar/cart.html'
})
$(".membercenter").click(function(){
window.location.href='personcenter/personcenter.html'
window.location.href="{:url('user/Center/index')}";
})
</script>
</body>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="__INDEX__/css/weui.css">
<link rel="stylesheet" href="__INDEX__/css/jquery-weui.css">
<link rel="stylesheet" href="__INDEX__/css/demos.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>关于我们</title>
<style>
body,html{
width:100%;
height:100%;
}
.head{
width:7.5rem;
height:4.21rem;
}
.head img{
width:100%;
}
.company{
color:RGBA(0, 0, 0, 1);
font-size: 0.32rem;
margin: 0.35rem 3.11rem;
}
.company_text{
width:6.84rem;
height:2.26rem;
margin: 0 auto;
overflow-y: scroll;
}
.phone{
font-size: 0.26rem;
color:RGBA(37, 39, 41, 1);
margin: 0.33rem 0.32rem;
}
.message{
width:6.86rem;
height:2.2rem;
background:#EBEBEB;
margin: 0 auto;
padding: 0.3rem;
}
#livemessage{
width:6.3rem;
height:1.6rem;
color:#999999;
font-size: 0.28rem;
border:none;
outline:none;
background: #EBEBEB;
}
.sub{
width:6.86rem;
height:0.88rem;
text-align: center;
line-height: 0.88rem;
background:#FE0A01;
color:#fff;
font-size: 0.32rem;
border-radius: 0.44rem;
box-shadow:0px 15px 30px 0px rgba(254,10,1,0.24);
position:fixed;
bottom: 0.55rem;
left:0;
right:0;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="container">
<div class="head">
<img src="__INDEX__/img/ushead.png" alt="">
</div>
<p class="company">
公司简介
</p>
<div class="company_text">
{$data}
</div>
<p class="phone">客服电话:{$mobile}</p>
<div class="message">
<textarea name="" id="livemessage" cols="30" rows="10" placeholder="请写下您的留言"></textarea>
</div>
<p class="sub">提交</p>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".sub").click(function () {
$.ajax({
url:"{:url('user/Center/aboutUs')}",
data:{
content:$("#livemessage").val()
},
type:"POST",
dataType:"JSON",
success: function (data) {
alert(data.msg)
}
})
})
</script>
</div>
</body>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>编辑名字</title>
<style>
html,body{
width:100%;
height:100%;
background: RGBA(255, 255, 255, 1);
}
.edit_name{
width:6.86rem;
height:1rem;
display:flex;
background: RGBA(245, 246, 250, 1);
margin: 0 auto;
border-radius: 0.1rem;
margin-top: 0.32rem;
padding-left: 0.22rem;
/*padding: 0.37rem 0.22rem;*/
}
.name{
color:RGBA(26, 26, 26, 1);
font-size: 0.28rem;
font-weight: bold;
height:1rem;
line-height: 1rem;
}
.entername{
border:none;
outline:none;
height:1rem;
line-height: 1rem;
width:5.5rem;
background: RGBA(245, 246, 250, 1);;
margin-left: 0.1rem;
font-size: 0.28rem;
font-weight: bold;
}
.save{
position:fixed;
bottom:0.55rem;
left:0;
right:0;
width:6.86rem;
margin: 0 auto;
height:0.88rem;
background: RGBA(254, 10, 1, 1);
color:#fff;
font-size: 0.32rem;
border-radius: 0.44rem;
text-align: center;
line-height: 0.88rem;
box-shadow: 0px 15px 30px 0px rgba(254,10,1,0.24);
}
</style>
</head>
<body>
<div class="container">
<div class="edit_name">
<p class="name">昵称:</p>
<input type="text" class="entername" value="{$nickname}">
</div>
<div class="save">
保存
</div>
</div>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".save").click(function () {
$.ajax({
url:"{:url('user/Center/editName')}",
data:{
user_nickname:$(".entername").val()
},
type:"POST",
dataType:"JSON",
success: function (data) {
alert(data.msg);
window.location.href=data.url;
}
})
})
</script>
</body>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>编辑手机号</title>
<style>
body,html{
width:100%;
height:100%;
background: RGBA(245, 246, 250, 1);
}
.phone{
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
font-size: 0.28rem;
color: RGBA(151, 160, 168, 1);
/*padding: 0.37rem 0.52rem;*/
margin-top: 0.32rem;
}
.enterphone{
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
font-size: 0.28rem;
color: RGBA(151, 160, 168, 1);
padding: 0.37rem 0.52rem;
border:none;
outline:none;
}
.code{
font-size: 0;
display:flex;
justify-content: space-between;
align-content: center;
width:6.96rem;
margin: 0 auto;
height:1rem;
background: #fff;
border-radius: 0.5rem;
color: RGBA(151, 160, 168, 1);
margin-top: 0.32rem;
}
.code_num{
height:1rem;
line-height: 1rem;
font-size: 0.28rem;
margin-left: 0.52rem;
}
.entercode{
height:1rem;
line-height: 1rem;
font-size: 0.28rem;
outline:none;
border:none;
border-radius: 0.5rem;
color: RGBA(151, 160, 168, 1);
}
.sendcode{
width:2.44rem;
font-size: 0.28rem;
height:0.72rem;
background: RGBA(254, 10, 1, 1);
color:#fff;
border-radius: 0.36rem;
line-height: 0.72rem;
text-align: center;
margin-top: 0.15rem;
margin-right: 0.37rem;
}
.nextstep{
width:6.86rem;
height:0.88rem;
text-align: center;
line-height: 0.88rem;
background:RGBA(254, 10, 1, 1);
font-size: 0.32rem;
color:#fff;
border-radius: 0.44rem;
position:fixed;
bottom:0.55rem;
left:0;
right:0;
margin: 0 auto;
box-shadow:0px 15px 30px 0px rgba(254,10,1,0.24);
}
</style>
</head>
<body>
<div class="container">
<div class="phone">
<input type="text" class="enterphone" placeholder="手机号">
</div>
</div>
<div class="code">
<p class="code_num">
<input type="text" class="entercode" placeholder="验证码">
</p>
<p class="sendcode">发送验证码</p>
</div>
<p class="nextstep">
下一步
</p>
</body>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
$(".nextstep").click(function(){
window.location.href='editnewphone.html'
})
</script>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_750594_itt4qc4xfcg.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/personcenter.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js" charset="utf-8"></script>
<title>个人中心</title>
</head>
<body>
<div class="container">
<div class="header">
<div class="person_info">
<p class="person_img">
<img src="{$data.avatar}" alt="">
</p>
<p class="person_name">
{$data.user_nickname}
</p>
</div>
<p class="change">
<img src="__INDEX__/img/xiugai@2x.png" alt="">
</p>
</div>
<div class="myorder">
<div class="my_order">
<p class="iconfont icon-dingdan iconmyorder"></p>
<P class="my_order_list">我的订单</P>
</div>
<div class="allorder">
<p class="my_all_order">全部订单</p>
<p class="iconfont icon-common-jinru-copy iconallorder"></p>
</div>
</div>
<div class="kind">
<div class="type">
<p class=" exchange">
<img src="__INDEX__/img/exchange.png" alt="">
</p>
<P class="delivery_type">待兑换</P>
</div>
<div class="type">
<p class="delivery">
<img src="__INDEX__/img/deliver.png" alt="">
</p>
<p class="delivery_type">待发货</p>
</div>
<div class="type">
<p class="alderydelivery">
<img src="__INDEX__/img/alderydelivery.png" alt="">
</p>
<p class="delivery_type">已发货</p>
</div>
<div class="type">
<p class="finish">
<img src="__INDEX__/img/finish.png" alt="">
</p>
<p class="delivery_type">已完成</p>
</div>
</div>
<div class="accumulate interg">
<p class="myaccumulate">我的积分</p>
<div class="accumulate_num">
<p class="accumulate_fen">{$data.balance}</p>
<P class="iconfont icon-jinru row_enter"></P>
</div>
</div>
<div class="accumulate address">
<p class="myaccumulate">地址管理</p>
<div class="accumulate_num">
<p class="accumulate_fen"></p>
<P class="iconfont icon-jinru row_enter"></P>
</div>
</div>
<div class="accumulate us">
<p class="myaccumulate">关于我们</p>
<div class="accumulate_num">
<p class="accumulate_fen"></p>
<P class="iconfont icon-jinru row_enter"></P>
</div>
</div>
<div class="foot">
<div class="home">
<p class="home_img">
<img src="__INDEX__/img/homegray.png" alt="">
</p>
<p class="home_page">首页</p>
</div>
<div class="shopcart">
<p class="shopcart_img">
<img src="__INDEX__/img/cartgray.png" alt="">
</p>
<p class="shop_cart">
购物车
</p>
</div>
<div class="membercenter">
<p class="member_img">
<img src="__INDEX__/img/personred.png" alt="">
</p>
<p class="member_center">
会员中心
</p>
</div>
</div>
</div>
</body>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
//编辑个人资料
$(".change").click(function(){
window.location.href="{:url('user/Center/userInfo')}";
});
//我的积分
$(".interg").click(function(){
window.location.href='myintegration.html'
})
//关于我们
$(".us").click(function(){
window.location.href="{:url('user/Center/aboutUs')}";
});
//地址管理
$(".address").click(function(){
window.location.href="{:url('user/Center/addressManage')}"
})
//全部订单
$(".myorder").click(function(){
window.location.href='myorder.html'
})
$(".home").click(function(){
window.location.href="{:url('index/Index/index')}";
})
$(".shopcart").click(function(){
window.location.href='__INDEX__/shopcar/cart.html'
})
</script>
</html>
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_750594_itt4qc4xfcg.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/editmateial.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<title>编辑资料</title>
<style>
#imghead{
width:100%;height:100%;
border-radius: 50%;
margin-top: 0;
}
#preview{
width:1.2rem;
margin: 0 auto;
height:1.2rem;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="headwrap">
<div class="headpop">
<div id="preview">
<!--<img id="imghead" border="0" src="__INDEX__/img/head@2x.png" style="width:100%;height:100%" onclick="$('#previewImg').click();">-->
<p class="iconfont icon-xiangji" id="imghead" onclick="$('#previewImg').click();"></p>
</div>
<!--<img src="__INDEX__/img/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
<input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
</div>
</div>
<div class="head">
<p class="head_img">
<img src="{$data.avatar}" alt="">
</p>
</div>
<div class="item">
<div class="material_name editname">
<p class="item_name">昵称</p>
<div class="list_item_name">
<p class="list_name">{$data.user_nickname}</p>
<p class="iconfont icon-jinru"></p>
</div>
</div>
<div class="material_name edit_sex">
<p class="item_name">性别</p>
<div class="list_item_name">
<p class="list_name"><if condition="$data['sex'] eq '0'"><else/></if></p>
<p class="iconfont icon-jinru"></p>
</div>
</div>
</div>
<div class="material_name editphone" style="margin-top: 0.16rem">
<p class="item_name">绑定手机号</p>
<div class="list_item_name">
<p class="list_name">{$data.mobile}</p>
<p class="iconfont icon-jinru"></p>
</div>
</div>
</body>
<script src="__INDEX__/js/jquery.min.js"></script>
<script>
//编辑姓名
$(".editname").click(function(){
window.location.href="{:url('user/Center/editName')}"
})
//绑定手机号
$(".editphone").click(function(){
window.location.href="{:url('user/Center/editPhone')}"
})
//上传头像
function clacImgZoomParam(maxWidth, maxHeight, width, height) {
var param = {
top: 0,
left: 0,
width: width,
height: height
};
if(width > maxWidth || height > maxHeight) {
rateWidth = width / maxWidth;
rateHeight = height / maxHeight;
if(rateWidth > rateHeight) {
param.width = maxWidth;
param.height = Math.round(height / rateWidth);
} else {
param.width = Math.round(width / rateHeight);
param.height = maxHeight;
}
}
param.left = Math.round((maxWidth - param.width) / 2);
param.top = Math.round((maxHeight - param.height) / 2);
return param;
}
function previewImage(file) {
$(".head_img").css("display","none")
var MAXWIDTH =60;
var MAXHEIGHT =77;
var div = document.getElementById('preview');
if(file.files && file.files[0]) {
div.innerHTML = '<img id=imghead onclick=$("#previewImg").click()>';
var img = document.getElementById('imghead');
img.onload = function() {
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
img.width = rect.width;
img.height = rect.height;
// img.style.marginLeft = rect.left+'px';
// img.style.marginTop = rect.top + 'px';
}
var reader = new FileReader();
reader.onload = function(evt) {
img.src = evt.target.result;
}
reader.readAsDataURL(file.files[0]);
} else //兼容IE
{
var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
file.select();
var src = document.selection.createRange().text;
div.innerHTML = '<img id=imghead>';
var img = document.getElementById('imghead');
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
// var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
// status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='100%;height:100%;border-radius:50%" + sFilter + src + "\"'></div>";
}
// var formData = new FormData();
// var fileM = document.querySelector("#previewImg");
// var fileObj = fileM.files[0];
// formData.append("files", fileObj);
// $.ajax({
// url: 'http://hula.wx.bronet.cn/index.php/MyComment/upload',
// type: 'POST',
// data: formData,
// async: false,
// cache: false,
// contentType: false,
// processData: false,
// success: function(res) {
// console.log(res);
// pic = res.data;
// console.log(pic);
// imgurl.push(pic);
// console.log(imgurl)
// var text = '';
// text += '<div class="evaluate_pic_item" style="float:left">' +
// '<img src="' + pic + '" class="delimg"/>' +
// '<div class="icon">' +
// '<img src="__INDEX__/img/10拷贝2@2x_59.png" />' +
// '</div>' +
// '</div>'
// $(".addimg").append(text);
// if(imgurl.length == 3) {
// $(".imgone").css("display", "none");
// }
// $("#imghead").attr("src","__INDEX__/img/3@2x.png");
// },
// error: function() {
//
// }
// });
}
</script>
</html>
... ...
<!DOCTYPE html>
<html>
<head>
<title>{$user_login}</title>
<meta name="keywords" content="" />
<meta name="description" content="">
<include file="public@head"/>
<style>
.control-label{
font-weight: bold;
float: left;
width: 70px;
}
</style>
</head>
<body class="body-white" id="top">
<include file="public@nav" />
<div class="container tc-main">
<div class="row">
<div class="tabs col-md-offset-2 col-md-8">
<div class="tab-content">
<div class="tab-pane active" id="one">
<div class="col-md-3">
<a href="javascript:;">
<if condition="empty($avatar)">
<img src="/themes/simpleboot3/Public/assets/images/headicon_128.png" class="headicon" width="128" />
<else />
<img src="__ROOT__/upload/{$avatar}" class="headicon" width="128"/>
</if>
</a>
</div>
<div class="col-md-9">
<div class="form-group">
<label class="control-label" for="input-user_nicename">昵称</label>
<div>{$user_nickname|default='未填写'}</div>
</div>
<div class="form-group">
<label class="control-label" for="input-sex">性别</label>
<div>
<php> $sexs=array("0"=>"保密","1"=>"程序猿","2"=>"程序媛");echo $sexs[$sex]; </php>
</div>
</div>
<div class="form-group">
<label class="control-label" for="input-birthday">生日</label>
<div>{:date('Y-m-d',$birthday)}</div>
</div>
<div class="form-group">
<label class="control-label" for="input-user_url">个人网址</label>
<div>{$user_url|default='未填写'}</div>
</div>
<div class="form-group">
<label class="control-label" for="input-signature">个性签名</label>
<div>{$signature|default='未填写'}</div>
</div>
</div>
</div>
</div>
</div>
</div>
<include file="public@footer" />
</div>
<!-- /container -->
<include file="public@scripts" />
</body>
</html>
\ No newline at end of file
... ... @@ -1823,3 +1823,11 @@ function getAccessToken(){
return $jssdk->getAccessToken();
}
function getBanner() {
$res = Db::name('slide_item')->field('image,url')->where(['slide_id' => 1])->select()->toArray();
foreach ($res as $k => $v) {
$res[$k]['image'] = cmf_get_image_url($v['image']);
}
return $res;
}
... ...
... ... @@ -8,7 +8,7 @@ class Doc
'version'=>'1.0.0',
'copyright'=>'银河百荣科技',
'controller' => [
'api\\home\\controller\\IndexController'
'app\\index\\controller\\IndexController'
],
'password'=>'bronet',
'static_path'=>'',
... ...