小程序优化

feat/task1-c-wallet
devil 2020-09-17 14:10:41 +08:00
parent 8f2f247645
commit 7f4887028f
31 changed files with 109 additions and 116 deletions

View File

@ -105,7 +105,7 @@ class Goodsbrowse
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'view_key' => 'add_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'b.add_time',

View File

@ -105,7 +105,7 @@ class Goodsfavor
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'view_key' => 'add_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'f.add_time',

View File

@ -1,6 +1,6 @@
<!-- 图标 -->
{{if !empty($module_data) and !empty($module_data['images_url'])}}
<div class="am-circle nav-icon-circle am-vertical-align" style="background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};">
<div class="am-circle nav-icon-circle" style="background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};">
<a href="{{$module_data['images_url']}}" target="_blank">
<img src="{{$module_data['images_url']}}" class="am-radius am-vertical-align-middle" width="30" height="30" />
</a>

View File

@ -1,6 +1,6 @@
<!-- 图标 -->
{{if !empty($module_data) and !empty($module_data['images_url'])}}
<div class="am-circle nav-icon-circle am-vertical-align" style="background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};">
<div class="am-circle nav-icon-circle" style="background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};">
<a href="{{$module_data['images_url']}}" target="_blank">
<img src="{{$module_data['images_url']}}" class="am-radius am-vertical-align-middle" width="30" height="30" />
</a>

View File

@ -108,7 +108,7 @@ class UserGoodsBrowse
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'view_key' => 'add_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'b.add_time',

View File

