begin of thinksaas 3.68

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2023-06-22 13:33:25 +08:00
commit 963ec1b2ea
2746 changed files with 331806 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<?php
+10
View File
@@ -0,0 +1,10 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
include template ( "add" );
?>
+105
View File
@@ -0,0 +1,105 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$shopid = intval ( $_POST ['shopid'] );
$much=intval ( $_POST ['much'] );
$strshop = $new ['shop']->find ( 'shop', array (
'shopid' => $shopid
) );/*
if ($strshop == '') {
header ( "HTTP/1.1 404 Not Found" );
header ( "Status: 404 Not Found" );
$title = '404';
include pubTemplate ( "404" );
exit ();
}*/
//卖家
$arrshopuser = aac ( 'user' )->getSimpleUser ( $strshop ['userid'] );
// 是否审核
if ($strshop ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strshop['userid']) {
tsNotice ( '内容审核中...' );
}
switch($_POST ['ts'] )
{
case "do":
$address=h($_POST['address']);
if($strshop['type']==1)//注册类
{
if($strshop['pay_type']==1)//积分支付
{
$preg = '/[^|\s]([\s\S])[$|\s]/';
$arr = explode("\n", $address);
$arr = array_filter($arr); // 删除空元素
$a=count($arr); //获取码数量
if($a!=$much)
{
tsNotice('你的购买数量是:'.$much.'但输入了:'.$a.'个申请');
}
if($much>$strshop['stock'])
{
tsNotice('库存不足!!');
}
$need_pay=$much*$strshop['pay'];
if(aac('user')->delScore($userid,"BUY".$strshop['title']."X".$much,$need_pay))
{
$reorder='';
for($b=0;$b<$a;$b++)
{
preg_replace('# #','',$arr[$b]);
$reorder=$reorder.'</br>for:'.$arr[$b].'</br>Key:'.md5($arr[$b].$strshop['note']).'</br>';
}
$orderid = $new['shop']->create('shop_order',array(
'userid'=>$userid,
'selluserid'=>$strshop['userid'],
'shopid'=>$strshop['shopid'],
'title'=>$strshop['title'],
'content'=>$strshop['content'],
'type'=>$strshop['type'],
'pay' => $strshop['pay'],
'pay_type' => $strshop['pay_type'],
'much'=> $much,
'address' => $address,
'reorder'=>$reorder,
'state' => 1,
'addtime'=>date('Y-m-d H:i:s')
));
$new['shop']->update ( 'shop', array (
'shopid' => $strshop['shopid']
), array (
'stock' => $strshop['stock']-$much
));
aac('user')->addScore($strshop['userid'],"订单:".$orderid."收益",$need_pay,1);
}else
{
tsNotice('积分不足!');
}
tsNotice('成功提交','查看订单',tsUrl('shop','order',array('id'=>$orderid)));
}
}
back;
case "cheack":
include template ( "buy" );
back;
}
+92
View File
@@ -0,0 +1,92 @@
<?php
defined('IN_TS') or die('Access Denied.');
//用户是否登录
$userid = aac('user')->isLogin($js,$userkey);
switch($ts){
case "do":
$authcode = strtolower($_POST['authcode']);
if ($TS_SITE ['isauthcode']) {
if ($authcode != $_SESSION ['verify']) {
getJson ( "验证码输入有误,请重新输入!" ,$js,0);
}
}
$shopid = intval($_POST['shopid']);
$content = tsClean($_POST['content'],$js);
$content2 = emptyText($_POST['content']);//测试空内容
$ispublic = intval($_POST['ispublic']);
//过滤内容开始
if($TS_USER['isadmin']==0){
aac('system')->antiWord($content,$js);
}
//过滤内容结束
if($content2==''){
getJson('没有任何内容是不允许你通过滴^_^',$js);
}else{
$commentid = $new['shop']->create('shop_comment',array(
'shopid' => $shopid,
'userid' => $userid,
'content' => $content,
'addtime'=> time(),
));
//发送系统消息(通知楼主有人回复他的帖子啦)
$strshop = $new['shop']->find('shop',array(
'shopid'=>$shopid,
));
if($strshop['userid'] != $TS_USER['userid']){
$msg_userid = '0';
$msg_touserid = $strshop['userid'];
$msg_content = '你的商品:《'.$strshop['shopname'].'》新增一条评论,快去看看给个回复吧^_^ ';
$msg_tourl = tsUrl('shop','show',array('id'=>$shopid));
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl);
}
header("Location: ".tsUrl('shop','show',array('id'=>$shopid)));
}
break;
//删除评论
case "delete":
$commentid = intval($_GET['commentid']);
$strComment = $new['shop']->find('shop_comment',array(
'commentid'=>$commentid,
));
$strshop = $new['shop']->find('shop',array(
'shopid'=>$strComment['shopid'],
));
if($strshop['userid']==$userid || $TS_USER['isadmin']==1 || $strComment['userid']==$userid){
$new['shop']->delete('shop_comment',array(
'commentid'=>$commentid,
));
}
//跳转回到帖子页
header("Location: ".tsUrl('shop','show',array('id'=>$strComment['shopid'])));
break;
}
+70
View File
@@ -0,0 +1,70 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
//判断用户登录
$userid = aac('user') -> isLogin();
//判断发布者状态
if(aac('user')->isPublisher()==false) tsNotice('你还不能发布内容,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify'));
//echo print_r($_POST);
$title = trim($_POST['title']);
$type=intval($_POST['type']);
$comkey = trim($_POST['comkey']);
$content = tsClean($_POST['content']);
$pay_type=intval($_POST['pay_type']);
$pay=intval($_POST['pay']);
$stock=intval($_POST['stock']);
if (intval($TS_USER['isadmin']) == 0) {
// 过滤内容开始
aac('system') -> antiWord($title);
aac('system') -> antiWord($content);
// 过滤内容结束
}
if ($title == '' || $type == '' || $pay_type == '' || $pay == '')
{
tsNotice("Have null");
}
$isaudit = 0;
$shopid = $new['shop'] -> create('shop', array(
'userid' => $userid,
'locationid' => aac('user') -> getLocationId($userid),
'type' => $type,
'note' => $comkey,
'pay' => $pay,
'pay_type' => $pay_type,
'stock' => $stock,
'title' => $title,
'content' => $content,
'isaudit' => $isaudit,
'addtime' => date('Y-m-d H:i:s')
));
// 上传图片开始
$arrUpload = tsUpload($_FILES['photo'], $shopid, 'shop', array('jpg', 'gif', 'png', 'jpeg'));
if ($arrUpload) {
$new['shop'] -> update('shop', array(
'shopid' => $shopid
), array(
'path' => $arrUpload['path'],
'photo' => $arrUpload['url']
));
#生成不同尺寸的图片
//tsXimg($arrUpload['url'],'shop',320,180,$arrUpload['path'],'1');
//tsXimg($arrUpload['url'],'shop',640,'',$arrUpload['path']);
}
// 上传图片结束
header("Location: " . tsUrl('shop', 'show', array('id' => $shopid)));
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$shopid = intval ( $_GET ['shopid'] );
$stredit = $new ['shop']->find ( 'shop', array ('shopid' => $shopid ) );
$stredit['content'] = tsDecode($stredit['content']);
if($stredit=='')
{
tsNotice('NO!');
}
if($userid!=$stredit['userid'])
{
tsNotice('NO');
}
include template ( "edit" );
?>
+62
View File
@@ -0,0 +1,62 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$shopid = intval ( $_POST ['shopid'] );
$stredit = $new ['shop']->find ( 'shop', array ('shopid' => $shopid ) );
$stredit['content'] = tsDecode($stredit['content']);
if($stredit=='')
{
tsNotice('NO!');
}
if($userid!=$stredit['userid'])
{
tsNotice('NO');
}
$title = trim($_POST['title']);
$type=intval($_POST['type']);
$comkey = trim($_POST['comkey']);
$content = tsClean($_POST['content']);
$pay_type=intval($_POST['pay_type']);
$pay=intval($_POST['pay']);
$stock=intval($_POST['stock']);
if($_FILES['photo']!='')
{
// 上传图片开始
$arrUpload = tsUpload($_FILES['photo'], $shopid, 'shop', array('jpg', 'gif', 'png', 'jpeg'));
if ($arrUpload) {
$new['shop'] -> update('shop', array(
'shopid' => $shopid
), array(
'path' => $arrUpload['path'],
'photo' => $arrUpload['url']
));
#生成不同尺寸的图片
//tsXimg($arrUpload['url'],'shop',320,180,$arrUpload['path'],'1');
//tsXimg($arrUpload['url'],'shop',640,'',$arrUpload['path']);
}
// 上传图片结束
}
$new['shop'] -> update('shop', array('shopid' => $shopid), array(
'type' => $type,
'note' => $comkey,
'pay' => $pay,
'pay_type' => $pay_type,
'stock' => $stock,
'title' => $title,
'content' => $content,
'addtime' => date('Y-m-d H:i:s')
));
header("Location: " . tsUrl('shop', 'show', array('id' => $shopid)));
?>
+19
View File
@@ -0,0 +1,19 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('shop','index',array('page'=>''));
$lstart = $page*30-30;
$arrAlbum = $new['shop']->findAll('shop',"`isaudit`=0",'shopid desc',null,$lstart.',30');
$albumNum = $new['shop']->findCount('shop');
$pageUrl = pagination($albumNum, 30, $page, $url);
include template ( "index" );
+25
View File
@@ -0,0 +1,25 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('shop','myorder',array('page'=>''));
$lstart = $page*30-30;
$strmyoder = $new['shop']->findAll('shop_order',"`userid`=".$userid,'orderid desc',null,$lstart.',30');
foreach($strmyoder as $key=>$item){
$strmyoder[$key]['needpay'] = $strmyoder[$key]['pay']*$strmyoder[$key]['much'];
//卖家
$selluser = aac ( 'user' )->getSimpleUser ( $strmyoder [$key]['selluserid'] );
$strmyoder[$key]['sellusername']=$selluser['username'];
}
$albumNum = $new['shop']->findCount('shop_order');
$pageUrl = pagination($albumNum, 30, $page, $url);
include template ( "myorder" );
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$oderid = intval ( $_GET ['id'] );
$stroder = $new ['shop']->find ( 'shop_order', array ('orderid' => $oderid ) );
if($stroder=='')
{
tsNotice('NO!');
}
if($userid!=$stroder['userid']&&$userid!=$stroder['selluserid'])
{
tsNotice('NO');
}
$needpay=$stroder['much']*$stroder['pay'];
$stroder['content'] = tsDecode($stroder['content']);
$buyuser=aac ( 'user' )->getSimpleUser ( $stroder['userid'] );
$selluser=aac ( 'user' )->getSimpleUser ( $stroder['selluserid'] );
//print_r($_GET);
//$stroder['address'] = htmlentities($stroder['address'], ENT_NOQUOTES, "utf-8");
include template ( "order" );
?>
+25
View File
@@ -0,0 +1,25 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$userid = aac('user')->isLogin();
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('shop','myorder',array('page'=>''));
$lstart = $page*30-30;
$strmyoder = $new['shop']->findAll('shop_order',"`selluserid`=".$userid,'orderid desc',null,$lstart.',30');
foreach($strmyoder as $key=>$item){
$strmyoder[$key]['needpay'] = $strmyoder[$key]['pay']*$strmyoder[$key]['much'];
//买家
$selluser = aac ( 'user' )->getSimpleUser ( $strmyoder [$key]['userid'] );
$strmyoder[$key]['buyusername']=$selluser['username'];
}
$albumNum = $new['shop']->findCount('shop_order');
$pageUrl = pagination($albumNum, 30, $page, $url);
include template ( "sellout" );
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
$shopid = intval ( $_GET ['id'] );
$strshop = $new ['shop']->find ( 'shop', array (
'shopid' => $shopid
) );
if ($strshop == '') {
header ( "HTTP/1.1 404 Not Found" );
header ( "Status: 404 Not Found" );
$title = '404';
include pubTemplate ( "404" );
exit ();
}
//卖家
$arrshopuser = aac ( 'user' )->getSimpleUser ( $strshop ['userid'] );
//是否关注
if($TS_USER['userid'] != '' && $TS_USER['userid'] != $arrshopuser['userid']){
$userid=$arrshopuser['userid'];
$followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$TS_USER['userid']."' and userid_follow='$userid'");
if($followNum > '0'){
$arrshopuser['isfollow'] = true;
}else{
$arrshopuser['isfollow'] = false;
}
}else{
$arrshopuser['isfollow'] = false;
}
// 是否审核
if ($strshop ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strshop['userid']) {
tsNotice ( '内容审核中...' );
}
$strshop['content'] = tsDecode($strshop['content']);
// 获取评论
$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1;
$url = tsUrl ( 'shop', 'show', array (
'id' => $shopid,
'page' => ''
) );
$lstart = $page * 10 - 10;
$arrComments = $new ['shop']->findAll ( 'shop_comment', array (
'shopid' => $shopid
), 'addtime desc', null, $lstart . ',10' );
foreach ( $arrComments as $key => $item ) {
$arrComment [] = $item;
$arrComment[$key]['content'] = tsDecode($item['content']);
$arrComment [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] );
}
$commentNum = $new ['shop']->findCount ( 'shop_comment', array (
'shopid' => $shopid
) );
$pageUrl = pagination ( $commentNum, 10, $page, $url );
// 标签
//$strshop ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'shop', 'shopid', $strshop ['shopid'] );
$title = $strshop['title'];
include template ( "show" );
+9
View File
@@ -0,0 +1,9 @@
<?php
defined('IN_TS') or die('Access Denied.');
class shop extends tsApp{
}
+1
View File
@@ -0,0 +1 @@
<?php
+123
View File
@@ -0,0 +1,123 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">发布新商品</li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" style="max-width:100%;flex:100%;">
<form method="POST" action="{SITE_URL}index.php?app=shop&ac=do" enctype="multipart/form-data">
<div class="form-group">
<label>标题</label>
<input name="title" type="text" class="form-control" required="required" value="">
</div>
<div class="form-group">
<label>封面图片:</label>
<div>
<input type="file" name="photo" accept="image/jpeg,image/png"> <span class="fs12 c9">(支持jpg,png格式;大小640*400px)</span>
</div>
</div>
<div class="form-group">
<label>类型</label>
<select name="type" class="form-control">
<option value="1">MD5注册</option>
</select>
</div>
<div class="form-group">
<label>公钥</label>
<input name="comkey" type="text" class="form-control" value="">
</div>
<div class="form-group">
<label>内容</label>
<div id="tseditor"></div>
<div style="display: none;">
<textarea name="content"></textarea>
</div>
</div>
<div class="form-group">
<label>支付类型</label>
<select name="pay_type" class="form-control">
<option value="1">积分</option>
</select>
</div>
<div class="form-group">
<label>价格(积分型只能用整数)</label>
<input name="pay" type="text" class="form-control" value="" required="required" oninput = "value=value.replace(/[^\d]/g,'')">
</div>
<div class="form-group">
<label>存货</label>
<input name="stock" type="text" class="form-control" value="" required="required" oninput = "value=value.replace(/[^\d]/g,'')">
</div>
{if $TS_SITE['isauthcode']}
<div class="form-group">
<label>验证码</label>
<div class="offset-0">
<input class="form-control form-control-sm w-auto float-left mr-1" name="authcode" />
<img class="mt-1" src="{SITE_URL}index.php?app=pubs&ac=code" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
</div>
</div>
{/if}
<button class="btn btn-sm btn-info" type="submit">点击发布</button>
<p></p>
</form>
</div>
<div class="col-md-2"></div>
</div>
</div>
</div>
</div>
{php doAction('tseditor')}
{php include pubTemplate("footer")}
+135
View File
@@ -0,0 +1,135 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">{$strshop[title]}</li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="shopping">
<form action="{tsUrl('shop','buy')}" method="post">
<input name="ts" value="do" hidden></input>
<input name="shopid" value="$strshop[shopid]" hidden></input>
<table class="table table-hover table-bordered">
<thead class="thead-light">
<tr><th>商品</th><th>价格</th><th>数量</th></tr>
</thead>
<tbody>
<tr>
<td>
<img class="mw100" src="{if $strshop[photo] == ''}{SITE_URL}app/{$app}/skins/{$skin}/photo_album.png{else}{php echo tsXimg($strshop[photo],'shop',50,'50',$strshop[path],1)}{/if}" alt="{$strshop[title]}">
<a target="_blank" href="{tsUrl('shop','show',array('id'=>$strshop[shopid]))}">{$strshop[title]}</a>
</td>
<td> <n id="pay_{$strshop[shopid]}">{$strshop[pay]}</n>{if $strshop[pay_type] == '1'}积分{/if}</td><td>
<a href="javascript:void('0');" onclick="jian('{$strshop[shopid]}')">-</a> <input id="number_{$strshop[shopid]}" style="width:50px;" name="much" value="{$much}" > <a href="javascript:void('0');" onclick="jia('{$strshop[shopid]}')">+</a>
</td></tr>
</tbody>
</table>
<div class="shopping_total">应付总额:<h1><n id="needpay_{$strshop[shopid]}">{$strshop[pay]}</n>{if $strshop[pay_type] == '1'}积分{/if}</h1></div>
<table class="table table-bordered">
<thead class="thead-light">
<tr bgcolor="#f0f0f0"><th>收货信息</th></tr>
</thead>
<tbody>
<tr>
<td>
<h4>地址</h4>
<textarea name="address" style="width:100%;height:100px;overflow:scroll;"></textarea>
</td>
</tr>
</tbody>
</table>
<div class="text-right"><button class="btn btn-lg btn-danger" type="submit">提交订单</button></div>
</form>
</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
<script>
function buyadd()
{
var sl=$('#number_{$strshop[shopid]}').val();
var s2=$('#pay_{$strshop[shopid]}').text();
s2=parseInt(s2);
var s3=sl*s2;
$('#number_{$strshop[shopid]}').val(sl);
$('#needpay_{$strshop[shopid]}').text(s3);
}
setInterval(buyadd,500);
function jia(shopid){
var sl=$('#number_'+shopid).val();
if(sl)
{
sl=parseInt(sl)+1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(0);
}
}
function jian(shopid){
var sl=$('#number_'+shopid).val();
if (sl>1){
sl=parseInt(sl)-1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(1);
}
}
</script>
+3
View File
@@ -0,0 +1,3 @@
{php include pubTemplate("header")}
{php include pubTemplate("footer")}
+125
View File
@@ -0,0 +1,125 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">修改商品信息</li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" style="max-width:100%;flex:100%;">
<form method="POST" action="{SITE_URL}index.php?app=shop&ac=editdo" enctype="multipart/form-data">
<input name="shopid" value="{$stredit[shopid]}" hidden></input>
<div class="form-group">
<label>标题</label>
<input name="title" type="text" class="form-control" required="required" value="{$stredit[title]}">
</div>
<div class="form-group">
<label>封面图片:</label>
<div>
<a href="/uploadfile/shop/{$stredit[photo]}"><img class="mw100" src="{if $stredit[photo] == ''}{SITE_URL}app/{$app}/skins/{$skin}/photo_album.png{else}{php echo tsXimg($stredit[photo],'shop',320,'320',$stredit[path],1)}{/if}"></img></a>
</div>
<div>
<input type="file" name="photo" accept="image/jpeg,image/png"> <span class="fs12 c9">(支持jpg,png格式;大小640*400px)</span>
</div>
</div>
<div class="form-group">
<label>类型</label>
<select name="type" class="form-control">
<option value="1">MD5注册</option>
</select>
</div>
<div class="form-group">
<label>公钥</label>
<input name="comkey" type="text" class="form-control" value="{$stredit[note]}">
</div>
<div class="form-group">
<label>内容</label>
<div id="tseditor">{$stredit[content]}</div>
<div style="display: none;">
<textarea name="content" >{$stredit[content]}</textarea>
</div>
</div>
<div class="form-group">
<label>支付类型</label>
<select name="pay_type" class="form-control">
<option value="1">积分</option>
</select>
</div>
<div class="form-group">
<label>价格(积分型只能用整数)</label>
<input name="pay" type="text" class="form-control" value="{$stredit[pay]}" required="required" oninput = "value=value.replace(/[^\d]/g,'')">
</div>
<div class="form-group">
<label>存货</label>
<input name="stock" type="text" class="form-control" value="{$stredit[stock]}" required="required" oninput = "value=value.replace(/[^\d]/g,'')">
</div>
{if $TS_SITE['isauthcode']}
<div class="form-group">
<label>验证码</label>
<div class="offset-0">
<input class="form-control form-control-sm w-auto float-left mr-1" name="authcode" />
<img class="mt-1" src="{SITE_URL}index.php?app=pubs&ac=code" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
</div>
</div>
{/if}
<button class="btn btn-sm btn-info" type="submit">提交修改</button>
<p></p>
</form>
</div>
<div class="col-md-2"></div>
</div>
</div>
</div>
</div>
{php doAction('tseditor')}
{php include pubTemplate("footer")}
+56
View File
@@ -0,0 +1,56 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="{tsUrl('shop')}">商店</a></li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:170px;background-color:#006600" href="{tsUrl('shop','add')}">添加商品</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="mb-3">
</div>
<div class="card">
<div class="card-body">
<div class="row">
{loop $arrAlbum $key $item}
<div class="col-6 col-md-2 mb-3">
<a href="{tsUrl('shop','show',array('id'=>$item[shopid]))}">
<img class="mw100" src="{if $item[photo] == ''}{SITE_URL}app/{$app}/skins/{$skin}/photo_album.png{else}{php echo tsXimg($item[photo],'shop',320,'320',$item[path],1)}{/if}" alt="{$item[title]}">
</a>
<div class="caption">
<div class="title-cut mt-2">{$item[title]}</div>
<div class="c9 fs12"> 价格:{$item[pay]} {if $item[pay_type] == '1'}积分{/if}</div>
<div class="c9 fs12"> 库存:{$item[stock]} </div>
</div>
</div>
{/loop}
</div>
<div class="clear"></div>
<div class="page">{$pageUrl}</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
+76
View File
@@ -0,0 +1,76 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">我的订单</li>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="mb-3">
<a class="btn btn-sm btn-outline-secondary" href="">我买到的</a>
<a class="btn btn-sm text-secondary" href="{tsUrl('shop','sellout')}">我卖出的</a>
</div>
<div class="shopping">
<table class="table table-hover table-bordered">
<thead class="thead-light">
<tr><th>订单ID</th><th>Title</th><th>卖家</th><th>价格</th><th>数量</th><th>总额</th><th>订单状态</th><th>日期</th><th>操作</th></tr>
</thead>
<tbody>
{loop $strmyoder $key $item}
<tr>
<td>
{$item[orderid]}
</td>
<td>
{$item[title]}
</td>
<td>
{$item[sellusername]}
</td>
<td> {$item[pay]}{if $item[pay_type] == '1'}积分{/if}</td>
<td>
{$item[much]}
</td>
<td>
{$item[needpay]}{if $item[pay_type] == '1'}积分{/if}
</td>
<td>
{if $item[state] == '1'}交易完成{/if}
</td>
<td>
{$item[addtime]}
</td>
<td>
<a href="{tsUrl('shop','order',array('id'=>$item[orderid]))}">查看</a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
+111
View File
@@ -0,0 +1,111 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop','myorder')}">我的订单</a></li>
<li class="breadcrumb-item active" aria-current="page">订单ID{$stroder[orderid]}</li>
</ol>
</nav>
<div class="card">
<div class="card-header">订单ID{$stroder[orderid]}<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="javascript:history.back(-1);">返回</a></div>
<div class="card-body">
<div class="shopping">
<table class="table table-hover table-bordered">
<thead class="thead-light">
<tr><th>Title</th><th>价格</th><th>数量</th><th>总额</th><th>订单状态</th><th>买家</th><th>卖家</th><th>日期</th></tr>
</thead>
<tbody>
<tr>
<td>
{$stroder[title]}
</td>
<td> {$stroder[pay]}{if $stroder[pay_type] == '1'}积分{/if}</td>
<td>
{$stroder[much]}
</td>
<td>
{$needpay}{if $stroder[pay_type] == '1'}积分{/if}
</td>
<td>
{if $stroder[state] == '1'}交易完成{/if}
</td>
<td>
{$buyuser[username]}
</td>
<td>
{$selluser[username]}
</td>
<td>
{$stroder[addtime]}
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered">
<thead class="thead-light">
<tr bgcolor="#f0f0f0"><th>收货信息</th></tr>
</thead>
<tbody>
<tr>
<td>
{$stroder[address]}
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered">
<thead class="thead-light">
<tr bgcolor="#f0f0f0"><th>反单</th></tr>
</thead>
<tbody>
<tr>
<td>
{$stroder[reorder]}
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered">
<thead class="thead-light">
<tr bgcolor="#f0f0f0"><th>交易快照</th></tr>
</thead>
<tbody>
<tr>
<td>
{$stroder[content]}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
+72
View File
@@ -0,0 +1,72 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item active" aria-current="page"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">我的订单</li>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="mb-3">
<a class="btn btn-sm text-secondary" href="{tsUrl('shop','myorder')}">我买到的</a>
<a class="btn btn-sm btn-outline-secondary" href="">我卖出的</a>
</div>
<div class="shopping">
<table class="table table-hover table-bordered">
<thead class="thead-light">
<tr><th>订单ID</th><th>Title</th><th>买家</th><th>价格</th><th>数量</th><th>总额</th><th>订单状态</th><th>日期</th><th>操作</th></tr>
</thead>
<tbody>
{loop $strmyoder $key $item}
<tr>
<td>
{$item[orderid]}
</td>
<td>
{$item[title]}
</td>
<td>
{$item[buyusername]}
</td>
<td> {$item[pay]}{if $item[pay_type] == '1'}积分{/if}</td>
<td>
{$item[much]}
</td>
<td>
{$item[needpay]}{if $item[pay_type] == '1'}积分{/if}
</td>
<td>
{if $item[state] == '1'}交易完成{/if}
</td>
<td>
{$item[addtime]}
</td>
<td>
<a href="{tsUrl('shop','order',array('id'=>$item[orderid]))}">查看</a>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
+287
View File
@@ -0,0 +1,287 @@
{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">{$strshop[title]}</li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-8">
{if $strshop['tags']}
<div class="mb-3 mt-3">
{loop $strshop[tags] $key $strshop}
<a class="badge badge-secondary fw300 mr-2" href="{tsUrl('shop','tag',array('id'=>$strshop['tagname']))}">{$strshop[tagname]}</a>
{/loop}
</div>
<div class="clear"></div>
{/if}
<hr />
<form action="{tsUrl('shop','buy')}" method="post">
<div class="media mt-3 mb-3">
<input name="ts" value="cheack" hidden></input>
<input name="shopid" value="{$strshop[shopid]}" hidden></input>
<div>
<a href="/uploadfile/shop/{$strshop[photo]}"><img class="mw100" src="{if $strshop[photo] == ''}{SITE_URL}app/{$app}/skins/{$skin}/photo_album.png{else}{php echo tsXimg($strshop[photo],'shop',320,'320',$strshop[path],1)}{/if}"></img></a>
</div>
<div class="col-md-4">
<div><h1 class="h3 pb-3 fw400">{$strshop[title]}</h1></div>
<div class="h5"> 价格:{$strshop[pay]} {if $strshop[pay_type] == '1'}积分{/if}</div>
<div class="h5"> 库存:{$strshop[stock]} </div>
<div><a href="javascript:void('0');" onclick="jian('{$strshop[shopid]}')">-</a> <input id="number_{$strshop[shopid]}" style="width:50px;" name="much" value="1"> <a href="javascript:void('0');" onclick="jia('{$strshop[shopid]}')">+</a></div><br />
{if $strshop[type]==1}<button class="btn btn-sm btn-info position-absolute" style="background-color:#999999" disabled="value">虚拟产品</button>{/if}
<br /><br />
{if $strshop[stock]!=0}
<button name="buy" value="1" class="btn btn-sm btn-info position-absolute" style="background-color:#F77F0D" type="submit">购买</button>
{else}
<button class="btn btn-sm btn-info position-absolute" style="background-color:#999999" disabled="value">库存不足</button>
{/if}
</div>
</div>
</form>
<br /><br />
<hr />
<div>{php doAction('group_topic_footer')}</div>
<hr />
</div>
<div class="card">
<div class="card-header">卖家信息</div>
<div class="card-body">
<div class="facebox">
<div class="face">
<a href="{tsUrl('user','space',array('id'=>$arrshopuser['userid']))}"><img class="rounded-circle" title="{$arrshopuser[username]}" alt="{$arrshopuser[username]}" src="{$arrshopuser[face]}" width="36" height="36"></a>
</div>
<div class="info">
{$arrshopuser[username]}
<div>
<a class="fs12 text-info" href="{tsUrl('shop','shop',array('id'=>$arrshopuser['userid']))}"><i class="far fa-user-circle"></i>进入ta的店铺</a>
</div>
</div>
<div class="clear"></div>
<ul class="other">
<div class="mt-2 text-right">
{if $arrshopuser[userid] != $TS_USER[userid]}
{if $arrshopuser[isfollow]}
<a class="btn btn-outline-secondary btn-sm" href="javascript:void('0');" onclick="unfollow('{$arrshopuser['userid']}','{$_SESSION['token']}');">取消关注</a>
{else}
<a class="btn btn-info btn-sm" href="javascript:void('0')" onclick="follow('{$arrshopuser['userid']}','{$_SESSION['token']}');">关注</a>
{/if}
<a href="{tsUrl('user','message',array(ts=>add,touserid=>$arrshopuser[userid]))}" rel="nofollow" class="btn btn-outline-secondary btn-sm">联系卖家</a>
{/if}
</div>
</ul>
<ul class="other"></ul>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="card-header">商品详细</div>
{if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strshop['userid']}
<div class="float-right text-right">
<a class="btn btn-outline-secondary btn-sm" href="{tsUrl('shop','edit',array('shopid'=>$strshop[shopid]))}"><i class="far fa-edit"></i> 修改</a>
<a onclick="return confirm('确定删除?')" class="btn btn-outline-secondary btn-sm" href="{SITE_URL}index.php?app=shop&ac=delete&shopid={$strshop[shopid]}&token={$_SESSION['token']}"><i class="far fa-trash-alt"></i> 删除</a>
</div>
{/if}
<div class="shop_show_content lh30 common-content">
<!---视频处理开始--->
{if $TS_APP['isshopvideo']}
{if $arrVideo}
<div class="shop_video pb-0">
{loop $arrVideo $key $strshop}
<div>
{if $strshop['siteid']==1 || $strshop['siteid']==2 || $strshop['siteid']==3}
<iframe frameborder="0" src="{$strshop['iframe']}" allowFullScreen="true"></iframe>
{if $TS_USER['userid']==$strshop['userid'] || $TS_USER['isadmin']==1}
<div class="text-right mb-2"><a class="btn btn-outline-info btn-sm" onclick="return confirm('确定删除?')" href="{SITE_URL}index.php?app=shop&ac=delete&ts=video&shopid={$shopid}&videoid={$strshop['videoid']}">删除</a></div>
{/if}
{/if}
</div>
{/loop}
</div>
{/if}
{if $TS_USER['userid']==$strshop['userid'] || $TS_USER['isadmin']==1}
<div class="shop_video">
<div class="text-center"><a class="btn btn-link" href="{tsUrl('video','upload',array('ts'=>'network','shopid'=>$shopid))}"> <i class="fas fa-plus-circle"></i> 插入视频</a></div>
</div>
{/if}
{/if}
{php
doAction('gobad','content_top')
}
{$strshop[content]}
{$tpUrl}
<div class="fs12 c9">{php doAction('gobad','468')
}</div>
<div class="of mt-3">
{if $TS_USER[isadmin]==1 || $TS_USER['userid']==$strshop['userid']}
<div class="float-right text-right">
<a class="btn btn-outline-secondary btn-sm" href="{tsUrl('shop','edit',array('shopid'=>$strshop[shopid]))}"><i class="far fa-edit"></i> 修改</a>
<a onclick="return confirm('确定删除?')" class="btn btn-outline-secondary btn-sm" href="{SITE_URL}index.php?app=shop&ac=delete&shopid={$strshop[shopid]}&token={$_SESSION['token']}"><i class="far fa-trash-alt"></i> 删除</a>
</div>
{/if}
</div>
</div>
<div class="card">
<div class="card-header">买家评论</div>
<div class="card-body">
{if $arrComment}
<div class="comment">
<ul>
{loop $arrComment $key $strshop}
<li class="clearfix">
<div class="user-face">
<a href="{tsUrl('user','space',array('id'=>$strshop[user][userid]))}"><img class="rounded-circle" title="{$strshop[user][username]}" alt="{$strshop[user][username]}" src="{$strshop[user][face]}" width="48" /></a>
</div>
<div class="reply-doc">
<h4>
<a class="c9" href="{tsUrl('user','space',array('id'=>$strshop[userid]))}">{$strshop[user][username]}</a>
</h4>
<p>{$strshop[content]}</p>
<h4>{php echo date('Y-m-d H:i:s',$strshop[addtime])}</h4>
{if $TS_USER[userid] == $strshop[userid] ||
$TS_USER['isadmin']==1}
<div class="mb-2 text-right">
<a class="fs12 text-secondary" href="{SITE_URL}index.php?app=shop&ac=comment&ts=delete&commentid={$strshop['commentid']}"><i class="far fa-trash-alt"></i> 删除</a>
</div>
{/if}
</div>
</li> {/loop}
</ul>
</div>
<div class="page">{$pageUrl}</div>
{/if}
<div>
{if intval($TS_USER[userid])==0}
<div class="pd20 tac">
<a href="{tsUrl('user','login')}">登录</a> | <a href="{tsUrl('user','register')}">注册</a>
</div>
{else}
<form method="POST" action="{SITE_URL}index.php?app=shop&ac=comment&ts=do">
<div id="tseditor"></div>
<div style="display: none"><textarea name="content"></textarea></div>
<div class="mt-2 of">
<div class="float-left">
{if $TS_SITE['isauthcode']}
验证码:<input name="authcode" />
<img align="absmiddle" src="{tsUrl('pubs','code')}" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
{/if}
</div>
<div class="float-right">
<input type="hidden" name="shopid" value="{$strshop[shopid]}" />
<input type="hidden" name="token" value="{$_SESSION['token']}" />
<button class="btn btn-sm btn-info" type="submit">评论</button>
</div>
</div>
</form>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
{php doAction('tseditor','mini')}
{php include pubTemplate("footer")}
<script>
function jia(shopid){
var sl=$('#number_'+shopid).val();
if(sl)
{
sl=parseInt(sl)+1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(0);
}
}
function jian(shopid){
var sl=$('#number_'+shopid).val();
if (sl>1){
sl=parseInt(sl)-1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(1);
}
}
</script>
+2
View File
@@ -0,0 +1,2 @@
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File