Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
18c8b8dc
authored
Dec 05, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev/ver/1.0.0' of
http://git.ichunt.net/semour/semour_web
into dev/ver/1.0.0
parents
d810333f
5aa12f29
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
4 deletions
app/Http/Controllers/Api/Controller.php
app/Http/Controllers/Api/SearchApiController.php
public/assets/js/brand/list.js
public/assets/js/class/class.js
public/assets/js/search/search.js
public/assets/js/sku/sku.js
routes/api.php
app/Http/Controllers/Api/Controller.php
View file @
18c8b8dc
...
...
@@ -73,4 +73,5 @@ class Controller extends BaseController
];
Log
::
error
(
json_encode
(
$err_info
,
JSON_UNESCAPED_UNICODE
));
}
}
app/Http/Controllers/Api/SearchApiController.php
0 → 100644
View file @
18c8b8dc
<?php
namespace
App\Http\Controllers\Api
;
use
App\Http\ApiHelper\ApiCode
;
use
App\Http\Requests\InquirySave
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Http
;
//搜索
class
SearchApiController
extends
Controller
{
public
$soUrl
;
public
function
__construct
(){
$this
->
soUrl
=
env
(
"so_url"
);
}
//搜索列表
public
function
skuLists
(
Request
$request
)
{
$response
=
Http
::
asForm
()
->
post
(
$this
->
soUrl
.
"/semour/skuLists"
,
$request
->
input
());
$data
=
json_decode
(
$response
->
body
(),
true
);
return
$this
->
setSuccess
(
"查询成功"
,
ApiCode
::
API_CODE_SUCCESS
,
\Arr
::
get
(
$data
,
"data"
));
}
//商品详情
public
function
goodsDetail
(
Request
$request
)
{
$response
=
Http
::
asForm
()
->
post
(
$this
->
soUrl
.
"/semour/goodsDetail"
,
$request
->
input
());
$data
=
json_decode
(
$response
->
body
(),
true
);
return
$this
->
setSuccess
(
"查询成功"
,
ApiCode
::
API_CODE_SUCCESS
,
\Arr
::
get
(
$data
,
"data"
));
}
}
public/assets/js/brand/list.js
View file @
18c8b8dc
...
...
@@ -39,7 +39,7 @@ define('brandlist', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], functio
data_
[
"single_price/sort"
]
=
"desc"
}
}
$
.
liexin_ajax
(
SO_URL
+
'/semour
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
$
.
liexin_ajax
(
'/api/search
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
if
(
res
.
code
==
0
)
{
var
dataArr
=
res
.
data
.
lists
||
[];
$
(
".brandlistCount"
).
html
(
res
.
data
.
total
||
0
)
...
...
public/assets/js/class/class.js
View file @
18c8b8dc
...
...
@@ -26,7 +26,7 @@ define('class_p', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function
if
(
$
(
"#class_id_three"
).
val
())
{
data_
[
"class_id2/eq"
]
=
$
(
"#class_id_three"
).
val
()
}
$
.
liexin_ajax
(
SO_URL
+
'/semour
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
$
.
liexin_ajax
(
'/api/search
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
if
(
res
.
code
==
0
)
{
var
dataArr
=
res
.
data
.
lists
||
[];
$
(
".search_result_count"
).
html
(
res
.
data
.
total
||
0
)
...
...
public/assets/js/search/search.js
View file @
18c8b8dc
...
...
@@ -39,7 +39,7 @@ define('search', ['tool', 'liexin_pop', 'artTemplate', 'pagination'], function (
data_
[
"single_price/sort"
]
=
"desc"
}
}
$
.
liexin_ajax
(
SO_URL
+
'/semour
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
$
.
liexin_ajax
(
'/api/search
/skuLists'
,
'POST'
,
data_
,
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
0
)
{
var
dataArr
=
res
.
data
.
lists
||
[];
...
...
public/assets/js/sku/sku.js
View file @
18c8b8dc
...
...
@@ -10,7 +10,7 @@ define('sku', ['liexin_pop', 'tool', 'artTemplate'], function (require, exports,
sku
.
handle
()
},
getData
:
function
()
{
$
.
liexin_ajax
(
SO_URL
+
'/semour
/goodsDetail'
,
'POST'
,
{
goods_id
:
$
(
"#sku_goods_id"
).
val
()
},
function
(
res
)
{
$
.
liexin_ajax
(
'/api/search
/goodsDetail'
,
'POST'
,
{
goods_id
:
$
(
"#sku_goods_id"
).
val
()
},
function
(
res
)
{
console
.
log
(
res
)
if
(
res
.
code
==
0
)
{
var
json_
=
res
.
data
...
...
routes/api.php
View file @
18c8b8dc
...
...
@@ -22,6 +22,10 @@ Route::middleware(['api'])->namespace('Api')->group(function () {
Route
::
POST
(
'auth/set_forget_password'
,
'AuthApiController@setForgetPassword'
);
Route
::
get
(
'country/list'
,
'CountryApiController@list'
);
Route
::
get
(
'brand/list'
,
'BrandApiController@list'
);
Route
::
POST
(
'/search/skuLists'
,
'SearchApiController@skuLists'
);
Route
::
POST
(
'/search/goodsDetail'
,
'SearchApiController@goodsDetail'
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment