细节优化

This commit is contained in:
devil 2020-02-12 12:12:43 +08:00
parent 63f05f6999
commit 06e9531fcb
12 changed files with 104 additions and 47 deletions

View File

@ -143,11 +143,12 @@
{{foreach $data_list as $v}} {{foreach $data_list as $v}}
<tr id="data-list-{{$v.id}}" {{if $v['pay_status'] eq 1 and $v['total_price'] gt $v['pay_price']}}class="am-danger"{{/if}}> <tr id="data-list-{{$v.id}}" {{if $v['pay_status'] eq 1 and $v['total_price'] gt $v['pay_price']}}class="am-danger"{{/if}}>
<td class="am-hide-sm-only"> <td class="am-hide-sm-only">
<div class="order-no am-padding-bottom-xs"> <div class="am-padding-bottom-xs">
<span>{{$v.order_no}}</span> <strong>{{$v.order_no}}</strong>
<span class="am-badge am-badge-primary am-radius" title="订单模式">{{$v.order_model_name}}</span> <span class="am-badge am-badge-primary am-radius" title="订单模式">{{$v.order_model_name}}</span>
<span class="am-badge am-badge-secondary am-radius" title="客户端类型">{{$v.client_type_name}}</span> <span class="am-badge am-badge-secondary am-radius" title="客户端类型">{{$v.client_type_name}}</span>
</div> </div>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
{{foreach $v.items as $vs}} {{foreach $v.items as $vs}}
<div class="goods-item"> <div class="goods-item">
<div class="base"> <div class="base">
@ -168,6 +169,7 @@
<span class="am-fr">{{$vs.price}}x{{$vs.buy_number}}</span> <span class="am-fr">{{$vs.price}}x{{$vs.buy_number}}</span>
</div> </div>
</div> </div>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
{{/foreach}} {{/foreach}}
<div class="goods-item">{{$v.describe}}</div> <div class="goods-item">{{$v.describe}}</div>
</td> </td>

View File

@ -115,7 +115,13 @@
{{foreach $data_list as $v}} {{foreach $data_list as $v}}
<tr id="data-list-{{$v.id}}"> <tr id="data-list-{{$v.id}}">
<td class="am-hide-sm-only"> <td class="am-hide-sm-only">
<div class="goods-detail"> <div class="am-padding-bottom-xs">
<strong>{{$v.order_data.order_no}}</strong>
<span class="am-badge am-badge-primary am-radius" title="订单模式">{{$v.order_data.order_model_name}}</span>
<span class="am-badge am-badge-secondary am-radius" title="客户端类型">{{$v.order_data.client_type_name}}</span>
</div>
<hr data-am-widget="divider" class="am-divider am-divider-dashed am-margin-vertical-0" />
<div class="goods-detail am-padding-vertical-xs">
<a href="{{$v.order_data.items.goods_url}}" target="_blank"> <a href="{{$v.order_data.items.goods_url}}" target="_blank">
<img src="{{$v.order_data.items.images}}" class="am-img-thumbnail am-radius" /> <img src="{{$v.order_data.items.images}}" class="am-img-thumbnail am-radius" />
</a> </a>

View File

