模板细节优化
parent
26041ed1d4
commit
e391ba54be
|
|
@ -571,12 +571,7 @@ function BuySubmitBack(e)
|
|||
if(e.code == 0)
|
||||
{
|
||||
$.AMUI.progress.done();
|
||||
if($(window).width() < 640)
|
||||
{
|
||||
PromptBottom(e.msg, 'success', null, 50);
|
||||
} else {
|
||||
PromptCenter(e.msg, 'success');
|
||||
}
|
||||
Prompt(e.msg, 'success');
|
||||
setTimeout(function()
|
||||
{
|
||||
window.location.href = e.data.jump_url;
|
||||
|
|
@ -584,12 +579,7 @@ function BuySubmitBack(e)
|
|||
} else {
|
||||
$('form.form-validation').find('button[type="submit"]').button('reset');
|
||||
$.AMUI.progress.done();
|
||||
if($(window).width() < 640)
|
||||
{
|
||||
PromptBottom(e.msg, null, null, 50);
|
||||
} else {
|
||||
PromptCenter(e.msg);
|
||||
}
|
||||
Prompt(e.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -88,10 +88,10 @@
|
|||
</div>
|
||||
{{if !empty($article_list)}}
|
||||
<div class="banner-news">
|
||||
<p class="banner-news-title">新闻头条</p>
|
||||
<p class="banner-news-title am-text-truncate">新闻头条</p>
|
||||
<ul>
|
||||
{{foreach $article_list as $article}}
|
||||
<li>
|
||||
<li class="am-text-truncate">
|
||||
<a href="{{$article.url}}" target="_blank">
|
||||
{{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>
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
'title' => $params['title'],
|
||||
'title_color' => empty($params['title_color']) ? '' : $params['title_color'],
|
||||
'article_category_id' => intval($params['article_category_id']),
|
||||
'jump_url' => empty($params['jump_url']) ? '' : $params['jump_url'],
|
||||
'content' => ResourcesService::ContentStaticReplace($content, 'add'),
|
||||
'content' => $content,
|
||||
'images' => empty($images) ? '' : json_encode($images),
|
||||
'images_count' => count($images),
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
'title' => $params['title'],
|
||||
'content' => ResourcesService::ContentStaticReplace($content, 'add'),
|
||||
'content' => $content,
|
||||
'images' => empty($images) ? '' : json_encode($images),
|
||||
'images_count' => count($images),
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
|
|
|
|||
|
|
@ -274,6 +274,10 @@ class OrderService
|
|||
|
||||
// 支付模块处理数据
|
||||
'data' => $ret['data'],
|
||||
|
||||
// 支付日志id
|
||||
'order_id' => $pay_log['data']['id'],
|
||||
'order_no' => $pay_log['data']['log_no'],
|
||||
];
|
||||
|
||||
// 是否线下支付
|
||||
|
|
|
|||
|
|
@ -570,14 +570,15 @@ class ResourcesService
|
|||
* @version 1.0.0
|
||||
* @date 2020-06-16
|
||||
* @desc description
|
||||
* @param [string] $content [内容]
|
||||
* @param [string] $type [模块名称]
|
||||
* @param [string] $content [内容]
|
||||
* @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))
|
||||
{
|
||||
$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);
|
||||
return empty($match[1]) ? [] : $match[1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
namespace app\service;
|
||||
|
||||
use think\Db;
|
||||
use app\service\PaymentService;
|
||||
use app\service\OrderService;
|
||||
|
||||
/**
|
||||
|
|
@ -56,12 +55,12 @@ class ToutiaoService
|
|||
}
|
||||
|
||||
// 获取订单信息
|
||||
$where = ['id'=>intval($params['id']), 'user_id' => $params['user']['id']];
|
||||
$order = Db::name('Order')->where($where)->find();
|
||||
|
||||
// 支付方式
|
||||
$payment_id = empty($params['payment_id']) ? $order['payment_id'] : intval($params['payment_id']);
|
||||
$payment = PaymentService::PaymentList(['where'=>['id'=>$payment_id]]);
|
||||
$where = ['id'=>$ret['data']['order_id'], 'user_id'=>$params['user']['id']];
|
||||
$pay_log = Db::name('PayLog')->where($where)->find();
|
||||
if(empty($pay_log))
|
||||
{
|
||||
return DataReturn('订单支付日志有误', -1);
|
||||
}
|
||||
|
||||
// 头条需要的订单信息
|
||||
$order_info = [
|
||||
|
|
@ -73,12 +72,12 @@ class ToutiaoService
|
|||
'trade_type' => 'H5',
|
||||
'product_code' => 'pay',
|
||||
'payment_type' => 'direct',
|
||||
'out_order_no' => $order['order_no'].GetNumberCode(6),
|
||||
'out_order_no' => $pay_log['log_no'],
|
||||
'uid' => md5($params['user']['id']),
|
||||
'total_amount' => $order['total_price']*100,
|
||||
'total_amount' => $pay_log['total_price']*100,
|
||||
'currency' => 'CNY',
|
||||
'subject' => '订单支付',
|
||||
'body' => $order['order_no'],
|
||||
'body' => $pay_log['log_no'],
|
||||
'trade_time' => time(),
|
||||
'valid_time' => intval(MyC('common_order_close_limit_time', 30, true))*60,
|
||||
'notify_url' => __MY_URL__,
|
||||
|
|
@ -86,7 +85,7 @@ class ToutiaoService
|
|||
|
||||
// 支付方式
|
||||
$service = 1;
|
||||
switch($payment[0]['payment'])
|
||||
switch($pay_log['payment'])
|
||||
{
|
||||
// 微信
|
||||
case 'Weixin' :
|
||||
|
|
|
|||
|
|
@ -32,21 +32,5 @@ return array (
|
|||
'log_write' =>
|
||||
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',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
|
@ -19,7 +19,7 @@ return [
|
|||
// 应用地址
|
||||
'app_host' => '',
|
||||
// 应用调试模式
|
||||
'app_debug' => false,
|
||||
'app_debug' => true,
|
||||
// 应用Trace
|
||||
'app_trace' => false,
|
||||
// 是否支持多模块
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ time, mark, audio, video {
|
|||
.w100 {width:100%;}
|
||||
.fw-100 {font-weight:100;}
|
||||
.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 * {font-size: 12px;}
|
||||
.am-icon-trash-o:before {width:12px !important;}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<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">
|
||||
.content{width:530px; height: 350px;margin: 10px auto;}
|
||||
.content table{width: 100%}
|
||||
|
|
|
|||
|
|
@ -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-news-title{position: absolute;left:10px;padding-right:10px;border-right:1px solid #F5F5F5 ;}
|
||||
.banner-news li,#banner-news li a{height: 30px;line-height:30px; font-size: 12px; overflow: hidden;}
|
||||
.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;}
|
||||
.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; }
|
||||
.banner-news li {padding:0 10px 0 80px;}
|
||||
|
|
@ -173,7 +173,7 @@ text-align: center;float:none}
|
|||
|
||||
@media only screen and (max-width: 640px) {
|
||||
.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; }
|
||||
|
||||
/*楼层*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
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");
|
||||
|
||||
var store = $.AMUI.store;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
|
|
@ -241,7 +241,7 @@ Page({
|
|||
title: "请求中..."
|
||||
});
|
||||
tt.request({
|
||||
url: app.get_request_url("pay", "order"),
|
||||
url: app.get_request_url("pay", "toutiao"),
|
||||
method: "POST",
|
||||
data: {
|
||||
ids: order_ids,
|
||||
|
|
@ -256,22 +256,32 @@ Page({
|
|||
switch (res.data.data.is_payment_type) {
|
||||
// 正常线上支付
|
||||
case 0:
|
||||
tt.requestPayment({
|
||||
timeStamp: res.data.data.data.timeStamp,
|
||||
nonceStr: res.data.data.data.nonceStr,
|
||||
package: res.data.data.data.package,
|
||||
signType: res.data.data.data.signType,
|
||||
paySign: res.data.data.data.paySign,
|
||||
success: function (res) {
|
||||
// 数据设置
|
||||
self.order_item_pay_success_handle(order_ids); // 跳转支付页面
|
||||
tt.pay({
|
||||
orderInfo: res.data.data.order_info,
|
||||
service: res.data.data.service,
|
||||
success(res) {
|
||||
// if (res.code == 0) {
|
||||
// // 数据设置
|
||||
// self.order_item_pay_success_handle(index);
|
||||
|
||||
tt.navigateTo({
|
||||
url: "/pages/paytips/paytips?code=9000"
|
||||
// // 跳转支付页面
|
||||
// wx.navigateTo({
|
||||
// url: "/pages/paytips/paytips?code=9000&total_price=" +
|
||||
// self.data.data_list[index]['total_price']
|
||||
// });
|
||||
// } else {
|
||||
// app.showToast('支付失败');
|
||||
// }
|
||||
|
||||
// 由于头条支付无法监听支付状态,这里就不做接口轮询了,直接刷新页面
|
||||
self.setData({
|
||||
data_page: 1
|
||||
});
|
||||
self.get_data_list(1);
|
||||
},
|
||||
fail: function (res) {
|
||||
app.showToast('支付失败');
|
||||
fail(res) {
|
||||
console.log(res, 'pay-fail');
|
||||
app.showToast('调起收银台失败-'+res.data.code);
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue