Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
8483c7e2
Commit
8483c7e2
authored
Apr 24, 2026
by
gongs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增AI试戴模型接口
parent
37d3fb9c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
347 additions
and
0 deletions
+347
-0
.gitignore
.gitignore
+1
-0
User.php
addons/shopro/controller/user/User.php
+14
-0
AiTryOn.php
application/admin/controller/shopro/AiTryOn.php
+37
-0
ai_try_on.php
application/admin/lang/zh-cn/shopro/ai_try_on.php
+14
-0
AiTryon.php
application/admin/model/shopro/AiTryon.php
+46
-0
AiTryon.php
application/admin/validate/shopro/AiTryon.php
+27
-0
add.html
application/admin/view/shopro/ai_try_on/add.html
+59
-0
edit.html
application/admin/view/shopro/ai_try_on/edit.html
+59
-0
index.html
application/admin/view/shopro/ai_try_on/index.html
+29
-0
ai_try_on.js
public/assets/js/backend/shopro/ai_try_on.js
+61
-0
No files found.
.gitignore
View file @
8483c7e2
...
...
@@ -10,3 +10,4 @@ composer.lock
.svn
.vscode
.user.ini
public/uploads/*
addons/shopro/controller/user/User.php
View file @
8483c7e2
...
...
@@ -2,6 +2,7 @@
namespace
addons\shopro\controller\user
;
use
app\admin\model\shopro\AiTryon
;
use
app\common\library\Sms
;
use
addons\shopro\controller\Common
;
use
addons\shopro\service\user\UserAuth
;
...
...
@@ -9,6 +10,7 @@ use app\admin\model\shopro\user\User as UserModel;
use
app\admin\model\shopro\user\Coupon
as
UserCouponModel
;
use
app\admin\model\shopro\order\Order
as
OrderModel
;
use
app\admin\model\shopro\order\Aftersale
as
AftersaleModel
;
use
app\admin\model\shopro\AiTryon
as
aiTryonModel
;
use
app\admin\model\shopro\ThirdOauth
;
class
User
extends
Common
...
...
@@ -47,6 +49,18 @@ class User extends Common
}
/**
* 我的试戴
*/
public
function
myTyon
()
{
$user
=
auth_user
();
//查询我的试戴列表
$data
=
AiTryon
::
geted
()
->
where
(
'user_id'
,
$user
->
id
)
->
count
();
$this
->
success
(
'我的试戴'
,
$data
);
}
/**
* 第三方授权信息
*/
public
function
thirdOauth
()
...
...
application/admin/controller/shopro/AiTryOn.php
0 → 100644
View file @
8483c7e2
<?php
namespace
app\admin\controller\shopro
;
use
app\common\controller\Backend
;
/**
* AI试戴
*
* @icon fa fa-circle-o
*/
class
AiTryOn
extends
Backend
{
/**
* AiTryon模型对象
* @var \app\admin\model\shopro\AiTryon
*/
protected
$model
=
null
;
public
function
_initialize
()
{
parent
::
_initialize
();
$this
->
model
=
new
\app\admin\model\shopro\AiTryon
;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}
application/admin/lang/zh-cn/shopro/ai_try_on.php
0 → 100644
View file @
8483c7e2
<?php
return
[
'Id'
=>
'ID'
,
'User_id'
=>
'用户id'
,
'Url'
=>
'AI视频或图片物理路径'
,
'Goods_id'
=>
'试戴商品id'
,
'Goods_sku_id'
=>
'试戴商品skuid'
,
'Goods_title'
=>
'试戴商品名称'
,
'Goods_image'
=>
'试戴商品图片'
,
'Goods_sku_name'
=>
'试戴商品型号'
,
'Createtime'
=>
'创建时间'
,
'Updatetime'
=>
'修改时间'
];
application/admin/model/shopro/AiTryon.php
0 → 100644
View file @
8483c7e2
<?php
namespace
app\admin\model\shopro
;
use
think\Model
;
class
AiTryon
extends
Model
{
// 表名
protected
$name
=
'ai_tryon'
;
// 自动写入时间戳字段
protected
$autoWriteTimestamp
=
'integer'
;
// 定义时间戳字段名
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
'updatetime'
;
protected
$deleteTime
=
false
;
// 追加属性
protected
$append
=
[
'url'
,
'user_id'
,
'goods_id'
,
'goods_sku_id'
,
'goods_title'
,
'goods_image'
,
'goods_sku_name'
];
}
application/admin/validate/shopro/AiTryon.php
0 → 100644
View file @
8483c7e2
<?php
namespace
app\admin\validate\shopro
;
use
think\Validate
;
class
AiTryon
extends
Validate
{
/**
* 验证规则
*/
protected
$rule
=
[
];
/**
* 提示消息
*/
protected
$message
=
[
];
/**
* 验证场景
*/
protected
$scene
=
[
'add'
=>
[],
'edit'
=>
[],
];
}
application/admin/view/shopro/ai_try_on/add.html
0 → 100644
View file @
8483c7e2
<form
id=
"add-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('User_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-user_id"
data-rule=
"required"
data-source=
"user/user/index"
data-field=
"nickname"
class=
"form-control selectpage"
name=
"row[user_id]"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Url')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-url"
class=
"form-control"
name=
"row[url]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_id"
data-rule=
"required"
data-source=
"goods/index"
class=
"form-control selectpage"
name=
"row[goods_id]"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_sku_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_sku_id"
data-rule=
"required"
data-source=
"goods/sku/index"
class=
"form-control selectpage"
name=
"row[goods_sku_id]"
type=
"text"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_title')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_title"
class=
"form-control"
name=
"row[goods_title]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_image')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"c-goods_image"
class=
"form-control"
size=
"50"
name=
"row[goods_image]"
type=
"text"
>
<div
class=
"input-group-addon no-border no-padding"
>
<span><button
type=
"button"
id=
"faupload-goods_image"
class=
"btn btn-danger faupload"
data-input-id=
"c-goods_image"
data-mimetype=
"image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
data-multiple=
"false"
data-preview-id=
"p-goods_image"
><i
class=
"fa fa-upload"
></i>
{:__('Upload')}
</button></span>
<span><button
type=
"button"
id=
"fachoose-goods_image"
class=
"btn btn-primary fachoose"
data-input-id=
"c-goods_image"
data-mimetype=
"image/*"
data-multiple=
"false"
><i
class=
"fa fa-list"
></i>
{:__('Choose')}
</button></span>
</div>
<span
class=
"msg-box n-right"
for=
"c-goods_image"
></span>
</div>
<ul
class=
"row list-inline faupload-preview"
id=
"p-goods_image"
></ul>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_sku_name')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_sku_name"
class=
"form-control"
name=
"row[goods_sku_name]"
type=
"text"
>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<label
class=
"control-label col-xs-12 col-sm-2"
></label>
<div
class=
"col-xs-12 col-sm-8"
>
<button
type=
"submit"
class=
"btn btn-primary btn-embossed disabled"
>
{:__('OK')}
</button>
</div>
</div>
</form>
application/admin/view/shopro/ai_try_on/edit.html
0 → 100644
View file @
8483c7e2
<form
id=
"edit-form"
class=
"form-horizontal"
role=
"form"
data-toggle=
"validator"
method=
"POST"
action=
""
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('User_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-user_id"
data-rule=
"required"
data-source=
"user/user/index"
data-field=
"nickname"
class=
"form-control selectpage"
name=
"row[user_id]"
type=
"text"
value=
"{$row.user_id|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Url')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-url"
class=
"form-control"
name=
"row[url]"
type=
"text"
value=
"{$row.url|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_id"
data-rule=
"required"
data-source=
"goods/index"
class=
"form-control selectpage"
name=
"row[goods_id]"
type=
"text"
value=
"{$row.goods_id|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_sku_id')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_sku_id"
data-rule=
"required"
data-source=
"goods/sku/index"
class=
"form-control selectpage"
name=
"row[goods_sku_id]"
type=
"text"
value=
"{$row.goods_sku_id|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_title')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_title"
class=
"form-control"
name=
"row[goods_title]"
type=
"text"
value=
"{$row.goods_title|htmlentities}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_image')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"input-group"
>
<input
id=
"c-goods_image"
class=
"form-control"
size=
"50"
name=
"row[goods_image]"
type=
"text"
value=
"{$row.goods_image|htmlentities}"
>
<div
class=
"input-group-addon no-border no-padding"
>
<span><button
type=
"button"
id=
"faupload-goods_image"
class=
"btn btn-danger faupload"
data-input-id=
"c-goods_image"
data-mimetype=
"image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
data-multiple=
"false"
data-preview-id=
"p-goods_image"
><i
class=
"fa fa-upload"
></i>
{:__('Upload')}
</button></span>
<span><button
type=
"button"
id=
"fachoose-goods_image"
class=
"btn btn-primary fachoose"
data-input-id=
"c-goods_image"
data-mimetype=
"image/*"
data-multiple=
"false"
><i
class=
"fa fa-list"
></i>
{:__('Choose')}
</button></span>
</div>
<span
class=
"msg-box n-right"
for=
"c-goods_image"
></span>
</div>
<ul
class=
"row list-inline faupload-preview"
id=
"p-goods_image"
></ul>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Goods_sku_name')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<input
id=
"c-goods_sku_name"
class=
"form-control"
name=
"row[goods_sku_name]"
type=
"text"
value=
"{$row.goods_sku_name|htmlentities}"
>
</div>
</div>
<div
class=
"form-group layer-footer"
>
<label
class=
"control-label col-xs-12 col-sm-2"
></label>
<div
class=
"col-xs-12 col-sm-8"
>
<button
type=
"submit"
class=
"btn btn-primary btn-embossed disabled"
>
{:__('OK')}
</button>
</div>
</div>
</form>
application/admin/view/shopro/ai_try_on/index.html
0 → 100644
View file @
8483c7e2
<div
class=
"panel panel-default panel-intro"
>
{:build_heading()}
<div
class=
"panel-body"
>
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
class=
"tab-pane fade active in"
id=
"one"
>
<div
class=
"widget-body no-padding"
>
<div
id=
"toolbar"
class=
"toolbar"
>
<a
href=
"javascript:;"
class=
"btn btn-primary btn-refresh"
title=
"{:__('Refresh')}"
><i
class=
"fa fa-refresh"
></i>
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-add {:$auth->check('shopro/ai_try_on/add')?'':'hide'}"
title=
"{:__('Add')}"
><i
class=
"fa fa-plus"
></i>
{:__('Add')}
</a>
<a
href=
"javascript:;"
class=
"btn btn-success btn-edit btn-disabled disabled {:$auth->check('shopro/ai_try_on/edit')?'':'hide'}"
title=
"{:__('Edit')}"
><i
class=
"fa fa-pencil"
></i>
{:__('Edit')}
</a>
<a
href=
"javascript:;"
class=
"btn btn-danger btn-del btn-disabled disabled {:$auth->check('shopro/ai_try_on/del')?'':'hide'}"
title=
"{:__('Delete')}"
><i
class=
"fa fa-trash"
></i>
{:__('Delete')}
</a>
</div>
<table
id=
"table"
class=
"table table-striped table-bordered table-hover table-nowrap"
data-operate-edit=
"{:$auth->check('shopro/ai_try_on/edit')}"
data-operate-del=
"{:$auth->check('shopro/ai_try_on/del')}"
width=
"100%"
>
</table>
</div>
</div>
</div>
</div>
</div>
public/assets/js/backend/shopro/ai_try_on.js
0 → 100644
View file @
8483c7e2
define
([
'jquery'
,
'bootstrap'
,
'backend'
,
'table'
,
'form'
],
function
(
$
,
undefined
,
Backend
,
Table
,
Form
)
{
var
Controller
=
{
index
:
function
()
{
// 初始化表格参数配置
Table
.
api
.
init
({
extend
:
{
index_url
:
'shopro/ai_try_on/index'
+
location
.
search
,
add_url
:
'shopro/ai_try_on/add'
,
edit_url
:
'shopro/ai_try_on/edit'
,
del_url
:
'shopro/ai_try_on/del'
,
multi_url
:
'shopro/ai_try_on/multi'
,
import_url
:
'shopro/ai_try_on/import'
,
table
:
'ai_tryon'
,
}
});
var
table
=
$
(
"#table"
);
// 初始化表格
table
.
bootstrapTable
({
url
:
$
.
fn
.
bootstrapTable
.
defaults
.
extend
.
index_url
,
pk
:
'id'
,
sortName
:
'id'
,
fixedColumns
:
true
,
fixedRightNumber
:
1
,
columns
:
[
[
{
checkbox
:
true
},
{
field
:
'id'
,
title
:
__
(
'Id'
)},
{
field
:
'user_id'
,
title
:
__
(
'User_id'
)},
{
field
:
'url'
,
title
:
__
(
'Url'
),
operate
:
'LIKE'
,
formatter
:
Table
.
api
.
formatter
.
url
},
{
field
:
'goods_id'
,
title
:
__
(
'Goods_id'
)},
{
field
:
'goods_sku_id'
,
title
:
__
(
'Goods_sku_id'
)},
{
field
:
'goods_title'
,
title
:
__
(
'Goods_title'
),
operate
:
'LIKE'
,
table
:
table
,
class
:
'autocontent'
,
formatter
:
Table
.
api
.
formatter
.
content
},
{
field
:
'goods_image'
,
title
:
__
(
'Goods_image'
),
operate
:
false
,
events
:
Table
.
api
.
events
.
image
,
formatter
:
Table
.
api
.
formatter
.
image
},
{
field
:
'goods_sku_name'
,
title
:
__
(
'Goods_sku_name'
),
operate
:
'LIKE'
,
table
:
table
,
class
:
'autocontent'
,
formatter
:
Table
.
api
.
formatter
.
content
},
{
field
:
'createtime'
,
title
:
__
(
'Createtime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'updatetime'
,
title
:
__
(
'Updatetime'
),
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
autocomplete
:
false
,
formatter
:
Table
.
api
.
formatter
.
datetime
},
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
table
:
table
,
events
:
Table
.
api
.
events
.
operate
,
formatter
:
Table
.
api
.
formatter
.
operate
}
]
]
});
// 为表格绑定事件
Table
.
api
.
bindevent
(
table
);
},
add
:
function
()
{
Controller
.
api
.
bindevent
();
},
edit
:
function
()
{
Controller
.
api
.
bindevent
();
},
api
:
{
bindevent
:
function
()
{
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
}
}
};
return
Controller
;
});
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