@ -108,7 +108,7 @@ class UserGoodsFavor
[
'label' => '创建时间',
'view_type' => 'field',
'view_key' => 'add_time_time',
'view_key' => 'add_time',
'search_config' => [
'form_type' => 'datetime',
'form_name' => 'f.add_time',

View File

@ -141,31 +141,19 @@ class GoodsBrowseService
$data = Db::name('GoodsBrowse')->alias('b')->join(['__GOODS__'=>'g'], 'g.id=b.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
// 商品数据处理
$ret = GoodsService::GoodsDataHandle($data, ['data_key_field'=>'goods_id']);
$data = $ret['data'];
// 是否公共读取
$is_public = (isset($params['is_public']) && $params['is_public'] == 0) ? 0 : 1;
foreach($data as &$v)
{
// 用户信息
if(isset($v['user_id']))
if(isset($v['user_id']) && $is_public == 0)
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
// 无封面图片
if(empty($v['images']))
{
$v['images'] = ResourcesService::AttachmentPathHandle(GoodsService::GoodsImagesCoverHandle($v['goods_id']));
}
// 商品信息
$v['images_old'] = $v['images'];
$v['images'] = ResourcesService::AttachmentPathViewHandle($v['images']);
$v['goods_url'] = MyUrl('index/goods/index', ['id'=>$v['goods_id']]);
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return DataReturn('处理成功', 0, $data);

View File

@ -204,31 +204,19 @@ class GoodsFavorService
$data = Db::name('GoodsFavor')->alias('f')->join(['__GOODS__'=>'g'], 'g.id=f.goods_id')->field($field)->where($where)->limit($m, $n)->order($order_by)->select();
if(!empty($data))
{
// 商品数据处理
$ret = GoodsService::GoodsDataHandle($data, ['data_key_field'=>'goods_id']);
$data = $ret['data'];
// 是否公共读取
$is_public = (isset($params['is_public']) && $params['is_public'] == 0) ? 0 : 1;
foreach($data as &$v)
{
// 用户信息
if(isset($v['user_id']))
if(isset($v['user_id']) && $is_public == 0)
{
if(isset($params['is_public']) && $params['is_public'] == 0)
{
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
$v['user'] = UserService::GetUserViewInfo($v['user_id']);
}
// 无封面图片
if(empty($v['images']))
{
$v['images'] = ResourcesService::AttachmentPathHandle(GoodsService::GoodsImagesCoverHandle($v['goods_id']));
}
// 商品信息
$v['images_old'] = $v['images'];
$v['images'] = ResourcesService::AttachmentPathViewHandle($v['images']);
$v['goods_url'] = MyUrl('index/goods/index', ['id'=>$v['goods_id']]);
// 时间
$v['add_time_time'] = date('Y-m-d H:i:s', $v['add_time']);
$v['add_time_date'] = date('Y-m-d', $v['add_time']);
}
}
return DataReturn('处理成功', 0, $data);

View File

@ -357,10 +357,14 @@ class GoodsService
$is_content_app = (isset($params['is_content_app']) && $params['is_content_app'] == true) ? true : false;
$is_category = (isset($params['is_category']) && $params['is_category'] == true) ? true : false;
$is_params = (isset($params['is_params']) && $params['is_params'] == true) ? true : false;
$data_key_field = empty($params['data_key_field']) ? 'id' : $params['data_key_field'];
// 开始处理数据
foreach($data as &$v)
{
// 数据主键id
$data_id = isset($v[$data_key_field]) ? $v[$data_key_field] : 0;
// 商品处理前钩子
$hook_name = 'plugins_service_goods_handle_begin';
$ret = HookReturnHandle(Hook::listen($hook_name, [
@ -368,7 +372,7 @@ class GoodsService
'is_backend' => true,
'params' => &$params,
'goods' => &$v,
'goods_id' => isset($v['id']) ? $v['id'] : 0,
'goods_id' => $data_id,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{
@ -386,15 +390,15 @@ class GoodsService
];
// 商品url地址
if(!empty($v['id']))
if(!empty($data_id))
{
$v['goods_url'] = MyUrl('index/goods/index', ['id'=>$v['id']]);
$v['goods_url'] = MyUrl('index/goods/index', ['id'=>$data_id]);
}
// 获取相册
if($is_photo && !empty($v['id']))
if($is_photo && !empty($data_id))
{
$v['photo'] = self::GoodsPhotoData($v['id']);
$v['photo'] = self::GoodsPhotoData($data_id);
if(!empty($v['photo']))
{
foreach($v['photo'] as &$vs)
@ -412,7 +416,7 @@ class GoodsService
if(empty($v['images']))
{
// 获取商品封面图片
$v['images'] = ResourcesService::AttachmentPathHandle(self::GoodsImagesCoverHandle($v['id'], isset($v['photo']) ? $v['photo'] : []));
$v['images'] = ResourcesService::AttachmentPathHandle(self::GoodsImagesCoverHandle($data_id, isset($v['photo']) ? $v['photo'] : []));
}
$v['images_old'] = $v['images'];
$v['images'] = ResourcesService::AttachmentPathViewHandle($v['images']);
@ -460,9 +464,9 @@ class GoodsService
}
// 是否需要分类名称
if($is_category && !empty($v['id']))
if($is_category && !empty($data_id))
{
$v['category_ids'] = Db::name('GoodsCategoryJoin')->where(['goods_id'=>$v['id']])->column('category_id');
$v['category_ids'] = Db::name('GoodsCategoryJoin')->where(['goods_id'=>$data_id])->column('category_id');
$category_name = Db::name('GoodsCategory')->where(['id'=>$v['category_ids']])->column('name');
$v['category_text'] = implode('', $category_name);
}
@ -474,21 +478,21 @@ class GoodsService
}
// 获取规格
if($is_spec && !empty($v['id']))
if($is_spec && !empty($data_id))
{
$v['specifications'] = self::GoodsSpecificationsData($v['id']);
$v['specifications'] = self::GoodsSpecificationsData($data_id);
}
// 获取商品参数
if($is_params && !empty($v['id']))
if($is_params && !empty($data_id))
{
$v['parameters'] = self::GoodsParametersData($v['id']);
$v['parameters'] = self::GoodsParametersData($data_id);
}
// 获取app内容
if($is_content_app && !empty($v['id']))
if($is_content_app && !empty($data_id))
{
$v['content_app'] = self::GoodsContentAppData(['goods_id'=>$v['id']]);
$v['content_app'] = self::GoodsContentAppData(['goods_id'=>$data_id]);
}
// 展示字段
@ -502,7 +506,7 @@ class GoodsService
'is_backend' => true,
'params' => &$params,
'goods' => &$v,
'goods_id' => isset($v['id']) ? $v['id'] : 0,
'goods_id' => isset($data_id) ? $data_id : 0,
]));
if(isset($ret['code']) && $ret['code'] != 0)
{

View File

@ -134,10 +134,12 @@ return array (
'plugins_service_goods_handle_end' =>
array (
0 => 'app\\plugins\\exchangerate\\Hook',
1 => 'app\\plugins\\usernotloginhidegoodsprice\\Hook',
),
'plugins_service_goods_spec_base' =>
array (
0 => 'app\\plugins\\exchangerate\\Hook',
1 => 'app\\plugins\\usernotloginhidegoodsprice\\Hook',
),
'plugins_service_order_pay_launch_handle' =>
array (

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -160,11 +160,13 @@
/**
* 留言
*/
.content-textarea-view {
.content-textarea-container {
padding: 5rpx;
}
.content-textarea-view textarea {
height: 180rpx;
.content-textarea-container textarea,
.content-textarea-container view {
padding: 5rpx 15rpx;
height: 170rpx;
}
/**

View File

@ -85,8 +85,9 @@
</view>
<!-- 留言 -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea onInput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view class="content-textarea-container bg-white spacing-mb">
<textarea a:if="{{user_note_status}}" onBlur="bind_user_note_blur_event" onInput="bind_user_note_event" focus="{{true}}" show-count="{{false}}" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view a:else onTap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
</view>
<!-- 支付方式 -->

View File

@ -11,6 +11,7 @@ Page({
address_id: 0,
total_price: 0,
user_note_value: '',
user_note_status: false,
is_first: 1,
extension_data: [],
payment_id: 0,
@ -214,6 +215,16 @@ Page({
this.setData({user_note_value: e.detail.value});
},
// 用户留言点击
bind_user_note_tap_event(e) {
this.setData({user_note_status: true});
},
// 用户留言失去焦点
bind_user_note_blur_event(e) {
this.setData({user_note_status: false});
},
// 提交订单
buy_submit_event(e) {
// 表单数据

View File

@ -160,11 +160,13 @@
/**
*
*/
.content-textarea-view {
.content-textarea-container {
padding: 5rpx;
}
.content-textarea-view textarea {
height: 180rpx;
.content-textarea-container textarea,
.content-textarea-container view {
padding: 5rpx 15rpx;
height: 170rpx;
}
/**

View File

@ -12,7 +12,7 @@ Page({
address_id: null,
total_price: 0,
user_note_value: '',
user_note_disabled: true,
user_note_status: false,
is_first: 1,
extension_data: [],
payment_id: 0,
@ -175,16 +175,12 @@ Page({
// 用户留言点击
bind_user_note_tap_event(e) {
this.setData({
user_note_disabled: false,
});
this.setData({user_note_status: true});
},
// 用户留言失去焦点
bind_user_note_blur_event(e) {
this.setData({
user_note_disabled: true,
});
this.setData({user_note_status: false});
},
// 提交订单

View File

@ -88,6 +88,10 @@
<view class="content-textarea-view bg-white spacing-mb">
<textarea bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" bindinput="bind_user_note_event" value="{=user_note_value=}" maxlength="60" placeholder="留言" focus="{{!user_note_disabled}}" disabled="{{user_note_disabled}}" />
</view>
<view class="content-textarea-container bg-white spacing-mb">
<textarea s-if="user_note_status" bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" focus="{{true}}" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view s-else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
</view>
<!-- 支付方式 -->
<view s-if="payment_list.length > 0 && common_order_is_booking != 1" class="payment-list bg-white oh">

View File

@ -12,7 +12,7 @@ Page({
address_id: null,
total_price: 0,
user_note_value: '',
user_note_disabled: true,
user_note_status: false,
is_first: 1,
extension_data: [],
payment_id: 0,
@ -180,23 +180,19 @@ Page({
this.init();
},
// 用户留言事件
// 用户留言输入事件
bind_user_note_event(e) {
this.setData({user_note_value: e.detail.value});
},
// 用户留言点击
bind_user_note_tap_event(e) {
this.setData({
user_note_disabled: false,
});
this.setData({user_note_status: true});
},
// 用户留言失去焦点
bind_user_note_blur_event(e) {
this.setData({
user_note_disabled: true,
});
this.setData({user_note_status: false});
},
// 提交订单

View File

@ -85,8 +85,9 @@
</view>
<!-- -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" focus="{{!user_note_disabled}}" disabled="{{user_note_disabled}}" />
<view class="content-textarea-container bg-white spacing-mb">
<textarea qq:if="{{user_note_status}}" bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" focus="{{true}}" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view qq:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
</view>
<!-- -->

View File

@ -160,11 +160,13 @@
/**
* 留言
*/
.content-textarea-view {
.content-textarea-container {
padding: 5rpx;
}
.content-textarea-view textarea {
height: 180rpx;
.content-textarea-container textarea,
.content-textarea-container view {
padding: 5rpx 15rpx;
height: 170rpx;
}
/**

View File

@ -12,7 +12,7 @@ Page({
address_id: null,
total_price: 0,
user_note_value: '',
user_note_disabled: true,
user_note_status: false,
is_first: 1,
extension_data: [],
payment_id: 0,
@ -190,23 +190,17 @@ Page({
// 用户留言事件
bind_user_note_event(e) {
this.setData({
user_note_value: e.detail.value
});
this.setData({user_note_value: e.detail.value});
},
// 用户留言点击
bind_user_note_tap_event(e) {
this.setData({
user_note_disabled: false,
});
this.setData({user_note_status: true});
},
// 用户留言失去焦点
bind_user_note_blur_event(e) {
this.setData({
user_note_disabled: true,
});
this.setData({user_note_status: false});
},
// 提交订单

View File

@ -85,8 +85,9 @@
</view>
<!-- 留言 -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" focus="{{!user_note_disabled}}" disabled="{{user_note_disabled}}" />
<view class="content-textarea-container bg-white spacing-mb">
<textarea tt:if="{{user_note_status}}" bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" focus="{{true}}" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view tt:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
</view>
<!-- 支付方式 -->

View File

@ -160,11 +160,13 @@
/**
* 留言
*/
.content-textarea-view {
.content-textarea-container {
padding: 5rpx;
}
.content-textarea-view textarea {
height: 180rpx;
.content-textarea-container textarea,
.content-textarea-container view {
padding: 5rpx 15rpx;
height: 170rpx;
}
/**

View File

@ -11,7 +11,7 @@ Page({
address_id: null,
total_price: 0,
user_note_value: '',
user_note_disabled: true,
user_note_status: false,
is_first: 1,
extension_data: [],
payment_id: 0,
@ -206,16 +206,12 @@ Page({
// 用户留言点击
bind_user_note_tap_event(e) {
this.setData({
user_note_disabled: false,
});
this.setData({user_note_status: true});
},
// 用户留言失去焦点
bind_user_note_blur_event(e) {
this.setData({
user_note_disabled: true,
});
this.setData({user_note_status: false});
},
// 提交订单

View File

@ -85,8 +85,9 @@
</view>
<!-- 留言 -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea bindtap="bind_user_note_tap_event" bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" focus="{{!user_note_disabled}}" disabled="{{user_note_disabled}}" />
<view class="content-textarea-container bg-white spacing-mb">
<textarea wx:if="{{user_note_status}}" bindblur="bind_user_note_blur_event" bindinput="bind_user_note_event" focus="{{true}}" disable-default-padding="{{false}}" value="{{user_note_value}}" maxlength="60" placeholder="留言" />
<view wx:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
</view>
<!-- 支付方式 -->

View File

@ -160,11 +160,13 @@
/**
* 留言
*/
.content-textarea-view {
.content-textarea-container {
padding: 5rpx;
}
.content-textarea-view textarea {
height: 180rpx;
.content-textarea-container textarea,
.content-textarea-container view {
padding: 5rpx 15rpx;
height: 170rpx;
}
/**