@ -100,9 +100,11 @@ class User extends Common
$user = UserService::AppUserInfoHandle(null, 'alipay_openid', $result['data']['user_id']); $user = UserService::AppUserInfoHandle(null, 'alipay_openid', $result['data']['user_id']);
if(empty($user)) if(empty($user))
{ {
return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result['data']['user_id']]); return DataReturn('授权登录成功', 0, ['is_user_exist'=>0, 'openid'=>$result['data']['user_id']]);
} }
$user['is_alipay_user_exist'] = 1;
// 标记用户存在
$user['is_user_exist'] = 1;
return DataReturn('授权成功', 0, $user); return DataReturn('授权成功', 0, $user);
} }
return DataReturn($result['msg'], -100); return DataReturn($result['msg'], -100);
@ -169,9 +171,11 @@ class User extends Common
$user = UserService::AppUserInfoHandle(null, 'weixin_openid', $result); $user = UserService::AppUserInfoHandle(null, 'weixin_openid', $result);
if(empty($user)) if(empty($user))
{ {
return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result]); return DataReturn('授权登录成功', 0, ['is_user_exist'=>0, 'openid'=>$result]);
} }
$user['is_alipay_user_exist'] = 1;
// 标记用户存在
$user['is_user_exist'] = 1;
return DataReturn('授权登录成功', 0, $user); return DataReturn('授权登录成功', 0, $user);
} }
return DataReturn('授权登录失败', -100); return DataReturn('授权登录失败', -100);
@ -255,9 +259,11 @@ class User extends Common
$user = UserService::AppUserInfoHandle(null, 'baidu_openid', $result); $user = UserService::AppUserInfoHandle(null, 'baidu_openid', $result);
if(empty($user)) if(empty($user))
{ {
return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result['data']]); return DataReturn('授权登录成功', 0, ['is_user_exist'=>0, 'openid'=>$result['data']]);
} }
$user['is_alipay_user_exist'] = 1;
// 标记用户存在
$user['is_user_exist'] = 1;
return DataReturn('授权登录成功', 0, $user); return DataReturn('授权登录成功', 0, $user);
} }
return DataReturn($result['msg'], -10); return DataReturn($result['msg'], -10);
@ -346,9 +352,11 @@ class User extends Common
$user = UserService::AppUserInfoHandle(null, 'toutiao_openid', $result); $user = UserService::AppUserInfoHandle(null, 'toutiao_openid', $result);
if(empty($user)) if(empty($user))
{ {
return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result['data']]); return DataReturn('授权登录成功', 0, ['is_user_exist'=>0, 'openid'=>$result['data']]);
} }
$user['is_alipay_user_exist'] = 1;
// 标记用户存在
$user['is_user_exist'] = 1;
return DataReturn('授权登录成功', 0, $user); return DataReturn('授权登录成功', 0, $user);
} }
return DataReturn($result['msg'], -10); return DataReturn($result['msg'], -10);
@ -427,9 +435,11 @@ class User extends Common
$user = UserService::AppUserInfoHandle(null, 'qq_openid', $result); $user = UserService::AppUserInfoHandle(null, 'qq_openid', $result);
if(empty($user)) if(empty($user))
{ {
return DataReturn('授权登录成功', 0, ['is_alipay_user_exist'=>0, 'openid'=>$result]); return DataReturn('授权登录成功', 0, ['is_user_exist'=>0, 'openid'=>$result]);
} }
$user['is_alipay_user_exist'] = 1;
// 标记用户存在
$user['is_user_exist'] = 1;
return DataReturn('授权登录成功', 0, $user); return DataReturn('授权登录成功', 0, $user);
} }
return DataReturn('授权登录失败', -100); return DataReturn('授权登录失败', -100);

View File

