切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
7f8a4b3fb1b5ef739b8dbd37d2e9f02c1163f41b
1 个父辈
8b84f535
1 个管道 的构建
通过
耗费 3 秒
手机摄像头调用
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
43 行增加
和
4 行删除
public/themes/simpleboot3/portal/salesmangoods/salesman_goods_add.html
simplewind/cmf/controller/WeChatBaseController.php
public/themes/simpleboot3/portal/salesmangoods/salesman_goods_add.html
查看文件 @
7f8a4b3
...
...
@@ -265,8 +265,8 @@
</div>
<div
class=
"log_six_picture"
>
<div
class=
"log_six_picture_one"
>
<div
class=
"log_six_pictyre_img"
>
<img
src=
"__TMPL__/public/assets/images/jiahao.png"
alt=
""
id=
"img2"
/>
<div
class=
"log_six_pictyre_img"
onclick=
"openCamera()"
>
<!--<img src="__TMPL__/public/assets/images/jiahao.png" alt="" id="img2" />-->
</div>
<div
class=
"log_six_pictyre_title"
>
添加图片
...
...
@@ -289,6 +289,45 @@
<script
src=
"__TMPL__/public/assets/js/jquery-3.2.1.min.js"
></script>
<script
src=
"__TMPL__/public/assets/js/city.data-3.js"
></script>
<script
src=
"__TMPL__/public/assets/js/uploadfile.js"
></script>
<script
src=
"https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
></script>
<script>
$
(
function
(){
wx
.
config
({
debug
:
true
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,测试完成后需要关闭。
appId
:
"wxdf34ec2179e19b9a"
,
// 必填,公众号的唯一标识
timestamp
:
"1560818590"
,
// 必填,生成签名的时间戳
nonceStr
:
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
,
// 必填,生成签名的随机串
signature
:
"almGHISt15642"
,
// 必填,签名(加密后,下文有实现)
jsApiList
:
[
'chooseImage'
,
'uploadImage'
]
// 必填,需要使用的JS接口列表,开发文档上有所有接口名称,根据需要选用就好。
});
});
function
openCamera
(){
wx
.
chooseImage
({
count
:
1
,
// 默认9
sizeType
:
[
'original'
,
'compressed'
],
// 指定是原图还是压缩图,默认都有
sourceType
:
[
'album'
,
'camera'
],
// 指定来源是相册还是相机,默认都有
success
:
function
(
res
)
{
var
localIds
=
res
.
localIds
;
// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
wx
.
uploadImage
({
localId
:
localIds
.
toString
(),
// 需要上传的图片的ID,由chooseImage接口获得
isShowProgressTips
:
1
,
// 进度提示
success
:
function
(
res
)
{
var
mediaId
=
res
.
serverId
;
// 返回图片的服务器端ID,即mediaId
//将获取到的 mediaId 传入后台 方法savePicture
$
.
post
(
path
+
"/getImage/savePicture"
,{
"mediaId"
:
mediaId
,
"tmp"
:
"填写证件的正反面参数"
},
function
(
res
){
//填写你自己的业务逻辑
});
},
fail
:
function
(
res
)
{
alertModal
(
'图片上传失败,请重试'
);
}
});
}
});
}
</script>
<script>
/**
*确定添加
...
...
simplewind/cmf/controller/WeChatBaseController.php
查看文件 @
7f8a4b3
...
...
@@ -204,8 +204,8 @@ class WeChatBaseController extends BaseController
*/
public
function
checkWeChatUserLogin
()
{
/*$user = Db::name('user')->where('id',5)->find();
cmf_update_current_user($user);*/
$user
=
Db
::
name
(
'user'
)
->
where
(
'id'
,
2
)
->
find
();
cmf_update_current_user
(
$user
);
$userId
=
cmf_get_current_user_id
();
if
(
empty
(
$userId
))
{
$config
=
[
...
...
请
注册
或
登录
后发表评论