Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
cbf1e1ed
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbf1e1ed
编写于
8月 17, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
推荐用户优化和商品新增海报
上级
152fe30a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
141 addition
and
122 deletion
+141
-122
application/api/controller/Goods.php
application/api/controller/Goods.php
+18
-0
application/api/controller/User.php
application/api/controller/User.php
+1
-1
application/tags.php
application/tags.php
+5
-57
extend/base/Wechat.php
extend/base/Wechat.php
+36
-10
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+36
-49
public/appmini/old/weixin/app.json
public/appmini/old/weixin/app.json
+2
-2
public/appmini/old/weixin/pages/answer-list/answer-list.wxml
public/appmini/old/weixin/pages/answer-list/answer-list.wxml
+1
-1
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
+40
-0
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
...c/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
+1
-1
public/appmini/old/weixin/pages/user/user.wxml
public/appmini/old/weixin/pages/user/user.wxml
+1
-1
未找到文件。
application/api/controller/Goods.php
浏览文件 @
cbf1e1ed
...
...
@@ -125,6 +125,7 @@ class Goods extends Common
'common_app_is_online_service'
=>
(
int
)
MyC
(
'common_app_is_online_service'
),
'common_app_is_limitedtimediscount'
=>
(
int
)
MyC
(
'common_app_is_limitedtimediscount'
),
'common_app_is_good_thing'
=>
(
int
)
MyC
(
'common_app_is_good_thing'
),
'common_app_is_poster_share'
=>
(
int
)
MyC
(
'common_app_is_poster_share'
),
];
// 秒杀
...
...
@@ -279,5 +280,22 @@ class Goods extends Common
];
return
DataReturn
(
'success'
,
0
,
$result
);
}
/**
* 商品海报
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-08-17T21:10:41+0800
*/
public
function
Poster
()
{
// 是否开启海报功能
if
(
MyC
(
'common_app_is_poster_share'
)
==
1
)
{
return
CallPluginsServiceMethod
(
'distribution'
,
'PosterGoodsService'
,
'GoodsCreateMiniWechat'
,
$this
->
data_post
);
}
return
DataReturn
(
'海报功能未启用'
,
-
100
);
}
}
?>
\ No newline at end of file
application/api/controller/User.php
浏览文件 @
cbf1e1ed
...
...
@@ -208,7 +208,7 @@ class User extends Common
$result
[
'avatar'
]
=
isset
(
$result
[
'avatarUrl'
])
?
$result
[
'avatarUrl'
]
:
''
;
$result
[
'gender'
]
=
empty
(
$result
[
'gender'
])
?
0
:
(
$result
[
'gender'
]
==
2
)
?
1
:
2
;
$result
[
'openid'
]
=
$result
[
'openId'
];
$result
[
'referrer'
]
=
isset
(
$this
->
data_post
[
'referrer'
])
?
intval
(
$this
->
data_post
[
'referrer'
])
:
0
;
$result
[
'referrer'
]
=
isset
(
$this
->
data_post
[
'referrer'
])
?
$this
->
data_post
[
'referrer'
]
:
0
;
return
UserService
::
AuthUserProgram
(
$result
,
'weixin_openid'
);
}
}
else
{
...
...
application/tags.php
浏览文件 @
cbf1e1ed
...
...
@@ -32,73 +32,21 @@ return array (
'log_write'
=>
array
(
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
1
=>
'app\\plugins\\answers\\Hook'
,
2
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_goods_handle_end'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_goods_spec_base'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_view_goods_detail_base_top'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_view_home_floor_top'
=>
array
(
0
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
0
=>
'app\\plugins\\
coup
on\\Hook'
,
0
=>
'app\\plugins\\
distributi
on\\Hook'
,
),
'plugins_service_header_navigation_top_right_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_goods_detail_panel_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_goods_bottom'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_handle'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_view_buy_form_inside'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
),
'plugins_service_buy_order_insert_success'
=>
array
(
0
=>
'app\\plugins\\coupon\\Hook'
,
0
=>
'app\\plugins\\distribution\\Hook'
,
),
'plugins_service_order_status_change_history_success_handle'
=>
array
(
0
=>
'app\\plugins\\
coup
on\\Hook'
,
0
=>
'app\\plugins\\
distributi
on\\Hook'
,
),
'plugins_service_
user_register
_end'
=>
'plugins_service_
order_aftersale_audit_handle
_end'
=>
array
(
0
=>
'app\\plugins\\
coup
on\\Hook'
,
0
=>
'app\\plugins\\
distributi
on\\Hook'
,
),
);
?>
\ No newline at end of file
extend/base/Wechat.php
浏览文件 @
cbf1e1ed
...
...
@@ -125,27 +125,53 @@ class Wechat
*/
public
function
MiniQrCodeCreate
(
$params
)
{
// 参数校验
if
(
empty
(
$params
[
'path'
]))
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'page'
,
'error_msg'
=>
'page地址不能为空'
,
],
[
'checked_type'
=>
'length'
,
'checked_data'
=>
'1,32'
,
'key_name'
=>
'scene'
,
'error_msg'
=>
'scene参数 1~32 个字符之间'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
'页面地址不能为空'
;
return
DataReturn
(
$ret
,
-
1
)
;
}
$params
[
'width'
]
=
empty
(
$params
[
'width'
])
?
1000
:
intval
(
$params
[
'width'
]);
// 获取access_token
$access_token
=
$this
->
GetMiniAccessToken
();
if
(
$access_token
===
false
)
{
return
''
;
return
DataReturn
(
'access_token获取失败'
,
-
1
)
;
}
//
网络请求
$url
=
'https://api.weixin.qq.com/
cgi-bin/wxaapp/createwxaqrcode
?access_token='
.
$access_token
;
//
获取二维码
$url
=
'https://api.weixin.qq.com/
wxa/getwxacodeunlimit
?access_token='
.
$access_token
;
$data
=
[
'path'
=>
$params
[
'path'
],
'width'
=>
$params
[
'width'
],
'page'
=>
$params
[
'page'
],
'scene'
=>
$params
[
'scene'
],
'width'
=>
empty
(
$params
[
'width'
])
?
1000
:
intval
(
$params
[
'width'
]),
];
return
$this
->
HttpRequestPost
(
$url
,
json_encode
(
$data
),
false
);
$res
=
$this
->
HttpRequestPost
(
$url
,
json_encode
(
$data
),
false
);
if
(
!
empty
(
$res
))
{
if
(
stripos
(
$res
,
'errcode'
)
===
false
)
{
return
DataReturn
(
'获取成功'
,
0
,
$res
);
}
$res
=
json_decode
(
$res
,
true
);
$msg
=
isset
(
$res
[
'errmsg'
])
?
$res
[
'errmsg'
]
:
'获取二维码失败'
;
}
else
{
$msg
=
'获取二维码失败'
;
}
return
DataReturn
(
$msg
,
-
1
);
}
/**
...
...
public/appmini/old/weixin/app.js
浏览文件 @
cbf1e1ed
...
...
@@ -15,7 +15,7 @@ App({
// 用户地址选择缓存key
cache_buy_user_address_select_key
:
"
cache_buy_user_address_select_key
"
,
//
用户传入信息
缓存key
//
启动参数
缓存key
cache_launch_info_key
:
"
cache_shop_launch_info_key
"
,
// 默认用户头像
...
...
@@ -61,7 +61,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
//
request_url: 'http://tp5-dev.com/',
request_url
:
'
http://tp5-dev.com/
'
,
// request_url: 'https://test.shopxo.net/',
// 基础信息
...
...
@@ -73,60 +73,31 @@ App({
* 小程序初始化
*/
onLaunch
(
options
)
{
// 启动参数处理
options
=
this
.
launch_params_handle
(
options
);
// 设置设备信息
this
.
set_system_info
();
// 启动query参数处理
this
.
startup_query
(
options
);
// 缓存启动参数
wx
.
setStorage
({
key
:
this
.
data
.
cache_launch_info_key
,
data
:
options
});
},
/**
* 启动
query
参数处理
* 启动参数处理
*/
startup_query
(
params
)
{
//
没有启动参数则返回
if
((
params
||
null
)
=
=
null
)
{
return
false
;
launch_params_handle
(
params
)
{
//
启动参数处理
if
((
params
.
query
||
null
)
!
=
null
)
{
params
=
params
.
query
;
}
// 启动处理类型
var
type
=
params
.
type
||
null
;
switch
(
type
)
{
// type=page
case
"
page
"
:
// 页面
var
page
=
params
.
page
||
null
;
// 参数名
var
params_field
=
params
.
params_field
||
null
;
// 参数值
var
params_value
=
params
.
params_value
||
null
;
// 页面跳转
if
(
page
!=
null
)
{
wx
.
navigateTo
({
url
:
"
/pages/
"
+
page
+
"
/
"
+
page
+
"
?
"
+
params_field
+
"
=
"
+
params_value
});
}
break
;
// type=view
case
"
view
"
:
var
url
=
params
.
url
||
null
;
// 页面跳转
if
(
url
!=
null
)
{
wx
.
navigateTo
({
url
:
'
/pages/web-view/web-view?url=
'
+
url
});
}
break
;
// 默认
default
:
break
;
if
((
params
.
scene
||
null
)
!=
null
)
{
params
=
this
.
url_params_to_json
(
decodeURIComponent
(
params
.
scene
));
}
return
params
;
},
/**
...
...
@@ -266,8 +237,8 @@ App({
get_user_login_info
(
object
,
method
,
openid
,
auth_data
)
{
// 邀请人参数
var
params
=
wx
.
getStorageSync
(
this
.
data
.
cache_launch_info_key
)
||
null
;
var
referrer
=
(
params
==
null
)
?
0
:
(
params
.
data
.
referrer
||
0
);
var
referrer
=
(
params
==
null
)
?
0
:
(
params
.
referrer
||
0
);
console
.
log
(
params
)
// 远程解密数据
var
$this
=
this
;
wx
.
request
({
...
...
@@ -518,6 +489,22 @@ App({
}
return
false
;
},
/**
* url参数转json对象
*/
url_params_to_json
(
url_params
)
{
var
json
=
new
Object
();
if
((
url_params
||
null
)
!=
null
)
{
var
arr
=
url_params
.
split
(
'
&
'
);
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
var
temp
=
arr
[
i
].
split
(
'
=
'
);
json
[
temp
[
0
]]
=
temp
[
1
]
}
}
return
json
;
}
});
\ No newline at end of file
public/appmini/old/weixin/app.json
浏览文件 @
cbf1e1ed
{
"pages"
:
[
"pages"
:
[
"pages/goods-detail/goods-detail"
,
"pages/index/index"
,
"pages/goods-category/goods-category"
,
"pages/cart/cart"
,
...
...
@@ -8,7 +8,7 @@
"pages/login/login"
,
"pages/paytips/paytips"
,
"pages/goods-search/goods-search"
,
"pages/goods-detail/goods-detail"
,
"pages/goods-comment/goods-comment"
,
"pages/goods-attribute/goods-attribute"
,
"pages/buy/buy"
,
...
...
public/appmini/old/weixin/pages/answer-list/answer-list.wxml
浏览文件 @
cbf1e1ed
...
...
@@ -2,7 +2,7 @@
<view class="item bg-white spacing-mb" wx:if="{{data_list.length > 0}}" wx:for="{{data_list}}">
<view class="base">
<view class="oh">
<image class="avatar fl" src="{{item.avatar}}" mode="widthFix" data-index="{{index}}"
onE
rror="user_avatar_error" />
<image class="avatar fl" src="{{item.avatar}}" mode="widthFix" data-index="{{index}}"
binde
rror="user_avatar_error" />
<view class="desc fr tl">{{item.content}}</view>
</view>
<view class="cr-888 tr">{{item.add_time}}</view>
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.js
浏览文件 @
cbf1e1ed
...
...
@@ -63,6 +63,10 @@ Page({
},
onLoad
(
params
)
{
// 启动参数处理
params
=
app
.
launch_params_handle
(
params
);
// 参数赋值,初始化
//params['goods_id']=2;
this
.
setData
({
params
:
params
});
this
.
init
();
...
...
@@ -730,6 +734,42 @@ Page({
}
},
// 商品海报分享
poster_event
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
poster_event
'
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
wx
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
wx
.
showLoading
({
title
:
'
生成中...
'
});
wx
.
request
({
url
:
app
.
get_request_url
(
'
poster
'
,
'
goods
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
console
.
log
(
res
.
data
);
wx
.
previewImage
({
current
:
res
.
data
.
data
,
urls
:
[
res
.
data
.
data
]
});
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
wx
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
},
// 自定义分享
onShareAppMessage
()
{
return
{
...
...
public/appmini/old/weixin/pages/goods-detail/goods-detail.wxml
浏览文件 @
cbf1e1ed
...
...
@@ -187,7 +187,7 @@
<text class="cr-888 single-text">一键分享给好友、群聊</text>
</button>
</view>
<view wx:if="{{common_app_is_poster_share == 1}}" class="share-items oh">
<view wx:if="{{common_app_is_poster_share == 1}}" class="share-items oh"
bindtap="poster_event"
>
<image src="/images/share-friend-icon.png" mode="scaleToFill" />
<text class="cr-888 single-text">生成海报,分享到朋友圈、好友及群聊</text>
</view>
...
...
public/appmini/old/weixin/pages/user/user.wxml
浏览文件 @
cbf1e1ed
<!-- 头部 -->
<view class="head-box bg-main">
<view class="head-item oh tc">
<image bindtap="preview_event"
onE
rror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<image bindtap="preview_event"
binde
rror="user_avatar_error" class="avatar" src="{{avatar}}" mode="widthFix" />
<text class="item-name dis-block cr-fff">{{nickname}}</text>
</view>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录