提交 e391ba54 编写于 作者: D devil

模板细节优化

上级 26041ed1
...@@ -571,12 +571,7 @@ function BuySubmitBack(e) ...@@ -571,12 +571,7 @@ function BuySubmitBack(e)
if(e.code == 0) if(e.code == 0)
{ {
$.AMUI.progress.done(); $.AMUI.progress.done();
if($(window).width() < 640) Prompt(e.msg, 'success');
{
PromptBottom(e.msg, 'success', null, 50);
} else {
PromptCenter(e.msg, 'success');
}
setTimeout(function() setTimeout(function()
{ {
window.location.href = e.data.jump_url; window.location.href = e.data.jump_url;
...@@ -584,12 +579,7 @@ function BuySubmitBack(e) ...@@ -584,12 +579,7 @@ function BuySubmitBack(e)
} else { } else {
$('form.form-validation').find('button[type="submit"]').button('reset'); $('form.form-validation').find('button[type="submit"]').button('reset');
$.AMUI.progress.done(); $.AMUI.progress.done();
if($(window).width() < 640) Prompt(e.msg);
{
PromptBottom(e.msg, null, null, 50);
} else {
PromptCenter(e.msg);
}
} }
} }
</script> </script>
\ No newline at end of file
...@@ -88,10 +88,10 @@ ...@@ -88,10 +88,10 @@
</div> </div>
{{if !empty($article_list)}} {{if !empty($article_list)}}
<div class="banner-news"> <div class="banner-news">
<p class="banner-news-title">新闻头条</p> <p class="banner-news-title am-text-truncate">新闻头条</p>
<ul> <ul>
{{foreach $article_list as $article}} {{foreach $article_list as $article}}
<li> <li class="am-text-truncate">
<a href="{{$article.url}}" target="_blank"> <a href="{{$article.url}}" target="_blank">
{{if isset($article['article_category_name'])}} {{if isset($article['article_category_name'])}}
<span>[</span><p class="news-category-name am-inline-block am-text-truncate">{{$article.article_category_name}}</p><span>]</span> <span>[</span><p class="news-category-name am-inline-block am-text-truncate">{{$article.article_category_name}}</p><span>]</span>
......
...@@ -168,16 +168,16 @@ class ArticleService ...@@ -168,16 +168,16 @@ class ArticleService
} }
// 编辑器内容 // 编辑器内容
$content = isset($params['content']) ? htmlspecialchars_decode($params['content']) : ''; $content = empty($params['content']) ? '' : ResourcesService::ContentStaticReplace(htmlspecialchars_decode($params['content']), 'add');
// 数据 // 数据
$images = ResourcesService::RichTextMatchContentImage($content, 'article'); $images = ResourcesService::RichTextMatchContentAttachment($content, 'article');
$data = [ $data = [
'title' => $params['title'], 'title' => $params['title'],
'title_color' => empty($params['title_color']) ? '' : $params['title_color'], 'title_color' => empty($params['title_color']) ? '' : $params['title_color'],
'article_category_id' => intval($params['article_category_id']), 'article_category_id' => intval($params['article_category_id']),
'jump_url' => empty($params['jump_url']) ? '' : $params['jump_url'], 'jump_url' => empty($params['jump_url']) ? '' : $params['jump_url'],
'content' => ResourcesService::ContentStaticReplace($content, 'add'), 'content' => $content,
'images' => empty($images) ? '' : json_encode($images), 'images' => empty($images) ? '' : json_encode($images),
'images_count' => count($images), 'images_count' => count($images),
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0, 'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
......
...@@ -146,13 +146,13 @@ class CustomViewService ...@@ -146,13 +146,13 @@ class CustomViewService
} }
// 编辑器内容 // 编辑器内容
$content = isset($params['content']) ? htmlspecialchars_decode($params['content']) : ''; $content = empty($params['content']) ? '' : ResourcesService::ContentStaticReplace(htmlspecialchars_decode($params['content']), 'add');
// 数据 // 数据
$images = ResourcesService::RichTextMatchContentImage($content, 'customview'); $images = ResourcesService::RichTextMatchContentAttachment($content, 'customview');
$data = [ $data = [
'title' => $params['title'], 'title' => $params['title'],
'content' => ResourcesService::ContentStaticReplace($content, 'add'), 'content' => $content,
'images' => empty($images) ? '' : json_encode($images), 'images' => empty($images) ? '' : json_encode($images),
'images_count' => count($images), 'images_count' => count($images),
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0, 'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
......
...@@ -274,6 +274,10 @@ class OrderService ...@@ -274,6 +274,10 @@ class OrderService
// 支付模块处理数据 // 支付模块处理数据
'data' => $ret['data'], 'data' => $ret['data'],
// 支付日志id
'order_id' => $pay_log['data']['id'],
'order_no' => $pay_log['data']['log_no'],
]; ];
// 是否线下支付 // 是否线下支付
......
...@@ -570,14 +570,15 @@ class ResourcesService ...@@ -570,14 +570,15 @@ class ResourcesService
* @version 1.0.0 * @version 1.0.0
* @date 2020-06-16 * @date 2020-06-16
* @desc description * @desc description
* @param [string] $content [内容] * @param [string] $content [内容]
* @param [string] $type [模块名称] * @param [string] $business [业务模块名称]
* @param [string] $type [附件类型(images 图片, file 文件, video 视频)]
*/ */
public static function RichTextMatchContentImage($content, $type) public static function RichTextMatchContentAttachment($content, $business, $type = 'images')
{ {
if(!empty($content)) if(!empty($content))
{ {
$pattern = '/<img.*?src=[\'|\"](\/static\/upload\/images\/'.$type.'\/image\/.*?[\.gif|\.jpg|\.jpeg|\.png|\.bmp])[\'|\"].*?[\/]?>/'; $pattern = '/<img.*?src=[\'|\"](\/static\/upload\/'.$type.'\/'.$business.'\/.*?[\.png|\.jpg|\.jpeg|\.gif|\.bmp|\.flv|\.swf|\.mkv|\.avi|\.rm|\.rmvb|\.mpeg|\.mpg|\.ogg|\.ogv|\.mov|\.wmv|\.mp4|\.webm|\.mp3|\.wav|\.mid|\.rar|\.zip|\.tar|\.gz|\.7z|\.bz2|\.cab|\.iso|\.doc|\.docx|\.xls|\.xlsx|\.ppt|\.pptx|\.pdf|\.txt|\.md|\.xml])[\'|\"].*?[\/]?>/';
preg_match_all($pattern, self::AttachmentPathHandle($content), $match); preg_match_all($pattern, self::AttachmentPathHandle($content), $match);
return empty($match[1]) ? [] : $match[1]; return empty($match[1]) ? [] : $match[1];
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
namespace app\service; namespace app\service;
use think\Db; use think\Db;
use app\service\PaymentService;
use app\service\OrderService; use app\service\OrderService;
/** /**
...@@ -56,12 +55,12 @@ class ToutiaoService ...@@ -56,12 +55,12 @@ class ToutiaoService
} }
// 获取订单信息 // 获取订单信息
$where = ['id'=>intval($params['id']), 'user_id' => $params['user']['id']]; $where = ['id'=>$ret['data']['order_id'], 'user_id'=>$params['user']['id']];
$order = Db::name('Order')->where($where)->find(); $pay_log = Db::name('PayLog')->where($where)->find();
if(empty($pay_log))
// 支付方式 {
$payment_id = empty($params['payment_id']) ? $order['payment_id'] : intval($params['payment_id']); return DataReturn('订单支付日志有误', -1);
$payment = PaymentService::PaymentList(['where'=>['id'=>$payment_id]]); }
// 头条需要的订单信息 // 头条需要的订单信息
$order_info = [ $order_info = [
...@@ -73,12 +72,12 @@ class ToutiaoService ...@@ -73,12 +72,12 @@ class ToutiaoService
'trade_type' => 'H5', 'trade_type' => 'H5',
'product_code' => 'pay', 'product_code' => 'pay',
'payment_type' => 'direct', 'payment_type' => 'direct',
'out_order_no' => $order['order_no'].GetNumberCode(6), 'out_order_no' => $pay_log['log_no'],
'uid' => md5($params['user']['id']), 'uid' => md5($params['user']['id']),
'total_amount' => $order['total_price']*100, 'total_amount' => $pay_log['total_price']*100,
'currency' => 'CNY', 'currency' => 'CNY',
'subject' => '订单支付', 'subject' => '订单支付',
'body' => $order['order_no'], 'body' => $pay_log['log_no'],
'trade_time' => time(), 'trade_time' => time(),
'valid_time' => intval(MyC('common_order_close_limit_time', 30, true))*60, 'valid_time' => intval(MyC('common_order_close_limit_time', 30, true))*60,
'notify_url' => __MY_URL__, 'notify_url' => __MY_URL__,
...@@ -86,7 +85,7 @@ class ToutiaoService ...@@ -86,7 +85,7 @@ class ToutiaoService
// 支付方式 // 支付方式
$service = 1; $service = 1;
switch($payment[0]['payment']) switch($pay_log['payment'])
{ {
// 微信 // 微信
case 'Weixin' : case 'Weixin' :
......
...@@ -32,21 +32,5 @@ return array ( ...@@ -32,21 +32,5 @@ return array (
'log_write' => 'log_write' =>
array ( array (
), ),
'plugins_css' =>
array (
0 => 'app\\plugins\\share\\Hook',
),
'plugins_js' =>
array (
0 => 'app\\plugins\\share\\Hook',
),
'plugins_view_common_bottom' =>
array (
0 => 'app\\plugins\\share\\Hook',
),
'plugins_view_goods_detail_photo_bottom' =>
array (
0 => 'app\\plugins\\share\\Hook',
),
); );
?> ?>
\ No newline at end of file
...@@ -19,7 +19,7 @@ return [ ...@@ -19,7 +19,7 @@ return [
// 应用地址 // 应用地址
'app_host' => '', 'app_host' => '',
// 应用调试模式 // 应用调试模式
'app_debug' => false, 'app_debug' => true,
// 应用Trace // 应用Trace
'app_trace' => false, 'app_trace' => false,
// 是否支持多模块 // 是否支持多模块
......
...@@ -25,7 +25,6 @@ time, mark, audio, video { ...@@ -25,7 +25,6 @@ time, mark, audio, video {
.w100 {width:100%;} .w100 {width:100%;}
.fw-100 {font-weight:100;} .fw-100 {font-weight:100;}
.fw-700 {font-weight:700;} .fw-700 {font-weight:700;}
#common-prompt {position:fixed;top:0;left:0;right:0;text-align:center;margin-top:0;padding:5px;font-size:14px;z-index:10000;}
.am-popover { border-radius:2px !important; } .am-popover { border-radius:2px !important; }
.am-popover * {font-size: 12px;} .am-popover * {font-size: 12px;}
.am-icon-trash-o:before {width:12px !important;} .am-icon-trash-o:before {width:12px !important;}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> <title></title>
<script type="text/javascript" src="../internal.js"></script> <script type="text/javascript" src="../internal.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script> <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
<style type="text/css"> <style type="text/css">
.content{width:530px; height: 350px;margin: 10px auto;} .content{width:530px; height: 350px;margin: 10px auto;}
.content table{width: 100%} .content table{width: 100%}
......
...@@ -15,8 +15,8 @@ ul, li, ol {list-style: none;} ...@@ -15,8 +15,8 @@ ul, li, ol {list-style: none;}
/*走马灯*/ /*走马灯*/
.banner-mixed{position: relative;border-top:1px solid #F5F5F5 ;border-bottom: 1px #f5f5f5 solid;overflow: hidden;} .banner-mixed{position: relative;border-top:1px solid #F5F5F5 ;border-bottom: 1px #f5f5f5 solid;overflow: hidden;}
.banner-news-title{position: absolute;left:10px;padding-right:10px;border-right:1px solid #F5F5F5 ;} .banner-news-title{position: absolute;left:10px;padding-right:10px;border-right:1px solid #eee ;}
.banner-news li,#banner-news li a{height: 30px;line-height:30px; font-size: 12px; overflow: hidden;} .banner-news li,#banner-news li a{height: 30px;line-height:30px; font-size: 12px;}
.banner-news{max-width:1200px; margin:0px auto; overflow:hidden; height:30px;width:100%; text-align:left;color:#fff;} .banner-news{max-width:1200px; margin:0px auto; overflow:hidden; height:30px;width:100%; text-align:left;color:#fff;}
.news-category-name { line-height: 11px; max-width: 50px; } .news-category-name { line-height: 11px; max-width: 50px; }
.banner-news li {padding:0 10px 0 80px;} .banner-news li {padding:0 10px 0 80px;}
...@@ -173,7 +173,7 @@ text-align: center;float:none} ...@@ -173,7 +173,7 @@ text-align: center;float:none}
@media only screen and (max-width: 640px) { @media only screen and (max-width: 640px) {
.items-nav-title{ padding: 0 10%;} .items-nav-title{ padding: 0 10%;}
.banner-news-title{line-height: 30px; height: 30px; color: #333; } .banner-news-title{line-height: 30px; height: 30px; color: #333; max-width: 62px;}
.am-footer { padding-bottom: 50px; } .am-footer { padding-bottom: 50px; }
/*楼层*/ /*楼层*/
......
console.log("%c\u5b89\u5168\u8b66\u544a\uff01","font-size:50px;color:red;-webkit-text-fill-color:red;-webkit-text-stroke: 1px black;"); console.log("%c\u5b89\u5168\u8b66\u544a\uff01","font-size:50px;color:red;-webkit-text-fill-color:red;-webkit-text-stroke: 1px black;");
console.log("%c\u6b64\u6d4f\u89c8\u5668\u529f\u80fd\u4e13\u4f9b\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u8bf7\u4e0d\u8981\u5728\u6b64\u7c98\u8d34\u6267\u884c\u4efb\u4f55\u5185\u5bb9\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u60a8\u7684\u8d26\u6237\u53d7\u5230\u653b\u51fb\uff0c\u7ed9\u60a8\u5e26\u6765\u635f\u5931 \uff01","font-size: 20px;color:#333"); console.log("%c\u6b64\u6d4f\u89c8\u5668\u529f\u80fd\u4e13\u4f9b\u5f00\u53d1\u8005\u4f7f\u7528\u3002\u8bf7\u4e0d\u8981\u5728\u6b64\u7c98\u8d34\u6267\u884c\u4efb\u4f55\u5185\u5bb9\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u60a8\u7684\u8d26\u6237\u53d7\u5230\u653b\u51fb\uff0c\u7ed9\u60a8\u5e26\u6765\u635f\u5931 \uff01","font-size: 20px;color:#e04343");
console.log("\u6280\u672f\u652f\u6301\uff1a\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0068\u006f\u0070\u0078\u006f\u002e\u006e\u0065\u0074\u002f"); console.log("\u6280\u672f\u652f\u6301\uff1a\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0073\u0068\u006f\u0070\u0078\u006f\u002e\u006e\u0065\u0074\u002f");
var store = $.AMUI.store; var store = $.AMUI.store;
......
...@@ -241,7 +241,7 @@ Page({ ...@@ -241,7 +241,7 @@ Page({
title: "请求中..." title: "请求中..."
}); });
tt.request({ tt.request({
url: app.get_request_url("pay", "order"), url: app.get_request_url("pay", "toutiao"),
method: "POST", method: "POST",
data: { data: {
ids: order_ids, ids: order_ids,
...@@ -256,22 +256,32 @@ Page({ ...@@ -256,22 +256,32 @@ Page({
switch (res.data.data.is_payment_type) { switch (res.data.data.is_payment_type) {
// 正常线上支付 // 正常线上支付
case 0: case 0:
tt.requestPayment({ tt.pay({
timeStamp: res.data.data.data.timeStamp, orderInfo: res.data.data.order_info,
nonceStr: res.data.data.data.nonceStr, service: res.data.data.service,
package: res.data.data.data.package, success(res) {
signType: res.data.data.data.signType, // if (res.code == 0) {
paySign: res.data.data.data.paySign, // // 数据设置
success: function (res) { // self.order_item_pay_success_handle(index);
// 数据设置
self.order_item_pay_success_handle(order_ids); // 跳转支付页面 // // 跳转支付页面
// wx.navigateTo({
tt.navigateTo({ // url: "/pages/paytips/paytips?code=9000&total_price=" +
url: "/pages/paytips/paytips?code=9000" // self.data.data_list[index]['total_price']
// });
// } else {
// app.showToast('支付失败');
// }
// 由于头条支付无法监听支付状态,这里就不做接口轮询了,直接刷新页面
self.setData({
data_page: 1
}); });
self.get_data_list(1);
}, },
fail: function (res) { fail(res) {
app.showToast('支付失败'); console.log(res, 'pay-fail');
app.showToast('调起收银台失败-'+res.data.code);
} }
}); });
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册