修复公众号bug,调整公众号引用类

This commit is contained in:
liaofei 2019-05-10 09:29:56 +08:00
parent 3739b09022
commit 502e4c8a33
24 changed files with 78 additions and 68 deletions

View File

@ -4,7 +4,6 @@ namespace app\wap\controller;
use app\admin\model\article\Article as ArticleModel; use app\admin\model\article\Article as ArticleModel;
use app\wap\model\wap\ArticleCategory; use app\wap\model\wap\ArticleCategory;
use basic\WapBasic;
use think\Db; use think\Db;
/** /**
@ -37,8 +36,7 @@ class Article extends WapBasic {
public function visit($id = '') public function visit($id = '')
{ {
$content = ArticleModel::where('status',1)->where('hide',0)->where('id',$id)->order('id desc')->find(); $content = ArticleModel::where('status',1)->where('hide',0)->where('id',$id)->find();
if(!$content || !$content["status"]) return $this->failed('此文章已经不存在!'); if(!$content || !$content["status"]) return $this->failed('此文章已经不存在!');
$content["content"] = Db::name('articleContent')->where('nid',$content["id"])->value('content'); $content["content"] = Db::name('articleContent')->where('nid',$content["id"])->value('content');
//增加浏览次数 //增加浏览次数

View File

@ -35,13 +35,12 @@ use app\wap\model\user\UserNotice;
use app\wap\model\user\UserSign; use app\wap\model\user\UserSign;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use behavior\wap\StoreProductBehavior; use behavior\wap\StoreProductBehavior;
use service\WechatTemplateService; use app\core\util\WechatTemplateService;
use service\CacheService; use service\CacheService;
use service\HookService; use service\HookService;
use service\JsonService; use service\JsonService;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\UtilService; use service\UtilService;
use service\WechatService;
use think\Cache; use think\Cache;
use think\Request; use think\Request;
use think\Url; use think\Url;
@ -490,7 +489,11 @@ class AuthApi extends AuthController
} }
$model = StoreProduct::validWhere(); $model = StoreProduct::validWhere();
if($cId && $sId){ if($cId && $sId){
$model->where('cate_id',$sId); $product_ids=\think\Db::name('store_product_cate')->where('cate_id',$sId)->column('product_id');
if(count($product_ids))
$model=$model->where('id',"in",$product_ids);
else
$model=$model->where('cate_id',-1);
}elseif($cId){ }elseif($cId){
$sids = StoreCategory::pidBySidList($cId)?:[]; $sids = StoreCategory::pidBySidList($cId)?:[];
$sids[] = $cId; $sids[] = $cId;

View File

@ -11,7 +11,6 @@ namespace app\wap\controller;
use app\wap\model\store\StoreOrder; use app\wap\model\store\StoreOrder;
use app\wap\model\user\User; use app\wap\model\user\User;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use basic\WapBasic;
use service\UtilService; use service\UtilService;
use think\Cookie; use think\Cookie;
use think\Session; use think\Session;

View File

@ -17,10 +17,9 @@ use app\wap\model\user\User;
use app\wap\model\user\UserNotice; use app\wap\model\user\UserNotice;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use basic\WapBasic; use basic\WapBasic;
use service\GroupDataService; use app\core\util\GroupDataService;
use service\QrcodeService; use app\core\util\QrcodeService;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\WechatService;
use think\Db; use think\Db;
use think\Url; use think\Url;

View File

@ -10,9 +10,7 @@ namespace app\wap\controller;
use app\wap\model\user\User; use app\wap\model\user\User;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use basic\WapBasic;
use service\UtilService; use service\UtilService;
use service\WechatService;
use think\Cookie; use think\Cookie;
use think\Request; use think\Request;
use think\Session; use think\Session;
@ -23,7 +21,7 @@ class Login extends WapBasic
public function index($ref = '') public function index($ref = '')
{ {
Cookie::set('is_bg',1); Cookie::set('is_bg',1);
$ref && $ref=htmlspecialchars(base64_decode($ref)); $ref && $ref=htmlspecialchars_decode(base64_decode($ref));
if(UtilService::isWechatBrowser()){ if(UtilService::isWechatBrowser()){
$this->_logout(); $this->_logout();
$openid = $this->oauth(); $openid = $this->oauth();

View File

@ -24,11 +24,11 @@ use app\wap\model\user\User;
use app\wap\model\user\UserBill; use app\wap\model\user\UserBill;
use app\wap\model\user\UserExtract; use app\wap\model\user\UserExtract;
use app\wap\model\user\UserNotice; use app\wap\model\user\UserNotice;
use service\GroupDataService; use app\core\util\GroupDataService;
use app\wap\model\user\UserAddress; use app\wap\model\user\UserAddress;
use app\wap\model\user\UserSign; use app\wap\model\user\UserSign;
use service\CacheService; use service\CacheService;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use think\Request; use think\Request;
use think\Url; use think\Url;

View File

@ -15,6 +15,7 @@ use app\wap\model\store\StoreCategory;
use app\wap\model\store\StoreCouponIssue; use app\wap\model\store\StoreCouponIssue;
use app\wap\model\store\StoreProduct; use app\wap\model\store\StoreProduct;
use app\wap\model\wap\ArticleCategory; use app\wap\model\wap\ArticleCategory;
use service\FileService;
use service\JsonService; use service\JsonService;
use service\UtilService; use service\UtilService;
use think\Cache; use think\Cache;
@ -103,8 +104,9 @@ class PublicApi
{ {
if(!$mediaIds) return JsonService::fail('参数错误'); if(!$mediaIds) return JsonService::fail('参数错误');
$mediaIds = explode(',',$mediaIds); $mediaIds = explode(',',$mediaIds);
$temporary = \service\WechatService::materialTemporaryService(); $temporary = \app\core\util\WechatService::materialTemporaryService();
$pathList = []; $pathList = [];
$dir='public'.DS.'uploads'.DS.'wechat'.DS.'media';
foreach ($mediaIds as $mediaId){ foreach ($mediaIds as $mediaId){
if(!$mediaId) continue; if(!$mediaId) continue;
try{ try{
@ -113,7 +115,10 @@ class PublicApi
continue; continue;
} }
$name = substr(md5($mediaId),12,20).'.jpg'; $name = substr(md5($mediaId),12,20).'.jpg';
$path = '.'.DS.'public'.DS.'uploads'.DS.'wechat'.DS.'media'.DS.$name; $path = '.'.DS.$dir.DS.$name;
$file=new FileService();
$res=$file->create_dir($dir);
if(!$res) return JsonService::fail('生成文件保存目录失败!请检查权限!');
$res = file_put_contents($path,$content); $res = file_put_contents($path,$content);
if($res) $pathList[] = UtilService::pathToUrl($path); if($res) $pathList[] = UtilService::pathToUrl($path);
} }

View File

@ -8,7 +8,6 @@
namespace app\wap\controller; namespace app\wap\controller;
use app\wap\model\store\StoreService; use app\wap\model\store\StoreService;
use service\SystemConfigService;
use app\wap\model\user\User; use app\wap\model\user\User;
use app\admin\model\system\Merchant; use app\admin\model\system\Merchant;
use think\Request; use think\Request;

View File

@ -28,8 +28,8 @@ use app\wap\model\store\StoreProductRelation;
use app\wap\model\user\User; use app\wap\model\user\User;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use app\wap\model\store\StoreCombination; use app\wap\model\store\StoreCombination;
use service\GroupDataService; use app\core\util\GroupDataService;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\UtilService; use service\UtilService;
use think\Cache; use think\Cache;
use think\Request; use think\Request;

View File

@ -16,7 +16,7 @@ use think\Controller;
use behavior\wechat\UserBehavior; use behavior\wechat\UserBehavior;
use service\HookService; use service\HookService;
use service\UtilService; use service\UtilService;
use service\WechatService; use app\core\util\WechatService;
use think\Cookie; use think\Cookie;
use think\Request; use think\Request;
use think\Session; use think\Session;

View File

@ -2,7 +2,7 @@
namespace app\wap\controller; namespace app\wap\controller;
use app\admin\model\wechat\WechatReply; use app\admin\model\wechat\WechatReply;
use service\WechatService; use app\core\util\WechatService;
/** /**
@ -32,7 +32,7 @@ class Wechat
public function text() public function text()
{ {
dump(WechatService::userGroupService()); //dump(WechatService::userGroupService());
} }

View File

@ -21,10 +21,10 @@ use behavior\wap\StoreProductBehavior;
use behavior\wechat\PaymentBehavior; use behavior\wechat\PaymentBehavior;
use service\HookService; use service\HookService;
use service\JsonService; use service\JsonService;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\UtilService; use service\UtilService;
use service\WechatService; use app\core\util\WechatService;
use service\WechatTemplateService; use app\core\util\WechatTemplateService;
use think\Cache; use think\Cache;
use think\Db; use think\Db;
use think\Request; use think\Request;

View File

@ -9,7 +9,7 @@ namespace app\wap\model\user;
use basic\ModelBasic; use basic\ModelBasic;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use think\Request; use think\Request;
use think\response\Redirect; use think\response\Redirect;
use think\Session; use think\Session;
@ -109,6 +109,7 @@ class User extends ModelBasic
if($cost > $orderInfo['pay_price']) return true;//成本价大于支付价格时直接返回 if($cost > $orderInfo['pay_price']) return true;//成本价大于支付价格时直接返回
$brokeragePrice = bcmul(bcsub($orderInfo['pay_price'],$cost,2),$brokerageRatio,2); $brokeragePrice = bcmul(bcsub($orderInfo['pay_price'],$cost,2),$brokerageRatio,2);
//返佣之后余额 //返佣之后余额
$orderInfo['pay_price'] = bcsub($orderInfo['pay_price'],$orderInfo['pay_postage'],2);
$balance = bcsub($userInfo['now_money'],$brokeragePrice,2); $balance = bcsub($userInfo['now_money'],$brokeragePrice,2);
if($brokeragePrice <= 0) return true; if($brokeragePrice <= 0) return true;
$mark = $userInfo['nickname'].'成功消费'.floatval($orderInfo['pay_price']).'元,奖励推广佣金'.floatval($brokeragePrice); $mark = $userInfo['nickname'].'成功消费'.floatval($orderInfo['pay_price']).'元,奖励推广佣金'.floatval($brokeragePrice);

View File

@ -9,8 +9,8 @@ namespace app\wap\model\user;
use basic\ModelBasic; use basic\ModelBasic;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\WechatTemplateService; use app\core\util\WechatTemplateService;
use think\Url; use think\Url;
use traits\ModelTrait; use traits\ModelTrait;

View File

@ -9,7 +9,7 @@ namespace app\wap\model\user;
use app\wap\model\user\WechatUser; use app\wap\model\user\WechatUser;
use basic\ModelBasic; use basic\ModelBasic;
use service\WechatService; use app\core\util\WechatService;
use traits\ModelTrait; use traits\ModelTrait;
class UserRecharge extends ModelBasic class UserRecharge extends ModelBasic

View File

@ -9,7 +9,7 @@ namespace app\wap\model\user;
use basic\ModelBasic; use basic\ModelBasic;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use think\Model; use think\Model;
class UserSign class UserSign

View File

@ -10,9 +10,9 @@ namespace app\wap\model\user;
use app\wap\model\store\StoreCoupon; use app\wap\model\store\StoreCoupon;
use app\wap\model\store\StoreCouponUser; use app\wap\model\store\StoreCouponUser;
use basic\ModelBasic; use basic\ModelBasic;
use service\SystemConfigService; use app\core\util\SystemConfigService;
use service\UtilService; use service\UtilService;
use service\WechatService; use app\core\util\WechatService;
use service\CacheService as Cache; use service\CacheService as Cache;
use think\Session; use think\Session;
use traits\ModelTrait; use traits\ModelTrait;

View File

@ -3,8 +3,8 @@
{block name="content"} {block name="content"}
<div class="about-us"> <div class="about-us">
<section> <section>
<div class="ewm"><img src="<?= \service\SystemConfigService::get('about_us') ?>" alt=""></div> <div class="ewm"><img src="<?= \app\core\util\SystemConfigService::get('about_us') ?>" alt=""></div>
<p class="name"><?= \service\SystemConfigService::get('site_name') ?></p> <p class="name"><?= \app\core\util\SystemConfigService::get('site_name') ?></p>
</section> </section>
<div class="copy-right"> <div class="copy-right">
<p>众邦科技提供技术支持</p> <p>众邦科技提供技术支持</p>

View File

@ -9,7 +9,7 @@
<script type="text/javascript" src="{__WAP_PATH}crmeb/js/lottie.min.js"></script> <script type="text/javascript" src="{__WAP_PATH}crmeb/js/lottie.min.js"></script>
{/block} {/block}
{block name="title"} {block name="title"}
<?= \service\SystemConfigService::get('site_name') ?> <?= \app\core\util\SystemConfigService::get('site_name') ?>
{/block} {/block}
{block name="content"} {block name="content"}
<div class="page-index" id="app-index"> <div class="page-index" id="app-index">
@ -454,10 +454,10 @@
var that = this; var that = this;
this.elInit(); this.elInit();
this.getIssueCouponList(); this.getIssueCouponList();
this.getproductList('is_best');//精品 // this.getproductList('is_best');//精品
this.getproductList('is_hot');//热卖 // this.getproductList('is_hot');//热卖
this.getproductList('is_benefit');//促销 // this.getproductList('is_benefit');//促销
this.getproductList('is_new');//首发新品 // this.getproductList('is_new');//首发新品
this.getIssueCouponList(); this.getIssueCouponList();
this.getCateData(); this.getCateData();
this.getCombinationList();//猜猜喜欢 this.getCombinationList();//猜猜喜欢

View File

@ -11,7 +11,7 @@
<img src="{$wechatUser.headimgurl}" style="width: 1rem;height: 1rem;position: absolute;left: 50%;top: 50%;margin-left: -.5rem;margin-top: -.5rem;" /> <img src="{$wechatUser.headimgurl}" style="width: 1rem;height: 1rem;position: absolute;left: 50%;top: 50%;margin-left: -.5rem;margin-top: -.5rem;" />
</div> </div>
<div class="text-content"> <div class="text-content">
搜索微信公众号 <span><?=\service\SystemConfigService::get('site_name')?></span><br /> 搜索微信公众号 <span><?=\app\core\util\SystemConfigService::get('site_name')?></span><br />
或长按上方二维码立即关注 或长按上方二维码立即关注
</div> </div>
<div class="link"><a href="{:Url('Index/index')}">进入商城</a></div> <div class="link"><a href="{:Url('Index/index')}">进入商城</a></div>
@ -22,9 +22,9 @@
<script> <script>
mapleWx($jssdk(),function(){ mapleWx($jssdk(),function(){
this.onMenuShareAll({ this.onMenuShareAll({
title:'<?=\service\SystemConfigService::get('wechat_share_title')?>', title:'<?=\app\core\util\SystemConfigService::get('wechat_share_title')?>',
imgUrl:location.origin+'<?=\service\SystemConfigService::get('wechat_share_img')?>', imgUrl:location.origin+'<?=\app\core\util\SystemConfigService::get('wechat_share_img')?>',
desc:'<?=\service\SystemConfigService::get('wechat_share_synopsis')?>', desc:'<?=\app\core\util\SystemConfigService::get('wechat_share_synopsis')?>',
link:"{:Url('Index/index',['spuid'=>$wechatUser['uid']],true,true)}" link:"{:Url('Index/index',['spuid'=>$wechatUser['uid']],true,true)}"
}); });
}); });

View File

@ -46,6 +46,13 @@
<img src="{__WAP_PATH}crmeb/images/user-orders-list001.png" /> <img src="{__WAP_PATH}crmeb/images/user-orders-list001.png" />
<p>待付款</p> <p>待付款</p>
</a> </a>
<a href="{$orderListUrl}#11">
{gt name="orderStatusNum.noPink" value="0"}
<i class="mark_num">{$orderStatusNum.noPink > 99 ? 99 : $orderStatusNum.noPink}</i>
{/gt}
<img src="{__WAP_PATH}crmeb/images/user-orders-list005.png" />
<p>团购中</p>
</a>
<a href="{$orderListUrl}#1"> <a href="{$orderListUrl}#1">
{gt name="orderStatusNum.noPostage" value="0"} {gt name="orderStatusNum.noPostage" value="0"}
<i class="mark_num">{$orderStatusNum.noPostage > 99 ? 99 : $orderStatusNum.noPostage}</i> <i class="mark_num">{$orderStatusNum.noPostage > 99 ? 99 : $orderStatusNum.noPostage}</i>
@ -79,18 +86,18 @@
</div> </div>
{/volist} {/volist}
{if condition="$statu == 2 || $userInfo['is_promoter'] == 1"} {if condition="$statu == 2 || $userInfo['is_promoter'] == 1"}
<div class="item"> <div class="item">
<a class="con-cell" href="/wap/my/spread_list.html"> <a class="con-cell" href="/wap/my/spread_list.html">
<img src="/public/uploads/common/5abc5804670d2.png" alt=""> <img src="/public/uploads/common/5abc5804670d2.png" alt="">
<p>我的推广人</p> <p>我的推广人</p>
</a> </a>
</div> </div>
<div class="item"> <div class="item">
<a class="con-cell" href="/wap/index/spread.html"> <a class="con-cell" href="/wap/index/spread.html">
<img src="/public/uploads/common/5abc5816d752b.png" alt=""> <img src="/public/uploads/common/5abc5816d752b.png" alt="">
<p>推广二维码</p> <p>推广二维码</p>
</a> </a>
</div> </div>
{/if} {/if}
</div> </div>
</section> </section>

View File

@ -12,8 +12,9 @@
<button type="button" @click="searchOrder"><i class="iconfont icon-icon"></i></button> <button type="button" @click="searchOrder"><i class="iconfont icon-icon"></i></button>
</div> </div>
<div class="menu flex" ref="nav"> <div class="menu flex" ref="nav">
<div class="item" :class="{on:type === ''}" @click="changeType('')"><span>全部</span></div> <div class="item" :class="{on:type === 'all'}" @click="changeType('all')"><span>全部</span></div>
<div class="item" :class="{on:type === 0}" @click="changeType(0)"><span>待付款</span></div> <div class="item" :class="{on:type === 0}" @click="changeType(0)"><span>待付款</span></div>
<div class="item" :class="{on:type == 11}" @click="changeType(11)"><span>拼团中</span></div>
<div class="item" :class="{on:type == 1}" @click="changeType(1)"><span>待发货</span></div> <div class="item" :class="{on:type == 1}" @click="changeType(1)"><span>待发货</span></div>
<div class="item" :class="{on:type == 2}" @click="changeType(2)"><span>待收货</span></div> <div class="item" :class="{on:type == 2}" @click="changeType(2)"><span>待收货</span></div>
<div class="item" :class="{on:type == 3}" @click="changeType(3)"><span>待评价</span></div> <div class="item" :class="{on:type == 3}" @click="changeType(3)"><span>待评价</span></div>
@ -205,7 +206,7 @@
if(group.loaded) return ; if(group.loaded) return ;
this.loading = true; this.loading = true;
storeApi.getUserOrderList({ storeApi.getUserOrderList({
type:this.type, type:this.type=='all' ?'null':this.type,
first:group.first, first:group.first,
limit:group.limit, limit:group.limit,
search:this.search search:this.search

View File

@ -7,10 +7,10 @@
{block name="head_top"}{/block} {block name="head_top"}{/block}
<script type="text/javascript" src="{__PLUG_PATH}wxApi.js"></script> <script type="text/javascript" src="{__PLUG_PATH}wxApi.js"></script>
<script> <script>
$jssdk = function(){return <?=\service\WechatService::jsSdk()?>;} $jssdk = function(){return <?=\app\core\util\WechatService::jsSdk()?>;}
window.wechat_share_title="<?=\service\SystemConfigService::get('wechat_share_title')?>"; window.wechat_share_title="<?=\app\core\util\SystemConfigService::get('wechat_share_title')?>";
window.wechat_share_synopsis="<?=\service\SystemConfigService::get('wechat_share_synopsis')?>"; window.wechat_share_synopsis="<?=\app\core\util\SystemConfigService::get('wechat_share_synopsis')?>";
window.wechat_share_img="<?=\service\SystemConfigService::get('wechat_share_img')?>"; window.wechat_share_img="<?=\app\core\util\SystemConfigService::get('wechat_share_img')?>";
mapleWx($jssdk(), function () { mapleWx($jssdk(), function () {
this.onMenuShareAll({ this.onMenuShareAll({
title: wechat_share_title || $('title').text(), title: wechat_share_title || $('title').text(),

View File

@ -1,10 +1,10 @@
<script type="text/javascript" src="{__PLUG_PATH}requirejs/require.js"></script> <script type="text/javascript" src="{__PLUG_PATH}requirejs/require.js"></script>
<script> <script>
requirejs.config({ requirejs.config({
urlArgs: "v=201712230955", urlArgs: "v=15615616515616556",
map: { map: {
'*': { '*': {
'css': "{__PLUG_PATH}requirejs/require-css.js" 'css': '{__PUBLIC_PATH}static/plug/requirejs/require-css.js'
} }
}, },
shim: { shim: {
@ -24,7 +24,7 @@
deps: ['css!yduicss'] deps: ['css!yduicss']
} }
}, },
baseUrl: '//' + location.hostname + "{__PUBLIC_PATH}", baseUrl: '//' + location.hostname + '{__PUBLIC_PATH}',
paths: { paths: {
'static': 'static', 'static': 'static',
'vue': 'static/plug/vue/dist/vue.min', 'vue': 'static/plug/vue/dist/vue.min',
@ -38,7 +38,7 @@
'moment': 'static/plug/moment', 'moment': 'static/plug/moment',
'sweetalert': 'static/plug/sweetalert2/sweetalert2.all.min', 'sweetalert': 'static/plug/sweetalert2/sweetalert2.all.min',
'helper':'static/plug/helper', 'helper':'static/plug/helper',
'store':'wap/first/crmeb/module/store', 'store':'{__WAP_PATH}crmeb/module/store',
'better-scroll':"static/plug/better-scroll", 'better-scroll':"static/plug/better-scroll",
'ydui':"static/plug/ydui/ydui", 'ydui':"static/plug/ydui/ydui",
'yduicss':"static/plug/ydui/ydui-px", 'yduicss':"static/plug/ydui/ydui-px",