@ -1718,31 +1718,25 @@ class UserService
{ {
return DataReturn('授权成功', 0, $user); return DataReturn('授权成功', 0, $user);
} else { } else {
// 用户unionid列表 // 用户unionid
// 微信用户unionid $unionid = self::UserUnionidHandle($params);
// QQ用户unionid if(!empty($unionid['field']) && !empty($unionid['value']))
$unionid_all = ['weixin_unionid', 'qq_unionid'];
foreach($unionid_all as $unionid)
{ {
if(!empty($params[$unionid])) // unionid字段是否存在用户
$user_unionid = UserService::AppUserInfoHandle(null, $unionid['field'], $unionid['value']);
if(!empty($user_unionid))
{ {
// unionid字段是否存在用户 // openid绑定
$user_unionid = UserService::AppUserInfoHandle(null, $unionid, $params[$unionid]); if(Db::name('User')->where(['id'=>$user_unionid['id']])->update([$field=>$params['openid'], 'upd_time'=>time()]))
if(!empty($user_unionid))
{ {
// openid绑定 // 直接返回用户信息
if(Db::name('User')->where(['id'=>$user_unionid['id']])->update([$field=>$params['openid'], 'upd_time'=>time()])) $user_unionid[$field] = $params['openid'];
{ return DataReturn('授权成功', 0, $user_unionid);
// 直接返回用户信息
$user_unionid[$field] = $params['openid'];
return DataReturn('授权成功', 0, $user_unionid);
}
} }
// 如果用户不存在数据库中则unionid放入用户data中
$data[$unionid] = $params[$unionid];
break;
} }
// 如果用户不存在数据库中则unionid放入用户data中
$data[$unionid['field']] = $unionid['value'];
} }
// 不强制绑定手机则写入用户信息 // 不强制绑定手机则写入用户信息
@ -1760,6 +1754,35 @@ class UserService
return DataReturn('授权成功', 0, self::AppUserInfoHandle(null, null, null, $data)); return DataReturn('授权成功', 0, self::AppUserInfoHandle(null, null, null, $data));
} }
/**
* 用户unionid处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-02-11
* @desc description
* @param [array] $params [输入参数]
*/
private static function UserUnionidHandle($params = [])
{
// 用户unionid列表
// 微信用户unionid
// QQ用户unionid
$field = null;
$value = null;
$unionid_all = ['weixin_unionid', 'qq_unionid'];
foreach($unionid_all as $unionid)
{
if(!empty($params[$unionid]))
{
$field = $unionid;
$value = $params[$unionid];
break;
}
}
return ['field'=>$field, 'value'=>$value];
}
/** /**
* app用户信息 * app用户信息
* @author Devil * @author Devil
@ -1870,6 +1893,14 @@ class UserService
return DataReturn('账号已存在', -10); return DataReturn('账号已存在', -10);
} }
// 用户unionid
$unionid = self::UserUnionidHandle($params);
if(!empty($unionid['field']) && !empty($unionid['value']))
{
// unionid放入用户data中
$data[$unionid['field']] = $unionid['value'];
}
// 推荐人id // 推荐人id
$data['referrer'] = self::UserReferrerDecrypt($params); $data['referrer'] = self::UserReferrerDecrypt($params);
@ -2043,6 +2074,17 @@ class UserService
return $user_ret; return $user_ret;
} }
} else { } else {
// 用户unionid
$unionid = self::UserUnionidHandle($params);
if(!empty($unionid['field']) && !empty($unionid['value']))
{
if(empty($temp_user[$unionid['field']]))
{
// unionid放入用户data中
$data[$unionid['field']] = $unionid['value'];
}
}
$data['upd_time'] = time(); $data['upd_time'] = time();
if(Db::name('User')->where(['id'=>$temp_user['id']])->update($data)) if(Db::name('User')->where(['id'=>$temp_user['id']])->update($data))
{ {

View File

@ -11,9 +11,6 @@
.am-table .goods-item { padding: 5px 0; } .am-table .goods-item { padding: 5px 0; }
.am-table .goods-item, .am-table .goods-item .base { overflow: hidden; } .am-table .goods-item, .am-table .goods-item .base { overflow: hidden; }
.am-table .goods-item .other .fl { width: 60%; } .am-table .goods-item .other .fl { width: 60%; }
.am-table .goods-item:not(:last-child), .am-table .order-no { border-bottom: 1px solid #eee; }
.am-table .order-no { font-weight: 700; color: #333;}
/** /**
* 业务弹窗 * 业务弹窗

View File

@ -1,11 +1,11 @@
/** /**
* 商品列表 * 商品列表
*/ */
.content-right .goods-detail img { width: 80px; height: 80px; position: absolute; left: 0; } .content-right .goods-detail img { width: 60px; height: 60px; position: absolute; left: 0; }
.content-right .goods-detail { position: relative; min-height: 80px; } .content-right .goods-detail { position: relative; min-height: 65px; }
.content-right .goods-title { display: block; max-height: 36px; overflow: hidden; text-overflow: ellipsis; } .content-right .goods-title { display: block; max-height: 36px; overflow: hidden; text-overflow: ellipsis; }
.content-right .goods-title:hover { text-decoration: underline; } .content-right .goods-title:hover { text-decoration: underline; }
.content-right .goods-base {float: left; top: 0; margin-left: 85px; } .content-right .goods-base {float: left; top: 0; margin-left: 65px; }
.content-right .goods-attr { margin-top: 5px; } .content-right .goods-attr { margin-top: 5px; }
.content-right .goods-attr li { color: #888; line-height: 16px; } .content-right .goods-attr li { color: #888; line-height: 16px; }
.content-right .original-price, .content-right .line-price { font-family: Verdana,Tahoma,arial; } .content-right .original-price, .content-right .line-price { font-family: Verdana,Tahoma,arial; }
@ -30,8 +30,8 @@
* 列表 * 列表
*/ */
@media only screen and (min-width:640px) { @media only screen and (min-width:640px) {
.content-right table.am-table tr .row-user-info { width: 20%; } .content-right table.am-table tr .row-goods { width: 25%; }
.content-right table.am-table tr .row-goods { width: 20%; } .content-right table.am-table tr .row-user-info { width: 15%; }
.content-right table.am-table tr .row-apply { width: 25%; } .content-right table.am-table tr .row-apply { width: 25%; }
.content-right table.am-table tr .row-more { width: 80px; } .content-right table.am-table tr .row-more { width: 80px; }
.content-right table.am-table tr .row-operation { width: 85px; } .content-right table.am-table tr .row-operation { width: 85px; }

View File

@ -19,7 +19,7 @@
.am-form-group:hover>input, .am-form-group:hover>select, .am-form-group:hover>textarea, .am-form-group:hover .chosen-choices, .am-form-group:hover .chosen-single { border: 1px solid #999 ; } .am-form-group:hover>input, .am-form-group:hover>select, .am-form-group:hover>textarea, .am-form-group:hover .chosen-choices, .am-form-group:hover .chosen-single { border: 1px solid #999 ; }
.am-form-error .chosen-choices, .am-form-error .chosen-default { border: 1px solid #dd514c !important; } .am-form-error .chosen-choices, .am-form-error .chosen-default { border: 1px solid #dd514c !important; }
.am-form-success .chosen-choices, .am-form-success .chosen-single { border: 1px solid #5eb95e !important; } .am-form-success .chosen-choices, .am-form-success .chosen-single { border: 1px solid #5eb95e !important; }
form.am-form .am-form-group-label-tips, form.am-form .am-form-group-label-tips-must { font-size: 12px; font-weight: 100; margin-left: 10px; } form.am-form .am-form-group-label-tips, form.am-form .am-form-group-label-tips-must { font-size: 12px; font-weight: 400; margin-left: 10px; }
form.am-form .am-form-group-label-tips { color: #ccc; } form.am-form .am-form-group-label-tips { color: #ccc; }
form.am-form .am-form-group-label-tips-must { color: #f00; } form.am-form .am-form-group-label-tips-must { color: #f00; }
.am-form-group:hover>label { color: #333 !important; } .am-form-group:hover>label { color: #333 !important; }

View File

@ -283,7 +283,7 @@ App({
my.hideLoading(); my.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
if((data.is_alipay_user_exist || 0) == 1) if((data.is_user_exist || 0) == 1)
{ {
my.setStorage({ my.setStorage({
key: self.data.cache_user_info_key, key: self.data.cache_user_info_key,

View File

@ -281,7 +281,7 @@ App({
swan.hideLoading(); swan.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
if ((data.is_alipay_user_exist || 0) == 1) { if ((data.is_user_exist || 0) == 1) {
swan.setStorage({ swan.setStorage({
key: self.data.cache_user_info_key, key: self.data.cache_user_info_key,
data: data, data: data,

View File

@ -249,7 +249,7 @@ App({
qq.hideLoading(); qq.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
if ((data.is_alipay_user_exist || 0) == 1) { if ((data.is_user_exist || 0) == 1) {
qq.setStorage({ qq.setStorage({
key: self.data.cache_user_info_key, key: self.data.cache_user_info_key,
data: data, data: data,

View File

@ -251,7 +251,7 @@ App({
tt.hideLoading(); tt.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
if ((data.is_alipay_user_exist || 0) == 1) { if ((data.is_user_exist || 0) == 1) {
tt.setStorage({ tt.setStorage({
key: self.data.cache_user_info_key, key: self.data.cache_user_info_key,
data: data, data: data,

View File

@ -252,7 +252,7 @@ App({
wx.hideLoading(); wx.hideLoading();
if (res.data.code == 0) { if (res.data.code == 0) {
var data = res.data.data; var data = res.data.data;
if ((data.is_alipay_user_exist || 0) == 1) { if ((data.is_user_exist || 0) == 1) {
wx.setStorage({ wx.setStorage({
key: self.data.cache_user_info_key, key: self.data.cache_user_info_key,
data: data, data: data,