微信小程序好物推荐
parent
acfcdacbfe
commit
e255904185
|
|
@ -5,4 +5,7 @@
|
|||
<li {{if $nav_type eq 'app'}}class="am-active"{{/if}} data-type="app">
|
||||
<a href="{{:MyUrl('admin/appconfig/index', ['nav_type'=>'app'])}}">APP/小程序</a>
|
||||
</li>
|
||||
<li {{if $nav_type eq 'weixinmini'}}class="am-active"{{/if}} data-type="weixinmini">
|
||||
<a href="{{:MyUrl('admin/appconfig/index', ['nav_type'=>'weixinmini'])}}">微信小程序</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- table nav start -->
|
||||
{{include file="appconfig/nav" /}}
|
||||
<!-- table nav end -->
|
||||
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/appconfig/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/appconfig/index', ['nav_type'=>'weixinmini'])}}" enctype="multipart/form-data">
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_app_is_good_thing.name}}<span class="am-form-group-label-tips">{{$data.common_app_is_good_thing.describe}}</span></label>
|
||||
<select name="{{$data.common_app_is_good_thing.only_tag}}" class="am-radius chosen-select c-p" data-validation-message="{{$data.common_app_is_good_thing.error_tips}}" required>
|
||||
{{foreach $common_is_text_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($data['common_app_is_good_thing']['value']) and $data['common_app_is_good_thing']['value'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
<input type="hidden" name="nav_type" value="{{$nav_type}}" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'处理中...'}">保存</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end
|
||||
|
|
@ -107,13 +107,18 @@ class Goods extends Common
|
|||
// 用户商品浏览
|
||||
GoodsService::GoodsBrowseSave(['goods_id'=>$goods_id, 'user'=>$this->user]);
|
||||
|
||||
// 商品所属分类名称
|
||||
$category = GoodsService::GoodsCategoryNames($goods_id);
|
||||
$ret['data'][0]['category_names'] = $category['data'];
|
||||
|
||||
// 数据返回
|
||||
$result = [
|
||||
'goods' => $ret['data'][0],
|
||||
'common_order_is_booking' => (int) MyC('common_order_is_booking', 0),
|
||||
'common_order_is_booking' => (int) MyC('common_order_is_booking'),
|
||||
'common_app_is_use_mobile_detail' => $is_use_mobile_detail,
|
||||
'common_app_is_online_service' => (int) MyC('common_app_is_online_service', 0),
|
||||
'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'),
|
||||
];
|
||||
|
||||
// 秒杀
|
||||
|
|
|
|||
|
|
@ -27,9 +27,14 @@ function CallPluginsServiceMethod($plugins, $service, $method, $params = null)
|
|||
$plugins_class = 'app\plugins\\'.$plugins.'\service\\'.$service;
|
||||
if(class_exists($plugins_class))
|
||||
{
|
||||
return $plugins_class::$method($params);
|
||||
if(method_exists($plugins_class, $method))
|
||||
{
|
||||
return $plugins_class::$method($params);
|
||||
} else {
|
||||
return DataReturn('类方法未定义['.$plugins.'-'.$service.'-'.$method.']', -1);
|
||||
}
|
||||
}
|
||||
return DataReturn('类未定义', -1);
|
||||
return DataReturn('类未定义['.$plugins.'-'.$service.']', -1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2203,5 +2203,20 @@ class GoodsService
|
|||
}
|
||||
return DataReturn('删除失败', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品id获取分类名称
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-08-29
|
||||
* @desc description
|
||||
* @param [int] $goods_id [商品id]
|
||||
*/
|
||||
public static function GoodsCategoryNames($goods_id)
|
||||
{
|
||||
$data = Db::name('GoodsCategory')->alias('gc')->join(['__GOODS_CATEGORY_JOIN__'=>'gci'], 'gc.id=gci.category_id')->where(['gci.goods_id'=>$goods_id])->column('gc.name');
|
||||
return DataReturn('获取成功', 0, $data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -62,7 +62,7 @@ App({
|
|||
// 请求地址
|
||||
// request_url: "{{request_url}}",
|
||||
request_url: 'http://tp5-dev.com/',
|
||||
request_url: 'https://test.shopxo.net/',
|
||||
//request_url: 'https://test.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@
|
|||
"request": 10000,
|
||||
"downloadFile": 10000
|
||||
},
|
||||
"plugins": {
|
||||
"goodsSharePlugin": {
|
||||
"version": "3.1.1",
|
||||
"provider": "wx56c8f077de74b07c"
|
||||
}
|
||||
},
|
||||
"debug": true,
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
||||
|
|
@ -42,6 +42,21 @@ Page({
|
|||
plugins_limitedtimediscount_data: null,
|
||||
plugins_limitedtimediscount_is_show_time: true,
|
||||
plugins_limitedtimediscount_time_millisecond: 0,
|
||||
|
||||
// 好物圈分享信息
|
||||
common_app_is_good_thing : 0,
|
||||
share_product: {
|
||||
"item_code": "",
|
||||
"title": "",
|
||||
"desc": "",
|
||||
"category_list": [],
|
||||
"image_list": [],
|
||||
"src_mini_program_path": "",
|
||||
"brand_info": {},
|
||||
},
|
||||
},
|
||||
on_error(e) {
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -116,6 +131,15 @@ Page({
|
|||
|
||||
common_app_is_limitedtimediscount: data.common_app_is_limitedtimediscount || 0,
|
||||
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
|
||||
|
||||
common_app_is_good_thing: data.common_app_is_good_thing || 0,
|
||||
'share_product.item_code': data.goods.id.toString(),
|
||||
'share_product.title': data.goods.title,
|
||||
'share_product.image_list': data.goods.photo.map(function (v) { return v.images;}),
|
||||
'share_product.desc': data.goods.simple_desc,
|
||||
'share_product.category_list': data.goods.category_names || [],
|
||||
'share_product.src_mini_program_path': '/pages/goods-detail/goods-detail?goods_id='+data.goods.id,
|
||||
'share_product.brand_info.name': data.goods.brand_name,
|
||||
});
|
||||
|
||||
// 限时秒杀倒计时
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"usingComponents": {
|
||||
"component-popup": "/components/popup/popup"
|
||||
"component-popup": "/components/popup/popup",
|
||||
"share-button": "plugin://goodsSharePlugin/share-button"
|
||||
}
|
||||
}
|
||||
|
|
@ -175,9 +175,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="share-popup-content">
|
||||
<view class="share-items oh">
|
||||
<image class="fl" src="/images/share-recomend-icon.png" mode="scaleToFill" />
|
||||
<view class="cr-888 single-text fl">好物推荐、和大家一起分享你发现的宝贝</view>
|
||||
<view wx:if="{{common_app_is_good_thing == 1}}" class="share-items oh">
|
||||
<share-button product="{{share_product}}" type="3" class="dis-block oh">
|
||||
<image class="fl" src="/images/share-recomend-icon.png" mode="scaleToFill" />
|
||||
<view class="cr-888 single-text fl">好物推荐、和大家一起分享你发现的宝贝</view>
|
||||
</share-button>
|
||||
</view>
|
||||
<view class="share-items oh">
|
||||
<button class="dis-block" type="default" size="mini" open-type="share" hover-class="none">
|
||||
|
|
|
|||
Loading…
Reference in New Issue