Skip to content

Commit

Permalink
update add
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericyhy committed Feb 21, 2017
1 parent f0f81c8 commit c951298
Show file tree
Hide file tree
Showing 23 changed files with 1,021 additions and 197 deletions.
Binary file not shown.
Binary file modified .sass-cache/8520709948cf6a5d821e937106bb197ccb969729/index.scssc
Binary file not shown.
55 changes: 55 additions & 0 deletions ajax/getlist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
class Goods{
public $goodsId;
public $goodsName;
public $goodsPrice;
public $goodsImg;
}

$con = new mysqli('127.0.0.1','root','','dome');
$con->query("set names utf8"); //设置编码为utf8 显示中文
$sql = 'select * from goods';
$res = $con->query($sql);
$arr = array();
if(!$con->connect_error){
if($res->num_rows > 0){
while($row = $res->fetch_assoc()){
$goods = new Goods();
$goods->goodsId = $row["gid"];
$goods->goodsName = $row["goodsname"];
$goods->goodsPrice = $row["goodsprice"];
$goods->goodsImg = $row["goodsImg"];

array_push($arr, $goods);
}

//返回json字符串
}else {
array_push($arr, "没有商品");
}
}else{
array_push($arr, "连接数据库失败");
}

print_r($arr);

//判断是否是jsonp的请求
//isset(var) 判断变量是否被定义
if(isset($_REQUEST['callback'])){
// 表示是一个jsonp的请求
//找到callback 的函数名称
$callback = $_REQUEST['callback'];
//调用callback的函数
$str = json_encode($arr);
print_r( $callback."('$str')");
}else{
array_push($arr, "连接数据库失败");
$str = json_encode($arr);
print_r( $str );

}


// print_r($str)

?>
1 change: 1 addition & 0 deletions ajax/list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"goodsId":"10001","goodsName":"\u5546\u54c11","goodsPrice":"100001","goodsImg":"http:\/\/localhost\/1611\/day22\/images\/1.jpg"},{"goodsId":"10002","goodsName":"\u5546\u54c12","goodsPrice":"100001","goodsImg":"http:\/\/localhost\/1611\/day22\/images\/2.jpg"},{"goodsId":"10004","goodsName":"\u5546\u54c13","goodsPrice":"100001","goodsImg":"http:\/\/localhost\/1611\/day22\/images\/3.jpg"},{"goodsId":"10005","goodsName":"\u5546\u54c14","goodsPrice":"100001","goodsImg":"http:\/\/localhost\/1611\/day22\/images\/4.jpg"},{"goodsId":"10006","goodsName":"\u5546\u54c15","goodsPrice":"100001","goodsImg":"http:\/\/localhost\/1611\/day22\/images\/5.jpg"}]
4 changes: 4 additions & 0 deletions ajax/new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name":"jk",
"data":[],
}
26 changes: 0 additions & 26 deletions css/index.css

This file was deleted.

6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var uglify = require("gulp-uglify") ;//压缩js
//task 第一个参数 任务名称
//第二个参数当前任务要干的事情
gulp.task("comCss",function(){
sass("./login/sass/index.scss",{
sass("./reg/sass/index.scss",{
style:"compact"
}).pipe(gulp.dest("css"))
}).pipe(gulp.dest("./reg/css"))
})

//给gulp添加livereload的功能
Expand Down Expand Up @@ -56,7 +56,7 @@ gulp.task("watch",function(){
//[] 要执行的任务
console.log('watch');
// gulp.watch("./*.html",["refalseHTML"]);
gulp.watch("./login/sass/index.scss",["comCss"]);
gulp.watch("./reg/sass/index.scss",["comCss"]);
// gulp.watch("./js/*.js",["js"]); //不科学
// gulp.watch("./css/*.css",['css']);
})
Expand Down
10 changes: 8 additions & 2 deletions html/login/login.html → html/reg/reg.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
<li><input type="text" name="phone_Num" class="phone_Num reg_text" placeholder="请输入手机号码"></li>
<li><input type="password" name="psw" class="psw reg_text" placeholder="密码由6-20位字母,数字和符号组合"></li>
<li><input type="password" name="checked_psw" class="checked_psw reg_text" placeholder="请再次输入上面的密码"></li>
<li><input type="text" name="id_code" class="id_code" placeholder="短信验证码"> <span class="code_btn">获取验证码</span></li>
<li><input type="submit" value="立即注册" class="reg_btn"><span class="reg_by_email">通过邮箱注册 >></span></li>
<li><input type="text" name="id_code" class="id_code" placeholder="短信验证码"> <input type="text" disabled="disabled" class="code_btn" value="获取验证码"></li>

<div class="reg_end">
<input type="submit" value="立即注册" class="reg_btn">
<a href="" class="reg_by_email">通过邮箱注册>></a>
</div>
<li class="agree"><input type="checkbox" class="reg_agree">我已阅读并接受<span class="VIP_ser">唯品会服务条款</span></li>
</form>

</div>
<div class="footer">Copyright 2008-2016 vip.com,All Rights Reserved ICP证:粤 B2-20080329</div>
</div>
13 changes: 7 additions & 6 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
require.config({
baseUrl:"../js",
// baseUrl:"../js",
shim:{
'login':['jquery'],
'reg':['jquery'],
},
paths:{
'jquery':'jquery-1.12.3',
'login':'login'
'reg':'reg',
'template':'template'
}
})
require(['jquery','login'],function($,login){
require(['jquery','reg'],function($,reg){
var path = location.pathname;
console.log(path)
if(path == "/yhy_pro/login/"){
login.init();
if(path == "/VIP/reg/"){
reg.init();
}else{

}
Expand Down
2 changes: 1 addition & 1 deletion js/login.js → js/reg.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(['jquery'],function($){

return {
init:function(){
$('#reg').load('../html/login/login.html',function(){
$('#reg').load('../html/reg/reg.html',function(){

})
}
Expand Down
Loading

0 comments on commit c951298

Please sign in to comment.