You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
604
hyhproject/mobile2/view/default/users/Users.php
Executable file
604
hyhproject/mobile2/view/default/users/Users.php
Executable file
@ -0,0 +1,604 @@
|
||||
<?php
|
||||
namespace wstmart\mobile\controller;
|
||||
use wstmart\mobile\model\Users as M;
|
||||
use wstmart\mobile\model\Messages;
|
||||
use wstmart\common\model\LogSms;
|
||||
use wstmart\common\model\Users as MUsers;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 用户控制器
|
||||
*/
|
||||
class Users extends Base{
|
||||
// 前置方法执行列表
|
||||
protected $beforeActionList = [
|
||||
'checkAuth' => ['except'=>'checklogin,login,register,getverify,toregister,forgetpass,forgetpasst,forgetpasss,forgetpassf,findpass,getfindphone,resetpass,getphoneverifycode,checkuserphone']// 访问这些except下的方法不需要执行前置操作
|
||||
];
|
||||
/**
|
||||
*跳转到合源惠联盟 mark 20170919 hsf
|
||||
*/
|
||||
|
||||
public function to_hyhlm(){
|
||||
session('to_hyhlm',null);
|
||||
hook('toHyhlm');
|
||||
die;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员登录页
|
||||
*/
|
||||
public function login(){
|
||||
//如果已经登录了则直接跳去用户中心
|
||||
$USER = session('WST_USER');
|
||||
if(!empty($USER) && $USER['userId']!=''){
|
||||
$this->redirect("users/index");
|
||||
}
|
||||
return $this->fetch('login');
|
||||
}
|
||||
/**
|
||||
* 会员登录
|
||||
*/
|
||||
public function checkLogin(){
|
||||
$m = new M();
|
||||
$rs = $m->checkLogin(2);
|
||||
$rs['url'] = session('WST_MO_WlADDRESS');
|
||||
return $rs;
|
||||
}
|
||||
|
||||
public function toRegister(){
|
||||
return $this->fetch('register');
|
||||
}
|
||||
/**
|
||||
* 会员注册
|
||||
*/
|
||||
public function register(){
|
||||
$m = new M();
|
||||
$rs = $m->regist(2);
|
||||
$rs['url'] = session('WST_MO_WlADDRESS');
|
||||
return $rs;
|
||||
}
|
||||
/**
|
||||
* 手机号码是否存在
|
||||
*/
|
||||
public function checkUserPhone(){
|
||||
$userPhone = input("post.userPhone");
|
||||
$m = new M();
|
||||
$rs = $m->checkUserPhone($userPhone,(int)session('WST_USER.userId'));
|
||||
if($rs["status"]!=1){
|
||||
return WSTReturn("手机号已注册",-1);
|
||||
}else{
|
||||
return WSTReturn("",1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
public function getPhoneVerifyCode(){
|
||||
$userPhone = input("post.userPhone");
|
||||
$rs = array();
|
||||
if(!WSTIsPhone($userPhone)){
|
||||
return WSTReturn("手机号格式不正确!");
|
||||
exit();
|
||||
}
|
||||
$m = new M();
|
||||
$rs = $m->checkUserPhone($userPhone,(int)session('WST_USER.userId'));
|
||||
if($rs["status"]!=1){
|
||||
return WSTReturn("手机号已存在!");
|
||||
exit();
|
||||
}
|
||||
$phoneVerify = rand(100000,999999);
|
||||
$tpl = WSTMsgTemplates('PHONE_USER_REGISTER_VERFIY');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['MALL_NAME'=>WSTConf("CONF.mallName"),'VERFIY_CODE'=>$phoneVerify,'VERFIY_TIME'=>10]];
|
||||
$m = new LogSms();
|
||||
$rv = $m->sendSMS(0,$userPhone,$params,'getPhoneVerifyCode',$phoneVerify);
|
||||
}
|
||||
if($rv['status']==1){
|
||||
session('VerifyCode_userPhone',$phoneVerify);
|
||||
session('VerifyCode_userPhone_Time',time());
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
/**
|
||||
* 会员中心
|
||||
*/
|
||||
public function index(){
|
||||
$userId = session('WST_USER.userId');
|
||||
$m = new M();
|
||||
$user = $m->getById($userId);
|
||||
if($user['userName']=='')
|
||||
$user['userName']=$user['loginName'];
|
||||
$this->assign('user', $user);
|
||||
//商城未读消息的数量 及 各订单状态数量
|
||||
$data = model('index')->getSysMsg('msg','order','follow','history');
|
||||
$this->assign('data',$data);
|
||||
return $this->fetch('users/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人信息
|
||||
*/
|
||||
public function edit(){
|
||||
$userId = session('WST_USER.userId');
|
||||
$m = new M();
|
||||
$user = $m->getById($userId);
|
||||
$this->assign('user', $user);
|
||||
return $this->fetch('users/edit');
|
||||
}
|
||||
/**
|
||||
* 编辑个人信息
|
||||
*/
|
||||
public function editUserInfo(){
|
||||
$m = new M();
|
||||
return $m->edit();
|
||||
}
|
||||
/**
|
||||
* 账户安全
|
||||
*/
|
||||
public function security(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$payPwd = $user['payPwd'];
|
||||
$userPhone = $user['userPhone'];
|
||||
$loginPwd = $user['loginPwd'];
|
||||
$user['loginPwd'] = empty($loginPwd)?0:1;
|
||||
$user['payPwd'] = empty($payPwd)?0:1;
|
||||
$user['userPhone'] = empty($userPhone)?0:1;
|
||||
$this->assign('user', $user);
|
||||
session('Edit_userPhone_Time', null);
|
||||
return $this->fetch('users/security/index');
|
||||
}
|
||||
/**
|
||||
* 修改登录密码
|
||||
*/
|
||||
public function editLoginPass(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$loginPwd = $user['loginPwd'];
|
||||
$user['loginPwd'] = empty($loginPwd)?0:1;
|
||||
$this->assign('user', $user);
|
||||
return $this->fetch('users/security/user_login_pass');
|
||||
}
|
||||
public function editloginPwd(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
return $m->editPass($userId);
|
||||
}
|
||||
/**
|
||||
* 修改支付密码
|
||||
*/
|
||||
public function editPayPass(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$payPwd = $user['payPwd'];
|
||||
$user['payPwd'] = empty($payPwd)?0:1;
|
||||
$this->assign('user', $user);
|
||||
return $this->fetch('users/security/user_pay_pass');
|
||||
}
|
||||
public function editpayPwd(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
return $m->editPayPass($userId);
|
||||
}
|
||||
/**
|
||||
* 忘记支付密码
|
||||
*/
|
||||
public function backPayPass(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$userPhone = $user['userPhone'];
|
||||
$user['userPhone'] = WSTStrReplace($user['userPhone'],'*',3);
|
||||
$user['phoneType'] = empty($userPhone)?0:1;
|
||||
$backType = (int)session('Type_backPaypwd');
|
||||
$timeVerify = session('Verify_backPaypwd_Time');
|
||||
$user['backType'] = ($backType==1 && time()<floatval($timeVerify)+10*60)?1:0;
|
||||
$this->assign('user', $user);
|
||||
return $this->fetch('users/security/user_back_paypwd');
|
||||
}
|
||||
/**
|
||||
* 忘记支付密码:发送短信
|
||||
*/
|
||||
public function backpayCode(){
|
||||
$m = new MUsers();
|
||||
$data = $m->getById(session('WST_USER.userId'));
|
||||
$userPhone = $data['userPhone'];
|
||||
$phoneVerify = rand(100000,999999);
|
||||
$rv = ['status'=>-1,'msg'=>'短信发送失败'];
|
||||
$tpl = WSTMsgTemplates('PHONE_FOTGET_PAY');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['LOGIN_NAME'=>$data['loginName'],'VERFIY_CODE'=>$phoneVerify,'VERFIY_TIME'=>10]];
|
||||
$m = new LogSms();
|
||||
$rv = $m->sendSMS(0,$userPhone,$params,'getPhoneVerifyt',$phoneVerify);
|
||||
}
|
||||
if($rv['status']==1){
|
||||
$USER = [];
|
||||
$USER['userPhone'] = $userPhone;
|
||||
$USER['phoneVerify'] = $phoneVerify;
|
||||
session('Verify_backPaypwd_info',$USER);
|
||||
session('Verify_backPaypwd_Time',time());
|
||||
return WSTReturn('短信发送成功!',1);
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
/**
|
||||
* 忘记支付密码:验证短信
|
||||
*/
|
||||
public function verifybackPay(){
|
||||
$phoneVerify = input("post.phoneCode");
|
||||
$timeVerify = session('Verify_backPaypwd_Time');
|
||||
if(!session('Verify_backPaypwd_info.phoneVerify') || time()>floatval($timeVerify)+10*60){
|
||||
return WSTReturn("校验码已失效,请重新发送!");
|
||||
exit();
|
||||
}
|
||||
if($phoneVerify==session('Verify_backPaypwd_info.phoneVerify')){
|
||||
session('Type_backPaypwd',1);
|
||||
return WSTReturn("验证成功",1);
|
||||
}
|
||||
return WSTReturn("校验码不一致,请重新输入!");
|
||||
}
|
||||
/**
|
||||
* 忘记支付密码:重置密码
|
||||
*/
|
||||
public function resetbackPay(){
|
||||
$m = new M();
|
||||
return $m->resetbackPay();
|
||||
}
|
||||
/**
|
||||
* 修改手机
|
||||
*/
|
||||
public function editPhone(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$userPhone = $user['userPhone'];
|
||||
$user['userPhone'] = WSTStrReplace($user['userPhone'],'*',3);
|
||||
$user['phoneType'] = empty($userPhone)?0:1;
|
||||
$this->assign('user', $user);
|
||||
session('Edit_userPhone_Time', null);
|
||||
return $this->fetch('users/security/user_phone');
|
||||
}
|
||||
/**
|
||||
* 绑定手机:发送短信验证码
|
||||
*/
|
||||
public function sendCodeTie(){
|
||||
$userPhone = input("post.userPhone");
|
||||
if(!WSTIsPhone($userPhone)){
|
||||
return WSTReturn("手机号格式不正确!");
|
||||
exit();
|
||||
}
|
||||
$rs = array();
|
||||
$m = new MUsers();
|
||||
$rs = WSTCheckLoginKey($userPhone,(int)session('WST_USER.userId'));
|
||||
if($rs["status"]!=1){
|
||||
return WSTReturn("手机号已存在!");
|
||||
exit();
|
||||
}
|
||||
$data = $m->getById(session('WST_USER.userId'));
|
||||
$phoneVerify = rand(100000,999999);
|
||||
$rv = ['status'=>-1,'msg'=>'短信发送失败'];
|
||||
$tpl = WSTMsgTemplates('PHONE_BIND');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['LOGIN_NAME'=>$data['loginName'],'VERFIY_CODE'=>$phoneVerify,'VERFIY_TIME'=>10]];
|
||||
$m = new LogSms();
|
||||
$rv = $m->sendSMS(0,$userPhone,$params,'sendCodeTie',$phoneVerify);
|
||||
}
|
||||
if($rv['status']==1){
|
||||
$USER = '';
|
||||
$USER['userPhone'] = $userPhone;
|
||||
$USER['phoneVerify'] = $phoneVerify;
|
||||
session('Verify_info',$USER);
|
||||
session('Verify_userPhone_Time',time());
|
||||
return WSTReturn('短信发送成功!',1);
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
/**
|
||||
* 绑定手机
|
||||
*/
|
||||
public function phoneEdit(){
|
||||
$phoneVerify = input("post.phoneCode");
|
||||
$process = input("post.process");
|
||||
$timeVerify = session('Verify_userPhone_Time');
|
||||
if(!session('Verify_info.phoneVerify') || time()>floatval($timeVerify)+10*60){
|
||||
return WSTReturn("校验码已失效,请重新发送!");
|
||||
exit();
|
||||
}
|
||||
if($phoneVerify==session('Verify_info.phoneVerify')){
|
||||
$m = new M();
|
||||
$rs = $m->editPhone((int)session('WST_USER.userId'),session('Verify_info.userPhone'));
|
||||
return $rs;
|
||||
}
|
||||
return WSTReturn("校验码不一致,请重新输入!");
|
||||
}
|
||||
/**
|
||||
* 修改手机:发送短信验证码
|
||||
*/
|
||||
public function sendCodeEdit(){
|
||||
$m = new MUsers();
|
||||
$data = $m->getById(session('WST_USER.userId'));
|
||||
$userPhone = $data['userPhone'];
|
||||
$phoneVerify = rand(100000,999999);
|
||||
$rv = ['status'=>-1,'msg'=>'短信发送失败'];
|
||||
$tpl = WSTMsgTemplates('PHONE_EDIT');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['LOGIN_NAME'=>$data['loginName'],'VERFIY_CODE'=>$phoneVerify,'VERFIY_TIME'=>10]];
|
||||
$m = new LogSms();
|
||||
$rv = $m->sendSMS(0,$userPhone,$params,'getPhoneVerifyt',$phoneVerify);
|
||||
}
|
||||
if($rv['status']==1){
|
||||
$USER = '';
|
||||
$USER['userPhone'] = $userPhone;
|
||||
$USER['phoneVerify'] = $phoneVerify;
|
||||
session('Verify_info2',$USER);
|
||||
session('Verify_userPhone_Time2',time());
|
||||
return WSTReturn('短信发送成功!',1);
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
/**
|
||||
* 修改手机
|
||||
*/
|
||||
public function phoneEdito(){
|
||||
$phoneVerify = input("post.phoneCode");
|
||||
$timeVerify = session('Verify_userPhone_Time2');
|
||||
if(!session('Verify_info2.phoneVerify') || time()>floatval($timeVerify)+10*60){
|
||||
return WSTReturn("校验码已失效,请重新发送!");
|
||||
exit();
|
||||
}
|
||||
if($phoneVerify==session('Verify_info2.phoneVerify')){
|
||||
session('Edit_userPhone_Time',time());
|
||||
return WSTReturn("验证成功",1);
|
||||
return $rs;
|
||||
}
|
||||
return WSTReturn("校验码不一致,请重新输入!",-1);
|
||||
}
|
||||
public function editPhoneo(){
|
||||
$m = new M();
|
||||
$userId = (int)session('WST_USER.userId');
|
||||
$user = $m->getById($userId);
|
||||
$userPhone = $user['userPhone'];
|
||||
$user['userPhone'] = WSTStrReplace($user['userPhone'],'*',3);
|
||||
$timeVerify = session('Edit_userPhone_Time');
|
||||
if(time()>floatval($timeVerify)+15*60){
|
||||
$user['phoneType'] = 1;
|
||||
}else{
|
||||
$user['phoneType'] = 0;
|
||||
}
|
||||
$this->assign('user', $user);
|
||||
return $this->fetch('users/security/user_phone');
|
||||
}
|
||||
/**
|
||||
* 用户退出
|
||||
*/
|
||||
public function logout(){
|
||||
session('WST_USER',null);
|
||||
setcookie("loginPwd", null);
|
||||
session('WST_MO_WlADDRESS',null);
|
||||
return WSTReturn("",1);
|
||||
}
|
||||
|
||||
/************************************************* 忘记密码 ********************************************************/
|
||||
// 页面过期/失效
|
||||
protected function expire($msg=''){
|
||||
$message = $msg?$msg:'页面已失效!';
|
||||
$html = '<h1>'.$message.'</h1><script>setTimeout(function(){location.href="'.url('mobile/users/index','','',true).'";},1000)</script>';
|
||||
return $this->display($html);
|
||||
}
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
public function forgetPass(){
|
||||
return $this->fetch('forget_pass');
|
||||
}
|
||||
public function forgetPasst(){
|
||||
if(time()<floatval(session('findPass.findTime'))+30*60){
|
||||
$userId = session('findPass.userId');
|
||||
$m = new M();
|
||||
$info = $m->getById($userId);
|
||||
if($info['userPhone']!='')$info['userPhone'] = WSTStrReplace($info['userPhone'],'*',3);
|
||||
if($info['userEmail']!='')$info['userEmail'] = WSTStrReplace($info['userEmail'],'*',2,'@');
|
||||
$this->assign('forgetInfo',$info);
|
||||
return $this->fetch('forget_pass2');
|
||||
}else{
|
||||
return $this->expire();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
public function resetPass(){
|
||||
if(!session('findPass')){
|
||||
return $this->expire();
|
||||
}
|
||||
return $this->fetch('forget_pass3');
|
||||
}
|
||||
public function forgetPasss(){
|
||||
if(!session('findPass')){
|
||||
return $this->expire();
|
||||
}
|
||||
$USER = session('findPass');
|
||||
if(empty($USER) && $USER['userId']!=''){
|
||||
$this->expire('请在同一浏览器操作!');
|
||||
}
|
||||
$uId = session('findPass.userId');
|
||||
$key = session("findPass.key");
|
||||
// 验证邮箱中的验证码
|
||||
$secretCode = input('secretCode');
|
||||
if($key==$secretCode){
|
||||
session('REST_userId',$uId);
|
||||
session('REST_success','1');
|
||||
return WSTReturn('验证成功',1);
|
||||
}else{
|
||||
return WSTReturn('校验码错误',-1);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 找回密码
|
||||
*/
|
||||
public function findPass(){
|
||||
//禁止缓存
|
||||
header('Cache-Control:no-cache,must-revalidate');
|
||||
header('Pragma:no-cache');
|
||||
$code = input("post.verifyCode");
|
||||
$step = input("post.step/d");
|
||||
switch ($step) {
|
||||
case 1:#第一步,验证身份
|
||||
if(!WSTVerifyCheck($code)){
|
||||
return WSTReturn('验证码错误!',-1);
|
||||
}
|
||||
$loginName = input("post.loginName");
|
||||
$rs = WSTCheckLoginKey($loginName);
|
||||
if($rs["status"]==1){
|
||||
return WSTReturn("用户名不存在!");
|
||||
exit();
|
||||
}
|
||||
$m = new M();
|
||||
$info = $m->checkAndGetLoginInfo($loginName);
|
||||
if ($info != false) {
|
||||
session('findPass',array('userId'=>$info['userId'],'loginName'=>$loginName,'userPhone'=>$info['userPhone'],'userEmail'=>$info['userEmail'],'loginSecret'=>$info['loginSecret'],'findTime'=>time()));
|
||||
return WSTReturn("操作成功",1);
|
||||
}else return WSTReturn("用户名不存在!");
|
||||
break;
|
||||
case 2:#第二步,验证方式
|
||||
if (session('findPass.loginName') != null ){
|
||||
if(input("post.modes")==1){
|
||||
if ( session('findPass.userPhone') == null) {
|
||||
return WSTReturn('你没有预留手机号码,请通过邮箱方式找回密码!',-1);
|
||||
}
|
||||
$phoneVerify = input("post.Checkcode");
|
||||
if(!$phoneVerify){
|
||||
return WSTReturn('校验码不能为空!',-1);
|
||||
}
|
||||
return $this->checkfindPhone($phoneVerify);
|
||||
}else{
|
||||
if (session('findPass.userEmail')==null) {
|
||||
return WSTReturn('你没有预留邮箱,请通过手机号码找回密码!',-1);
|
||||
}
|
||||
if(!WSTVerifyCheck($code)){
|
||||
return WSTReturn('验证码错误!',-1);
|
||||
}
|
||||
return $this->getfindEmail();
|
||||
}
|
||||
}else return $this->expire();
|
||||
break;
|
||||
case 3:#第三步,设置新密码
|
||||
$resetPass = session('REST_success');
|
||||
if($resetPass != 1)return $this->expire();
|
||||
$loginPwd = input("post.loginPwd");
|
||||
$repassword = input("post.repassword");
|
||||
$decrypt_data = WSTRSA($loginPwd);
|
||||
$decrypt_data2 = WSTRSA($repassword);
|
||||
if($decrypt_data['status']==1 && $decrypt_data2['status']==1){
|
||||
$loginPwd = $decrypt_data['data'];
|
||||
$repassword = $decrypt_data2['data'];
|
||||
}else{
|
||||
return WSTReturn('设置失败');
|
||||
}
|
||||
if ($loginPwd == $repassword) {
|
||||
$m = new M();
|
||||
$rs = $m->resetPass();
|
||||
if($rs['status']==1){
|
||||
return $rs;
|
||||
}else{
|
||||
return $rs;
|
||||
}
|
||||
}else return WSTReturn('两次密码不同!',-1);
|
||||
break;
|
||||
default:
|
||||
return $this->expire();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 手机验证码获取
|
||||
*/
|
||||
public function getfindPhone(){
|
||||
session('WST_USER',session('findPass.userId'));
|
||||
if(session('findPass.userPhone')==''){
|
||||
return WSTReturn('你没有预留手机号码,请通过邮箱方式找回密码!',-1);
|
||||
}
|
||||
$phoneVerify = rand(100000,999999);
|
||||
session('WST_USER',null);
|
||||
$rv = ['status'=>-1,'msg'=>'短信发送失败'];
|
||||
$tpl = WSTMsgTemplates('PHONE_FOTGET');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$params = ['tpl'=>$tpl,'params'=>['VERFIY_CODE'=>$phoneVerify,'VERFIY_TIME'=>10]];
|
||||
$m = new LogSms();
|
||||
$rv = $m->sendSMS(0,session('findPass.userPhone'),$params,'getPhoneVerify',$phoneVerify);
|
||||
}
|
||||
if($rv['status']==1){
|
||||
// 记录发送短信的时间,用于验证是否过期
|
||||
session('REST_Time',time());
|
||||
$USER = '';
|
||||
$USER['phoneVerify'] = $phoneVerify;
|
||||
$USER['time'] = time();
|
||||
session('findPhone',$USER);
|
||||
return WSTReturn('短信发送成功!',1);
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
/**
|
||||
* 手机验证码检测
|
||||
* -1 错误,1正确
|
||||
*/
|
||||
public function checkfindPhone($phoneVerify){
|
||||
if(!session('findPhone.phoneVerify') || time()>floatval(session('findPhone.time'))+10*60){
|
||||
return WSTReturn("校验码已失效,请重新发送!");
|
||||
exit();
|
||||
}
|
||||
if (session('findPhone.phoneVerify') == $phoneVerify ) {
|
||||
$fuserId = session('findPass.userId');
|
||||
if(!empty($fuserId)){
|
||||
session('REST_userId',$fuserId);
|
||||
session('REST_success','1');
|
||||
$rs['status'] = 1;
|
||||
$rs['url'] = url('mobile/users/resetPass');
|
||||
return $rs;
|
||||
}
|
||||
return WSTReturn('无效用户',-1);
|
||||
}
|
||||
return WSTReturn('校验码错误!',-1);
|
||||
}
|
||||
/**
|
||||
* 发送验证邮件/找回密码
|
||||
*/
|
||||
public function getfindEmail(){
|
||||
$code = rand(0,999999);
|
||||
$sendRs = ['status'=>-1,'msg'=>'邮件发送失败'];
|
||||
$tpl = WSTMsgTemplates('EMAIL_FOTGET');
|
||||
if( $tpl['tplContent']!='' && $tpl['status']=='1'){
|
||||
$find = ['${LOGIN_NAME}','${SEND_TIME}','${VERFIY_CODE}','${VERFIY_TIME}'];
|
||||
$replace = [session('findPass.loginName'),date('Y-m-d H:i:s'),$code,30];
|
||||
$sendRs = WSTSendMail(session('findPass.userEmail'),'密码重置',str_replace($find,$replace,$tpl['content']));
|
||||
}
|
||||
if($sendRs['status']==1){
|
||||
$uId = session('findPass.userId');
|
||||
session("findPass.key", $code);
|
||||
// 发起重置密码的时间;
|
||||
session('REST_Time',time());
|
||||
return WSTReturn("发送成功",1);
|
||||
}else{
|
||||
return WSTReturn($sendRs['msg'],-1);
|
||||
}
|
||||
}
|
||||
public function userSet(){
|
||||
return $this->fetch('users/userset/list');
|
||||
}
|
||||
public function aboutUs(){
|
||||
return $this->fetch('users/userset/about');
|
||||
}
|
||||
// mark by cheng 添加手机版分享20180320
|
||||
public function share(){
|
||||
$name = session('WST_USER.loginName');
|
||||
$data['url'] = 'http://www.heyuanhui.cn/mregister?pName='.$name;
|
||||
$data['title'] = '分享好友';
|
||||
$data['desc'] = '分享好友注册';
|
||||
$this->assign('data',$data);
|
||||
return $this->fetch('users/share');
|
||||
}
|
||||
}
|
251
hyhproject/mobile2/view/default/users/cashconfigs/cashconfigs.js
Executable file
251
hyhproject/mobile2/view/default/users/cashconfigs/cashconfigs.js
Executable file
@ -0,0 +1,251 @@
|
||||
jQuery.noConflict();
|
||||
// 获取提现记录
|
||||
function getCashConfigs(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/cashconfigs/pageQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('list').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#listBox').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-account.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>没有提现账户</p>';
|
||||
html += '</div>';
|
||||
$('#listBox').html(html);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getCashConfigs();
|
||||
WST.initFooter('user');
|
||||
// 弹出层
|
||||
$('#modal-large').css({'top':0,'margin-top':0});
|
||||
var h = WST.pageHeight();
|
||||
$("#frame").css('bottom','-'+h/2);
|
||||
var listh = h/2-106;
|
||||
$(".wst-fr-box .list").css('overflow-y','scroll').css('height',listh+'px');
|
||||
|
||||
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getCashConfigs();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//新增或编辑提现账号
|
||||
function editAddress(id){
|
||||
$('#accTargetId').val('');
|
||||
$('#accUser').val('');
|
||||
$('#accNo').val('');
|
||||
$('#accAreaId').val('');
|
||||
$('#addresst').html('请选择地址');
|
||||
$('.wst-ad-submit .button').attr('onclick','javascript:saveConfig('+id+');');
|
||||
if(id>0){
|
||||
$('.iziModal-header-title').html('修改提现账号');
|
||||
$.post(WST.U('mobile/cashConfigs/getById'), {id:id}, function(data){
|
||||
var info = WST.toJson(data);
|
||||
if(info){
|
||||
$('#accTargetId').val(info.accTargetId);
|
||||
$('#accUser').val(info.accUser);
|
||||
$('#accNo').val(info.accNo);
|
||||
$('#accAreaId').val(info.accAreaId);
|
||||
$('#areaName').html($('#addr_'+id).val());
|
||||
}
|
||||
addressInfo= null;
|
||||
});
|
||||
}else{
|
||||
$('.iziModal-header-title').html('新增提现账号');
|
||||
}
|
||||
jQuery('#modal-large').iziModal('open');
|
||||
}
|
||||
jQuery("#modal-large").iziModal({
|
||||
title: "新增提现账号",
|
||||
subtitle: "",
|
||||
iconClass: 'icon-chat',
|
||||
overlayColor: 'rgba(0, 0 0, 0.6)',
|
||||
headerColor: '#ffffff'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 循环创建地区
|
||||
* @param id 当前分类ID
|
||||
* @param val 当前分类值
|
||||
* @param className 样式,方便将来获取值
|
||||
*/
|
||||
WST.ITAreas = function(opts){
|
||||
opts.className = opts.className?opts.className:"j-areas";
|
||||
var obj = $('#'+opts.id);
|
||||
obj.attr('lastarea',1);
|
||||
$.post(WST.U('mobile/areas/listQuery'),{parentId:opts.val},function(data,textStatus){
|
||||
var json = WST.toJson(data);
|
||||
if(json.data && json.data.length>0){
|
||||
json = json.data;
|
||||
var html = [],tmp;
|
||||
var tid = opts.id+"_"+opts.val;
|
||||
var level = parseInt(obj.attr('level'),10);
|
||||
$('.area_'+level).addClass('hide');
|
||||
var level = level+1;
|
||||
html.push('<div id="'+tid+'" class="list '+opts.className+' area_'+level+'" areaId="0" level="'+level+'">');
|
||||
for(var i=0;i<json.length;i++){
|
||||
tmp = json[i];
|
||||
html.push("<p onclick='javascript:inChoice(this,\""+tid+"\","+tmp.areaId+","+level+");'>"+tmp.areaName+"</p>");
|
||||
}
|
||||
html.push('</div>');
|
||||
$(html.join('')).insertAfter('#'+opts.id);
|
||||
var h = WST.pageHeight();
|
||||
var listh = h/2-106;
|
||||
$(".wst-fr-box .list").css('overflow-y','scroll').css('height',listh+'px');
|
||||
$(".wst-fr-box .option").append('<p class="ui-nowrap-flex term active_'+level+' active" onclick="javascript:inOption(this,'+level+')">请选择</p>');
|
||||
}else{
|
||||
opts.isLast = true;
|
||||
opts.lastVal = opts.val;
|
||||
$('#accAreaId').val(opts.lastVal);
|
||||
var ht = '';
|
||||
$('.wst-fr-box .term').each(function(){
|
||||
ht += $(this).html();
|
||||
});
|
||||
$('#areaName').html(ht);
|
||||
dataHide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//地址选择
|
||||
function inOption(obj,n){
|
||||
$(obj).addClass('active').siblings().removeClass('active');
|
||||
$('.area_'+n).removeClass('hide').siblings('.list').addClass('hide');
|
||||
var level = $('#level').val();
|
||||
var n = n+1;
|
||||
for(var i=n; i<=level; i++){
|
||||
$('.area_'+i).remove();
|
||||
$('.active_'+i).remove();
|
||||
}
|
||||
}
|
||||
|
||||
function inChoice(obj,id,val,level){
|
||||
$('#level').val((level+1));
|
||||
$(obj).addClass('active').siblings().removeClass('active');
|
||||
$('#'+id).attr('areaId',val);
|
||||
$('.active_'+level).removeClass('active').html($(obj).html());
|
||||
WST.ITAreas({id:id,val:val,className:'j-areas'});
|
||||
}
|
||||
|
||||
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#frame').show();
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"bottom": 0}, 500);
|
||||
}
|
||||
function dataHide(){
|
||||
var dataHeight = $("#frame").css('height');
|
||||
jQuery('#frame').animate({'bottom': '-'+dataHeight}, 500);
|
||||
jQuery('#cover').hide();
|
||||
setTimeout(function(){
|
||||
jQuery('#frame').hide();
|
||||
},500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//保存
|
||||
function saveConfig(cId){
|
||||
var accUser = $('#accUser').val();
|
||||
var accNo = $('#accNo').val();
|
||||
var areaId = $('#areaId').val();
|
||||
var accAreaId = $('#accAreaId').val();
|
||||
var accTargetId = $('#accTargetId').val();
|
||||
|
||||
if(accTargetId==''){
|
||||
WST.msg('请选择账户类型','info');
|
||||
$('#accTargetId').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(accAreaId==''){
|
||||
WST.msg('请选择地址','info');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(accUser==''){
|
||||
WST.msg('持卡人不能为空','info');
|
||||
$('#accUser').focus();
|
||||
return false;
|
||||
}
|
||||
if(accNo==''){
|
||||
WST.msg('卡号不能为空','info');
|
||||
return false;
|
||||
}
|
||||
|
||||
var param = {};
|
||||
param.id = cId;
|
||||
param.accAreaId = accAreaId;
|
||||
param.accUser = accUser;
|
||||
param.accNo = accNo;
|
||||
param.accTargetId = accTargetId;
|
||||
$('.wst-ad-submit .button').addClass("active").attr('disabled', 'disabled');
|
||||
var act = (cId>0)?'edit':'add';
|
||||
$.post(WST.U('mobile/cashconfigs/'+act), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
history.go(0);
|
||||
},1000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
setTimeout(function(){
|
||||
$('.wst-ad-submit .button').removeAttr('disabled').removeClass("active");
|
||||
},1500);
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
|
||||
//删除提现账号
|
||||
function del(id){
|
||||
WST.dialog('确定删除吗?','toDel('+id+')');
|
||||
}
|
||||
//删除提现账号
|
||||
function toDel(id){
|
||||
$.post(WST.U('mobile/cashconfigs/del'), {id:id}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
$('#listBox').html(' ');
|
||||
$('#currPage').val(0)
|
||||
getCashConfigs();
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
}
|
||||
WST.dialogHide('prompt');
|
||||
data = json = null;
|
||||
});
|
||||
}
|
48
hyhproject/mobile2/view/default/users/cashconfigs/edit.html
Executable file
48
hyhproject/mobile2/view/default/users/cashconfigs/edit.html
Executable file
@ -0,0 +1,48 @@
|
||||
<div id="modal-large" class="iziModal">
|
||||
<input type="hidden" name="" value="" id="accAreaId" autocomplete="off">
|
||||
<div class="wst-ad-form">
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">账户类型:</label>
|
||||
<select name="accTargetId" id="accTargetId" class="wst-ca-choice">
|
||||
<option value="">请选择</option>
|
||||
{volist name="$banks" id="b"}
|
||||
<option value="{$b['bankId']}">{$b['bankName']}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">账户地址:</label>
|
||||
<div id="areaName" class="ui-nowrap-flex address" onclick="javascript:dataShow();">请选择账户地址</div>
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">持卡人:</label><input class="ui-border-binte" id="accUser" type="text" placeholder="请填写持卡人姓名" maxLength="20">
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">卡号:</label>
|
||||
<input class="ui-border-binte" id="accNo" type="text" maxLength="20" placeholder="请填写银行卡号" onkeypress='return WST.isNumberKey(event);' onkeyup="javascript:WST.isChinese(this,1)">
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
</div>
|
||||
<div class="wst-ad-submit"><button class="ui-btn-lg button" onclick="javascript:saveAddress(0);">保存</button></div>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 地址框 */}
|
||||
<div class="wst-fr-box" id="frame" style="display:none;">
|
||||
<input type="hidden" name="" value="" id="level" autocomplete="off">
|
||||
<div class="title"><span>账户地址</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
<div class="option">
|
||||
<p class="ui-nowrap-flex term active_0 active" onclick="javascript:inOption(this,0)">请选择</p>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
<div id="area_0" class="list j-areas area_0" areaId="0" level="0">
|
||||
{volist name="area" id="ar"}
|
||||
<p onclick="javascript:inChoice(this,'area_0',{$ar['areaId']},0);">{$ar['areaName']}</p>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
55
hyhproject/mobile2/view/default/users/cashconfigs/list.html
Executable file
55
hyhproject/mobile2/view/default/users/cashconfigs/list.html
Executable file
@ -0,0 +1,55 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的提现账户 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/iziModal.css?v={$v}">
|
||||
<link rel="stylesheet" href="__MOBILE__/css/cashconfigs.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>我的提现账户</h1>
|
||||
<span class="add" onclick="editAddress()">添加</span>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<script type="text/html" id="list">
|
||||
{{# for(var i=0;i<d.length;++i){ }}
|
||||
<ul class="ui-row" >
|
||||
<li class="ui-col ui-col-80" onclick="editAddress({{d[i].id}})">
|
||||
<input type="hidden" id="addr_{{d[i].id}}" value="{{d[i].areaName}}">
|
||||
<p class="wst-ca-accno">{{d[i].accNo}}</p>
|
||||
<p class="wst-ca-info"> 持卡人姓名:{{d[i].accUser}}</p>
|
||||
<p class="wst-ca-info"> 开户行:{{d[i].bankName}}</p>
|
||||
</li>
|
||||
<li class="ui-col ui-col-20" onclick="del({{d[i].id}})"><p class="c-tr"><span class="delete-icon"></span>删除<p></li>
|
||||
</ul>
|
||||
{{# } }}
|
||||
</script>
|
||||
<section class="ui-container" id="listBox">
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{include file="default/users/cashconfigs/edit" /}<!-- 新增/编辑收货地址模板 -->
|
||||
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/izimodal/iziModal.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/cashconfigs/cashconfigs.js?v={$v}'></script>
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
47
hyhproject/mobile2/view/default/users/cashdraws/cashdraws.js
Executable file
47
hyhproject/mobile2/view/default/users/cashdraws/cashdraws.js
Executable file
@ -0,0 +1,47 @@
|
||||
jQuery.noConflict();
|
||||
// 获取提现记录
|
||||
function getCashDraws(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/cashdraws/pageQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('scoreList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#score-list').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-relevant.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无相关信息</p>';
|
||||
html += '</div>';
|
||||
$('#score-list').html(html);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getCashDraws();
|
||||
WST.initFooter('user');
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getCashDraws();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
52
hyhproject/mobile2/view/default/users/cashdraws/list.html
Executable file
52
hyhproject/mobile2/view/default/users/cashdraws/list.html
Executable file
@ -0,0 +1,52 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}提现记录 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/cashdraws.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>提现记录</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
||||
<script type="text/html" id="scoreList">
|
||||
<ul class="ui-row score-detail">
|
||||
{{# for(var i=0;i<d.length;i++){ }}
|
||||
<li class="ui-col ui-col-75">
|
||||
<p>{{d[i].accUser}}</p>
|
||||
<p>{{d[i].accTargetName}}{{d[i].accAreaName}}</p>
|
||||
<span class="score-time">{{d[i].createTime}}</span>
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 score-text">
|
||||
{{#if(d[i].cashSatus==1){}}
|
||||
<span style="color:green;">已通过</span>
|
||||
{{#}else if(d[i].cashSatus==-1){}}
|
||||
失败
|
||||
{{#}else{}}
|
||||
<span style="color: #59595c;">待处理</span>
|
||||
{{#}}}
|
||||
<br />
|
||||
- {{d[i].money}}
|
||||
</li>
|
||||
{{#if(d[i].cashSatus==-1){}}
|
||||
<li class="ui-col">提现失败原因:{{d[i].cashRemarks}}</li>
|
||||
{{#}}}
|
||||
<div class="wst-clear"></div>
|
||||
<div class="score-line"></div>
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div id="score-list"></div>
|
||||
</section>
|
||||
|
||||
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/cashdraws/cashdraws.js?v={$v}'></script>
|
||||
{/block}
|
127
hyhproject/mobile2/view/default/users/edit.html
Executable file
127
hyhproject/mobile2/view/default/users/edit.html
Executable file
@ -0,0 +1,127 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}账户管理 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/userinfo.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="useri_infos">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<a onclick="history.back()"><i class="ui-icon-return return_users"></i></a><h1 class="useri_info">账户管理</h1>
|
||||
<i onclick="javascript:closeUploadArea()" style="display:none;font-size: 0.15rem;" id="upload_close">关闭</i>
|
||||
<a href="javascript:void(0);" style="display:none;float:right;font-size: 0.15rem;" id="upload_button">上传</a>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container" id="useri_info">
|
||||
<ul class="ui-list ui-list-one ui-list-link wst-ed-info">
|
||||
<li>
|
||||
<div class="ui-list-info">
|
||||
<h4 class="ui-nowrap" id="chooseImages">头像</h4>
|
||||
<input type="file" id="uploadImg" class="uploadfile-input" accept="image/*">
|
||||
<div class="ui-list-thumb" id="previewImages" style="width: 65px;">
|
||||
<span>
|
||||
<img src="__IMGURL__/{:WSTUserPhoto($user['userPhoto'])}" class="wst-useri_portrait" id="imgurl">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="wst-useri_line"></div>
|
||||
<ul class="ui-list ui-list-text wst-ed-info">
|
||||
<li>
|
||||
<h4 class="ui-nowrap">用户名</h4>
|
||||
<div class="ui-txt-info">{$user['loginName']}</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="wst-useri_line"></div>
|
||||
<ul class="ui-list ui-list-text ui-list-link wst-ed-info">
|
||||
<li onclick="javascript:openNickName();">
|
||||
<h4 class="ui-nowrap">昵称</h4>
|
||||
<div class="ui-txt-info" id="nickname">{$user['userName']}</div>
|
||||
</li>
|
||||
<div class="wst-useri_line"></div>
|
||||
<li onclick="javascript:openUserSex();">
|
||||
<h4 class="ui-nowrap">性别</h4>
|
||||
<?php $usersex = array('保密','男','女');?>
|
||||
<div class="ui-txt-info" id="usersex"><?php echo $usersex[$user['userSex']];?></div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="wst-useri_line"></div>
|
||||
</section>
|
||||
<sction class="ui-container" id="upload_modal">
|
||||
<div class="upload-modal">
|
||||
<div id="clipArea" class="clipArea"></div>
|
||||
<input type="hidden" id="imgData" autocomplete="off">
|
||||
</div>
|
||||
</sction>
|
||||
</div>
|
||||
<div id="useri_nickname" style="display:none;">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="javascript:returnUserinfo()"></i><h1>修改昵称</h1>
|
||||
</header>
|
||||
<section class="ui-container" style="height:80%;">
|
||||
<div class="wst-useri_determine">
|
||||
<input type="text" id="userName" placeholder="昵称">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<footer>
|
||||
<div class="ui-btn-wrap">
|
||||
<button class="ui-btn-lg ui-btn-danger wst-ed-button" onclick="javascript:editNickName()">
|
||||
确定
|
||||
</button>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<div id="useri_sex" style="display:none;">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="javascript:returnUserinfo()"></i><h1>修改性别</h1>
|
||||
</header>
|
||||
<section class="ui-container" id="useri_sex">
|
||||
<ul class="ui-list wst-listse wst-listse1" onclick="javascript:eidtUserSex(this, 0);">
|
||||
<li>
|
||||
<div class="wst-list-infose1">
|
||||
<span>保密</span>
|
||||
</div>
|
||||
</li>
|
||||
<div class="wst-list-infose2">
|
||||
<?php if($user['userSex']==0){ ?>
|
||||
<i class="ui-icon-checked-s wst-icon-checked-s_se"></i>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</ul>
|
||||
<ul class="ui-list wst-listse wst-listse2" onclick="javascript:eidtUserSex(this, 1);">
|
||||
<li>
|
||||
<div class="wst-list-infose1">
|
||||
<span>男</span>
|
||||
</div>
|
||||
</li>
|
||||
<div class="wst-list-infose2">
|
||||
<?php if($user['userSex']==1){ ?>
|
||||
<i class="ui-icon-checked-s wst-icon-checked-s_se"></i>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</ul>
|
||||
<ul class="ui-list wst-listse wst-listse3" onclick="javascript:eidtUserSex(this, 2);">
|
||||
<li>
|
||||
<div class="wst-list-infose1">
|
||||
<span>女</span>
|
||||
</div>
|
||||
</li>
|
||||
<div class="wst-list-infose2">
|
||||
<?php if($user['userSex']==2){ ?>
|
||||
<i class="ui-icon-checked-s wst-icon-checked-s_se"></i>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/photoclip/iscroll-zoom.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/photoclip/hammer.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/photoclip/jquery.photoClip.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/photoclip/upload.hpictures.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/user.js?v={$v}'></script>
|
||||
{/block}
|
99
hyhproject/mobile2/view/default/users/favorites/favorite_shop.js
Executable file
99
hyhproject/mobile2/view/default/users/favorites/favorite_shop.js
Executable file
@ -0,0 +1,99 @@
|
||||
// 获取关注的店铺
|
||||
function getFavorites(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/favorites/listShopQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
|
||||
var gettpl = document.getElementById('shopList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#shopBox').html(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-follow-shps.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>您还没有关注店铺。</p>';
|
||||
html += '</div>';
|
||||
$('#shopBox').html(html);
|
||||
}
|
||||
imgShop('j-imgAdapt');
|
||||
imgShop('goodsImg');
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
function goToShop(sid){
|
||||
location.href=WST.U('mobile/shops/home','shopId='+sid);
|
||||
}
|
||||
// 全选
|
||||
function checkAll(obj){
|
||||
var chk = $(obj).prop('checked');
|
||||
$('.s-active').each(function(k,v){
|
||||
$(this).prop('checked',chk);
|
||||
});
|
||||
}
|
||||
// 取消关注
|
||||
function cancelFavorite(){
|
||||
WST.dialogHide('prompt');
|
||||
var fids = new Array();
|
||||
$('.s-active').each(function(k,v){
|
||||
if($(this).attr('checked')){
|
||||
fids.push($(this).attr('fid'));
|
||||
}
|
||||
});
|
||||
fids = fids.join(',');
|
||||
if(fids==''){
|
||||
WST.msg('请先选择店铺','info');
|
||||
return;
|
||||
}
|
||||
$.post(WST.U('mobile/favorites/cancel'),{id:fids,type:1},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$('#currPage').val('0')
|
||||
getFavorites();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getFavorites();
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getFavorites();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//适应图片大小正方形
|
||||
function imgShop(name){
|
||||
var w = $('.'+name).width();
|
||||
if(name == 'j-imgAdapt'){
|
||||
$('.'+name).css({"width": w+"px","height": w+"px"});
|
||||
}else{
|
||||
$('.'+name).css({"width": w+"px","height": w+20+"px"});
|
||||
}
|
||||
$('.'+name+' a').css({"width": w+"px","height": w+"px"});
|
||||
$('.'+name+' a img').css({"width": w+"px","height": w+"px"});
|
||||
$('.'+name+' a .goodsPrice').css({"width": w+"px"});
|
||||
}
|
95
hyhproject/mobile2/view/default/users/favorites/favorites.js
Executable file
95
hyhproject/mobile2/view/default/users/favorites/favorites.js
Executable file
@ -0,0 +1,95 @@
|
||||
// 获取关注的商品
|
||||
function getFavorites(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.id = $('#catId').val();
|
||||
param.condition = $('#condition').val();
|
||||
param.desc = $('#desc').val();
|
||||
param.keyword = $('#searchKey').val();
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/favorites/listGoodsQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('fGoods').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#goods-list').html(html);
|
||||
});
|
||||
$('#currPage').val(data.CurrentPage);
|
||||
$('#totalPage').val(data.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-follow-goods.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>您还没有关注商品。</p>';
|
||||
html += '</div>';
|
||||
$('#goods-list').html(html);
|
||||
}
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
// 全选
|
||||
function checkAll(obj){
|
||||
var chk = $(obj).attr('checked');
|
||||
$('.active').each(function(k,v){
|
||||
$(this).prop('checked',chk);
|
||||
});
|
||||
}
|
||||
// 取消关注
|
||||
function cancelFavorite(){
|
||||
WST.dialogHide('prompt');
|
||||
var gids = new Array();
|
||||
$('.active').each(function(k,v){
|
||||
if($(this).attr('checked')){
|
||||
gids.push($(this).attr('gid'));
|
||||
}
|
||||
});
|
||||
gids = gids.join(',');
|
||||
if(gids==''){
|
||||
WST.msg('请先选择商品','info');
|
||||
return;
|
||||
}
|
||||
$.post(WST.U('mobile/favorites/cancel'),{id:gids,type:0},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$('#currPage').val('0')
|
||||
getFavorites();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getFavorites();
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getFavorites();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function addCart(goodsId){
|
||||
$.post(WST.U('mobile/carts/addCart'),{goodsId:goodsId,buyNum:1},function(data,textStatus){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
73
hyhproject/mobile2/view/default/users/favorites/list_goods.html
Executable file
73
hyhproject/mobile2/view/default/users/favorites/list_goods.html
Executable file
@ -0,0 +1,73 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的关注 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__ROOT__/hyhproject/mobile/view/default/css/favorites.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>关注商品</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
<div class="ui-loading-wrap wst-Load" id="Load">
|
||||
<i class="ui-loading"></i>
|
||||
</div>
|
||||
<footer class="ui-footer wst-footer-btns" style="height:45px; border-top: 1px solid #e0e0e0;" id="footer">
|
||||
<div class="wst-toTop" id="toTop">
|
||||
<i class="wst-toTopimg"><span>顶部</span></i>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace">
|
||||
<div class="ui-col ui-col-2 favorite-tc">
|
||||
<label class="ui-checkbox">
|
||||
<input class="sactive" type="checkbox" onclick="javascript:checkAll(this);">
|
||||
</label>
|
||||
全选
|
||||
</div>
|
||||
|
||||
<div class="ui-col">
|
||||
<div class="ui-btn-wrap f-btn">
|
||||
<button class="ui-btn ui-btn-danger" onclick="WST.dialog('确认要取消关注吗','cancelFavorite()');">
|
||||
取消关注
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<script id="fGoods" type="text/html">
|
||||
{{# for(var i=0; i<d.length; i++){ }}
|
||||
<div class="ui-row-flex wst-shl-list" >
|
||||
<label class="ui-checkbox">
|
||||
<input class="active" type="checkbox" gId="{{d[i].favoriteId}}" onclick="javascript:WST.changeIconStatus($(this), 1);">
|
||||
</label>
|
||||
|
||||
<div class="ui-col">
|
||||
<div class="img j-imgAdapt">
|
||||
<a href="javascript:void(0);" onclick="javascript:WST.intoGoods({{d[i].goodsId}});">
|
||||
<img src="__IMGURL__/{{WST.conf.GOODS_LOGO}}" data-echo="__IMGURL__/{{d[i].goodsImg}}" title="{{d[i].shopName}}"></a></div>
|
||||
</div>
|
||||
<div class="ui-col ui-col-2 info">
|
||||
<div class="title ui-nowrap-multi ui-whitespace" onclick="javascript:WST.intoGoods({{d[i].goodsId}});">{{d[i].goodsName}}</div>
|
||||
<p class="price"><span>¥ </span>{{d[i].shopPrice}}</p>
|
||||
<p class="deal">成交数:{{d[i].saleNum}}</p><span class="add-cart" onclick="addCart({{d[i].goodsId}})"></span>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</script>
|
||||
<section class="ui-container info-prompt">
|
||||
<ul class="ui-tab-content">
|
||||
<li id="goods-list"></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/favorites/favorites.js?v={$v}'></script>
|
||||
{/block}
|
93
hyhproject/mobile2/view/default/users/favorites/list_shops.html
Executable file
93
hyhproject/mobile2/view/default/users/favorites/list_shops.html
Executable file
@ -0,0 +1,93 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}关注店铺 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__ROOT__/hyhproject/mobile/view/default/css/favorites.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>关注店铺</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
<div class="ui-loading-wrap wst-Load" id="Load">
|
||||
<i class="ui-loading"></i>
|
||||
</div>
|
||||
<footer class="ui-footer wst-footer-btns" style="height:45px; border-top: 1px solid #e0e0e0;" id="footer">
|
||||
<div class="wst-toTop" id="toTop">
|
||||
<i class="wst-toTopimg"><span>顶部</span></i>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace">
|
||||
<div class="ui-col ui-col-2 favorite-tc">
|
||||
<label class="ui-checkbox">
|
||||
<input class="sactive" type="checkbox" onclick="javascript:checkAll(this);">
|
||||
</label>
|
||||
全选
|
||||
</div>
|
||||
|
||||
<div class="ui-col">
|
||||
<div class="ui-btn-wrap f-btn">
|
||||
<button class="ui-btn ui-btn-danger" onclick="WST.dialog('确认要取消关注吗','cancelFavorite()');">
|
||||
取消关注
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</footer>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
|
||||
<script id="shopList" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<div class="ui-row-flex ui-whitespace ui-row-flex-ver shop-box">
|
||||
<div class="ui-col f-shop-header">
|
||||
<div class="ui-row-flex ui-whitespace">
|
||||
<div class="ui-col ui-col-3">
|
||||
<label class="ui-checkbox f-chk">
|
||||
<input class="s-active" type="checkbox" fId="{{d[i].favoriteId}}" onclick="javascript:WST.changeIconStatus($(this), 1);">
|
||||
</label>
|
||||
<div class="shopImg j-imgAdapt">
|
||||
<a href="javascript:void(0);" onclick="goToShop({{d[i].shopId}})"><img src="__IMGURL__/{:WSTConf('CONF.goodsLogo')}" data-echo="__IMGURL__/{{ d[i].shopImg }}" title="{{ d[i].shopName }}"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-col ui-col-2" onclick="goToShop({{d[i].shopId}})">
|
||||
<div class="f-shopname ui-nowrap ui-whitespace">{{d[i].shopName}}</div>
|
||||
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 f-goshops" onclick="goToShop({{d[i].shopId}})">
|
||||
<a href="javascript:void(0);" onclick="goToShop({{d[i].shopId}})"><span class="wst-action">进入店铺</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-col">
|
||||
<div class="ui-row-flex goods-box">
|
||||
{{# var gLength = Math.min(d[i].goods.length,4) }}
|
||||
{{# for(var g=0;g<gLength;++g){ }}
|
||||
<div class="goodsImg"><a href="javascript:void(0);" onclick="WST.intoGoods({{d[i].goods[g].goodsId}})"><img src="__IMGURL__/{:WSTConf('CONF.goodsLogo')}" data-echo="__IMGURL__/{{d[i].goods[g].goodsImg}}">
|
||||
<i class="goodsPrice ui-nowrap" >¥ {{d[i].goods[g].shopPrice}}</i></a>
|
||||
</div>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<section class="ui-container" id="shopBox">
|
||||
|
||||
</section>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/favorites/favorite_shop.js?v={$v}'></script>
|
||||
{/block}
|
51
hyhproject/mobile2/view/default/users/global.css
Executable file
51
hyhproject/mobile2/view/default/users/global.css
Executable file
@ -0,0 +1,51 @@
|
||||
@charset "utf-8";
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,
|
||||
fieldset,input,textarea,p,blockquote,th,td {
|
||||
margin:0;
|
||||
padding:0;
|
||||
|
||||
}
|
||||
table {
|
||||
border-collapse:collapse; /*让表格边框细线*/
|
||||
border-spacing:0; /*清除边框间距*/
|
||||
}
|
||||
fieldset,img {
|
||||
border:0 none; /*有些浏览器默认这些标签有边框,所以要清除默认边框*/
|
||||
display:block;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,i,u,b,strong,th,var {
|
||||
font-style:normal;
|
||||
font-weight:normal;
|
||||
/*清除标签默认文本样式和加粗*/
|
||||
}
|
||||
input,textarea{
|
||||
outline:0 none;/*去掉文本框的默认轮廓线*/
|
||||
}
|
||||
ol,ul {
|
||||
list-style:none; /*清除列表默认样式*/
|
||||
}
|
||||
caption,th {
|
||||
text-align:left; /*清除标签默认文本居中对齐*/
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-size:100%;
|
||||
font-weight:normal; /*清除标题标签的默认样式*/
|
||||
}
|
||||
a{
|
||||
text-decoration:none;/*大部分页面中的链接没有下划线*/
|
||||
}
|
||||
|
||||
.clearfix:after{
|
||||
height:0;
|
||||
content:" ";
|
||||
display:block;
|
||||
overflow:hidden;
|
||||
clear:both;
|
||||
}
|
||||
.clearfix{
|
||||
zoom:1;/*IE低版本浏览器不支持after伪类所以要加这一句*/
|
||||
}
|
||||
|
48
hyhproject/mobile2/view/default/users/history/history.js
Executable file
48
hyhproject/mobile2/view/default/users/history/history.js
Executable file
@ -0,0 +1,48 @@
|
||||
// 获取浏览记录
|
||||
function getHistory(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/goods/historyQuery'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('list').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#listBox').append(html);
|
||||
});
|
||||
$('#currPage').val(data.CurrentPage);
|
||||
$('#totalPage').val(data.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-history.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无浏览记录</p>';
|
||||
html += '<button class="ui-btn-s" onclick="javascript:WST.intoIndex();">去逛逛</button>';
|
||||
html += '</div>';
|
||||
$('#listBox').html(html);
|
||||
}
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
WST.initFooter();
|
||||
getHistory();
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getHistory();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
47
hyhproject/mobile2/view/default/users/history/list.html
Executable file
47
hyhproject/mobile2/view/default/users/history/list.html
Executable file
@ -0,0 +1,47 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}浏览记录 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/history.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>浏览记录</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<script type="text/html" id="list">
|
||||
{{# for(var i=0;i<d.length;++i){ }}
|
||||
<div class="ui-row-flex goods-item">
|
||||
<div class="ui-col">
|
||||
<div class="img j-imgAdapt">
|
||||
<a href="javascript:void(0);" onclick="javascript:WST.intoGoods({{d[i]['goodsId']}});"><img src="__IMGURL__/{:WSTConf('CONF.goodsLogo')}" data-echo="__IMGURL__/{{d[i]['goodsImg']}}"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-col ui-col-3" onclick="javascript:WST.intoGoods({{d[i]['goodsId']}});">
|
||||
<div class="ui-row-flex ui-row-flex-ver wst-info">
|
||||
<div class="goodsTitle ui-nowrap-multi">{{d[i].goodsName}}</div>
|
||||
<div>
|
||||
<p class="price"><span>¥ </span>{{d[i].shopPrice}}</p>
|
||||
<p class="goods-info">成交数:{{d[i].saleNum}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<section class="ui-container" id="listBox">
|
||||
</section>
|
||||
|
||||
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/history/history.js?v={$v}'></script>
|
||||
{/block}
|
242
hyhproject/mobile2/view/default/users/index.html
Executable file
242
hyhproject/mobile2/view/default/users/index.html
Executable file
@ -0,0 +1,242 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/user.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container" id="user">
|
||||
<div class="wst-users_info">
|
||||
<a href="{:url('mobile/messages/index')}"><i class="wst-msg-icon">
|
||||
{if ($data['message']['num']>0)}
|
||||
<span class="number" id="msgNum">{$data['message']['num']}</span>
|
||||
{/if}
|
||||
</i></a>
|
||||
<i class="ui-icon-set wst-info-icon" onclick="location.href='{:url('mobile/users/userset')}'" ></i>
|
||||
<div class="ui-row-flex" style="height:0.7rem">
|
||||
<div class="ui-col ui-col-2">
|
||||
<div class="wst-users_infol" id="previewImages">
|
||||
<img src="__IMGURL__/{:WSTUserPhoto($user['userPhoto'])}" class="wst-useri_portrait" id="imgurl">
|
||||
</div>
|
||||
<p class="wst-users_infor wst-users_infortop">
|
||||
{:$user['userName']?$user['userName']:$user['loginName']}
|
||||
{if ($user['ranks']['rankName']!='')}<img src="__IMGURL__/{$user['ranks']['userrankImg']}">{/if}
|
||||
</p>
|
||||
{if ($user['ranks']['rankName']!='')}
|
||||
<p class="wst-users_infor wst-users_inforbo">{$user['ranks']['rankName']}</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="ui-col">
|
||||
{php}$signScore=explode(",",WSTConf('CONF.signScore'));{/php}
|
||||
{if(WSTConf('CONF.signScoreSwitch')==1 && $signScore[0]>0)}
|
||||
<div class="wst-us-sign">
|
||||
{if(session('WST_USER.signScoreTime')==date('Y-m-d'))}
|
||||
<a id="j-sign" class="sign sign2" disabled="disabled"></a>
|
||||
{else}
|
||||
<a id="j-sign" class="sign" onclick="javascript:inSign();"></a>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{:hook('mobileDocumentUserIndex')}
|
||||
|
||||
{/* 商家订单管理 */}
|
||||
{if ($user['userType']==1)}
|
||||
<?php $shopMenus = WSTShopOrderMenus();?>
|
||||
{if (count($shopMenus)>0)}
|
||||
<div class="user-order">
|
||||
<ul class="ui-row order">
|
||||
<li class="ui-col ui-col-50"><i class="order-icon"></i>商家订单管理</li>
|
||||
<li class="ui-col ui-col-50 view-order" onclick="location.href='{:url('mobile/orders/sellerorder')}'">查看全部订单 ></li>
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{/*用户订单管理 */}
|
||||
<div class="user-order">
|
||||
<ul class="ui-row order">
|
||||
<li class="ui-col ui-col-50"><i class="order-icon"></i>我的订单</li>
|
||||
<li class="ui-col ui-col-50 view-order" onclick="location.href='{:url('mobile/orders/index')}'">查看全部订单 ></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ui-row-flex ui-whitespace wst-users_icon">
|
||||
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitPay'])}">
|
||||
<p class="ui-badge-wrap">
|
||||
<i class="wst-users_icon1"></i>
|
||||
{if ($data['order']['waitPay']>0)}
|
||||
<span class="ui-badge-corner wait-payment ui-nowrap-flex ui-whitespace" id="waitPay">{$data['order']['waitPay']}</span>
|
||||
{/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">待付款</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitDeliver'])}">
|
||||
<p class="ui-badge-wrap">
|
||||
<i class="wst-users_icon2"></i>
|
||||
{if ($data['order']['waitSend']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitSend">{$data['order']['waitSend']}</span>
|
||||
{/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">待发货</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitReceive'])}">
|
||||
<p class="ui-badge-wrap">
|
||||
<i class="wst-users_icon3"></i>
|
||||
{if ($data['order']['waitReceive']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitReceive">{$data['order']['waitReceive']}</span>
|
||||
{/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">待收货</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitAppraise'])}">
|
||||
<p class="ui-badge-wrap">
|
||||
<i class="wst-users_icon4"></i>
|
||||
{if ($data['order']['waitAppraise']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitAppraise">{$data['order']['waitAppraise']}</span>
|
||||
{/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">待评价</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'abnormal'])}">
|
||||
<p style="display:none;"><i class="wst-users_icon5"></i></p><p><i class="wst-users_icon5"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">取消拒收</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="user-order">
|
||||
<ul class="ui-row order">
|
||||
<li class="ui-col ui-col-50"><i class="wallet-icon"></i>我的财产</li>
|
||||
<li class="ui-col ui-col-50 view-order" onclick="location.href='{:url('mobile/logmoneys/usermoneys')}'">资金管理 ></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ui-row-flex wst-users_capital">
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/logmoneys/usermoneys')}">
|
||||
<p class="ui-badge-wrap ui-nowrap"><span>¥ </span>{$user['userMoney']}</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">余额</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/userscores/index')}">
|
||||
<p class="ui-badge-wrap ui-nowrap" id="currentScore">{$user['userScore']}</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">积分</span>
|
||||
</a>
|
||||
</div>
|
||||
{:hook('mobileDocumentUserIndexTerm')}
|
||||
</div>
|
||||
|
||||
<div class="user-order">
|
||||
<ul class="ui-row order">
|
||||
<li class="ui-col ui-col-50"><i class="tool-icon"></i>必备工具</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="ui-row" style="background: #fff;">
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/favorites/goods')}">
|
||||
<p><i class="user-icon1"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">关注商品</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/favorites/shops')}">
|
||||
<p><i class="user-icon2"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">关注店铺</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/goods/history')}">
|
||||
<p><i class="user-icon3"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">浏览记录</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/users/security')}">
|
||||
<p><i class="user-icon4"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">账户安全</span>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/logmoneys/usermoneys')}">
|
||||
<p><i class="user-icon5"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">资金管理</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/userscores/index')}">
|
||||
<p><i class="user-icon6"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">我的惠宝</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="ui-col ui-col-25 user-icon-box border-b">
|
||||
<a href="#">
|
||||
<i class="user-icon7"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">我的礼券</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box border-b">
|
||||
<a href="#">
|
||||
<i class="user-icon8"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">我的客服</span>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box">
|
||||
<a href="{:url('mobile/useraddress/index')}">
|
||||
<p><i class="user-icon9"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">地址管理</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="ui-col ui-col-25 user-icon-box ui-center-hor">
|
||||
<a href="{:url('mobile/messages/index')}">
|
||||
<p class="ui-badge-wrap" style="width:33px;">
|
||||
<i class="user-icon10"></i>
|
||||
{if ($data['message']['num']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="msgNum">{$data['message']['num']}</span>
|
||||
{/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">商城消息</span>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="ui-col ui-col-25 user-icon-box ui-center-hor">
|
||||
<a href="{:url('mobile/ordercomplains/index')}">
|
||||
<p><i class="user-icon11"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center">订单投诉</span>
|
||||
</a>
|
||||
</li>
|
||||
{:hook('mobileDocumentUserIndexTools')}
|
||||
</ul>
|
||||
<div class="ui-btn-wrap logout">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/user.js?v={$v}'></script>
|
||||
{/block}
|
127
hyhproject/mobile2/view/default/users/index1.html
Executable file
127
hyhproject/mobile2/view/default/users/index1.html
Executable file
@ -0,0 +1,127 @@
|
||||
{extend name="default/base" /} {block name="title"}我的 - {__block__}{/block} {block name="css"}
|
||||
<link rel="stylesheet" href="__ROOT__/hyhproject/mobile/view/default/css/user.css?v={$v}"> {/block} {block name="header"} {/block} {block name="main"}
|
||||
<section class="ui-container" id="user">
|
||||
<div class="ui-row-flex wst-users_info">
|
||||
<div class="ui-col">
|
||||
<div class="wst-users_infol" id="previewImages">
|
||||
<img src="__IMGURL__{:WSTUserPhoto($user['userPhoto'])}" class="wst-useri_portrait" id="imgurl">
|
||||
<span class="span_my">{:$user['userName']?$user['userName']:$user['loginName']}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="ui-col ui-col-2 wst-users_infor">
|
||||
<span class="wst-users_infor wst-users_infortop ui-nowrap-flex ui-whitespace">{:$user['userName']?$user['userName']:$user['loginName']}</span>
|
||||
<span class="wst-users_infor ui-nowrap-flex ui-whitespace" style="height:35px;width:100%;">
|
||||
{if ($user['ranks']['rankName']!='')}
|
||||
<div class="user-rank-box">{$user['ranks']['rankName']}
|
||||
<img src="__ROOT__/{$user['ranks']['userrankImg']}">
|
||||
</div>
|
||||
{/if}
|
||||
</span>
|
||||
</div>-->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{:hook('mobileDocumentUserIndex')}
|
||||
<!-- 导航 -->
|
||||
<div class="nav clearfix">
|
||||
<div class="nblock">
|
||||
<a href="{:url('mobile/favorites/goods')}">
|
||||
<p>22</p>
|
||||
<p>收藏夹</p>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="nblock">
|
||||
<a href="{:url('mobile/favorites/shops')}">
|
||||
<p>22</p>
|
||||
<p>关注店铺</p>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="nblock">
|
||||
<a href="{:url('mobile/goods/history')}">
|
||||
<p>22</p>
|
||||
<p>足迹</p>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{/* 商家订单管理 */} {if ($user['userType']==1)}
|
||||
<!--<ul class="ui-row user-order">
|
||||
<li class="ui-col ui-col-50">商家订单管理</li>
|
||||
<li class="ui-col ui-col-50 view-order" onclick="location.href='{:url('mobile/orders/sellerorder')}'">查看全部订单 ></li>
|
||||
</ul>-->
|
||||
{/if} {/*用户订单管理 */}
|
||||
<ul class="ui-row user-order" style="background: #fff;">
|
||||
<li class="ui-col ui-col-50">我的订单</li>
|
||||
<li class="ui-col ui-col-50 view-order" onclick="location.href='{:url('mobile/orders/index')}'">查看全部订单 ></li>
|
||||
</ul>
|
||||
<div class="ui-row-flex ui-whitespace wst-users_icon pd10">
|
||||
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitPay'])}">
|
||||
<p class="ui-badge-wrap" style="width:33px;">
|
||||
<i class="wst-users_icon1"></i> {if ($data['order']['waitPay']>0)}
|
||||
<span class="ui-badge-corner wait-payment ui-nowrap-flex ui-whitespace" id="waitPay">{$data['order']['waitPay']}</span> {/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center pdl7">待付款</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitDeliver'])}">
|
||||
<p class="ui-badge-wrap" style="width:33px;">
|
||||
<i class="wst-users_icon2"></i> {if ($data['order']['waitSend']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitSend">{$data['order']['waitSend']}</span> {/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center pdl7">待发货</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitReceive'])}">
|
||||
<p class="ui-badge-wrap" style="width:33px;">
|
||||
<i class="wst-users_icon3"></i> {if ($data['order']['waitReceive']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitReceive">{$data['order']['waitReceive']}</span> {/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center pdl7">待收货</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'waitAppraise'])}">
|
||||
<p class="ui-badge-wrap" style="width:33px;">
|
||||
<i class="wst-users_icon4"></i> {if ($data['order']['waitAppraise']>0)}
|
||||
<span class="ui-badge-corner wait-payment" id="waitAppraise">{$data['order']['waitAppraise']}</span> {/if}
|
||||
</p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center pdl7">待评价</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui-col ui-col">
|
||||
<a href="{:url('mobile/orders/index',['type'=>'abnormal'])}">
|
||||
<p style="display:none;"><i class="wst-users_icon5"></i></p>
|
||||
<p><i class="wst-users_icon5"></i></p>
|
||||
<span class="ui-flex ui-flex-align-end ui-flex-pack-center pdl7">退款售后</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<ul class="ui-row user-tool">
|
||||
<li class="ui-col ui-col-100">必备工具</li>
|
||||
|
||||
</ul>-->
|
||||
|
||||
<!--<div class="ui-btn-wrap logout">
|
||||
<button class="ui-btn-lg ui-btn-danger logout-btn" onclick="WST.dialog('确定要退出吗?','logout()')">
|
||||
退出登录
|
||||
</button>
|
||||
</div>-->
|
||||
|
||||
</section>
|
||||
{/block} {block name="include"} {include file="default/dialog" /}
|
||||
<!-- 对话框模板 -->
|
||||
{/block} {block name="js"}
|
||||
<script type='text/javascript' src='__ROOT__/hyhproject//mobile/view/default/users/user.js?v={$v}'></script>
|
||||
{/block}
|
6
hyhproject/mobile2/view/default/users/jquery-1.10.2.min.js
vendored
Executable file
6
hyhproject/mobile2/view/default/users/jquery-1.10.2.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
119
hyhproject/mobile2/view/default/users/logmoneys/list.html
Executable file
119
hyhproject/mobile2/view/default/users/logmoneys/list.html
Executable file
@ -0,0 +1,119 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的资金 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/logmoneys.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>我的资金</h1>
|
||||
<span class="record" onclick="location.href='{:url('mobile/cashdraws/index')}'">提现记录</span>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="{$rs['isSetPayPwd']}" id="isSet" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="ui-row-flex ui-row-flex-ver head">
|
||||
<div class="title">
|
||||
<div class="money_number">
|
||||
<p id="userMoney" money="{$rs['userMoney']}" cash="{:WSTConf('CONF.drawCashUserLimit')}">可用资金:<span>¥ </span>{$rs['userMoney']}</p>
|
||||
</div>
|
||||
<div class="money_number2">
|
||||
<p money="{$rs['userMoney']}" cash="{:WSTConf('CONF.drawCashUserLimit')}">冻结资金:<span>¥ </span>{$rs['lockMoney']}</p>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
<div class="ui-col head-btn-box"></div>
|
||||
</div>
|
||||
<ul class="ui-row recharge-box">
|
||||
<li class="ui-col ui-col-50" onclick="location.href='{:url('mobile/logmoneys/toRecharge')}'">
|
||||
<div class="wst_model">
|
||||
<div class="icon_add"><p>充值</p></div>
|
||||
</div>
|
||||
</li>
|
||||
<!--{if session('WST_USER.userType') == 1 }
|
||||
<li class="ui-col ui-col-50" onclick="getCash()">
|
||||
<div class="wst_model">
|
||||
<div class="icon_out"><p>提现</p></div>
|
||||
</div>
|
||||
</li>
|
||||
{/if}-->
|
||||
</ul>
|
||||
{if session('WST_USER.userType') == 1 }
|
||||
<ul class="ui-row money-detail" onclick="check()">
|
||||
<li class="ui-col ui-col-50 money-detail-title"><div class="icon_stript stript_1"></div><h5> 我的提现账户</h5></li>
|
||||
<li class="ui-col ui-col-50 money-detail-title m-tr"><h5>{$rs['num']}个 ></h5></li>
|
||||
</ul>
|
||||
{/if}
|
||||
<ul class="ui-row money-detail" onclick="javascript:toRecord()">
|
||||
<li class="ui-col ui-col-50 money-detail-title"><div class="icon_stript stript_2"></div><h5> 我的资金流水</h5></li>
|
||||
<li class="ui-col ui-col-50 money-detail-title m-tr"><h5>></h5></li>
|
||||
</ul>
|
||||
{if session('WST_USER.userType') == 1 }
|
||||
<ul class="ui-row first-time">
|
||||
<li class="ui-col ui-col-100 ft-title"><i></i><span>首次提现步骤:</span></li>
|
||||
<li class="ui-col ui-col-100 ft-item">1.设置支付密码和绑定手机号码</li>
|
||||
<li class="ui-col ui-col-100 ft-item">2.绑定您的微信钱包或银行卡</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</section>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}
|
||||
<input type="hidden" value="{:WSTConf('CONF.pwdModulusKey')}" id="key" autocomplete="off">
|
||||
{/* 对话框 prompt */}
|
||||
<div class="ui-dialog" id="payPwdBox">
|
||||
<div class="ui-dialog-cnt">
|
||||
<div class="ui-dialog-bd">
|
||||
<p id="wst-dialog" class="wst-dialog-t">
|
||||
请输入支付密码:<br />
|
||||
<input type="password" id="payPwd" maxLength="6" class="wst-pay-inp"/>
|
||||
</p>
|
||||
<p class="wst-dialog-l"></p>
|
||||
<button id="wst-event1" type="button" class="ui-btn-s wst-dialog-b1" data-role="button">取消</button>
|
||||
<button id="wst-event3" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 分类层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title"><span>申请提现</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="info">
|
||||
<p>可提现金额</p>
|
||||
<p class="money"><span>¥ </span>{$rs['userMoney']}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul class="ui-row">
|
||||
<li class="ui-col ui-col-25">提现账号:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<select name="accId" id="accId" class="wst-lo-choice">
|
||||
<option value="">请选择</option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="ui-col ui-col-25">提现金额:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<input type="number" name="money" id="money" class="wst-lo-choice" onkeyup="javascript:WST.isChinese(this,1)" autocomplete="off" />
|
||||
</li>
|
||||
<li class="ui-col ui-col-25">支付密码:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<input type="password" id="cashPayPwd" class="wst-lo-choice" maxLength="6" onkeypress='return WST.isNumberKey(event);' onkeyup="javascript:WST.isChinese(this,1)" autocomplete="off" />
|
||||
</li>
|
||||
<li class="ui-col wst-red">(至少¥ {:WSTConf('CONF.drawCashUserLimit')}以上可提现)</li>
|
||||
<li class="ui-col ui-col-100">
|
||||
<div class="ui-btn-wrap">
|
||||
<button class="ui-btn-lg ui-btn-danger wst-apply-button" id="submit" onclick="drawMoney()">
|
||||
确定
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript" src="__STATIC__/js/rsa.js"></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/logmoneys/logmoneys.js?v={$v}'></script>
|
||||
{/block}
|
155
hyhproject/mobile2/view/default/users/logmoneys/logmoneys.js
Executable file
155
hyhproject/mobile2/view/default/users/logmoneys/logmoneys.js
Executable file
@ -0,0 +1,155 @@
|
||||
jQuery.noConflict();
|
||||
$(document).ready(function(){
|
||||
WST.initFooter('user');
|
||||
// 弹出层
|
||||
var w = WST.pageWidth();
|
||||
$("#frame").css('top',0);
|
||||
$("#frame").css('right',-w);
|
||||
});
|
||||
//资金流水列表
|
||||
function getRecordList(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.type = $('#type').val() || -1;
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/logMoneys/pageQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('scoreList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#score-list').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-relevant.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无相关信息</p>';
|
||||
html += '</div>';
|
||||
$('#score-list').html(html);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
// 验证支付密码资金
|
||||
function check(){
|
||||
var isSetPayPwd = $('#isSet').val();
|
||||
if(isSetPayPwd==0){
|
||||
$('#wst-event2').html('去设置');
|
||||
WST.dialog('您未设置支付密码','location.href="'+WST.U('mobile/users/editPayPass')+'"');
|
||||
return;
|
||||
}else{
|
||||
showPayBox();
|
||||
}
|
||||
|
||||
}
|
||||
// 支付密码对话框
|
||||
function showPayBox(){
|
||||
$("#wst-event3").attr("onclick","javascript:checkSecret()");
|
||||
$("#payPwdBox").dialog("show");
|
||||
}
|
||||
function checkSecret(){
|
||||
var payPwd = $.trim($('#payPwd').val());
|
||||
if(payPwd==''){
|
||||
WST.msg('请输入支付密码','info');
|
||||
return;
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
var payPwd = rsa.encrypt(payPwd);
|
||||
}
|
||||
$.post(WST.U('mobile/logmoneys/checkPayPwd'),{payPwd:payPwd},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$("#payPwdBox").dialog("hide");
|
||||
location.href=WST.U('mobile/cashconfigs/index');
|
||||
}else{
|
||||
WST.msg(json.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
//资金流水
|
||||
function toRecord(){
|
||||
location.href = WST.U('mobile/logmoneys/record');
|
||||
}
|
||||
/******************** 提现层 *************************/
|
||||
function getCash(){
|
||||
$('#money').val('');
|
||||
$('#cashPayPwd').val('');
|
||||
$.post(WST.U('mobile/cashconfigs/pageQuery'),{},function(data){
|
||||
var json = WST.toJson(data);
|
||||
var html = '<option value="">请选择</option>';
|
||||
if(json.status==1){
|
||||
$(json.data.Rows).each(function(k,v){
|
||||
html +='<option value='+v.id+'>'+v.accUser+'|'+v.accNo+'</option>';
|
||||
});
|
||||
$('#accId').html(html);
|
||||
// 判断是否禁用按钮
|
||||
if($('#userMoney').attr('money')<$('#userMoney').attr('cash'))$('#submit').attr('disabled','disabled');
|
||||
dataShow();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
})
|
||||
}
|
||||
// 申请提现
|
||||
function drawMoney(){
|
||||
var accId = $('#accId').val();
|
||||
var money = $('#money').val();
|
||||
var payPwd = $('#cashPayPwd').val();
|
||||
|
||||
if(accId==''){
|
||||
WST.msg('请选择提现账号','info');
|
||||
return;
|
||||
}
|
||||
if(money==''){
|
||||
WST.msg('请输入提现金额','info');
|
||||
return
|
||||
}
|
||||
if(payPwd==''){
|
||||
WST.msg('请输入支付密码','info');
|
||||
return
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
var payPwd = rsa.encrypt(payPwd);
|
||||
}
|
||||
var param = {};
|
||||
param.accId = accId;
|
||||
param.money = money;
|
||||
param.payPwd = payPwd;
|
||||
$.post(WST.U('mobile/cashdraws/drawMoney'),param,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg('提现申请已提交','success');
|
||||
setTimeout(function(){
|
||||
history.go(0);
|
||||
},1000);
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
})
|
||||
}
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"right": 0}, 500);
|
||||
}
|
||||
function dataHide(){
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
55
hyhproject/mobile2/view/default/users/logmoneys/record.html
Executable file
55
hyhproject/mobile2/view/default/users/logmoneys/record.html
Executable file
@ -0,0 +1,55 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}资金流水 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/userscores.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "资金流水"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="ui-row-flex ui-whitespace ui-row-flex-ver head" style="text-align: left;">
|
||||
<div class="ui-col" style="padding-top: 30px;font-size: 0.16rem;text-align: right;">可用资金:¥ {$rs['userMoney']}</div>
|
||||
<div class="ui-col" style="font-size: 0.16rem;text-align: right;">冻结资金:¥ {$rs['lockMoney']}</div>
|
||||
</div>
|
||||
<script type="text/html" id="scoreList">
|
||||
<ul class="ui-row score-detail">
|
||||
{{# for(var i=0;i<d.length;i++){ }}
|
||||
<li class="ui-col ui-col-75 wst-re-info">
|
||||
{{d[i].remark}}
|
||||
<span class="score-time">{{d[i].createTime}}</span>
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 {{(d[i].moneyType==1)?'score-plus':'score-reduce'}}">{{(d[i].moneyType==1)?'+':'-'}} {{d[i].money}}</li>
|
||||
<div class="wst-clear"></div>
|
||||
<div class="score-line"></div>
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
<div class="score-detail-title">资金明细</div>
|
||||
<div id="score-list"></div>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/logmoneys/logmoneys.js?v={$v}'></script>
|
||||
<script>
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getRecordList();
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - $(window).height())) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getRecordList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
77
hyhproject/mobile2/view/default/users/messages/list.html
Executable file
77
hyhproject/mobile2/view/default/users/messages/list.html
Executable file
@ -0,0 +1,77 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的消息 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__ROOT__/hyhproject/mobile/view/default/css/messages.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="location.href='{:url('mobile/users/index')}'"></i><h1>我的消息</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
<div class="ui-loading-wrap wst-Load" id="Load">
|
||||
<i class="ui-loading"></i>
|
||||
</div>
|
||||
<footer class="ui-footer wst-footer-btns" style="height:45px; border-top: 1px solid #e0e0e0;" id="footer">
|
||||
<div class="wst-toTop" id="toTop">
|
||||
<i class="wst-toTopimg"><span>顶部</span></i>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace">
|
||||
<div class="ui-col ui-col-2 favorite-tc">
|
||||
<label class="ui-checkbox" style="margin-left:5px;">
|
||||
<input class="sactive" type="checkbox" onclick="javascript:checkAll(this);">
|
||||
</label>
|
||||
全选
|
||||
</div>
|
||||
|
||||
<div class="ui-col">
|
||||
<div class="ui-btn-wrap f-btn">
|
||||
<button class="ui-btn ui-btn-danger del-btn" onclick="toDelMsg()">
|
||||
删除消息
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<script type="text/html" id="msgList">
|
||||
{{# for(var i=0; i<d.length; i++){ }}
|
||||
<li>
|
||||
<label class="ui-checkbox msg-chk">
|
||||
<input class="active" type="checkbox" msgId="{{d[i].id}}" >
|
||||
</label>
|
||||
<div class="ui-list-info" onclick="javascript:getMsgDetails({{d[i].id}});">
|
||||
<h5 class="ui-nowrap">
|
||||
<span class="{{(d[i].msgStatus == 0)?'wst-info_ico':'wst-info_ico1' }} j-icon_{{d[i].id}}"></span>{{d[i].msgContent}}</h5>
|
||||
</div>
|
||||
</li>
|
||||
<div class="wst-Line"></div>
|
||||
{{# } }}
|
||||
</script>
|
||||
<section class="ui-container info-prompt">
|
||||
<ul class="ui-list ui-list-text wst-info_content" id="info-list">
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div id="info_details" style="display:none;">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="javascript:returnInfo()"></i><h1>消息详情</h1>
|
||||
</header>
|
||||
<section class="ui-container">
|
||||
<div class="ui-whitespace detail-time"><span class="wst-info_detime"></span></div>
|
||||
<div class="ui-whitespace"><span class="wst-info_decontent"></span></div>
|
||||
</section>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__ROOT__/hyhproject//mobile/view/default/users/messages/messages.js?v={$v}'></script>
|
||||
{/block}
|
103
hyhproject/mobile2/view/default/users/messages/messages.js
Executable file
103
hyhproject/mobile2/view/default/users/messages/messages.js
Executable file
@ -0,0 +1,103 @@
|
||||
//消息列表
|
||||
function getMessages(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 12;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/messages/pageQuery'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
var mhtml = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('msgList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#info-list').append(html);
|
||||
});
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
|
||||
}else{
|
||||
mhtml += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-message.png"></div>';
|
||||
mhtml += '<div class="wst-prompt-info">';
|
||||
mhtml += '<p>对不起,没有相关消息。</p>';
|
||||
mhtml += '</div>';
|
||||
$('.info-prompt').append(mhtml);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
});
|
||||
}
|
||||
//返回消息列表
|
||||
function returnInfo(){
|
||||
$('#info_details').hide();
|
||||
$('#info_list').show();
|
||||
}
|
||||
|
||||
// 全选
|
||||
function checkAll(obj){
|
||||
var chk = $(obj).attr('checked');
|
||||
$('.active').each(function(k,v){
|
||||
$(this).prop('checked',chk);
|
||||
});
|
||||
}
|
||||
//消息详情
|
||||
function getMsgDetails(id){
|
||||
$('#info_list').hide();
|
||||
$('#info_details').show();
|
||||
$('.j-icon_'+id).addClass('wst-info_ico1').removeClass('wst-info_ico');
|
||||
$.post(WST.U('mobile/messages/getById'), {msgId:id}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json){
|
||||
$('.wst-info_detime').html(json.createTime);
|
||||
$('.wst-info_decontent').html(json.msgContent);
|
||||
}
|
||||
json = null;
|
||||
});
|
||||
}
|
||||
var msgIdsToDel=new Array();//要删除的消息的id 数组
|
||||
//去删除商城消息
|
||||
function toDelMsg(){
|
||||
var msgIds = new Array();
|
||||
$('.active').each(function(k,v){
|
||||
if($(this).attr('checked')){
|
||||
msgIds.push($(this).attr('msgid'));
|
||||
}
|
||||
});
|
||||
msgIdsToDel = msgIds;
|
||||
if(msgIds.join(',')==''){
|
||||
WST.msg('请选择要删除的消息','info');
|
||||
return false;
|
||||
}
|
||||
WST.dialog('确定要删除选中的消息吗?','delMsg()');
|
||||
}
|
||||
var vn ='';
|
||||
//删除商城消息
|
||||
function delMsg(){
|
||||
WST.dialogHide('prompt');
|
||||
$.post(WST.U('mobile/messages/del'), {ids:msgIdsToDel}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
$('#currPage').val(0)
|
||||
$('#info-list').html(' ');
|
||||
getMessages();
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
}
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getMessages();
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getMessages();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
133
hyhproject/mobile2/view/default/users/orders/list_complains.html
Executable file
133
hyhproject/mobile2/view/default/users/orders/list_complains.html
Executable file
@ -0,0 +1,133 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的投诉 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/list_complains.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>我的投诉</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<script type="text/html" id="complainList">
|
||||
<ul class="ui-row">
|
||||
{{# for(var i=0;i<d.length;i++){ }}
|
||||
<div class="complain-box">
|
||||
<li class="ui-col ui-col-50" onclick="javascript:WST.intoShops({{d[i].shopId}});">{{d[i].shopName}}</li>
|
||||
<li class="ui-col ui-col-50 c-tr">{{d[i].complainTime}}</li>
|
||||
<div class="c-item" onclick="complainDetail({{d[i].complainId}})">
|
||||
<li class="ui-col ui-col-75">订单号:{{d[i].orderNo}}</li>
|
||||
<li class="ui-col ui-col-25 c-tr wst-co-status">{{d[i].complainStatus}}</li>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
<div class="c-line"></div>
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
<div id="complain-list"></div>
|
||||
</section>
|
||||
<script type="text/html" id="complainDetail">
|
||||
<ul class="ui-row com-detail-box">
|
||||
<li class="ui-col ui-col-100 com-detail-big-title">投诉信息</li>
|
||||
<li class="ui-col ui-col-25 com-detail-title">订单编号:</li>
|
||||
<li class="ui-col ui-col-75">{{d.orderNo}}</li>
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">投诉内容:</li>
|
||||
<li class="ui-col ui-col-75">{{d.complainContent}}</li>
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">投诉类型:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
{{# if (d.complainType==1){ }}
|
||||
承诺的没有做到
|
||||
{{# } else if (d.complainType==2) { }}
|
||||
未按约定时间发货
|
||||
{{# } else if (d.complainType==3) { }}
|
||||
未按成交价格进行交易
|
||||
{{# } else if (d.complainType==4) { }}
|
||||
恶意骚扰
|
||||
{{# } }}
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">附件:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
{{# if(d.complainAnnex){ }}
|
||||
{{# for(var c=0;c<d.complainAnnex.length;c++){ }}
|
||||
<img src="__IMGURL__/{{d.complainAnnex[c]}}" style="width:60px;height:60px;" id="imgurl">
|
||||
{{# } }}
|
||||
{{# }else{ }}
|
||||
无
|
||||
{{# } }}
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">投诉时间:</li>
|
||||
<li class="ui-col ui-col-75">{{d.complainTime}}</li>
|
||||
</ul>
|
||||
|
||||
|
||||
{{# if (d.needRespond==1 && WST.blank(d.respondContent)!=''){ }}
|
||||
|
||||
<ul class="ui-row com-detail-box">
|
||||
<li class="ui-col ui-col-100 com-detail-big-title">应诉信息</li>
|
||||
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">应诉内容:</li>
|
||||
<li class="ui-col ui-col-75">{{d.respondContent}}</li>
|
||||
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">附件:</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
{{# if(d.respondAnnex){ }}
|
||||
{{# for(var r=0;r<d.respondAnnex.length;r++){ }}
|
||||
<img src="__IMGURL__/{{d.respondAnnex[r]}}" class="annex">
|
||||
{{# } }}
|
||||
{{# }else{ }}
|
||||
无
|
||||
{{# } }}
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 com-detail-title">应诉时间:</li>
|
||||
<li class="ui-col ui-col-75">{{d.respondTime}}</li>
|
||||
</ul>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<ul class="ui-row com-detail-box">
|
||||
<li class="ui-col ui-col-100 com-detail-big-title">仲裁信息【
|
||||
{{# if(d.complainStatus==0){ }}
|
||||
等待处理
|
||||
{{# }else if(d.complainStatus==1){ }}
|
||||
等待应诉人回应
|
||||
{{# }else if(d.complainStatus==2 || d.complainStatus==3){ }}
|
||||
等待仲裁
|
||||
{{# }else if(d.complainStatus==4){ }}
|
||||
已仲裁
|
||||
{{# } }}
|
||||
】</li>
|
||||
|
||||
{{# if(d.complainStatus==4){ }}
|
||||
<li class="ui-col ui-col-25 com-detail-title">仲裁结果:</li>
|
||||
<li class="ui-col ui-col-75">{{d.finalResult}}</li>
|
||||
|
||||
<li class="ui-col ui-col-25 com-detail-title">仲裁时间:</li>
|
||||
<li class="ui-col ui-col-75">{{d.finalResultTime}}</li>
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 分类层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title"><span>投诉详情</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="complainDetailBox">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/list_complains.js?v={$v}'></script>
|
||||
{/block}
|
88
hyhproject/mobile2/view/default/users/orders/list_complains.js
Executable file
88
hyhproject/mobile2/view/default/users/orders/list_complains.js
Executable file
@ -0,0 +1,88 @@
|
||||
jQuery.noConflict();
|
||||
// 获取订单列表
|
||||
function getComplainList(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/orderComplains/complainByPage'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('complainList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#complain-list').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-complaint.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无投诉信息</p>';
|
||||
html += '</div>';
|
||||
$('#complain-list').html(html);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getComplainList();
|
||||
WST.initFooter('user');
|
||||
// 弹出层
|
||||
$("#frame").css('top',0);
|
||||
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getComplainList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"right": 0}, 500);
|
||||
}
|
||||
function dataHide(){
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
|
||||
function complainDetail(cId){
|
||||
$.post(WST.U('mobile/orderComplains/getComplainDetail'),{'id':cId},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json){
|
||||
var gettpl = document.getElementById('complainDetail').innerHTML;
|
||||
laytpl(gettpl).render(json, function(html){
|
||||
// 写入数据
|
||||
$('#complainDetailBox').html(html);
|
||||
// 设置滚动条
|
||||
var screenH = WST.pageHeight();
|
||||
var titleH = $('#frame').find('.title').height();
|
||||
var contentH = $('#complainDetailBox').height();
|
||||
|
||||
if(screenH-titleH < contentH){
|
||||
$('#complainDetailBox').css('height',screenH-titleH);
|
||||
}
|
||||
// 展示弹出层
|
||||
dataShow();
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
172
hyhproject/mobile2/view/default/users/orders/orders_appraises.html
Executable file
172
hyhproject/mobile2/view/default/users/orders/orders_appraises.html
Executable file
@ -0,0 +1,172 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}商品评价 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders_appraises.css?v={$v}">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title='商品评价'{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$oId}" id="oId" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="ui-row-flex item-head">
|
||||
<div class="ui-col ui-col-2 ui-nowrap-flex shop"><i></i>{$data['shopName']}</div>
|
||||
</div>
|
||||
{volist name="data['Rows']" id="g"}
|
||||
<div class="ui-row-flex border-b g-item">
|
||||
<div class="ui-col">
|
||||
<div class="g-Img j-imgAdapt">
|
||||
<a href="javascript:void(0);" onclick="javascript:WST.intoGoods({$g['goodsId']});">
|
||||
<img src="__IMGURL__/{:WSTConf('CONF.goodsLogo')}" data-echo="__IMGURL__/{:WSTImg($g['goodsImg'],3)}">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 g-gInfo">
|
||||
<p class="g-gName ui-nowrap-multi">{$g['goodsName']}</p>
|
||||
<p class="g-gSpec ui-nowrap-flex">{if($g['goodsSpecNames'])}规格:{$g['goodsSpecNames']}{/if}</p>
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;">
|
||||
{if ($g['appraise']!='')}
|
||||
<span class="appraise" onclick="appraise({$g.goodsId},{$g['goodsSpecId'] ?? 0},{$g.id},this)"></span>
|
||||
{else /}
|
||||
<span class="appraise" onclick="appraise({$g.goodsId},{$g['goodsSpecId'] ?? 0},{$g.id},this)"></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div id="appBox_{$g.id}"></div>
|
||||
{/volist}
|
||||
<script id="appraises-box" type="text/html">
|
||||
<ul class="ui-row appraise-box">
|
||||
<li class="ui-col ui-col-25 appraise-title">商品名称</li>
|
||||
<li class="ui-col ui-col-75 ui-nowrap-multi appraise-name">
|
||||
{{d.goodsName}}
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 appraise-title" style="height: 25px;line-height:25px;">商品评分</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<ul class="ui-row">
|
||||
<li class="ui-col ui-col-80">
|
||||
{{# if(d.goodsScore!=''){ }}
|
||||
{{# for(var i=0;i<d.goodsScore;i++){ }}
|
||||
<span class="start-on"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# for(var j=0;j<5-d.goodsScore;j++){ }}
|
||||
<span class="start-not"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# }else{ }}
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
{{# } }}
|
||||
</li>
|
||||
<li class="ui-col ui-col-20 score" id="goodsScore" score="{{(d.timeScore!='')?d.timeScore:'0'}}" style="height: 25px;line-height:25px;">{{(d.goodsScore!='')?d.goodsScore:'0'}}分</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 appraise-title" style="height: 25px;line-height:25px;">服务评分</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<ul class="ui-row">
|
||||
<li class="ui-col ui-col-80">
|
||||
{{# if(d.serviceScore!=''){ }}
|
||||
{{# for(var i=0;i<d.serviceScore;i++){ }}
|
||||
<span class="start-on"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# for(var j=0;j<5-d.serviceScore;j++){ }}
|
||||
<span class="start-not"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# }else{ }}
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
{{# } }}
|
||||
</li>
|
||||
<li class="ui-col ui-col-20 score" id="serviceScore" score="{{(d.timeScore!='')?d.timeScore:'0'}}" style="height: 25px;line-height:25px;">{{(d.serviceScore!='')?d.serviceScore:'0'}}分</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="ui-col ui-col-25 appraise-title" style="height: 25px;line-height:25px;">时效评分</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
<ul class="ui-row">
|
||||
<li class="ui-col ui-col-80">
|
||||
{{# if(d.timeScore!=''){ }}
|
||||
{{# for(var i=0;i<d.timeScore;i++){ }}
|
||||
<span class="start-on"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# for(var j=0;j<5-d.timeScore;j++){ }}
|
||||
<span class="start-not"></span>
|
||||
{{# } }}
|
||||
|
||||
{{# }else{ }}
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
<span class="start-not" onclick="clickStar(this)"></span>
|
||||
{{# } }}
|
||||
</li>
|
||||
<li class="ui-col ui-col-20 score" id="timeScore" score="{{(d.timeScore!='')?d.timeScore:'0'}}" style="height: 25px;line-height:25px;">{{(d.timeScore!='')?d.timeScore:'0'}}分</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
{{# if(d.content==''){ }}
|
||||
<li class="ui-col" style="padding:10px">
|
||||
<textarea class="appraisesContent" id="content"></textarea>
|
||||
</li>
|
||||
<div class="ui-col uploadfile-box">
|
||||
<ul class="complainFileBox" id="edit_chart">
|
||||
</ul>
|
||||
<div id="filePicker" style='margin-left:10px;width:250px;overflow:hidden;height:35px;font-size:.13rem;'>上传附件(最多5张)</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="ui-btn-wrap post-btn">
|
||||
<button class="ui-btn-lg ui-btn-danger" onclick="javascript:saveAppr({{d.goodsId}},{{d.goodsSpecId}},{{d.orderGoodsId}});">提交</button>
|
||||
</div>
|
||||
{{# }else{ }}
|
||||
<li class="ui-col ui-col-25 appraise-title">点评内容</li>
|
||||
<li class="ui-col ui-col-75">
|
||||
{{d.content}}
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 appraise-title" style="padding-top:15px;">评价附件</li>
|
||||
<li class="ui-col ui-col-75" style="margin-top:10px;margin-left:-10px;">
|
||||
{{# if(WST.blank(d.images)!=''){
|
||||
var img = d.images;
|
||||
}}
|
||||
<ul class="complainFileBox">
|
||||
{{# for(var g=0;g<img.length;++g){ }}
|
||||
<li><img src="__IMGURL__/{{img[g]}}"> </li>
|
||||
{{# } }}
|
||||
</ul>
|
||||
{{# } }}
|
||||
</li>
|
||||
|
||||
{{# } }}
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<div id="appraisesBox">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_appraises.js?v={$v}'></script>
|
||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
|
||||
{/block}
|
115
hyhproject/mobile2/view/default/users/orders/orders_appraises.js
Executable file
115
hyhproject/mobile2/view/default/users/orders/orders_appraises.js
Executable file
@ -0,0 +1,115 @@
|
||||
jQuery.noConflict();
|
||||
//商品评价
|
||||
function clickStar(obj){
|
||||
var index = $(obj).index(); // 当前选中的分数
|
||||
$(obj).parent().find('span').each(function(k,v){
|
||||
if(k<=index){
|
||||
$(this).removeClass('start-not').addClass('start-on');
|
||||
}else{
|
||||
$(this).removeClass('start-on').addClass('start-not');
|
||||
}
|
||||
})
|
||||
$(obj).parent().siblings().html(index+1+'分');
|
||||
$(obj).parent().siblings().attr('score',index+1);
|
||||
}
|
||||
|
||||
function appraise(gId,sId,ogId,obj){
|
||||
|
||||
$('.appraise').removeClass('score');
|
||||
$(obj).addClass('score');
|
||||
var gName = $(obj).parent().parent().find('.g-gName').html();
|
||||
|
||||
var param = {};
|
||||
param.gId = gId;
|
||||
param.sId = sId;
|
||||
param.oId = $('#oId').val();
|
||||
param.orderGoodsId = ogId;
|
||||
$.post(WST.U('mobile/goodsappraises/getAppr'),param,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
var gettpl = document.getElementById('appraises-box').innerHTML;
|
||||
json.data.goodsName = gName;
|
||||
json.data.goodsId = gId;
|
||||
json.data.goodsSpecId = sId;
|
||||
json.data.orderGoodsId = ogId;
|
||||
laytpl(gettpl).render(json.data, function(html){
|
||||
$('div[id^="appBox_"]').html(' ');
|
||||
$('#appBox_'+ogId).html(html);
|
||||
});
|
||||
if(json.data.serviceScore=='')userAppraiseInit();
|
||||
}else{
|
||||
WST.msg('请求出错','info');
|
||||
}
|
||||
})
|
||||
}
|
||||
function saveAppr(gId,sId,ogId){
|
||||
var content = $.trim($('#content').val());
|
||||
if(content==''){
|
||||
WST.msg('评价内容不能为空','info');
|
||||
return
|
||||
}
|
||||
var param = {};
|
||||
param.content = content;
|
||||
param.goodsId = gId;
|
||||
param.goodsSpecId = sId;
|
||||
param.orderId = $('#oId').val();
|
||||
param.timeScore = $('#timeScore').attr('score');
|
||||
param.goodsScore = $('#goodsScore').attr('score');
|
||||
param.serviceScore = $('#serviceScore').attr('score');
|
||||
param.orderGoodsId = ogId;
|
||||
|
||||
var imgs = [];
|
||||
// 是否有上传附件
|
||||
$('.imgSrc').each(function(k,v){
|
||||
imgs.push($(this).attr('v'));
|
||||
})
|
||||
imgs = imgs.join(',');
|
||||
if(imgs!='')
|
||||
param.images = imgs;
|
||||
|
||||
$.post(WST.U('mobile/goodsappraises/add'),param,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){history.go(0);},1000);
|
||||
}else{
|
||||
WST.msg(json.msg);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
$(function(){
|
||||
WST.initFooter('user');
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
})
|
||||
|
||||
|
||||
/*************** 上传图片 *****************/
|
||||
function userAppraiseInit(){
|
||||
var uploader =WST.upload({
|
||||
pick:'#filePicker',
|
||||
formData: {dir:'appraises',isThumb:1},
|
||||
fileNumLimit:5,
|
||||
accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
|
||||
callback:function(f,file){
|
||||
var json = WST.toJson(f);
|
||||
if(json.status==1){
|
||||
var tdiv = $("<li>"+
|
||||
"<img class='imgSrc' src='"+WST.conf.IMGURL+"/"+json.savePath+json.thumb+"' v='"+json.savePath+json.name+"'></li>");
|
||||
var btn = $('<div class="del-btn"><span class="ui-icon-delete"></span></div>');
|
||||
tdiv.append(btn);
|
||||
$('#edit_chart').append(tdiv);
|
||||
btn.on('click','span',function(){
|
||||
uploader.removeFile(file);
|
||||
$(this).parent().parent().remove();
|
||||
uploader.refresh();
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
progress:function(rate){
|
||||
$('#uploadMsg').show().html('已上传'+rate+"%");
|
||||
}
|
||||
});
|
||||
}
|
182
hyhproject/mobile2/view/default/users/orders/orders_complains.html
Executable file
182
hyhproject/mobile2/view/default/users/orders/orders_complains.html
Executable file
@ -0,0 +1,182 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}订单投诉 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__ROOT__/hyhproject/mobile/view/default/css/orders_complains.css?v={$v}">
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="useri_infos">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<a href="{:url('mobile/users/index')}"><i class="ui-icon-return"></i></a><h1 class="useri_info">订单投诉</h1>
|
||||
<i onclick="javascript:closeUploadArea()" style="display:none;font-size: 0.15rem;" id="upload_close">关闭</i>
|
||||
<a href="javascript:void(0);" style="display:none;float:right;font-size: 0.15rem;" id="upload_button">上传</a>
|
||||
</header>
|
||||
{/block}
|
||||
|
||||
{block name="main"}
|
||||
<sction class="ui-container" id="upload_modal">
|
||||
<div class="upload-modal">
|
||||
<div id="clipArea" class="clipArea"></div>
|
||||
<input type="hidden" id="imgData" autocomplete="off">
|
||||
</div>
|
||||
</sction>
|
||||
<input type="hidden" name="" value="" id="complainType" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$oId}" id="oId" autocomplete="off">
|
||||
<section class="ui-container" id="Ccontrainer">
|
||||
<script type="text/html" id="detailBox">
|
||||
<div id="detailBox">
|
||||
<div class="ui-row-flex ui-whitespace detail-head">
|
||||
<div class="ui-col ui-col ">订单号:{{d.orderNo}}</div>
|
||||
<div class="ui-col order-tr o-status">
|
||||
{{d.status}}
|
||||
{{# if($.inArray(d.orderStatus,[-1,-3])!=-1){ }}
|
||||
{{# if(d.isRefund==1) { }}
|
||||
(已退款)
|
||||
{{# }else{ }}
|
||||
(未退款)
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-row-flex-ver d-uInfo">
|
||||
<div class="ui-col">{{d.shopName}}</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{# for(var i=0;i<d.goods.length;i++){ }}
|
||||
<div class="ui-row-flex ui-whitespace border-b d-goodsitme">
|
||||
<div class="ui-col">
|
||||
<div class="o-Img j-imgAdapt">
|
||||
<a href="javascript:void(0);" onclick="javascript:WST.intoGoods({{d.goods[i]['goodsId']}});">
|
||||
<img src="__IMGURL__/{:WSTConf('CONF.goodsLogo')}" data-echo="__IMGURL__/{{d.goods[i].goodsImg}}">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi">{{d.goods[i].goodsName}}</p>
|
||||
|
||||
|
||||
<p class="o-gSpec d-gSpec">
|
||||
{{# if(d.goods[i].goodsSpecNames){ }}
|
||||
{{d.goods[i].goodsSpecNames.replace(/@@_@@/g,'<br />')}}
|
||||
{{# } }}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0;"><p class="price">¥ {{d.goods[i].goodsPrice}}</p><p> x {{d.goods[i].goodsNum}}</p></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<div class="ui-row-flex ui-whitespace d-item">
|
||||
<div class="ui-col ui-col">下单时间</div>
|
||||
<div class="ui-col ui-col order-tr">{{d.createTime}}</div>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace d-item" style="min-height:80px;">
|
||||
<div class="ui-col ui-col">商品总额</div>
|
||||
<div class="ui-col ui-col-4 order-tr">
|
||||
<p class="price">¥ {{d.goodsMoney}}</p>
|
||||
<p class="price"><span class="title">运费:</span>¥ {{d.deliverMoney}}</p>
|
||||
<p>实付款:<span class="price">¥ {{d.needPay}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<div id="orderDetail">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace d-item c-item">
|
||||
<div class="ui-col ui-col">投诉类型</div>
|
||||
<div class="ui-col ui-col-3 order-tr" onclick="dataShow(0)" id="complainText" >请选择投诉类型 > </div>
|
||||
</div>
|
||||
|
||||
<div class="ui-row-flex ui-whitespace ui-row-flex-ver c-box">
|
||||
<div class="ui-col c-title">投诉内容</div>
|
||||
<div class="ui-col c-content">
|
||||
<textarea id="complain"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="ui-col uploadfile-box">
|
||||
<ul class="complainFileBox" id="edit_chart">
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="filePicker" style='margin-left:5px;width:250px;overflow:hidden;height:35px;font-size:.13rem;'>上传附件(最多5张)</div>
|
||||
</div>
|
||||
|
||||
<div class="ui-btn-wrap" style="padding:5px;padding-bottom:5px;">
|
||||
<button class="ui-btn-lg ui-btn-danger c-btn" onclick="saveCom({$oId})">
|
||||
提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 订单详情层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title" id="boxTitle"><span>投诉类型</span><i class="ui-icon-close-page" onclick="javascript:dataHide(0);"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
|
||||
<ul class="ui-row complain-item">
|
||||
<li class="ui-col ui-col-75">承诺的没有做到</li>
|
||||
<li class="ui-col ui-col-25 chk-box">
|
||||
<label class="ui-checkbox">
|
||||
<input class="active" type="radio" name="data" value='1' >
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="ui-row complain-item">
|
||||
<li class="ui-col ui-col-75">未按约定时间发货</li>
|
||||
<li class="ui-col ui-col-25 chk-box">
|
||||
<label class="ui-checkbox">
|
||||
<input class="active" type="radio" name="data" value='2' >
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="ui-row complain-item">
|
||||
<li class="ui-col ui-col-75">未按成交价格进行交易</li>
|
||||
<li class="ui-col ui-col-25 chk-box">
|
||||
<label class="ui-checkbox">
|
||||
<input class="active" type="radio" name="data" value='3' >
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="ui-row complain-item">
|
||||
<li class="ui-col ui-col-75">恶意骚扰</li>
|
||||
<li class="ui-col ui-col-25 chk-box">
|
||||
<label class="ui-checkbox">
|
||||
<input class="active" type="radio" name="data" value='4' >
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="ui-btn-wrap">
|
||||
<button class="ui-btn-lg ui-btn-danger c-btn" onclick="dataHide(1)">
|
||||
确定
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_complains.js?v={$v}'></script>
|
||||
|
||||
|
||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
|
||||
{/block}
|
122
hyhproject/mobile2/view/default/users/orders/orders_complains.js
Executable file
122
hyhproject/mobile2/view/default/users/orders/orders_complains.js
Executable file
@ -0,0 +1,122 @@
|
||||
jQuery.noConflict();
|
||||
$(function(){
|
||||
getOrderDetail();
|
||||
userComplainInit();
|
||||
})
|
||||
function getOrderDetail(){
|
||||
var oid = $('#oId').val();
|
||||
$.post(WST.U('mobile/orders/getDetail'),{id:oid},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status!=-1){
|
||||
var gettpl1 = document.getElementById('detailBox').innerHTML;
|
||||
laytpl(gettpl1).render(json, function(html){
|
||||
$('#orderDetail').html(html);
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*********************** 投诉类型 ****************************/
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide(0);").show();
|
||||
jQuery('#frame').animate({"bottom": 0}, 500);
|
||||
}
|
||||
function dataHide(type){
|
||||
if(type==1){
|
||||
var flag=false,chk;
|
||||
$('.active').each(function(k,v){
|
||||
if($(this).prop('checked')){
|
||||
flag = true
|
||||
$('#complainType').val($(this).val());
|
||||
chk = $(this).parent().parent().siblings().html();
|
||||
}
|
||||
});
|
||||
if(!flag){
|
||||
WST.msg('请选择投诉类型');
|
||||
return;
|
||||
}
|
||||
$('#complainText').html(chk+' >');
|
||||
}
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'bottom': '-'+dataHeight}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
|
||||
function uploadFile(){
|
||||
$('#filePicker').trigger("click");
|
||||
}
|
||||
|
||||
|
||||
function saveCom(oId){
|
||||
// 验证投诉类型
|
||||
var type = $('#complainType').val();
|
||||
if(type==''){
|
||||
dataShow();
|
||||
WST.msg('请选择投诉类型','info');
|
||||
return;
|
||||
}
|
||||
var complainContent = $.trim($('#complain').val());
|
||||
if(complainContent==''){
|
||||
WST.msg('投诉内容不能为空','info');
|
||||
return;
|
||||
}
|
||||
var param = {};
|
||||
param.orderId = oId;
|
||||
param.complainType = type;
|
||||
param.complainContent = complainContent;
|
||||
|
||||
var imgs = [];
|
||||
// 是否有上传附件
|
||||
$('.imgSrc').each(function(k,v){
|
||||
imgs.push($(this).attr('v'));
|
||||
})
|
||||
imgs = imgs.join(',');
|
||||
if(imgs!='')
|
||||
param.complainAnnex = imgs;
|
||||
|
||||
$.post(WST.U('mobile/ordercomplains/saveComplain'),param,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(data.status){
|
||||
WST.msg('投诉成功请留意商城消息','success');
|
||||
setTimeout(function(){location.href=WST.U('mobile/ordercomplains/index')},1000);
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
/*************** 上传图片 *****************/
|
||||
function userComplainInit(){
|
||||
var uploader =WST.upload({
|
||||
pick:'#filePicker',
|
||||
formData: {dir:'complains',isThumb:1},
|
||||
fileNumLimit:5,
|
||||
accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
|
||||
callback:function(f,file){
|
||||
var json = WST.toJson(f);
|
||||
if(json.status==1){
|
||||
var tdiv = $("<li>"+
|
||||
"<img class='imgSrc' src='"+WST.conf.IMGURL+"/"+json.savePath+json.thumb+"' v='"+json.savePath+json.name+"'></li>");
|
||||
var btn = $('<div class="del-btn"><span class="ui-icon-delete"></span></div>');
|
||||
tdiv.append(btn);
|
||||
$('#edit_chart').append(tdiv);
|
||||
btn.on('click','span',function(){
|
||||
uploader.removeFile(file);
|
||||
$(this).parent().parent().remove();
|
||||
uploader.refresh();
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
progress:function(rate){
|
||||
$('#uploadMsg').show().html('已上传'+rate+"%");
|
||||
}
|
||||
});
|
||||
}
|
490
hyhproject/mobile2/view/default/users/orders/orders_list.html
Executable file
490
hyhproject/mobile2/view/default/users/orders/orders_list.html
Executable file
@ -0,0 +1,490 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的订单 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive wst-header wst-headero">
|
||||
<i class="ui-icon-return" onclick="location.href='{:url('mobile/users/index')}'"></i><h1>我的订单</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$type}" id="type" autocomplete="off">
|
||||
|
||||
<script id="shopList" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<div class="order-item">
|
||||
<div class="ui-row-flex ui-whitespace item-head">
|
||||
<div class="ui-col ui-col-2" onclick="javascript:WST.intoShops({{d[i].shopId}});"><p class="ui-nowrap-flex"><i class="shopicon"></i>{{d[i].shopName}}</p></div>
|
||||
<div class="ui-col order-tr o-status">
|
||||
{{ d[i].status }}
|
||||
{{# if($.inArray(d[i].orderStatus,[-1,-3])!=-1){ }}
|
||||
{{# if(d[i].payType==1 && d[i].isPay==1) { }}
|
||||
{{# if(d[i].isRefund==1) { }}
|
||||
(已退款)
|
||||
{{# }else{ }}
|
||||
(未退款)
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# for(var g=0;g<d[i].list.length;g++){ }}
|
||||
<div class="ui-row-flex ui-whitespace border-b" onclick="getOrderDetail({{d[i].orderId}})">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{{d[i].list[g].goodsImg}}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi ui-whitespace">{{d[i].list[g].goodsName}}</p>
|
||||
|
||||
{{# if(d[i].list[g].goodsSpecNames){ }}
|
||||
<p class="o-gSpec ui-nowrap-flex ui-whitespace">规格:{{d[i].list[g].goodsSpecNames}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;">
|
||||
{{# if(d[i].list[g].goodsCode=='gift'){ }}
|
||||
【赠品】
|
||||
{{# }else{ }}
|
||||
<p>¥ {{d[i].list[g].goodsPrice}}</p><p>x {{d[i].list[g].goodsNum}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<div class="ui-btn-wrap" style="padding:5px 0px;">
|
||||
{{# if(d[i].orderCodeTitle!=""){ }}
|
||||
<span class="order_from">{{d[i].orderCodeTitle}}</span>
|
||||
{{# } }}
|
||||
<div class="o-oListMoney">
|
||||
订单总价:<span>¥ {{d[i].realTotalMoney}}</span>
|
||||
</div>
|
||||
{{# if(d[i].orderStatus==-2){ }}
|
||||
<button class="ui-btn o-btn" onclick="choicePay({{d[i].orderNo}},0);">
|
||||
立即付款
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d[i].orderStatus==0 && d[i].noticeDeliver==0 ){ }}
|
||||
<button class="ui-btn o-btn o-cancel-btn" onclick="WST.dialog('您确定要提醒发货吗?','noticeDeliver({{d[i].orderId}})')">
|
||||
提醒发货
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
|
||||
{{# if(d[i].orderStatus==-2 || d[i].orderStatus==0){ }}
|
||||
<button class="ui-btn o-btn o-cancel-btn" onclick="showCancelBox('cancelOrder({{d[i].orderId}})')">
|
||||
取消订单
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
{{# if((d[i].orderStatus!=-1 || d[i].orderStatus==1) && d[i].orderStatus!=-2 && d[i].isComplain==0 ){ }}
|
||||
<button class="ui-btn o-btn o-cancel-btn" onclick="complain({{d[i].orderId}})">
|
||||
投诉
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d[i].orderStatus==2 && d[i].isAppraise==0) { }}
|
||||
<button class="ui-btn o-btn" onclick="toAppr({{d[i].orderId}})">
|
||||
评价
|
||||
</button>
|
||||
{{# } }}
|
||||
{{# if(d[i].isAppraise==1){ }}
|
||||
<button class="ui-btn o-btn" onclick="toAppr({{d[i].orderId}})">
|
||||
查看评价
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
|
||||
{{# if((d[i].allowRefund==1) && (d[i].orderStatus==-1 || d[i].orderStatus==-3)){ }}
|
||||
<button class="ui-btn o-btn" onclick="showRefundBox({{d[i].orderId}})">
|
||||
申请退款
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
|
||||
{{# if(d[i].orderStatus==1){ }}
|
||||
<button class="ui-btn o-btn o-cancel-btn" onclick="showRejectBox('rejectOrder({{d[i].orderId}})')">
|
||||
拒收
|
||||
</button>
|
||||
<button class="ui-btn o-btn" onclick="WST.dialog('你确定已收货吗?','receive({{d[i].orderId}})')">
|
||||
确认收货
|
||||
</button>
|
||||
{{# } }}
|
||||
{{ d[i]['hook']?d[i]['hook']:"" }}
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<section class="ui-container" id="shopBox">
|
||||
<div class="ui-tab">
|
||||
<ul class="ui-tab-nav order-tab">
|
||||
<li class="tab-item {if $type==''}tab-curr{/if}" type="" >全部</li>
|
||||
<li class="tab-item {if $type=='waitPay'}tab-curr{/if}" type="waitPay" >待付款</li>
|
||||
<li class="tab-item {if $type=='waitDeliver'}tab-curr{/if}" type="waitDeliver" >待发货</li>
|
||||
<li class="tab-item {if $type=='waitReceive'}tab-curr{/if}" type="waitReceive" >待收货</li>
|
||||
<li class="tab-item {if $type=='waitAppraise'}tab-curr{/if}" type="waitAppraise" >待评价</li>
|
||||
<li class="tab-item {if $type=='finish'}tab-curr{/if}" type="finish" >已完成</li>
|
||||
<li class="tab-item {if $type=='abnormal'}tab-curr{/if}" type="abnormal" >取消拒收</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="order-box">
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:hook('mobileDocumentOrderList')}
|
||||
|
||||
<script type="text/html" id="detailBox">
|
||||
<div id="detailBox">
|
||||
<div class="detail-head" style="margin-top:0;">
|
||||
{{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex">
|
||||
{{# if(d.payType==1) { }}
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>待付款</p></div>
|
||||
{{# } }}
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>待发货</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>已发货</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.orderStatus==2){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>已收货</p></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# if($.inArray(d.orderStatus,[-1,-3])!=-1 && d.payType==1 && d.isPay==1){ }}
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span class="active"></span>
|
||||
<span {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block active"></i></p>
|
||||
<div class="wst-clear"></div></p><p>卖家申请退款</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.refundStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>商家申请退款处理</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.refundStatus==2) { }} class="active"{{# } }}></span>
|
||||
<span {{# if(d.refundStatus==2) { }} class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.refundStatus==2) { }} active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>退款完成</p></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单状态:</span>
|
||||
<span class="o-status">{{d.status}}
|
||||
{{# if($.inArray(d.orderStatus,[-1,-3])!=-1){ }}
|
||||
{{# if(d.payType==1 && d.isPay==1) { }}
|
||||
{{# if(d.isRefund==1) { }}
|
||||
(已退款)
|
||||
{{# }else{ }}
|
||||
(未退款)
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单编号:</span>{{d.orderNo}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">下单时间:</span>{{d.createTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="detail-head">
|
||||
{{# if(d.userName){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">收货人:</span>{{d.userName}} <span class="d-utel">{{d.userPhone}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">收货地址:</span><span class="d-uaddr">{{d.userAddress}}<i></i></span></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">支付信息:</span>{{d.payInfo}}</div>
|
||||
</div>
|
||||
{{# if(d.payTime){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">支付时间:</span>{{d.payTime}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">配送信息:</span>{{d.deliverInfo}}</div>
|
||||
</div>
|
||||
{{# if(WST.blank(d.expressNo)!=''){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">快递公司:</span>{{d.expressName}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">快递号:</span>{{d.expressNo}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票信息:</span>{{# if(d.isInvoice==1) { }}需要{{# } else{ }}不需要{{# } }}</div>
|
||||
</div>
|
||||
{{# if(d.isInvoice==1) { }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票抬头:</span>{{d.invoiceClient}}</div>
|
||||
</div>
|
||||
{{#
|
||||
var inv_json = JSON.parse(d.invoiceJson);
|
||||
var inv_code = (inv_json!=null && inv_json.invoiceCode!=undefined)?inv_json.invoiceCode:'';
|
||||
if(inv_json!=null && inv_json.type!=undefined && inv_json.type==0){
|
||||
}}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票税号:</span>{{inv_code}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单备注:</span>{{d.orderRemarks}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# if(d.isRefund==1){ }}
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款金额:</span>¥ {{d.backMoney}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款备注:</span>{{d.refundRemark}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款时间:</span>{{d.refundTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex o-shops">
|
||||
<div class="ui-col ui-col wst-or-term"><p class="shops" onclick="javascript:WST.intoShops({{d.shopId}});"><i></i>{{d.shopName}}<p></div>
|
||||
</div>
|
||||
{{# for(var i=0;i<d.goods.length;i++){ }}
|
||||
<div class="ui-row-flex ui-whitespace border-b d-goodsitme" onclick="javascript:WST.intoGoods({{d.goods[i].goodsId}})">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{{d.goods[i].goodsImg}}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi ui-whitespace">{{d.goods[i].goodsName}}</p>
|
||||
<p class="o-gSpec d-gSpec">
|
||||
{{# if(d.goods[i].goodsSpecNames){ }}
|
||||
{{d.goods[i].goodsSpecNames.replace(/@@_@@/g,'<br />')}}
|
||||
{{# } }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0;">
|
||||
{{# if(d.goods[i].goodsCode=='gift'){ }}
|
||||
【赠品】
|
||||
{{# }else{ }}
|
||||
<p>¥ {{d.goods[i].goodsPrice}}</p><p>x {{d.goods[i].goodsNum}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
{{# if(d.goods[i].goodsType==1 && d.orderStatus==2){ }}
|
||||
{{# for(var e=0;e<d.goods[i].extraJson.length;e++){ }}
|
||||
<div class="ui-row-flex ui-row-flex-ver d-uInfo">
|
||||
<div class="ui-col">
|
||||
<p>卡券号:{{d.goods[i].extraJson[e].cardNo}}</p>
|
||||
<p>卡券密码:{{d.goods[i].extraJson[e].cardPwd}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">获得积分</span><span class="o-status2">{{d.orderScore}} 个</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">商品总额</span><span class="o-status2">¥ {{d.goodsMoney}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">运费</span><span class="o-status2">¥ {{d.deliverMoney}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">积分抵扣金额</span><span class="o-status2">¥ -{{d.scoreMoney}}</span></div>
|
||||
</div>
|
||||
{{# if(d.useScore>0){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">使用积分数</span><span class="o-status2">{{d.useScore}} 个</span></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{ d['hook']?d['hook']:"" }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term2"><span class="wst-or-describe2">实付款</span><span class="o-status2"><span style="font-size:0.13rem;">¥ </span>{{d.realTotalMoney}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 订单详情层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title" id="boxTitle"><span>订单详情</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/* 退款层 */}
|
||||
<div class="wst-fr-box" id="refundFrame">
|
||||
<div class="title"><span>申请退款</span><i class="ui-icon-close-page" onclick="javascript:reFundDataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="refund-content">
|
||||
<div class="detail-head" style="margin-top:0;">
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex" style="padding:10px;border-bottom:RGB(242,242,242) 2px dashed;">
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span class="active"></span>
|
||||
<span></span>
|
||||
<p class="icon"><i class="ui-icon-success-block active"></i></p>
|
||||
<div class="wst-clear"></div></p><p>卖家申请退款</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<p class="icon"><i class="ui-icon-success-block"></i></p>
|
||||
<div class="wst-clear"></div></p><p>商家申请退款处理</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<p class="icon"><i class="ui-icon-success-block"></i></p>
|
||||
<div class="wst-clear"></div></p><p>退款完成</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-or-refund">
|
||||
<p class="prompt">请选择取消订单申请退款的原因,以便我们能更好的为您服务。</p>
|
||||
<div class="term">
|
||||
<span class="sign">*</span>退款原因:
|
||||
<select id='refundReason' onchange='javascript:changeRefundType(this.value)'>
|
||||
{volist name=":WSTDatas('REFUND_TYPE')" id="vo"}
|
||||
<option value='{$vo["dataVal"]}'>{$vo["dataName"]}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="term">
|
||||
<span class="sign">*</span>退款金额: <input type='number' id='money' maxLength='10' onkeyup="javascript:WST.isChinese(this,1)" autocomplete="off">
|
||||
</div>
|
||||
<p class="prompt">(金额不能超过<font color='red' id="realTotalMoney">0</font>,<span id="useScore">0</span>个积分抵扣<font color='red' id="scoreMoney">¥ 0</font>)</p>
|
||||
<div class="term">
|
||||
<div id='refundTr' style="width:99%;display:none;" >
|
||||
<span class="sign">*</span>其他原因
|
||||
<textarea id='refundContent' style='width:100%;height:80px;padding: 5px;' maxLength='200'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<p class="cancel-btn-box ui-flex ui-flex-pack-center">
|
||||
<button id="wst-event8" type="button" class="ui-btn-s wst-dialog-b2">提交申请退款</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
<div class="ui-dialog" id="cancelBox">
|
||||
<div class="ui-dialog-cnt">
|
||||
<div class="ui-dialog-bd">
|
||||
<div class="ui-dialog-bd-title">请选择您取消订单的原因:</div>
|
||||
<select id='reason'>
|
||||
{volist name=":WSTDatas('ORDER_CANCEL')" id="vo"}
|
||||
<option value='{$vo["dataVal"]}'>{$vo["dataName"]}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
|
||||
<p class="cancel-btn-box">
|
||||
<button id="wst-event1" type="button" class="ui-btn-s wst-dialog-b1" data-role="button">取消</button>
|
||||
<button id="wst-event0" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="ui-dialog" id="rejectBox">
|
||||
<div class="ui-dialog-cnt">
|
||||
<div class="ui-dialog-bd">
|
||||
<div class="ui-dialog-bd-title">请选择您拒收订单的原因:</div>
|
||||
<select id='reject' onchange='javascript:changeRejectType(this.value)'>
|
||||
{volist name=":WSTDatas('ORDER_REJECT')" id="vo"}
|
||||
<option value='{$vo["dataVal"]}'>{$vo["dataName"]}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
<br />
|
||||
<div id='rejectTr' style='display:none'>
|
||||
原因<font color='red'>*</font>:
|
||||
<textarea id='content' style='width:99%;height:80px;' maxLength='200'></textarea>
|
||||
</div>
|
||||
|
||||
<p class="cancel-btn-box">
|
||||
<button id="wst-event1" type="button" class="ui-btn-s wst-dialog-b1" data-role="button">取消</button>
|
||||
<button id="wst-event3" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_list.js?v={$v}'></script>
|
||||
<script>
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getOrderList();
|
||||
WST.initFooter('user');
|
||||
backPrevPage(WST.U('mobile/users/index'));
|
||||
// Tab切换卡
|
||||
$('.tab-item').click(function(){
|
||||
$(this).addClass('tab-curr').siblings().removeClass('tab-curr');
|
||||
var type = $(this).attr('type');
|
||||
$('#type').val(type);
|
||||
reFlashList();
|
||||
});
|
||||
// 弹出层
|
||||
var w = WST.pageWidth();
|
||||
$("#frame").css('top',0);
|
||||
$("#frame").css('right',-w);
|
||||
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - $(window).height())) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getOrderList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
333
hyhproject/mobile2/view/default/users/orders/orders_list.js
Executable file
333
hyhproject/mobile2/view/default/users/orders/orders_list.js
Executable file
@ -0,0 +1,333 @@
|
||||
jQuery.noConflict();
|
||||
// 提醒发货
|
||||
function noticeDeliver(id){
|
||||
hideDialog('#wst-di-prompt');
|
||||
$.post(WST.U('mobile/orders/noticeDeliver'),{id:id},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
reFlashList();// 刷新列表
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 拒收
|
||||
function showNoticeBox(event){
|
||||
$("#wst-event4").attr("onclick","javascript:"+event);
|
||||
$("#noticeBox").dialog("show");
|
||||
}
|
||||
|
||||
|
||||
// 获取订单列表
|
||||
function getOrderList(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.type = $('#type').val();
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/orders/getOrderList'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('shopList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#order-box').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-order.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无相关订单</p>';
|
||||
html += '<button class="ui-btn-s" onclick="javascript:WST.intoIndex();">去逛逛</button>';
|
||||
html += '</div>';
|
||||
$('#order-box').html(html);
|
||||
}
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
|
||||
// 刷新列表页
|
||||
function reFlashList(){
|
||||
$('#currPage').val('0');
|
||||
$('#order-box').html(' ');
|
||||
getOrderList();
|
||||
}
|
||||
|
||||
function showCancelBox(event){
|
||||
$("#wst-event0").attr("onclick","javascript:"+event);
|
||||
$("#cancelBox").dialog("show");
|
||||
}
|
||||
// 取消订单
|
||||
function cancelOrder(oid){
|
||||
hideDialog('#cancelBox');
|
||||
$.post(WST.U('mobile/orders/cancellation'),{id:oid,reason:$('#reason').val()},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$('#order-box').html(' ');
|
||||
reFlashList();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 拒收
|
||||
function showRejectBox(event){
|
||||
$("#wst-event3").attr("onclick","javascript:"+event);
|
||||
$("#rejectBox").dialog("show");
|
||||
}
|
||||
|
||||
function rejectOrder(oid){
|
||||
var param = {};
|
||||
param.id=oid;
|
||||
param.reason=$('#reject').val();
|
||||
param.content=$('#content').val();
|
||||
if($('reject').val()==10000){
|
||||
var content = $.trim($('#content').val());
|
||||
if(content == '')
|
||||
WST.msg('请输入拒收原因','info');
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(WST.U('mobile/orders/reject'),param,function(data){
|
||||
|
||||
hideDialog('#rejectBox');
|
||||
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$('#content').val(' ');
|
||||
reFlashList();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//退款
|
||||
function showRefundBox(id){
|
||||
// 重置表单
|
||||
$('#refundReason').val(1);
|
||||
$('#refundContent').html(' ');
|
||||
$('#money').val(' ');
|
||||
$('#refundTr').hide();
|
||||
$.post(WST.U('mobile/orders/getRefund'),{id:id},function(data){
|
||||
$('#realTotalMoney').html('¥'+data.realTotalMoney);
|
||||
$('#useScore').html(data.useScore);
|
||||
$('#scoreMoney').html('¥ '+data.scoreMoney);
|
||||
// 弹出层滚动条
|
||||
var clientH = WST.pageHeight();// 屏幕高度
|
||||
var boxheadH = $('#refund-boxTitle').height();// 弹出层标题高度
|
||||
var contentH = $('#refund-content').height(); // 弹出层内容高度
|
||||
$('#refund-content').css('height',clientH-boxheadH+'px');
|
||||
$("#wst-event8").attr("onclick","javascript:refund("+id+")");
|
||||
reFundDataShow();
|
||||
})
|
||||
}
|
||||
function changeRefundType(v){
|
||||
if(v==10000){
|
||||
$('#refundTr').show();
|
||||
}else{
|
||||
$('#refundTr').hide();
|
||||
}
|
||||
}
|
||||
//弹框
|
||||
function reFundDataHide(){
|
||||
$('#shopBox').show();
|
||||
var dataHeight = $("#refundFrame").css('height');
|
||||
var dataWidth = $("#refundFrame").css('width');
|
||||
jQuery('#refundFrame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
function reFundDataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:reFundDataHide();").show();
|
||||
jQuery('#refundFrame').animate({"right": 0}, 500);
|
||||
setTimeout(function(){$('#shopBox').hide();},600)
|
||||
}
|
||||
// 退款
|
||||
function refund(id){
|
||||
var params = {};
|
||||
params.reason = $.trim($('#refundReason').val());
|
||||
params.content = $.trim($('#refundContent').val());
|
||||
params.money = $.trim($('#money').val());
|
||||
params.id = id;
|
||||
if(params.money<0 || params.money==''){
|
||||
WST.msg('无效的退款金额','info');
|
||||
return;
|
||||
}
|
||||
if(params.reason==10000){
|
||||
var content = $.trim($('#refundContent').val());
|
||||
if(content == ''){
|
||||
WST.msg('请输入原因','info');
|
||||
return;
|
||||
}
|
||||
}
|
||||
$.post(WST.U('mobile/orderrefunds/refund'),params,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg('申请退款成功','success');
|
||||
history.go(0);
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function changeRejectType(v){
|
||||
if(v==10000){
|
||||
$('#rejectTr').show();
|
||||
}else{
|
||||
$('#rejectTr').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏对话框
|
||||
function hideDialog(id){
|
||||
$(id).dialog("hide");
|
||||
}
|
||||
|
||||
// 确认收货
|
||||
function receive(oid){
|
||||
hideDialog('#wst-di-prompt');
|
||||
$.post(WST.U('mobile/orders/receive'),{id:oid},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
reFlashList();// 刷新列表
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********************** 订单详情 ****************************/
|
||||
//弹框
|
||||
function dataShow(title){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"right": 0}, 500);
|
||||
setTimeout(function(){$('#shopBox').hide();},600)
|
||||
$('#wordTitle').html(title);
|
||||
}
|
||||
function dataHide(){
|
||||
$('#shopBox').show();
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getOrderDetail(oid){
|
||||
$.post(WST.U('mobile/orders/getDetail'),{id:oid},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status!=-1){
|
||||
var gettpl1 = document.getElementById('detailBox').innerHTML;
|
||||
laytpl(gettpl1).render(json, function(html){
|
||||
$('#content').html(html);
|
||||
// 弹出层滚动条
|
||||
var clientH = WST.pageHeight();// 屏幕高度
|
||||
var boxheadH = $('#boxTitle').height();// 弹出层标题高度
|
||||
var contentH = $('#content').height(); // 弹出层内容高度
|
||||
$('#content').css('height',clientH-boxheadH+'px');
|
||||
dataShow('订单详情');
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
// 跳转到评价页
|
||||
function toAppr(oid){
|
||||
location.href=WST.U('mobile/orders/orderappraise',{'oId':oid});
|
||||
}
|
||||
// 投诉
|
||||
function complain(oid){
|
||||
location.href=WST.U('mobile/ordercomplains/complain',{'oId':oid});
|
||||
}
|
||||
|
||||
//余额支付
|
||||
function walletPay(type){
|
||||
var payPwd = $('#payPwd').val();
|
||||
if(!payPwd){
|
||||
WST.msg('请输入支付密码','info');
|
||||
return;
|
||||
}
|
||||
if(type==0){
|
||||
var payPwd2 = $('#payPwd2').val();
|
||||
if(payPwd2==''){
|
||||
WST.msg('确认密码不能为空','info');
|
||||
return false;
|
||||
}
|
||||
if(payPwd!=payPwd2){
|
||||
WST.msg('确认密码不一致','info');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
var payPwd = rsa.encrypt(payPwd);
|
||||
}
|
||||
var params = {};
|
||||
if(type==0){
|
||||
params.newPass = payPwd;
|
||||
$.post(WST.U('mobile/users/editpayPwd'),params,function(data,textStatus){
|
||||
WST.noload();
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.load('成功设置密码,<br>订单支付中···');
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}else{
|
||||
WST.load('正在核对密码···');
|
||||
}
|
||||
params.payPwd = payPwd;
|
||||
params.orderNo = $('#orderNo').val();
|
||||
params.isBatch = $('#isBatch').val();
|
||||
$('.wst-btn-dangerlo').attr('disabled', 'disabled');
|
||||
setTimeout(function(){
|
||||
$.post(WST.U('mobile/wallets/payByWallet'),params,function(data,textStatus){
|
||||
WST.noload();
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/orders/index');
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
setTimeout(function(){
|
||||
$('.wst-btn-dangerlo').removeAttr('disabled');
|
||||
},2000);
|
||||
}
|
||||
});
|
||||
},1000);
|
||||
}
|
||||
//选择支付方式
|
||||
function choicePay(orderNo,isBatch){
|
||||
location.href=WST.U('mobile/orders/succeed',{'orderNo':orderNo,'isBatch':isBatch});
|
||||
}
|
||||
//跳转支付
|
||||
function toPay(orderNo,isBatch,n){
|
||||
if(n=='alipays'){
|
||||
location.href=WST.U('mobile/alipays/toAliPay',{'orderNo':orderNo,'isBatch':isBatch});
|
||||
}else if(n=='wallets'){
|
||||
location.href = WST.U('mobile/wallets/payment',{"orderNo":orderNo,'isBatch':isBatch});
|
||||
}else if(n=='weixinpays'){
|
||||
location.href = WST.U('mobile/weixinpays/toWeixinPay',{"orderNo":orderNo,'isBatch':isBatch});
|
||||
}
|
||||
}
|
62
hyhproject/mobile2/view/default/users/orders/orders_pay.html
Executable file
62
hyhproject/mobile2/view/default/users/orders/orders_pay.html
Executable file
@ -0,0 +1,62 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的订单 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header class="ui-header ui-header-positive wst-header">
|
||||
<a class="ui-icon-return" href='{:Url('mobile/orders/index')}'></a><h1>支付订单</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
||||
<section class="ui-container" id="shopBox">
|
||||
{volist name="$rs['list']" id="order"}
|
||||
<div class="order-item">
|
||||
<div class="ui-row-flex item-head" onclick="getOrderDetail({{d[i].orderId}})">
|
||||
<div class="ui-col ui-col-2 ui-nowrap-flex">订单号:{$order['orderNo']}<span style="float : right;">邮费:{$order['deliverMoney']}</span></div>
|
||||
</div>
|
||||
{volist name="$rs['goods'][$order['orderId']]" id="vo"}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{$vo['goodsImg']}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi">{$vo['goodsName']}</p>
|
||||
{if condition="count($vo['goodsSpecNames']) gt 0"}
|
||||
<p class="o-gSpec ui-nowrap-flex">规格:
|
||||
{volist name="$vo['goodsSpecNames']" id="spec"}
|
||||
{$spec}
|
||||
{/volist}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0"><p>¥ {$vo['goodsPrice']}</p><p>x {$vo['goodsNum']}</p></div>
|
||||
</div>
|
||||
{/volist}
|
||||
|
||||
<div class="ui-btn-wrap" style="text-align: right;padding:10px 0">
|
||||
<span class="wst-orders_pricet">总金额:<span class="wst-orders_prices">¥ <?php echo sprintf("%.2f", $rs['totalMoney']);?></span></span>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
{/volist}
|
||||
<div style="text-align: center;padding-top: 20px;">
|
||||
<button type="button" class="wst-btn-dangerlo" onclick="javascript:callpay();" style="width: 80%; display: inline-block;">确认支付</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_list.js?v={$v}'></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
backPrevPage(WST.U('mobile/orders/index'));
|
||||
});
|
||||
</script>
|
||||
{/block}
|
27
hyhproject/mobile2/view/default/users/orders/orders_pay_list.html
Executable file
27
hyhproject/mobile2/view/default/users/orders/orders_pay_list.html
Executable file
@ -0,0 +1,27 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}选择支付方式 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>选择支付方式</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container">
|
||||
<ul class="ui-list ui-list-text ui-list-link wst-pa-l">
|
||||
{volist name="$payments[1]" id="pa"}
|
||||
<li class="line" onclick="javascript:toPay({$orderNo},{$isBatch},'{$pa['payCode']}');">
|
||||
<span class="{$pa['payCode']}"></span><h5 class="ui-nowrap">{$pa['payName']}</h5>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_list.js?v={$v}'></script>
|
||||
{/block}
|
86
hyhproject/mobile2/view/default/users/orders/orders_pay_wallets.html
Executable file
86
hyhproject/mobile2/view/default/users/orders/orders_pay_wallets.html
Executable file
@ -0,0 +1,86 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}支付订单 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header class="ui-header ui-header-positive wst-header">
|
||||
<a class="ui-icon-return" href='{:Url('mobile/orders/index')}'></a><h1>支付订单</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" value="{:WSTConf('CONF.pwdModulusKey')}" id="key" autocomplete="off">
|
||||
{/* 大加载 */}
|
||||
<div class="ui-loading-block" id="Loadl">
|
||||
<div class="ui-loading-cnt">
|
||||
<i class="ui-loading-bright"></i>
|
||||
<p id="j-Loadl">正在加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
<section class="ui-container">
|
||||
{if(empty($message))}
|
||||
<input type="hidden" name="" value="{$data['orderNo']}" id="orderNo" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$data['isBatch']}" id="isBatch" autocomplete="off">
|
||||
{volist name="$rs['list']" id="order"}
|
||||
<div class="order-item">
|
||||
<div class="ui-row-flex item-head">
|
||||
<div class="ui-col ui-col-2 ui-nowrap-flex">订单号:{$order['orderNo']}<span style="float : right;">邮费:{$order['deliverMoney']}</span></div>
|
||||
</div>
|
||||
{volist name="$rs['goods'][$order['orderId']]" id="vo"}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{$vo['goodsImg']}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi">{$vo['goodsName']}</p>
|
||||
{if condition="count($vo['goodsSpecNames']) gt 0"}
|
||||
<p class="o-gSpec ui-nowrap-flex">规格:
|
||||
{volist name="$vo['goodsSpecNames']" id="spec"}
|
||||
{$spec}
|
||||
{/volist}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0"><p>¥ {$vo['goodsPrice']}</p><p>x {$vo['goodsNum']}</p></div>
|
||||
</div>
|
||||
{/volist}
|
||||
<div class="ui-btn-wrap" style="text-align: right;padding:10px 0">
|
||||
<span class="wst-orders_pricet">总金额:<span class="wst-orders_prices">¥ <?php echo sprintf("%.2f", $rs['totalMoney']);?></span></span>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
{/volist}
|
||||
<div class="wst-wa-info">
|
||||
<p class="info">钱包余额:<span>¥ {$userMoney}</span>,待支付订单总额:<span>¥ {$needPay}</span></p>
|
||||
{if($payPwd==0)}
|
||||
<p class="pay-info">您尚未设置支付密码,请设置支付密码</p>
|
||||
<div class="pay">设置密码:<input type="password" id="payPwd" maxlength="30" autocomplete="off"></div>
|
||||
<div class="pay">确认密码:<input type="password" id="payPwd2" maxlength="30" autocomplete="off"></div>
|
||||
{else}
|
||||
<div class="pay">支付密码:<input type="password" id="payPwd" maxlength="30" autocomplete="off"></div>
|
||||
{/if}
|
||||
</div>
|
||||
{if($payPwd==1)}<div class="wst-wa-forget ui-whitespace"><a href="{:url('mobile/users/backPayPass')}">忘记密码?</a></div>{/if}
|
||||
<div style="text-align: center;">
|
||||
<button type="button" class="wst-btn-dangerlo" onclick="javascript:walletPay({$payPwd});" style="width: 80%; display: inline-block;">确认支付</button>
|
||||
</div>
|
||||
{else}
|
||||
<ul class="ui-row-flex wst-flexslp">
|
||||
<li class="ui-col ui-flex ui-flex-pack-center">
|
||||
<p>{$message}</p>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</section>
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript" src="__STATIC__/js/rsa.js"></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/orders/orders_list.js?v={$v}'></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
backPrevPage(WST.U('mobile/orders/index'));
|
||||
});
|
||||
</script>
|
||||
{/block}
|
103
hyhproject/mobile2/view/default/users/orders/orders_wxpay.html
Executable file
103
hyhproject/mobile2/view/default/users/orders/orders_wxpay.html
Executable file
@ -0,0 +1,103 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}
|
||||
{$payObj=='recharge'?"在线充值":"支付订单"}
|
||||
- {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header class="ui-header ui-header-positive wst-header">
|
||||
{if($payObj=='recharge')}
|
||||
<a class="ui-icon-return" href='{:Url('mobile/logmoneys/usermoneys')}'></a><h1>在线充值</h1>
|
||||
{else}
|
||||
<a class="ui-icon-return" href='{:Url('mobile/orders/index')}'></a><h1>支付订单</h1>
|
||||
{/if}
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container" id="shopBox">
|
||||
{if(empty($message))}
|
||||
{if($payObj=='recharge')}
|
||||
<div class="recharge-box">
|
||||
<div>钱包充值</div>
|
||||
<div class="paybox"><span class="wst-orders_prices">¥ {$needPay}</span></div>
|
||||
</div>
|
||||
{else}
|
||||
{volist name="$rs['list']" id="order"}
|
||||
<div class="order-item">
|
||||
<div class="ui-row-flex item-head" onclick="getOrderDetail({{d[i].orderId}})">
|
||||
<div class="ui-col ui-col-2 ui-nowrap-flex">订单号:{$order['orderNo']}<span style="float : right;">邮费:{$order['deliverMoney']}</span></div>
|
||||
</div>
|
||||
{volist name="$rs['goods'][$order['orderId']]" id="vo"}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{$vo['goodsImg']}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi">{$vo['goodsName']}</p>
|
||||
{if condition="count($vo['goodsSpecNames']) gt 0"}
|
||||
<p class="o-gSpec ui-nowrap-flex">规格:
|
||||
{volist name="$vo['goodsSpecNames']" id="spec"}
|
||||
{$spec}
|
||||
{/volist}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0"><p>¥ {$vo['goodsPrice']}</p><p>x {$vo['goodsNum']}</p></div>
|
||||
</div>
|
||||
{/volist}
|
||||
|
||||
<div class="ui-btn-wrap" style="text-align: right;padding:10px 0">
|
||||
<span class="wst-orders_pricet">总金额:<span class="wst-orders_prices">¥ <?php echo sprintf("%.2f", $rs['totalMoney']);?></span></span>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
{/volist}
|
||||
{/if}
|
||||
<div style="text-align: center;padding-top: 20px;">
|
||||
<button type="button" class="wst-btn-dangerlo" onclick="javascript:callpay();" style="width: 80%; display: inline-block;">确认支付</button>
|
||||
</div>
|
||||
</section>
|
||||
{else}
|
||||
<ul class="ui-row-flex wst-flexslp">
|
||||
<li class="ui-col ui-flex ui-flex-pack-center">
|
||||
<p>{$message}</p>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="ui-dialog" id="wst-di-wxpay">
|
||||
<div class="ui-dialog-cnt">
|
||||
<header class="ui-dialog-hd ui-border-b">
|
||||
<h3>请确认微信支付已完成</h3>
|
||||
<i class="ui-dialog-close" data-role="button"></i>
|
||||
</header>
|
||||
<div class="ui-dialog-hd ui-border-b">
|
||||
<a href="{$returnUrl}"><div style="color:red;">已完成支付</div></a>
|
||||
</div>
|
||||
<div class="ui-dialog-hd ui-border-b">
|
||||
<a href=""><div >支付遇到问题,重新支付</div></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="js"}
|
||||
|
||||
{if(empty($message))}
|
||||
<script type="text/javascript">
|
||||
function callpay(){
|
||||
$("#wst-di-wxpay").dialog("show");
|
||||
location.href = "{$mweb_url}";
|
||||
}
|
||||
$(document).ready(function(){
|
||||
{if($payObj=='recharge')}
|
||||
backPrevPage(WST.U('mobile/logmoneys/usermoneys'));
|
||||
{else}
|
||||
backPrevPage(WST.U('mobile/orders/index'));
|
||||
{/if}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
{/block}
|
614
hyhproject/mobile2/view/default/users/qrcode.js
Executable file
614
hyhproject/mobile2/view/default/users/qrcode.js
Executable file
@ -0,0 +1,614 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* - Using the 'QRCode for Javascript library'
|
||||
* - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
|
||||
* - this library has no dependencies.
|
||||
*
|
||||
* @author davidshimjs
|
||||
* @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a>
|
||||
* @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a>
|
||||
*/
|
||||
var QRCode;
|
||||
|
||||
(function () {
|
||||
//---------------------------------------------------------------------
|
||||
// QRCode for JavaScript
|
||||
//
|
||||
// Copyright (c) 2009 Kazuhiko Arase
|
||||
//
|
||||
// URL: http://www.d-project.com/
|
||||
//
|
||||
// Licensed under the MIT license:
|
||||
// http://www.opensource.org/licenses/mit-license.php
|
||||
//
|
||||
// The word "QR Code" is registered trademark of
|
||||
// DENSO WAVE INCORPORATED
|
||||
// http://www.denso-wave.com/qrcode/faqpatent-e.html
|
||||
//
|
||||
//---------------------------------------------------------------------
|
||||
function QR8bitByte(data) {
|
||||
this.mode = QRMode.MODE_8BIT_BYTE;
|
||||
this.data = data;
|
||||
this.parsedData = [];
|
||||
|
||||
// Added to support UTF-8 Characters
|
||||
for (var i = 0, l = this.data.length; i < l; i++) {
|
||||
var byteArray = [];
|
||||
var code = this.data.charCodeAt(i);
|
||||
|
||||
if (code > 0x10000) {
|
||||
byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);
|
||||
byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);
|
||||
byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);
|
||||
byteArray[3] = 0x80 | (code & 0x3F);
|
||||
} else if (code > 0x800) {
|
||||
byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);
|
||||
byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);
|
||||
byteArray[2] = 0x80 | (code & 0x3F);
|
||||
} else if (code > 0x80) {
|
||||
byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);
|
||||
byteArray[1] = 0x80 | (code & 0x3F);
|
||||
} else {
|
||||
byteArray[0] = code;
|
||||
}
|
||||
|
||||
this.parsedData.push(byteArray);
|
||||
}
|
||||
|
||||
this.parsedData = Array.prototype.concat.apply([], this.parsedData);
|
||||
|
||||
if (this.parsedData.length != this.data.length) {
|
||||
this.parsedData.unshift(191);
|
||||
this.parsedData.unshift(187);
|
||||
this.parsedData.unshift(239);
|
||||
}
|
||||
}
|
||||
|
||||
QR8bitByte.prototype = {
|
||||
getLength: function (buffer) {
|
||||
return this.parsedData.length;
|
||||
},
|
||||
write: function (buffer) {
|
||||
for (var i = 0, l = this.parsedData.length; i < l; i++) {
|
||||
buffer.put(this.parsedData[i], 8);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function QRCodeModel(typeNumber, errorCorrectLevel) {
|
||||
this.typeNumber = typeNumber;
|
||||
this.errorCorrectLevel = errorCorrectLevel;
|
||||
this.modules = null;
|
||||
this.moduleCount = 0;
|
||||
this.dataCache = null;
|
||||
this.dataList = [];
|
||||
}
|
||||
|
||||
QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);}
|
||||
return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row<this.moduleCount;row++){this.modules[row]=new Array(this.moduleCount);for(var col=0;col<this.moduleCount;col++){this.modules[row][col]=null;}}
|
||||
this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(test,maskPattern);if(this.typeNumber>=7){this.setupTypeNumber(test);}
|
||||
if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}
|
||||
this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
|
||||
return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row<this.modules.length;row++){var y=row*cs;for(var col=0;col<this.modules[row].length;col++){var x=col*cs;var dark=this.modules[row][col];if(dark){qr_mc.beginFill(0,100);qr_mc.moveTo(x,y);qr_mc.lineTo(x+cs,y);qr_mc.lineTo(x+cs,y+cs);qr_mc.lineTo(x,y+cs);qr_mc.endFill();}}}
|
||||
return qr_mc;},setupTimingPattern:function(){for(var r=8;r<this.moduleCount-8;r++){if(this.modules[r][6]!=null){continue;}
|
||||
this.modules[r][6]=(r%2==0);}
|
||||
for(var c=8;c<this.moduleCount-8;c++){if(this.modules[6][c]!=null){continue;}
|
||||
this.modules[6][c]=(c%2==0);}},setupPositionAdjustPattern:function(){var pos=QRUtil.getPatternPosition(this.typeNumber);for(var i=0;i<pos.length;i++){for(var j=0;j<pos.length;j++){var row=pos[i];var col=pos[j];if(this.modules[row][col]!=null){continue;}
|
||||
for(var r=-2;r<=2;r++){for(var c=-2;c<=2;c++){if(r==-2||r==2||c==-2||c==2||(r==0&&c==0)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}}}},setupTypeNumber:function(test){var bits=QRUtil.getBCHTypeNumber(this.typeNumber);for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}
|
||||
for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}
|
||||
for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}
|
||||
this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex<data.length){dark=(((data[byteIndex]>>>bitIndex)&1)==1);}
|
||||
var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}
|
||||
this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}
|
||||
row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;i<dataList.length;i++){var data=dataList[i];buffer.put(data.mode,4);buffer.put(data.getLength(),QRUtil.getLengthInBits(data.mode,typeNumber));data.write(buffer);}
|
||||
var totalDataCount=0;for(var i=0;i<rsBlocks.length;i++){totalDataCount+=rsBlocks[i].dataCount;}
|
||||
if(buffer.getLengthInBits()>totalDataCount*8){throw new Error("code length overflow. ("
|
||||
+buffer.getLengthInBits()
|
||||
+">"
|
||||
+totalDataCount*8
|
||||
+")");}
|
||||
if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}
|
||||
while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}
|
||||
while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}
|
||||
buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}
|
||||
buffer.put(QRCodeModel.PAD1,8);}
|
||||
return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r<rsBlocks.length;r++){var dcCount=rsBlocks[r].dataCount;var ecCount=rsBlocks[r].totalCount-dcCount;maxDcCount=Math.max(maxDcCount,dcCount);maxEcCount=Math.max(maxEcCount,ecCount);dcdata[r]=new Array(dcCount);for(var i=0;i<dcdata[r].length;i++){dcdata[r][i]=0xff&buffer.buffer[i+offset];}
|
||||
offset+=dcCount;var rsPoly=QRUtil.getErrorCorrectPolynomial(ecCount);var rawPoly=new QRPolynomial(dcdata[r],rsPoly.getLength()-1);var modPoly=rawPoly.mod(rsPoly);ecdata[r]=new Array(rsPoly.getLength()-1);for(var i=0;i<ecdata[r].length;i++){var modIndex=i+modPoly.getLength()-ecdata[r].length;ecdata[r][i]=(modIndex>=0)?modPoly.get(modIndex):0;}}
|
||||
var totalCodeCount=0;for(var i=0;i<rsBlocks.length;i++){totalCodeCount+=rsBlocks[i].totalCount;}
|
||||
var data=new Array(totalCodeCount);var index=0;for(var i=0;i<maxDcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<dcdata[r].length){data[index++]=dcdata[r][i];}}}
|
||||
for(var i=0;i<maxEcCount;i++){for(var r=0;r<rsBlocks.length;r++){if(i<ecdata[r].length){data[index++]=ecdata[r][i];}}}
|
||||
return data;};var QRMode={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3};var QRErrorCorrectLevel={L:1,M:0,Q:3,H:2};var QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:(1<<10)|(1<<8)|(1<<5)|(1<<4)|(1<<2)|(1<<1)|(1<<0),G18:(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)|(1<<5)|(1<<2)|(1<<0),G15_MASK:(1<<14)|(1<<12)|(1<<10)|(1<<4)|(1<<1),getBCHTypeInfo:function(data){var d=data<<10;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)>=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}
|
||||
return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}
|
||||
return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;}
|
||||
return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i<errorCorrectLength;i++){a=a.multiply(new QRPolynomial([1,QRMath.gexp(i)],0));}
|
||||
return a;},getLengthInBits:function(mode,type){if(1<=type&&type<10){switch(mode){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw new Error("mode:"+mode);}}else if(type<27){switch(mode){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw new Error("mode:"+mode);}}else if(type<41){switch(mode){case QRMode.MODE_NUMBER:return 14;case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw new Error("mode:"+mode);}}else{throw new Error("type:"+type);}},getLostPoint:function(qrCode){var moduleCount=qrCode.getModuleCount();var lostPoint=0;for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount;col++){var sameCount=0;var dark=qrCode.isDark(row,col);for(var r=-1;r<=1;r++){if(row+r<0||moduleCount<=row+r){continue;}
|
||||
for(var c=-1;c<=1;c++){if(col+c<0||moduleCount<=col+c){continue;}
|
||||
if(r==0&&c==0){continue;}
|
||||
if(dark==qrCode.isDark(row+r,col+c)){sameCount++;}}}
|
||||
if(sameCount>5){lostPoint+=(3+sameCount-5);}}}
|
||||
for(var row=0;row<moduleCount-1;row++){for(var col=0;col<moduleCount-1;col++){var count=0;if(qrCode.isDark(row,col))count++;if(qrCode.isDark(row+1,col))count++;if(qrCode.isDark(row,col+1))count++;if(qrCode.isDark(row+1,col+1))count++;if(count==0||count==4){lostPoint+=3;}}}
|
||||
for(var row=0;row<moduleCount;row++){for(var col=0;col<moduleCount-6;col++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row,col+1)&&qrCode.isDark(row,col+2)&&qrCode.isDark(row,col+3)&&qrCode.isDark(row,col+4)&&!qrCode.isDark(row,col+5)&&qrCode.isDark(row,col+6)){lostPoint+=40;}}}
|
||||
for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount-6;row++){if(qrCode.isDark(row,col)&&!qrCode.isDark(row+1,col)&&qrCode.isDark(row+2,col)&&qrCode.isDark(row+3,col)&&qrCode.isDark(row+4,col)&&!qrCode.isDark(row+5,col)&&qrCode.isDark(row+6,col)){lostPoint+=40;}}}
|
||||
var darkCount=0;for(var col=0;col<moduleCount;col++){for(var row=0;row<moduleCount;row++){if(qrCode.isDark(row,col)){darkCount++;}}}
|
||||
var ratio=Math.abs(100*darkCount/moduleCount/moduleCount-50)/5;lostPoint+=ratio*10;return lostPoint;}};var QRMath={glog:function(n){if(n<1){throw new Error("glog("+n+")");}
|
||||
return QRMath.LOG_TABLE[n];},gexp:function(n){while(n<0){n+=255;}
|
||||
while(n>=256){n-=255;}
|
||||
return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<<i;}
|
||||
for(var i=8;i<256;i++){QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];}
|
||||
for(var i=0;i<255;i++){QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;}
|
||||
function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);}
|
||||
var offset=0;while(offset<num.length&&num[offset]==0){offset++;}
|
||||
this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}
|
||||
QRPolynomial.prototype={get:function(index){return this.num[index];},getLength:function(){return this.num.length;},multiply:function(e){var num=new Array(this.getLength()+e.getLength()-1);for(var i=0;i<this.getLength();i++){for(var j=0;j<e.getLength();j++){num[i+j]^=QRMath.gexp(QRMath.glog(this.get(i))+QRMath.glog(e.get(j)));}}
|
||||
return new QRPolynomial(num,0);},mod:function(e){if(this.getLength()-e.getLength()<0){return this;}
|
||||
var ratio=QRMath.glog(this.get(0))-QRMath.glog(e.get(0));var num=new Array(this.getLength());for(var i=0;i<this.getLength();i++){num[i]=this.get(i);}
|
||||
for(var i=0;i<e.getLength();i++){num[i]^=QRMath.gexp(QRMath.glog(e.get(i))+ratio);}
|
||||
return new QRPolynomial(num,0).mod(e);}};function QRRSBlock(totalCount,dataCount){this.totalCount=totalCount;this.dataCount=dataCount;}
|
||||
QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(typeNumber,errorCorrectLevel){var rsBlock=QRRSBlock.getRsBlockTable(typeNumber,errorCorrectLevel);if(rsBlock==undefined){throw new Error("bad rs block @ typeNumber:"+typeNumber+"/errorCorrectLevel:"+errorCorrectLevel);}
|
||||
var length=rsBlock.length/3;var list=[];for(var i=0;i<length;i++){var count=rsBlock[i*3+0];var totalCount=rsBlock[i*3+1];var dataCount=rsBlock[i*3+2];for(var j=0;j<count;j++){list.push(new QRRSBlock(totalCount,dataCount));}}
|
||||
return list;};QRRSBlock.getRsBlockTable=function(typeNumber,errorCorrectLevel){switch(errorCorrectLevel){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[(typeNumber-1)*4+3];default:return undefined;}};function QRBitBuffer(){this.buffer=[];this.length=0;}
|
||||
QRBitBuffer.prototype={get:function(index){var bufIndex=Math.floor(index/8);return((this.buffer[bufIndex]>>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i<length;i++){this.putBit(((num>>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}
|
||||
if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));}
|
||||
this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];
|
||||
|
||||
function _isSupportCanvas() {
|
||||
return typeof CanvasRenderingContext2D != "undefined";
|
||||
}
|
||||
|
||||
// android 2.x doesn't support Data-URI spec
|
||||
function _getAndroid() {
|
||||
var android = false;
|
||||
var sAgent = navigator.userAgent;
|
||||
|
||||
if (/android/i.test(sAgent)) { // android
|
||||
android = true;
|
||||
var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i);
|
||||
|
||||
if (aMat && aMat[1]) {
|
||||
android = parseFloat(aMat[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return android;
|
||||
}
|
||||
|
||||
var svgDrawer = (function() {
|
||||
|
||||
var Drawing = function (el, htOption) {
|
||||
this._el = el;
|
||||
this._htOption = htOption;
|
||||
};
|
||||
|
||||
Drawing.prototype.draw = function (oQRCode) {
|
||||
var _htOption = this._htOption;
|
||||
var _el = this._el;
|
||||
var nCount = oQRCode.getModuleCount();
|
||||
var nWidth = Math.floor(_htOption.width / nCount);
|
||||
var nHeight = Math.floor(_htOption.height / nCount);
|
||||
|
||||
this.clear();
|
||||
|
||||
function makeSVG(tag, attrs) {
|
||||
var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
|
||||
for (var k in attrs)
|
||||
if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);
|
||||
return el;
|
||||
}
|
||||
|
||||
var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight});
|
||||
svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
||||
_el.appendChild(svg);
|
||||
|
||||
svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"}));
|
||||
svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"}));
|
||||
|
||||
for (var row = 0; row < nCount; row++) {
|
||||
for (var col = 0; col < nCount; col++) {
|
||||
if (oQRCode.isDark(row, col)) {
|
||||
var child = makeSVG("use", {"x": String(col), "y": String(row)});
|
||||
child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template")
|
||||
svg.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Drawing.prototype.clear = function () {
|
||||
while (this._el.hasChildNodes())
|
||||
this._el.removeChild(this._el.lastChild);
|
||||
};
|
||||
return Drawing;
|
||||
})();
|
||||
|
||||
var useSVG = document.documentElement.tagName.toLowerCase() === "svg";
|
||||
|
||||
// Drawing in DOM by using Table tag
|
||||
var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {
|
||||
var Drawing = function (el, htOption) {
|
||||
this._el = el;
|
||||
this._htOption = htOption;
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the QRCode
|
||||
*
|
||||
* @param {QRCode} oQRCode
|
||||
*/
|
||||
Drawing.prototype.draw = function (oQRCode) {
|
||||
var _htOption = this._htOption;
|
||||
var _el = this._el;
|
||||
var nCount = oQRCode.getModuleCount();
|
||||
var nWidth = Math.floor(_htOption.width / nCount);
|
||||
var nHeight = Math.floor(_htOption.height / nCount);
|
||||
var aHTML = ['<table style="border:0;border-collapse:collapse;">'];
|
||||
|
||||
for (var row = 0; row < nCount; row++) {
|
||||
aHTML.push('<tr>');
|
||||
|
||||
for (var col = 0; col < nCount; col++) {
|
||||
aHTML.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:' + nWidth + 'px;height:' + nHeight + 'px;background-color:' + (oQRCode.isDark(row, col) ? _htOption.colorDark : _htOption.colorLight) + ';"></td>');
|
||||
}
|
||||
|
||||
aHTML.push('</tr>');
|
||||
}
|
||||
|
||||
aHTML.push('</table>');
|
||||
_el.innerHTML = aHTML.join('');
|
||||
|
||||
// Fix the margin values as real size.
|
||||
var elTable = _el.childNodes[0];
|
||||
var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;
|
||||
var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;
|
||||
|
||||
if (nLeftMarginTable > 0 && nTopMarginTable > 0) {
|
||||
elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px";
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the QRCode
|
||||
*/
|
||||
Drawing.prototype.clear = function () {
|
||||
this._el.innerHTML = '';
|
||||
};
|
||||
|
||||
return Drawing;
|
||||
})() : (function () { // Drawing in Canvas
|
||||
function _onMakeImage() {
|
||||
this._elImage.src = this._elCanvas.toDataURL("image/png");
|
||||
this._elImage.style.display = "block";
|
||||
this._elCanvas.style.display = "none";
|
||||
}
|
||||
|
||||
// Android 2.1 bug workaround
|
||||
// http://code.google.com/p/android/issues/detail?id=5141
|
||||
if (this._android && this._android <= 2.1) {
|
||||
var factor = 1 / window.devicePixelRatio;
|
||||
var drawImage = CanvasRenderingContext2D.prototype.drawImage;
|
||||
CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {
|
||||
if (("nodeName" in image) && /img/i.test(image.nodeName)) {
|
||||
for (var i = arguments.length - 1; i >= 1; i--) {
|
||||
arguments[i] = arguments[i] * factor;
|
||||
}
|
||||
} else if (typeof dw == "undefined") {
|
||||
arguments[1] *= factor;
|
||||
arguments[2] *= factor;
|
||||
arguments[3] *= factor;
|
||||
arguments[4] *= factor;
|
||||
}
|
||||
|
||||
drawImage.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the user's browser supports Data URI or not
|
||||
*
|
||||
* @private
|
||||
* @param {Function} fSuccess Occurs if it supports Data URI
|
||||
* @param {Function} fFail Occurs if it doesn't support Data URI
|
||||
*/
|
||||
function _safeSetDataURI(fSuccess, fFail) {
|
||||
var self = this;
|
||||
self._fFail = fFail;
|
||||
self._fSuccess = fSuccess;
|
||||
|
||||
// Check it just once
|
||||
if (self._bSupportDataURI === null) {
|
||||
var el = document.createElement("img");
|
||||
var fOnError = function() {
|
||||
self._bSupportDataURI = false;
|
||||
|
||||
if (self._fFail) {
|
||||
self._fFail.call(self);
|
||||
}
|
||||
};
|
||||
var fOnSuccess = function() {
|
||||
self._bSupportDataURI = true;
|
||||
|
||||
if (self._fSuccess) {
|
||||
self._fSuccess.call(self);
|
||||
}
|
||||
};
|
||||
|
||||
el.onabort = fOnError;
|
||||
el.onerror = fOnError;
|
||||
el.onload = fOnSuccess;
|
||||
el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data.
|
||||
return;
|
||||
} else if (self._bSupportDataURI === true && self._fSuccess) {
|
||||
self._fSuccess.call(self);
|
||||
} else if (self._bSupportDataURI === false && self._fFail) {
|
||||
self._fFail.call(self);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Drawing QRCode by using canvas
|
||||
*
|
||||
* @constructor
|
||||
* @param {HTMLElement} el
|
||||
* @param {Object} htOption QRCode Options
|
||||
*/
|
||||
var Drawing = function (el, htOption) {
|
||||
this._bIsPainted = false;
|
||||
this._android = _getAndroid();
|
||||
|
||||
this._htOption = htOption;
|
||||
this._elCanvas = document.createElement("canvas");
|
||||
this._elCanvas.width = htOption.width;
|
||||
this._elCanvas.height = htOption.height;
|
||||
el.appendChild(this._elCanvas);
|
||||
this._el = el;
|
||||
this._oContext = this._elCanvas.getContext("2d");
|
||||
this._bIsPainted = false;
|
||||
this._elImage = document.createElement("img");
|
||||
this._elImage.alt = "Scan me!";
|
||||
this._elImage.style.display = "none";
|
||||
this._el.appendChild(this._elImage);
|
||||
this._bSupportDataURI = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the QRCode
|
||||
*
|
||||
* @param {QRCode} oQRCode
|
||||
*/
|
||||
Drawing.prototype.draw = function (oQRCode) {
|
||||
var _elImage = this._elImage;
|
||||
var _oContext = this._oContext;
|
||||
var _htOption = this._htOption;
|
||||
|
||||
var nCount = oQRCode.getModuleCount();
|
||||
var nWidth = _htOption.width / nCount;
|
||||
var nHeight = _htOption.height / nCount;
|
||||
var nRoundedWidth = Math.round(nWidth);
|
||||
var nRoundedHeight = Math.round(nHeight);
|
||||
|
||||
_elImage.style.display = "none";
|
||||
this.clear();
|
||||
|
||||
for (var row = 0; row < nCount; row++) {
|
||||
for (var col = 0; col < nCount; col++) {
|
||||
var bIsDark = oQRCode.isDark(row, col);
|
||||
var nLeft = col * nWidth;
|
||||
var nTop = row * nHeight;
|
||||
_oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
|
||||
_oContext.lineWidth = 1;
|
||||
_oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;
|
||||
_oContext.fillRect(nLeft, nTop, nWidth, nHeight);
|
||||
|
||||
// 안티 앨리어싱 방지 처리
|
||||
_oContext.strokeRect(
|
||||
Math.floor(nLeft) + 0.5,
|
||||
Math.floor(nTop) + 0.5,
|
||||
nRoundedWidth,
|
||||
nRoundedHeight
|
||||
);
|
||||
|
||||
_oContext.strokeRect(
|
||||
Math.ceil(nLeft) - 0.5,
|
||||
Math.ceil(nTop) - 0.5,
|
||||
nRoundedWidth,
|
||||
nRoundedHeight
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._bIsPainted = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Make the image from Canvas if the browser supports Data URI.
|
||||
*/
|
||||
Drawing.prototype.makeImage = function () {
|
||||
if (this._bIsPainted) {
|
||||
_safeSetDataURI.call(this, _onMakeImage);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return whether the QRCode is painted or not
|
||||
*
|
||||
* @return {Boolean}
|
||||
*/
|
||||
Drawing.prototype.isPainted = function () {
|
||||
return this._bIsPainted;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the QRCode
|
||||
*/
|
||||
Drawing.prototype.clear = function () {
|
||||
this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);
|
||||
this._bIsPainted = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Number} nNumber
|
||||
*/
|
||||
Drawing.prototype.round = function (nNumber) {
|
||||
if (!nNumber) {
|
||||
return nNumber;
|
||||
}
|
||||
|
||||
return Math.floor(nNumber * 1000) / 1000;
|
||||
};
|
||||
|
||||
return Drawing;
|
||||
})();
|
||||
|
||||
/**
|
||||
* Get the type by string length
|
||||
*
|
||||
* @private
|
||||
* @param {String} sText
|
||||
* @param {Number} nCorrectLevel
|
||||
* @return {Number} type
|
||||
*/
|
||||
function _getTypeNumber(sText, nCorrectLevel) {
|
||||
var nType = 1;
|
||||
var length = _getUTF8Length(sText);
|
||||
|
||||
for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
|
||||
var nLimit = 0;
|
||||
|
||||
switch (nCorrectLevel) {
|
||||
case QRErrorCorrectLevel.L :
|
||||
nLimit = QRCodeLimitLength[i][0];
|
||||
break;
|
||||
case QRErrorCorrectLevel.M :
|
||||
nLimit = QRCodeLimitLength[i][1];
|
||||
break;
|
||||
case QRErrorCorrectLevel.Q :
|
||||
nLimit = QRCodeLimitLength[i][2];
|
||||
break;
|
||||
case QRErrorCorrectLevel.H :
|
||||
nLimit = QRCodeLimitLength[i][3];
|
||||
break;
|
||||
}
|
||||
|
||||
if (length <= nLimit) {
|
||||
break;
|
||||
} else {
|
||||
nType++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nType > QRCodeLimitLength.length) {
|
||||
throw new Error("Too long data");
|
||||
}
|
||||
|
||||
return nType;
|
||||
}
|
||||
|
||||
function _getUTF8Length(sText) {
|
||||
var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
|
||||
return replacedText.length + (replacedText.length != sText ? 3 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @class QRCode
|
||||
* @constructor
|
||||
* @example
|
||||
* new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie");
|
||||
*
|
||||
* @example
|
||||
* var oQRCode = new QRCode("test", {
|
||||
* text : "http://naver.com",
|
||||
* width : 128,
|
||||
* height : 128
|
||||
* });
|
||||
*
|
||||
* oQRCode.clear(); // Clear the QRCode.
|
||||
* oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode.
|
||||
*
|
||||
* @param {HTMLElement|String} el target element or 'id' attribute of element.
|
||||
* @param {Object|String} vOption
|
||||
* @param {String} vOption.text QRCode link data
|
||||
* @param {Number} [vOption.width=256]
|
||||
* @param {Number} [vOption.height=256]
|
||||
* @param {String} [vOption.colorDark="#000000"]
|
||||
* @param {String} [vOption.colorLight="#ffffff"]
|
||||
* @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H]
|
||||
*/
|
||||
QRCode = function (el, vOption) {
|
||||
this._htOption = {
|
||||
width : 256,
|
||||
height : 256,
|
||||
typeNumber : 4,
|
||||
colorDark : "#000000",
|
||||
colorLight : "#ffffff",
|
||||
correctLevel : QRErrorCorrectLevel.H
|
||||
};
|
||||
|
||||
if (typeof vOption === 'string') {
|
||||
vOption = {
|
||||
text : vOption
|
||||
};
|
||||
}
|
||||
|
||||
// Overwrites options
|
||||
if (vOption) {
|
||||
for (var i in vOption) {
|
||||
this._htOption[i] = vOption[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof el == "string") {
|
||||
el = document.getElementById(el);
|
||||
}
|
||||
|
||||
if (this._htOption.useSVG) {
|
||||
Drawing = svgDrawer;
|
||||
}
|
||||
|
||||
this._android = _getAndroid();
|
||||
this._el = el;
|
||||
this._oQRCode = null;
|
||||
this._oDrawing = new Drawing(this._el, this._htOption);
|
||||
|
||||
if (this._htOption.text) {
|
||||
this.makeCode(this._htOption.text);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Make the QRCode
|
||||
*
|
||||
* @param {String} sText link data
|
||||
*/
|
||||
QRCode.prototype.makeCode = function (sText) {
|
||||
this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);
|
||||
this._oQRCode.addData(sText);
|
||||
this._oQRCode.make();
|
||||
this._el.title = sText;
|
||||
this._oDrawing.draw(this._oQRCode);
|
||||
this.makeImage();
|
||||
};
|
||||
|
||||
/**
|
||||
* Make the Image from Canvas element
|
||||
* - It occurs automatically
|
||||
* - Android below 3 doesn't support Data-URI spec.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
QRCode.prototype.makeImage = function () {
|
||||
if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) {
|
||||
this._oDrawing.makeImage();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the QRCode
|
||||
*/
|
||||
QRCode.prototype.clear = function () {
|
||||
this._oDrawing.clear();
|
||||
};
|
||||
|
||||
/**
|
||||
* @name QRCode.CorrectLevel
|
||||
*/
|
||||
QRCode.CorrectLevel = QRErrorCorrectLevel;
|
||||
})();
|
86
hyhproject/mobile2/view/default/users/recharge/recharge.html
Executable file
86
hyhproject/mobile2/view/default/users/recharge/recharge.html
Executable file
@ -0,0 +1,86 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的资金 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/recharge.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive wst-header">
|
||||
<i class="ui-icon-return" onclick="history.back()"></i><h1>充值</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
||||
<section class="ui-container">
|
||||
|
||||
<ul class="ui-grid-trisect">
|
||||
{volist name="chargeItems" id="item"}
|
||||
<li >
|
||||
<div class=" wst-frame2 {$key} " onclick="javascript:changeSelected({$item['id']},'itemId',this)">
|
||||
<div>
|
||||
{if condition="$item['giveMoney'] gt 0"}
|
||||
<div class='charge-doub'>充值 <span class="charge-money" id="needPay_{$item['id']}" sum="{$item['chargeMoney']}">{$item['chargeMoney']}</span> 元</div>
|
||||
<div>送 {$item['giveMoney']} 元</div>
|
||||
{else/}
|
||||
<div class='charge-alone'>充值 <span class="charge-money">{$item['chargeMoney']}</span> 元</div>
|
||||
{/if}
|
||||
</div>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
{/volist}
|
||||
<li >
|
||||
<div class="wst-frame2 " onclick="javascript:changeSelected(0,'itemId',this)">
|
||||
<div>
|
||||
<div class='charge-alone'>
|
||||
<span class="j-charge-other">其他金额</span>
|
||||
<span class="j-charge-money">
|
||||
<input class="charge-othermoney j-ipt" id="needPay" value="1" maxlength="10" data-rule="充值金额:required;" onkeypress="return WST.isNumberKey(event)" onkeyup="javascript:WST.isChinese(this,1)" maxlength="8">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
{php}
|
||||
$sum = 0;
|
||||
if($chargeItems){
|
||||
$sum = $chargeItems[0]['chargeMoney'];
|
||||
}
|
||||
{/php}
|
||||
<div class="wst-re-info">
|
||||
<p>当前余额<span class="balance">¥ <span>{$rs['userMoney']}</span></span></p>
|
||||
<p>充值金额<span class="balance">¥ <span id="rechargeMoney">{$sum}</span></span></p>
|
||||
</div>
|
||||
<div class="ui-form">
|
||||
{volist name="payments" id="payment" }
|
||||
<div class="ui-form-item ui-form-item-radio paytype-term">
|
||||
<label class="ui-checkbox" for="radio">
|
||||
<input type="radio" {if condition="$key eq 0"}checked{/if} name="payCode" value="{$payment['payCode']}">
|
||||
</label>
|
||||
<i class="{$payment['payCode']}"></i>
|
||||
<p>{$payment['payName']}</p>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
<div class="ui-btn-wrap">
|
||||
<button class="ui-btn-lg ui-btn-danger wst-re-button" onclick="toPay()">确认支付</button>
|
||||
</div>
|
||||
<div class="tips-box">
|
||||
<ul class="ui-row first-time">
|
||||
<li class="ui-col ui-col-100 ft-title"><i></i><span>充值说明:</span></li>
|
||||
<li class="ui-col ui-col-100 ft-item">1.充值金额和赠送金额只能用于购买商品,不能提现;</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="hidden" value="" id='itemId' class='j-ipt' />
|
||||
</section>
|
||||
{/block}
|
||||
|
||||
{block name="footer"}
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/recharge/recharge.js?v={$v}'></script>
|
||||
{/block}
|
52
hyhproject/mobile2/view/default/users/recharge/recharge.js
Executable file
52
hyhproject/mobile2/view/default/users/recharge/recharge.js
Executable file
@ -0,0 +1,52 @@
|
||||
jQuery.noConflict();
|
||||
function inEffect(obj,n){
|
||||
$("ul div").removeClass('j-selected');
|
||||
$(obj).addClass('j-selected');
|
||||
}
|
||||
function changeSelected(n,index,obj){
|
||||
$('#'+index).val(n);
|
||||
if(n==0){
|
||||
$(".j-charge-other").hide();
|
||||
$(".j-charge-money").show();
|
||||
var needPay = $("#needPay").val();
|
||||
|
||||
}else{
|
||||
$(".j-charge-other").show();
|
||||
$(".j-charge-money").hide();
|
||||
var needPay = $("#needPay_"+n).attr("sum");
|
||||
}
|
||||
rechargeMoney(needPay);
|
||||
inEffect(obj,2);
|
||||
}
|
||||
function rechargeMoney(n){
|
||||
$("#rechargeMoney").html(n);
|
||||
}
|
||||
|
||||
|
||||
function toPay(){
|
||||
var params = {};
|
||||
params.payObj = "recharge";
|
||||
params.targetType = 0;
|
||||
params.needPay = $.trim($("#needPay").val());
|
||||
params.payCode = $("input[name='payCode']:checked").val();
|
||||
params.itemId = $.trim($("#itemId").val());
|
||||
if(params.itemId==0 && params.needPay<=0){
|
||||
WST.msg('请输入充值金额', 'info');
|
||||
return;
|
||||
}
|
||||
if(params.payCode==""){
|
||||
WST.msg('请先选择支付方式','info');
|
||||
return;
|
||||
}
|
||||
if(params.payCode=="weixinpays"){
|
||||
location.href = WST.U('mobile/Weixinpays/toWeixinPay',params);
|
||||
}else{
|
||||
location.href = WST.U('mobile/Alipays/toAliPay',params);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(function(){
|
||||
jQuery(".wst-frame2:first").click();
|
||||
});
|
27
hyhproject/mobile2/view/default/users/security/index.html
Executable file
27
hyhproject/mobile2/view/default/users/security/index.html
Executable file
@ -0,0 +1,27 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}账户安全 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/security.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "账户安全"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container">
|
||||
<ul class="ui-list ui-list-text ui-list-link wst-se-l">
|
||||
<li class="line" onclick="javascript:inLogin();">
|
||||
<span class="pay"></span><h5 class="ui-nowrap">{if($user['loginPwd']==0)}设置{else}修改{/if}登录密码</h5></a>
|
||||
</li>
|
||||
<li class="line" onclick="javascript:inPay();">
|
||||
<span class="pay"></span><h5 class="ui-nowrap">{if($user['payPwd']==0)}设置{else}修改{/if}支付密码</h5></a>
|
||||
</li>
|
||||
<li onclick="javascript:inPhone();">
|
||||
<span class="phone"></span><h5 class="ui-nowrap">{if($user['userPhone']==0)}绑定{else}修改{/if}手机号码</h5>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/security/security.js?v={$v}'></script>
|
||||
{/block}
|
338
hyhproject/mobile2/view/default/users/security/security.js
Executable file
338
hyhproject/mobile2/view/default/users/security/security.js
Executable file
@ -0,0 +1,338 @@
|
||||
var time = 0;
|
||||
var isSend = false;
|
||||
$(document).ready(function(){
|
||||
WST.initFooter('user');
|
||||
});
|
||||
//修改登录密码
|
||||
function inLogin(){
|
||||
location.href = WST.U('mobile/users/editLoginPass');
|
||||
}
|
||||
function editLogin(type){
|
||||
if(type==1){
|
||||
var orloginPwd = $('#orloginPwd').val();
|
||||
if(orloginPwd==''){
|
||||
WST.msg('原密码不能为空','info');
|
||||
$('#orloginPwd').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var loginPwd = $('#loginPwd').val();
|
||||
var cologinPwd = $('#cologinPwd').val();
|
||||
if(loginPwd==''){
|
||||
WST.msg('新密码不能为空','info');
|
||||
$('#loginPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(cologinPwd==''){
|
||||
WST.msg('确认密码不能为空','info');
|
||||
$('#cologinPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(loginPwd.length < 6){
|
||||
WST.msg('请输入6位以上数字或者字母密码','info');
|
||||
$('#cologinPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(cologinPwd!=loginPwd){
|
||||
WST.msg('确认密码不一致','info');
|
||||
$('#cologinPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
if(type==1)var orloginPwd = rsa.encrypt(orloginPwd);
|
||||
var loginPwd = rsa.encrypt(loginPwd);
|
||||
}
|
||||
WST.load('设置中···');
|
||||
var param = {};
|
||||
param.type = type;
|
||||
if(type==1) param.oldPass = orloginPwd;
|
||||
param.newPass = loginPwd;
|
||||
$('#modifyPwd').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/users/editloginPwd'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/security');
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPwd').removeAttr('disabled').removeClass("active");
|
||||
}
|
||||
WST.noload();
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
//修改密码
|
||||
function inPay(){
|
||||
location.href = WST.U('mobile/users/editPayPass');
|
||||
}
|
||||
function editPay(type){
|
||||
if(type==1){
|
||||
var orpayPwd = $('#orpayPwd').val();
|
||||
if(orpayPwd==''){
|
||||
WST.msg('原密码不能为空','info');
|
||||
$('#orpayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var payPwd = $('#payPwd').val();
|
||||
var copayPwd = $('#copayPwd').val();
|
||||
if(payPwd==''){
|
||||
WST.msg('新密码不能为空','info');
|
||||
$('#payPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(copayPwd==''){
|
||||
WST.msg('确认密码不能为空','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(payPwd.length <6){
|
||||
WST.msg('请输入6位以上数字或者字母密码','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(copayPwd!=payPwd){
|
||||
WST.msg('确认密码不一致','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
if(type==1)var orpayPwd = rsa.encrypt(orpayPwd);
|
||||
var payPwd = rsa.encrypt(payPwd);
|
||||
}
|
||||
WST.load('设置中···');
|
||||
var param = {};
|
||||
param.type = type;
|
||||
if(type==1)param.oldPass = orpayPwd;
|
||||
param.newPass = payPwd;
|
||||
param.reNewPass = copayPwd;
|
||||
$('#modifyPwd').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/users/editpayPwd'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/security');
|
||||
},2000);
|
||||
}else if(json.status == -2){
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPwd').removeAttr('disabled').removeClass("active");
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPwd').removeAttr('disabled').removeClass("active");
|
||||
}
|
||||
WST.noload();
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
//找回支付密码
|
||||
function backpayCode(){
|
||||
if(WST.conf.SMS_VERFY==1){
|
||||
var smsVerfy = $('#smsVerfy').val();
|
||||
if(smsVerfy ==''){
|
||||
WST.msg('请输入验证码','info');
|
||||
$('#smsVerfy').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var param = {};
|
||||
param.smsVerfy = smsVerfy;
|
||||
if(isSend)return;
|
||||
isSend = true;
|
||||
$.post(WST.U('mobile/users/backpayCode'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
time = 120;
|
||||
$('#obtain').attr('disabled', 'disabled').html('120秒获取');
|
||||
var task = setInterval(function(){
|
||||
time--;
|
||||
$('#obtain').html(''+time+"秒获取");
|
||||
if(time==0){
|
||||
isSend = false;
|
||||
clearInterval(task);
|
||||
$('#obtain').removeAttr('disabled').html("重新发送");
|
||||
}
|
||||
},1000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
WST.getVerify("#verifyImg");
|
||||
isSend = false;
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
function backPaypwd(type){
|
||||
if(type==1){
|
||||
var payPwd = $('#payPwd').val();
|
||||
var copayPwd = $('#copayPwd').val();
|
||||
if(payPwd==''){
|
||||
WST.msg('新密码不能为空','info');
|
||||
$('#payPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(copayPwd==''){
|
||||
WST.msg('确认密码不能为空','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(payPwd.length !=6){
|
||||
WST.msg('请输入6位数字密码','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(copayPwd!=payPwd){
|
||||
WST.msg('确认密码不一致','info');
|
||||
$('#copayPwd').focus();
|
||||
return false;
|
||||
}
|
||||
if(window.conf.IS_CRYPTPWD==1){
|
||||
var public_key=$('#key').val();
|
||||
var exponent="10001";
|
||||
var rsa = new RSAKey();
|
||||
rsa.setPublic(public_key, exponent);
|
||||
var payPwd = rsa.encrypt(payPwd);
|
||||
}
|
||||
WST.load('设置中···');
|
||||
var param = {};
|
||||
param.newPass = payPwd;
|
||||
$('#modifyPwd').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/users/resetbackPay'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/security');
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPwd').removeAttr('disabled').removeClass("active");
|
||||
}
|
||||
WST.noload();
|
||||
data = json = null;
|
||||
});
|
||||
}else{
|
||||
var phoneCode = $('#phoneCode').val();
|
||||
if(phoneCode==''){
|
||||
WST.msg('请输入短信验证码','info');
|
||||
$('#phoneCode').focus();
|
||||
return false;
|
||||
}
|
||||
var param = {};
|
||||
param.phoneCode = phoneCode;
|
||||
$('#modifyPhone').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/users/verifybackPay'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/backPayPass');
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPhone').removeAttr('disabled').removeClass("active");
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
//修改手机
|
||||
function inPhone(){
|
||||
location.href = WST.U('mobile/users/editPhone');
|
||||
}
|
||||
//发送短信
|
||||
function obtainCode(type){
|
||||
if(type==0){
|
||||
var userPhone = $('#userPhone').val();
|
||||
if(userPhone ==''){
|
||||
WST.msg('请输入手机号码','info');
|
||||
$('#userPhone').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(WST.conf.SMS_VERFY==1){
|
||||
var smsVerfy = $('#smsVerfy').val();
|
||||
if(smsVerfy ==''){
|
||||
WST.msg('请输入验证码','info');
|
||||
$('#smsVerfy').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var param = {};
|
||||
param.userPhone = userPhone;
|
||||
param.smsVerfy = smsVerfy;
|
||||
if(isSend)return;
|
||||
isSend = true;
|
||||
$.post(WST.U('mobile/users/'+((type==0)?"sendCodeTie":"sendCodeEdit")), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
time = 120;
|
||||
$('#obtain').attr('disabled', 'disabled').html('120秒获取');
|
||||
var task = setInterval(function(){
|
||||
time--;
|
||||
$('#obtain').html(''+time+"秒获取");
|
||||
if(time==0){
|
||||
isSend = false;
|
||||
clearInterval(task);
|
||||
$('#obtain').removeAttr('disabled').html("重新发送");
|
||||
}
|
||||
},1000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
WST.getVerify("#verifyImg");
|
||||
isSend = false;
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
//修改手机号码
|
||||
function editPhone(type){
|
||||
if(type==0){
|
||||
var userPhone = $('#userPhone').val();
|
||||
if(userPhone==''){
|
||||
WST.msg('手机号码不能为空','info');
|
||||
$('#userPhone').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var phoneCode = $('#phoneCode').val();
|
||||
if(phoneCode==''){
|
||||
WST.msg('请输入短信验证码','info');
|
||||
$('#phoneCode').focus();
|
||||
return false;
|
||||
}
|
||||
var param = {};
|
||||
param.phoneCode = phoneCode;
|
||||
$('#modifyPhone').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/users/'+((type==0)?"phoneEdit":"phoneEdito")), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
if(type==0){
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/security');
|
||||
},2000);
|
||||
}else{
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/users/editPhoneo');
|
||||
},2000);
|
||||
}
|
||||
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('#modifyPhone').removeAttr('disabled').removeClass("active");
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
64
hyhproject/mobile2/view/default/users/security/user_back_paypwd.html
Executable file
64
hyhproject/mobile2/view/default/users/security/user_back_paypwd.html
Executable file
@ -0,0 +1,64 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}找回支付密码 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/security.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "找回支付密码"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{/* 大加载 */}
|
||||
<div class="ui-loading-block" id="Loadl">
|
||||
<div class="ui-loading-cnt">
|
||||
<i class="ui-loading-bright"></i>
|
||||
<p id="j-Loadl">正在加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
{if($user['phoneType']==1)}
|
||||
<div class="wst-se-footer">
|
||||
<button id="modifyPhone" type="button" class="button" onclick="javascript:backPaypwd({$user['backType']});">{if($user['backType']==0)}下一步{else}确定{/if}</button>
|
||||
</div>
|
||||
{else}
|
||||
<div class="wst-se-footer">
|
||||
<button id="modifyPhone" type="button" class="button" onclick="javascript:inPhone();">去绑定手机号码</button>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" value="{:WSTConf('CONF.pwdModulusKey')}" id="key" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
{if($user['backType']==1)}
|
||||
<div class="wst-se-pay">
|
||||
<div class="pay"><input id="payPwd" type="password" placeholder="新密码" maxlength="30"></div>
|
||||
<div class="pay"><input id="copayPwd" type="password" placeholder="确认密码" maxlength="30"></div>
|
||||
</div>
|
||||
{else}
|
||||
{if($user['phoneType']==1)}
|
||||
<div class="wst-se-pay">
|
||||
<div class="phone">您绑定的手机号码为:{$user['userPhone']}</div>
|
||||
{if(WSTConf('CONF.smsVerfy')==1)}
|
||||
<div class="verify">
|
||||
<input id="smsVerfy" type="text" placeholder="输入验证码" maxlength="10">
|
||||
<img id='verifyImg' src="{:url('mobile/users/getVerify')}" onclick='javascript:WST.getVerify("#verifyImg")'>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="verify">
|
||||
<input id="phoneCode" type="text" placeholder="输入短信验证码" maxlength="8">
|
||||
<button id="obtain" type="button" class="ui-btn-primary" onclick="javascript:backpayCode()">获取验证码</button>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<ul class="ui-row-flex wst-flexslp ui-whitespace">
|
||||
<li class="ui-col ui-flex ui-flex-pack-center">
|
||||
<p>对不起,你还未绑定手机号码,请去绑定手机号码。</p>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript" src="__STATIC__/js/rsa.js"></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/security/security.js?v={$v}'></script>
|
||||
{/block}
|
35
hyhproject/mobile2/view/default/users/security/user_login_pass.html
Executable file
35
hyhproject/mobile2/view/default/users/security/user_login_pass.html
Executable file
@ -0,0 +1,35 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}{if($user['loginPwd']==1)}修改{else}设置{/if}登录密码- {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/security.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$user['loginPwd']==1?$Title = "修改登录密码":$Title = "设置登录密码"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{/* 大加载 */}
|
||||
<div class="ui-loading-block" id="Loadl">
|
||||
<div class="ui-loading-cnt">
|
||||
<i class="ui-loading-bright"></i>
|
||||
<p id="j-Loadl">正在加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-se-footer">
|
||||
<button id="modifyPwd" type="button" class="button" onclick="javascript:editLogin({$user['loginPwd']});">确定</button>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" value="{:WSTConf('CONF.pwdModulusKey')}" id="key" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="wst-se-pay">
|
||||
{if($user['loginPwd']==1)}<div class="pay"><input id="orloginPwd" type="password" placeholder="原密码"></div>{/if}
|
||||
<div class="pay"><input id="loginPwd" type="password" placeholder="新密码"></div>
|
||||
<div class="pay"><input id="cologinPwd" type="password" placeholder="确认密码"></div>
|
||||
</div>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript" src="__STATIC__/js/rsa.js"></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/security/security.js?v={$v}'></script>
|
||||
{/block}
|
36
hyhproject/mobile2/view/default/users/security/user_pay_pass.html
Executable file
36
hyhproject/mobile2/view/default/users/security/user_pay_pass.html
Executable file
@ -0,0 +1,36 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}{if($user['payPwd']==1)}修改{else}设置{/if}支付密码 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/security.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$user['payPwd']==1?$Title = "修改支付密码":$Title = "设置支付密码"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{/* 大加载 */}
|
||||
<div class="ui-loading-block" id="Loadl">
|
||||
<div class="ui-loading-cnt">
|
||||
<i class="ui-loading-bright"></i>
|
||||
<p id="j-Loadl">正在加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-se-footer">
|
||||
<button id="modifyPwd" class="ui-btn-lg button" onclick="javascript:editPay({$user['payPwd']});">确定</button>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" value="{:WSTConf('CONF.pwdModulusKey')}" id="key" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="wst-se-pay">
|
||||
{if($user['payPwd']==1)}<div class="pay"><input id="orpayPwd" type="password" placeholder="原密码" maxlength="30"></div>{/if}
|
||||
<div class="pay"><input id="payPwd" type="password" placeholder="新密码" maxlength="30"></div>
|
||||
<div class="pay"><input id="copayPwd" type="password" placeholder="确认密码" maxlength="30"></div>
|
||||
</div>
|
||||
{if($user['payPwd']==1)}<p class="wst-se-back"><a href="{:url('mobile/users/backPayPass')}">忘记支付密码?</a></p>{/if}
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type="text/javascript" src="__STATIC__/js/rsa.js"></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/security/security.js?v={$v}'></script>
|
||||
{/block}
|
45
hyhproject/mobile2/view/default/users/security/user_phone.html
Executable file
45
hyhproject/mobile2/view/default/users/security/user_phone.html
Executable file
@ -0,0 +1,45 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}{if($user['phoneType']==1)}修改{else}绑定{/if}手机号码 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/security.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$user['phoneType']==1?$Title = "修改手机号码":$Title = "绑定手机号码"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{/* 大加载 */}
|
||||
<div class="ui-loading-block" id="Loadl">
|
||||
<div class="ui-loading-cnt">
|
||||
<i class="ui-loading-bright"></i>
|
||||
<p id="j-Loadl">正在加载中...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-se-footer">
|
||||
<button id="modifyPhone" class="ui-btn-lg button" onclick="javascript:editPhone({$user['phoneType']});">{if($user['phoneType']==1)}下一步{else}确定{/if}</button>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container">
|
||||
<div class="wst-se-pay">
|
||||
{if($user['phoneType']==1)}
|
||||
<div class="phone">您绑定的手机号码为:{$user['userPhone']}</div>
|
||||
{else}
|
||||
<div class="pay"><input id="userPhone" type="tel" placeholder="手机号码"></div>
|
||||
{/if}
|
||||
{if(WSTConf('CONF.smsVerfy')==1)}
|
||||
<div class="verify">
|
||||
<input id="smsVerfy" type="text" placeholder="输入验证码" maxlength="10">
|
||||
<img id='verifyImg' src="{:url('mobile/users/getVerify')}" onclick='javascript:WST.getVerify("#verifyImg")'>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="verify">
|
||||
<input id="phoneCode" type="text" placeholder="输入短信验证码" maxlength="8">
|
||||
<button id="obtain" class="ui-btn ui-btn-primary" onclick="javascript:obtainCode({$user['phoneType']})">获取验证码</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/security/security.js?v={$v}'></script>
|
||||
{/block}
|
439
hyhproject/mobile2/view/default/users/sellerorders/orders_list.html
Executable file
439
hyhproject/mobile2/view/default/users/sellerorders/orders_list.html
Executable file
@ -0,0 +1,439 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的订单 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/orders.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<div id="info_list">
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive wst-header wst-headero">
|
||||
<i class="ui-icon-return" onclick="location.href='{:url('mobile/users/index')}'"></i><h1>我的订单</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$type}" id="type" autocomplete="off">
|
||||
|
||||
<script id="shopList" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<div class="order-item">
|
||||
<div class="ui-row-flex ui-whitespace item-head" onclick="getOrderDetail({{d[i].orderId}})">
|
||||
<div class="ui-col ui-col-2 ui-nowrap-flex">订单号:{{d[i].orderNo}}
|
||||
{{#if(d[i].orderStatus==0 && d[i].noticeDeliver==1){}}<span class='notice'>
|
||||
<img style='width:0.2rem' src='{{WST.conf.ROOT}}\hyhproject\mobile\view\default\img\nocite_deliver.png'>提醒发货</span>
|
||||
{{#}}}
|
||||
</div>
|
||||
<div class="ui-col order-tr o-status">
|
||||
{{ d[i].status }}
|
||||
{{# if($.inArray(d[i].orderStatus,[-1,-3])!=-1){ }}
|
||||
{{# if(d[i].payType==1 && d[i].isPay==1) { }}
|
||||
{{# if(d[i].isRefund==1) { }}
|
||||
(已退款)
|
||||
{{# }else{ }}
|
||||
(未退款)
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# for(var g=0;g<d[i].list.length;g++){ }}
|
||||
<div class="ui-row-flex ui-whitespace border-b" onclick="getOrderDetail({{d[i].orderId}})">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{{d[i].list[g].goodsImg}}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi ui-whitespace">{{d[i].list[g].goodsName}}</p>
|
||||
|
||||
{{# if(d[i].list[g].goodsSpecNames){ }}
|
||||
<p class="o-gSpec ui-nowrap-flex ui-whitespace">规格:{{d[i].list[g].goodsSpecNames}}</p>
|
||||
{{# } }}
|
||||
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0;">
|
||||
{{# if(d[i].list[g].goodsCode=='gift'){ }}
|
||||
【赠品】
|
||||
{{# }else{ }}
|
||||
<p>¥ {{d[i].list[g].goodsPrice}}</p><p>x {{d[i].list[g].goodsNum}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<div style="padding-top:5px;padding-bottom:5px;">
|
||||
<div class="o-oListMoney">
|
||||
订单总价:<span>¥ {{d[i].realTotalMoney}}</span>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
{{# if(d[i].orderStatus==-2){ }}
|
||||
<button class="ui-btn o-btn" onclick="showEditMoneyBox('editOrderMoney({{d[i].orderId}})')">
|
||||
修改价格
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d[i].orderStatus==0){ }}
|
||||
<button class="ui-btn o-btn" onclick="toDeliver({{d[i].orderId}},{{d[i].deliverTypes}})">
|
||||
发货
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
{{# if(d[i].payType==1 && WST.blank(d[i].refundId)!=''){ }}
|
||||
<button class="ui-btn o-btn" onclick="showRefundBox({{d[i].refundId}})">
|
||||
退款操作
|
||||
</button>
|
||||
{{# } }}
|
||||
|
||||
|
||||
|
||||
|
||||
{{# if(d[i].isAppraise==1){ }}
|
||||
<button class="ui-btn o-btn" onclick="toAppr({{d[i].orderId}})">
|
||||
查看评价
|
||||
</button>
|
||||
{{# } }}
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<section class="ui-container" id="shopBox">
|
||||
<div class="ui-tab">
|
||||
<ul class="ui-tab-nav order-tab">
|
||||
<?php $shopMenus = WSTShopOrderMenus();?>
|
||||
{if (count($shopMenus)==6)}
|
||||
<li class="tab-item {if $type=='all'}tab-curr{/if}" type="all" >全部</li>
|
||||
{/if}
|
||||
{if array_key_exists("waitPay",$shopMenus)}
|
||||
<li class="tab-item {if $type=='waitPay'}tab-curr{/if}" type="waitPay" >待付款</li>
|
||||
{/if}
|
||||
{if array_key_exists("waitDeliver",$shopMenus)}
|
||||
<li class="tab-item {if $type=='waitDeliver'}tab-curr{/if}" type="waitDeliver" >待发货</li>
|
||||
{/if}
|
||||
{if array_key_exists("waitReceive",$shopMenus)}
|
||||
<li class="tab-item {if $type=='waitReceive'}tab-curr{/if}" type="waitReceive" >待收货</li>
|
||||
{/if}
|
||||
{if array_key_exists("waitAppraise",$shopMenus)}
|
||||
<li class="tab-item {if $type=='waitAppraise'}tab-curr{/if}" type="waitAppraise" >待评价</li>
|
||||
{/if}
|
||||
{if array_key_exists("finish",$shopMenus)}
|
||||
<li class="tab-item {if $type=='finish'}tab-curr{/if}" type="finish" >已完成</li>
|
||||
{/if}
|
||||
{if array_key_exists("abnormal",$shopMenus)}
|
||||
<li class="tab-item {if $type=='abnormal'}tab-curr{/if}" type="abnormal" >取消拒收</li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="order-box"></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="detailBox">
|
||||
<div id="detailBox">
|
||||
<div class="detail-head" style="margin-top:0;">
|
||||
{{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex">
|
||||
{{# if(d.payType==1) { }}
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[-2,0,1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>待付款</p></div>
|
||||
{{# } }}
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[0,1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>待发货</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if($.inArray(d.orderStatus,[1,2])!=-1){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>已发货</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.orderStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.orderStatus==2){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>已收货</p></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# if($.inArray(d.orderStatus,[-1,-3])!=-1 && d.payType==1 && d.isPay==1){ }}
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span class="active"></span>
|
||||
<span {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block active"></i></p>
|
||||
<div class="wst-clear"></div></p><p>卖家申请退款</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}class="active"{{# } }}></span>
|
||||
<span {{# if(d.refundStatus==2){ }}class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.refundStatus==1 || d.refundStatus==2 || d.refundStatus==0){ }}active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>商家申请退款处理</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span {{# if(d.refundStatus==2) { }} class="active"{{# } }}></span>
|
||||
<span {{# if(d.refundStatus==2) { }} class="active"{{# } }}></span>
|
||||
<p class="icon"><i class="ui-icon-success-block {{# if(d.refundStatus==2) { }} active{{# } }}"></i></p>
|
||||
<div class="wst-clear"></div></p><p>退款完成</p></div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单状态:</span>
|
||||
<span class="o-status">{{d.status}}
|
||||
{{# if($.inArray(d.orderStatus,[-1,-3])!=-1){ }}
|
||||
{{# if(d.payType==1 && d.isPay==1) { }}
|
||||
{{# if(d.isRefund==1) { }}
|
||||
(已退款)
|
||||
{{# }else{ }}
|
||||
(未退款)
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单编号:</span>{{d.orderNo}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">下单时间:</span>{{d.createTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="detail-head">
|
||||
{{# if(d.userName){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">收货人:</span>{{d.userName}} <span class="d-utel">{{d.userPhone}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">收货地址:</span><span class="d-uaddr">{{d.userAddress}}<i></i></span></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">支付信息:</span>{{d.payInfo}}</div>
|
||||
</div>
|
||||
{{# if(d.payTime){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">支付时间:</span>{{d.payTime}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">配送信息:</span>{{d.deliverInfo}}</div>
|
||||
</div>
|
||||
{{# if(WST.blank(d.expressNo)!=''){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">快递公司:</span>{{d.expressName}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">快递号:</span>{{d.expressNo}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票信息:</span>{{# if(d.isInvoice==1) { }}需要{{# } else{ }}不需要{{# } }}</div>
|
||||
</div>
|
||||
{{# if(d.isInvoice==1) { }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票抬头:</span>{{d.invoiceClient}}</div>
|
||||
</div>
|
||||
{{#
|
||||
var inv_json = JSON.parse(d.invoiceJson);
|
||||
var inv_code = (inv_json!=null && inv_json.invoiceCode!=undefined)?inv_json.invoiceCode:'';
|
||||
if(inv_json!=null && inv_json.type!=undefined && inv_json.type==0){
|
||||
}}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">发票税号:</span>{{inv_code}}</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">订单备注:</span>{{d.orderRemarks}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{# if(d.isRefund==1){ }}
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款金额:</span>¥ {{d.backMoney}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款备注:</span>{{d.refundRemark}}</div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe">退款时间:</span>{{d.refundTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
|
||||
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex o-shops">
|
||||
<div class="ui-col ui-col wst-or-term"><p class="shops" onclick="javascript:WST.intoShops({{d.shopId}});"><i></i>{{d.shopName}}<p></div>
|
||||
</div>
|
||||
{{# for(var i=0;i<d.goods.length;i++){ }}
|
||||
<p>商品编号: {{d.goods[i].goodsSn}}</p>
|
||||
<div class="ui-row-flex ui-whitespace border-b d-goodsitme" onclick="javascript:WST.intoGoods({{d.goods[i].goodsId}})">
|
||||
<div class="ui-col">
|
||||
<img src="__IMGURL__/{{d.goods[i].goodsImg}}" class="o-Img">
|
||||
</div>
|
||||
<div class="ui-col ui-col-3 o-gInfo">
|
||||
<p class="o-gName ui-nowrap-multi ui-whitespace">{{d.goods[i].goodsName}}</p>
|
||||
<p class="o-gSpec d-gSpec">
|
||||
{{# if(d.goods[i].goodsSpecNames){ }}
|
||||
{{d.goods[i].goodsSpecNames.replace(/@@_@@/g,'<br />')}}
|
||||
{{# } }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="ui-col order-tr" style="word-break:break-all;padding:5px 0;">
|
||||
{{# if(d.goods[i].goodsCode=='gift'){ }}
|
||||
【赠品】
|
||||
{{# }else{ }}
|
||||
<p>¥ {{d.goods[i].goodsPrice}}</p><p>x {{d.goods[i].goodsNum}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
{{# if(d.goods[i].goodsType==1 && d.orderStatus==2){ }}
|
||||
{{# for(var e=0;e<d.goods[i].extraJson.length;e++){ }}
|
||||
<div class="ui-row-flex ui-row-flex-ver d-uInfo">
|
||||
<div class="ui-col">
|
||||
<p>卡券号:{{d.goods[i].extraJson[e].cardNo}}</p>
|
||||
<p>卡券密码:{{d.goods[i].extraJson[e].cardPwd}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
{{# } }}
|
||||
</div>
|
||||
|
||||
<div class="detail-head">
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">获得积分</span><span class="o-status2">{{d.orderScore}} 个</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">商品总额</span><span class="o-status2">¥ {{d.goodsMoney}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">运费</span><span class="o-status2">¥ {{d.deliverMoney}}</span></div>
|
||||
</div>
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">积分抵扣金额</span><span class="o-status2">¥ -{{d.scoreMoney}}</span></div>
|
||||
</div>
|
||||
{{# if(d.useScore>0){ }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term"><span class="wst-or-describe2">使用积分数</span><span class="o-status2">{{d.useScore}} 个</span></div>
|
||||
</div>
|
||||
{{# } }}
|
||||
{{ d['hook']?d['hook']:"" }}
|
||||
<div class="ui-row-flex">
|
||||
<div class="ui-col ui-col wst-or-term2"><span class="wst-or-describe2">实付款</span><span class="o-status2"><span style="font-size:0.13rem;">¥ </span>{{d.realTotalMoney}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 订单详情层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title" id="boxTitle"><span>订单详情</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/* 退款层 */}
|
||||
<div class="wst-fr-box" id="refundFrame">
|
||||
<div class="title"><span>申请退款</span><i class="ui-icon-close-page" onclick="javascript:reFundDataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="refund-content">
|
||||
<div class="detail-head" style="margin-top:0;">
|
||||
<div class="wst-or-process">
|
||||
<div class="ui-row-flex" style="padding:10px;border-bottom:RGB(242,242,242) 2px dashed;">
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span class="active"></span>
|
||||
<span class="active"></span>
|
||||
<p class="icon"><i class="ui-icon-success-block active"></i></p>
|
||||
<div class="wst-clear"></div></p><p>卖家申请退款</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span class="active"></span>
|
||||
<span></span>
|
||||
<p class="icon"><i class="ui-icon-success-block active"></i></p>
|
||||
<div class="wst-clear"></div></p><p>商家申请退款处理</p></div>
|
||||
<div class="ui-col ui-col process"><p class="line">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<p class="icon"><i class="ui-icon-success-block"></i></p>
|
||||
<div class="wst-clear"></div></p><p>退款完成</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-or-refund">
|
||||
<p class="term" style="padding: 3px 5px 0 5px;">订单号:<span id="refundOid"></span></p>
|
||||
<p class="term" style="padding: 3px 5px 0 5px;">实付金额:<span id="realTotalMoney"></span></p>
|
||||
<p class="term" style="padding: 3px 5px 0 5px;">退款金额:<span id="refundMoney" class="sign"></span></p>
|
||||
<p class="term" style="padding: 3px 5px 0 5px;">退款积分:<span id="useScore" class="sign">0</span> 个(积分抵扣<span id="scoreMoney" class="sign">¥ 0</span>)</p>
|
||||
<p style="padding: 3px 5px 0 5px;">商家意见:
|
||||
<label><input type='radio' onclick='WST.showHide(0,"#tr")' name='refundStatus' id='refundStatus' value='1' checked/>同意</label>
|
||||
<label style='margin-left:15px;'><input type='radio' onclick='WST.showHide(1,"#tr")' name='refundStatus' id='refundStatus' value='-1'/>不同意</label>
|
||||
</p>
|
||||
<div class="term">
|
||||
<div id='tr' style="width:99%;display:none;" >
|
||||
<span class="sign">*</span>原因
|
||||
<textarea id='shopRejectReason' style='width:100%;height:80px;padding: 5px;' maxLength='200'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<p class="cancel-btn-box ui-flex ui-flex-pack-center">
|
||||
<button id="wst-event8" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{/* 发货 */}
|
||||
<div class="ui-dialog" id="deliveryBox">
|
||||
<div class="ui-dialog-cnt">
|
||||
<div class="ui-dialog-bd">
|
||||
快递公司:<br>
|
||||
<select id='expressId' style="height:30px;width:100%;">
|
||||
{volist name="$express" id="vo"}
|
||||
<option value='{$vo["expressId"]}'>{$vo["expressName"]}</option>
|
||||
{/volist}
|
||||
</select><br>
|
||||
快递号:<br>
|
||||
<input type="text" id="expressNo" style="float: left;height:30px;width:100%;"/>
|
||||
|
||||
<p class="cancel-btn-box">
|
||||
<button id="wst-event1" type="button" class="ui-btn-s wst-dialog-b1" data-role="button">取消</button>
|
||||
<button id="wst-event0" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 修改价格 */}
|
||||
<div class="ui-dialog" id="editMoneyBox">
|
||||
<div class="ui-dialog-cnt">
|
||||
<div class="ui-dialog-bd">
|
||||
新价格:<input type='text' id='newOrderMoney' maxLength='10' style='width:150px;height:30px' onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberdoteKey(event,true)" onblur='javascript:WST.limitDecimal(this,2)'>
|
||||
|
||||
<p class="cancel-btn-box">
|
||||
<button id="wst-event1" type="button" class="ui-btn-s wst-dialog-b1" data-role="button">取消</button>
|
||||
<button id="wst-event3" type="button" class="ui-btn-s wst-dialog-b2">确定</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/sellerorders/orders_list.js?v={$v}'></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// 弹出层
|
||||
var w = WST.pageWidth();
|
||||
$("#frame").css('top',0);
|
||||
$("#frame").css('right',-w);
|
||||
});
|
||||
</script>
|
||||
{/block}
|
288
hyhproject/mobile2/view/default/users/sellerorders/orders_list.js
Executable file
288
hyhproject/mobile2/view/default/users/sellerorders/orders_list.js
Executable file
@ -0,0 +1,288 @@
|
||||
jQuery.noConflict();
|
||||
// 获取订单列表
|
||||
function getOrderList(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.type = $('#type').val();
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
param.deliverType = -1;
|
||||
param.payType = -1;
|
||||
$.post(WST.U('mobile/orders/getSellerOrderList'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status>0){
|
||||
var html = '';
|
||||
json = json.data;
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('shopList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#order-box').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-order.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无相关订单</p>';
|
||||
html += '</div>';
|
||||
$('#order-box').html(html);
|
||||
}
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#type').val(jQuery("#shopBox li:first").attr("type"));
|
||||
jQuery("#shopBox li:first").addClass("tab-curr");
|
||||
getOrderList();
|
||||
|
||||
WST.initFooter('user');
|
||||
// Tab切换卡
|
||||
$('.tab-item').click(function(){
|
||||
$(this).addClass('tab-curr').siblings().removeClass('tab-curr');
|
||||
var type = $(this).attr('type');
|
||||
$('#type').val(type);
|
||||
reFlashList();
|
||||
});
|
||||
// 弹出层
|
||||
$("#frame").css('top',0);
|
||||
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getOrderList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 刷新列表页
|
||||
function reFlashList(){
|
||||
$('#currPage').val('0');
|
||||
$('#order-box').html(' ');
|
||||
getOrderList();
|
||||
}
|
||||
|
||||
|
||||
// 拒收
|
||||
function showEditMoneyBox(event){
|
||||
$("#wst-event3").attr("onclick","javascript:"+event);
|
||||
$("#editMoneyBox").dialog("show");
|
||||
}
|
||||
|
||||
function editOrderMoney(oid){
|
||||
var newOrderMoney = $('#newOrderMoney').val();
|
||||
$.post(WST.U('mobile/orders/editOrderMoney'),{id:oid,orderMoney:newOrderMoney},function(data){
|
||||
hideDialog('#editMoneyBox');
|
||||
var json = WST.toJson(data);
|
||||
if(json.status>0){
|
||||
$('#newOrderMoney').val(' ');
|
||||
WST.msg(json.msg,'success');
|
||||
reFlashList();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//退款
|
||||
function showRefundBox(id){
|
||||
$.post(WST.U('mobile/orders/toShopRefund'),{id:id},function(data){
|
||||
var json = WST.toJson(data);
|
||||
$('#refundOid').html(json.orderNo);
|
||||
$('#realTotalMoney').html('¥ '+json.realTotalMoney);
|
||||
$('#refundMoney').html('¥ '+json.backMoney);
|
||||
$('#useScore').html(json.useScore);
|
||||
$('#scoreMoney').html('¥ '+json.scoreMoney);
|
||||
// 弹出层滚动条
|
||||
var clientH = WST.pageHeight();// 屏幕高度
|
||||
var boxheadH = $('#refund-boxTitle').height();// 弹出层标题高度
|
||||
var contentH = $('#refund-content').height(); // 弹出层内容高度
|
||||
$('#refund-content').css('height',clientH-boxheadH+'px');
|
||||
$("#wst-event8").attr("onclick","javascript:refund("+id+")");
|
||||
reFundDataShow();
|
||||
})
|
||||
}
|
||||
//弹框
|
||||
function reFundDataHide(){
|
||||
$('#shopBox').show();
|
||||
var dataHeight = $("#refundFrame").css('height');
|
||||
var dataWidth = $("#refundFrame").css('width');
|
||||
jQuery('#refundFrame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
function reFundDataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:reFundDataHide();").show();
|
||||
jQuery('#refundFrame').animate({"right": 0}, 500);
|
||||
setTimeout(function(){$('#shopBox').hide();},600)
|
||||
}
|
||||
// 退款
|
||||
function refund(id){
|
||||
|
||||
var params = {};
|
||||
params.refundStatus = $('#refundStatus')[0].checked?1:-1;
|
||||
params.content = $.trim($('#shopRejectReason').val());
|
||||
params.id = id;
|
||||
if(params.refundStatus==-1 && params.content==''){
|
||||
WST.msg('请输入原因','info');
|
||||
return;
|
||||
}
|
||||
$.post(WST.U('mobile/orderrefunds/shoprefund'),params,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg('操作成功','success');
|
||||
history.go(0);
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 隐藏对话框
|
||||
function hideDialog(id){
|
||||
$(id).dialog("hide");
|
||||
}
|
||||
|
||||
// 确认收货
|
||||
function receive(oid){
|
||||
hideDialog('#wst-di-prompt');
|
||||
$.post(WST.U('mobile/orders/receive'),{id:oid},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
reFlashList();// 刷新列表
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*********************** 订单详情 ****************************/
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"right": 0}, 500);
|
||||
setTimeout(function(){$('#shopBox').hide();},600)
|
||||
|
||||
}
|
||||
function dataHide(){
|
||||
$('#shopBox').show();
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getOrderDetail(oid){
|
||||
$.post(WST.U('mobile/orders/getDetail'),{id:oid},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status!=-1){
|
||||
var gettpl1 = document.getElementById('detailBox').innerHTML;
|
||||
laytpl(gettpl1).render(json, function(html){
|
||||
$('#content').html(html);
|
||||
// 弹出层滚动条
|
||||
var clientH = WST.pageHeight();// 屏幕高度
|
||||
var boxheadH = $('#boxTitle').height();// 弹出层标题高度
|
||||
var contentH = $('#content').height(); // 弹出层内容高度
|
||||
if((clientH-boxheadH) < contentH){
|
||||
$('#content').css('height',clientH-boxheadH+'px');
|
||||
}
|
||||
dataShow();
|
||||
});
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
// 跳转到评价页
|
||||
function toAppr(oid){
|
||||
location.href=WST.U('mobile/orders/orderappraise',{'oId':oid});
|
||||
}
|
||||
// 投诉
|
||||
function complain(oid){
|
||||
location.href=WST.U('mobile/ordercomplains/complain',{'oId':oid});
|
||||
}
|
||||
|
||||
//修改价格
|
||||
function editPrice(orderNo){
|
||||
alert('修改价格');
|
||||
}
|
||||
|
||||
|
||||
// 发货
|
||||
var deliverType
|
||||
function toDeliver(id,type){
|
||||
deliverType = type
|
||||
if(type==0){
|
||||
delivery('orderDelivery('+id+')');
|
||||
}else{
|
||||
WST.dialog('确定发货吗?','orderDelivery('+id+')');
|
||||
}
|
||||
}
|
||||
function delivery(event){
|
||||
$("#wst-event0").attr("onclick","javascript:"+event);
|
||||
$("#deliveryBox").dialog("show");
|
||||
}
|
||||
function orderDelivery(oid){
|
||||
if(deliverType==0){
|
||||
hideDialog('#deliveryBox');
|
||||
}else{
|
||||
WST.dialogHide('prompt');
|
||||
}
|
||||
$.post(WST.U('mobile/orders/deliver'),{id:oid,expressId:$('#expressId').val(),expressNo:$('#expressNo').val()},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status>0){
|
||||
$('#order-box').html(' ');
|
||||
reFlashList();
|
||||
}else{
|
||||
WST.msg(json.msg,'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*************** 修改价格需要用到的方法 ******************/
|
||||
|
||||
//只能輸入數字和小數點
|
||||
WST.isNumberdoteKey = function(evt){
|
||||
var e = evt || window.event;
|
||||
var srcElement = e.srcElement || e.target;
|
||||
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode > 31 && ((charCode < 48 || charCode > 57) && charCode!=46)){
|
||||
return false;
|
||||
}else{
|
||||
if(charCode==46){
|
||||
var s = srcElement.value;
|
||||
if(s.length==0 || s.indexOf(".")!=-1){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
WST.limitDecimal = function(obj,len){
|
||||
var s = obj.value;
|
||||
if(s.indexOf(".")>-1){
|
||||
if((s.length - s.indexOf(".")-1)>len){
|
||||
obj.value = s.substring(0,s.indexOf(".")+len+1);
|
||||
}
|
||||
}
|
||||
s = null;
|
||||
}
|
24
hyhproject/mobile2/view/default/users/share.css
Executable file
24
hyhproject/mobile2/view/default/users/share.css
Executable file
@ -0,0 +1,24 @@
|
||||
.con{
|
||||
position: relative;
|
||||
}
|
||||
.con .bg{
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
.con .img{
|
||||
position: absolute;
|
||||
top: 66.8%;
|
||||
width: 30%;
|
||||
left: 49%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.share{
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
padding: 3px 8px;
|
||||
top: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.img img{
|
||||
width: 100%;
|
||||
}
|
30
hyhproject/mobile2/view/default/users/share.html
Executable file
30
hyhproject/mobile2/view/default/users/share.html
Executable file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<link rel="stylesheet" type="text/css" href="global.css" />
|
||||
<link rel="stylesheet" type="text/css" href="share.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="con">
|
||||
<img class="bg" src="share_bg.png" />
|
||||
<div id="qrcode" class="img"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<!--<script src="jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>-->
|
||||
<script src="qrcode.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width: 96, //设置宽高
|
||||
height: 96
|
||||
});
|
||||
qrcode.makeCode('https://www.baidu.com');
|
||||
</script>
|
||||
|
||||
</html>
|
BIN
hyhproject/mobile2/view/default/users/share_bg.png
Executable file
BIN
hyhproject/mobile2/view/default/users/share_bg.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 492 KiB |
111
hyhproject/mobile2/view/default/users/user.js
Executable file
111
hyhproject/mobile2/view/default/users/user.js
Executable file
@ -0,0 +1,111 @@
|
||||
//返回个人信息
|
||||
function returnUserinfo(){
|
||||
jQuery('#useri_infos').slideDown();
|
||||
jQuery('#footer').slideDown();
|
||||
jQuery('#useri_nickname').slideUp();
|
||||
jQuery("#useri_sex").slideUp();
|
||||
}
|
||||
//修改昵称面板
|
||||
function openNickName(){
|
||||
jQuery('#useri_infos').slideUp();
|
||||
jQuery('#footer').slideUp();
|
||||
jQuery('#useri_nickname').slideDown();
|
||||
}
|
||||
//修改昵称
|
||||
function editNickName(){
|
||||
var userName = $('#userName').val();
|
||||
if(userName==''){
|
||||
WST.msg('昵称不能为空','info');
|
||||
$('#userName').focus();
|
||||
return false;
|
||||
}
|
||||
$('.nickname_onclick').attr("onclick", "null");
|
||||
$.post(WST.U('mobile/users/editUserInfo'), {userName:userName}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status == '1'){
|
||||
WST.msg(json.msg,'success');
|
||||
$('#nickname').html(userName);
|
||||
setTimeout(function(){
|
||||
setTimeout(function(){
|
||||
$('.nickname_onclick').attr("onclick", "editNickName()");
|
||||
},1000);
|
||||
returnUserinfo();
|
||||
},1500);
|
||||
}else{
|
||||
WST.msg('修改昵称失败,请重试','warn');
|
||||
setTimeout(function(){
|
||||
$('.nickname_onclick').attr("onclick", "editNickName()");
|
||||
},1500);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//修改性別面板
|
||||
function openUserSex(){
|
||||
jQuery('#useri_infos').slideUp();
|
||||
jQuery('#footer').slideUp();
|
||||
jQuery("#useri_sex").slideDown();
|
||||
}
|
||||
//修改性别
|
||||
function eidtUserSex(obj, userSex){
|
||||
$(obj).children('.wst-list-infose2').html('<i class="ui-icon-checked-s wst-icon-checked-s_se"></i>');
|
||||
$(obj).siblings().children('.wst-list-infose2').html('');
|
||||
$('.wst-listse').attr("onclick", "null");
|
||||
$.post(WST.U('mobile/users/editUserInfo'), {userSex:userSex}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status == '1'){
|
||||
var newUserSex = '';
|
||||
if(userSex==0){
|
||||
newUserSex = '保密';
|
||||
}else if(userSex==1){
|
||||
newUserSex = '男';
|
||||
}else if(userSex==2){
|
||||
newUserSex = '女';
|
||||
}
|
||||
WST.msg(json.msg,'success');
|
||||
$('#usersex').html(newUserSex);
|
||||
setTimeout(function(){
|
||||
returnUserinfo();
|
||||
setTimeout(function(){
|
||||
$('.wst-listse1').attr("onclick", "eidtUserSex(this, 0)");
|
||||
$('.wst-listse2').attr("onclick", "eidtUserSex(this, 1)");
|
||||
$('.wst-listse3').attr("onclick", "eidtUserSex(this, 2)");
|
||||
},1000);
|
||||
},1500);
|
||||
}else{
|
||||
WST.msg('修改性别失败,请重试','warn');
|
||||
setTimeout(function(){
|
||||
$('.wst-listse1').attr("onclick", "eidtUserSex(this, 0)");
|
||||
$('.wst-listse2').attr("onclick", "eidtUserSex(this, 1)");
|
||||
$('.wst-listse3').attr("onclick", "eidtUserSex(this, 2)");
|
||||
},1000);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
/*签到*/
|
||||
function inSign(){
|
||||
$("#j-sign").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/userscores/signScore'),{},function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
$("#j-sign").addClass('sign2')
|
||||
$("#currentScore").html(json.data.totalScore);
|
||||
WST.msg(json.msg,'success');
|
||||
}else{
|
||||
$("#j-sign").removeClass('sign2');
|
||||
WST.msg(json.msg,'warn');
|
||||
$("#j-sign").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function(){
|
||||
if(WST.conf.IS_LOGIN==0){//是否登录
|
||||
WST.inLogin();
|
||||
return;
|
||||
}
|
||||
WST.initFooter('user');
|
||||
WST.imgAdapt('j-imgAdapt');
|
||||
})
|
||||
|
||||
|
232
hyhproject/mobile2/view/default/users/useraddress/address.js
Executable file
232
hyhproject/mobile2/view/default/users/useraddress/address.js
Executable file
@ -0,0 +1,232 @@
|
||||
jQuery.noConflict();
|
||||
//新增或编辑收货地址页
|
||||
function editAddress(addressId){
|
||||
$('#wst-switch').html('');
|
||||
$('#username').val('');
|
||||
$('#cellphone').val('');
|
||||
$('#address_detailed').val('');
|
||||
$('#areaId').val('');
|
||||
$('#addresst').html('请选择收货地址');
|
||||
$('.wst-ad-submit .button').attr('onclick','javascript:saveAddress('+addressId+');');
|
||||
if(addressId>0){
|
||||
$('.iziModal-header-title').html('修改收货地址');
|
||||
$.post(WST.U('mobile/useraddress/getById'), {addressId:addressId}, function(data){
|
||||
var info = WST.toJson(data);
|
||||
if(info){
|
||||
$('#username').val(info.userName);
|
||||
$('#cellphone').val(info.userPhone);
|
||||
$('#address_detailed').val(info.userAddress);
|
||||
$('#areaId').val(info.areaId);
|
||||
if(info.isDefault==1){
|
||||
$('#defaults').attr('checked',true);
|
||||
}else{
|
||||
$('#defaults').removeAttr('checked');
|
||||
}
|
||||
$('#addresst').html(info.areaName);
|
||||
}
|
||||
addressInfo= null;
|
||||
});
|
||||
}else{
|
||||
$('.iziModal-header-title').html('新增收货地址');
|
||||
}
|
||||
jQuery('#modal-large').iziModal('open');
|
||||
}
|
||||
jQuery("#modal-large").iziModal({
|
||||
title: "新增收货地址",
|
||||
subtitle: "",
|
||||
iconClass: 'icon-chat',
|
||||
overlayColor: 'rgba(0, 0 0, 0.6)',
|
||||
headerColor: '#ffffff'
|
||||
});
|
||||
//保存收货地址
|
||||
function saveAddress(addressId){
|
||||
var userName = $('#username').val();
|
||||
var userPhone = $('#cellphone').val();
|
||||
var areaId = $('#areaId').val();
|
||||
var userAddress = $('#address_detailed').val();
|
||||
if( $('#defaults').is(':checked')){
|
||||
var isdefaultAddress = 1;//设为默认地址
|
||||
}else{
|
||||
var isdefaultAddress = 0;//不设为默认地址
|
||||
}
|
||||
if(userName==''){
|
||||
WST.msg('收货人名称不能为空','info');
|
||||
return false;
|
||||
}
|
||||
if(userPhone==''){
|
||||
WST.msg('联系电话不能为空','info');
|
||||
return false;
|
||||
}
|
||||
if(areaId==''){
|
||||
WST.msg('请选择地址','info');
|
||||
return false;
|
||||
}
|
||||
if(userAddress==''){
|
||||
WST.msg('请填写详细地址','info');
|
||||
return false;
|
||||
}
|
||||
var param = {};
|
||||
param.addressId = addressId;
|
||||
param.userName = userName;
|
||||
param.areaId = areaId;
|
||||
param.userPhone = userPhone;
|
||||
param.userAddress = userAddress;
|
||||
param.isDefault = isdefaultAddress;
|
||||
$('.wst-ad-submit .button').addClass("active").attr('disabled', 'disabled');
|
||||
$.post(WST.U('mobile/useraddress/edits'), param, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
var type = $('#type').val();
|
||||
var id = $('#addressId2').val();
|
||||
if(param.addressId==0 && type==1)var addId = json.data.addressId;
|
||||
setTimeout(function(){
|
||||
if(param.addressId==0 && type==1){
|
||||
chooseAddress(addId);
|
||||
}else{
|
||||
location.href = WST.U('mobile/useraddress/index','type='+type+'&addressId='+id);
|
||||
}
|
||||
},1500);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
setTimeout(function(){
|
||||
$('.wst-ad-submit .button').removeAttr('disabled').removeClass("active");
|
||||
},1500);
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
//设为默认地址
|
||||
function inDefault(obj,id){
|
||||
$(obj).addClass('default').removeClass('nodefault').siblings('.j-operate').addClass('nodefault').removeClass('default');
|
||||
$('.wst-ad-operate').css('position','relative');
|
||||
$.post(WST.U('mobile/useraddress/setDefault'), {id:id}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if( json.status == 1 ){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
location.href = WST.U('mobile/useraddress/index');
|
||||
},1500);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
$('.wst-ad-operate').css('position','static');
|
||||
}
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
function setToDefault(obj){
|
||||
if( $(obj).is(':checked')){
|
||||
$('#defaults').removeAttr('checked');
|
||||
}else{
|
||||
$('#defaults').attr('checked',true);
|
||||
}
|
||||
}
|
||||
//删除收货地址
|
||||
function delAddress(addressId){
|
||||
WST.dialog('确定删除吗?','toDelAddress('+addressId+')');
|
||||
}
|
||||
//删除收货地址
|
||||
function toDelAddress(addressId){
|
||||
$.post(WST.U('mobile/useraddress/del'), {id:addressId}, function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
WST.msg(json.msg,'success');
|
||||
setTimeout(function(){
|
||||
var type = $('#type').val();
|
||||
var id = $('#addressId2').val();
|
||||
location.href = WST.U('mobile/useraddress/index','type='+type+'&addressId='+id);
|
||||
},2000);
|
||||
}else{
|
||||
WST.msg(json.msg,'warn');
|
||||
}
|
||||
WST.dialogHide('prompt');
|
||||
data = json = null;
|
||||
});
|
||||
}
|
||||
//地址选择
|
||||
function inOption(obj,n){
|
||||
$(obj).addClass('active').siblings().removeClass('active');
|
||||
$('.area_'+n).removeClass('hide').siblings('.list').addClass('hide');
|
||||
var level = $('#level').val();
|
||||
var n = n+1;
|
||||
for(var i=n; i<=level; i++){
|
||||
$('.area_'+i).remove();
|
||||
$('.active_'+i).remove();
|
||||
}
|
||||
}
|
||||
function inChoice(obj,id,val,level){
|
||||
$('#level').val((level+1));
|
||||
$(obj).addClass('active').siblings().removeClass('active');
|
||||
$('#'+id).attr('areaId',val);
|
||||
$('.active_'+level).removeClass('active').html($(obj).html());
|
||||
WST.ITAreas({id:id,val:val,className:'j-areas'});
|
||||
}
|
||||
/**
|
||||
* 循环创建地区
|
||||
* @param id 当前分类ID
|
||||
* @param val 当前分类值
|
||||
* @param className 样式,方便将来获取值
|
||||
*/
|
||||
WST.ITAreas = function(opts){
|
||||
opts.className = opts.className?opts.className:"j-areas";
|
||||
var obj = $('#'+opts.id);
|
||||
obj.attr('lastarea',1);
|
||||
$.post(WST.U('mobile/areas/listQuery'),{parentId:opts.val},function(data,textStatus){
|
||||
var json = WST.toJson(data);
|
||||
if(json.data && json.data.length>0){
|
||||
json = json.data;
|
||||
var html = [],tmp;
|
||||
var tid = opts.id+"_"+opts.val;
|
||||
var level = parseInt(obj.attr('level'),10);
|
||||
$('.area_'+level).addClass('hide');
|
||||
var level = level+1;
|
||||
html.push('<div id="'+tid+'" class="list '+opts.className+' area_'+level+'" areaId="0" level="'+level+'">');
|
||||
for(var i=0;i<json.length;i++){
|
||||
tmp = json[i];
|
||||
html.push("<p onclick='javascript:inChoice(this,\""+tid+"\","+tmp.areaId+","+level+");'>"+tmp.areaName+"</p>");
|
||||
}
|
||||
html.push('</div>');
|
||||
$(html.join('')).insertAfter('#'+opts.id);
|
||||
var h = WST.pageHeight();
|
||||
var listh = h/2-106;
|
||||
$(".wst-fr-box .list").css('overflow-y','scroll').css('height',listh+'px');
|
||||
$(".wst-fr-box .option").append('<p class="ui-nowrap-flex term active_'+level+' active" onclick="javascript:inOption(this,'+level+')">请选择</p>');
|
||||
}else{
|
||||
opts.isLast = true;
|
||||
opts.lastVal = opts.val;
|
||||
$('#areaId').val(opts.lastVal);
|
||||
var ht = '';
|
||||
$('.wst-fr-box .term').each(function(){
|
||||
ht += $(this).html();
|
||||
});
|
||||
$('#addresst').html(ht);
|
||||
dataHide();
|
||||
}
|
||||
});
|
||||
}
|
||||
function chooseAddress(id){
|
||||
location.href = WST.U('mobile/carts/settlement','addressId='+id);
|
||||
}
|
||||
$(document).ready(function(){
|
||||
WST.initFooter('user');
|
||||
// 弹出层
|
||||
$('#modal-large').css({'top':0,'margin-top':0});
|
||||
var h = WST.pageHeight();
|
||||
$("#frame").css('bottom','-'+h/2);
|
||||
var listh = h/2-106;
|
||||
$(".wst-fr-box .list").css('overflow-y','scroll').css('height',listh+'px');
|
||||
});
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#frame').show();
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"bottom": 0}, 500);
|
||||
}
|
||||
function dataHide(){
|
||||
var dataHeight = $("#frame").css('height');
|
||||
jQuery('#frame').animate({'bottom': '-'+dataHeight}, 500);
|
||||
jQuery('#cover').hide();
|
||||
setTimeout(function(){
|
||||
jQuery('#frame').hide();
|
||||
},500);
|
||||
}
|
49
hyhproject/mobile2/view/default/users/useraddress/edit.html
Executable file
49
hyhproject/mobile2/view/default/users/useraddress/edit.html
Executable file
@ -0,0 +1,49 @@
|
||||
<div id="modal-large" class="iziModal">
|
||||
<input type="hidden" name="" value="" id="areaId" autocomplete="off">
|
||||
<div class="wst-ad-form">
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">收货人:</label><input class="ui-border-binte" id="username" type="text" placeholder="请填写收货人">
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">联系电话:</label><input class="ui-border-binte" id="cellphone" type="text" placeholder="请填写联系电话" onkeypress='return WST.isNumberKey(event);' onkeyup="javascript:WST.isChinese(this,1)">
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">收货地址:</label>
|
||||
<div id="addresst" class="ui-nowrap-flex address" onclick="javascript:dataShow();">请选择收货地址</div>
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form-itemin">
|
||||
<label class="word">详细地址:</label><input class="ui-border-binte" id="address_detailed" type="text" placeholder="请填写详细地址">
|
||||
</div>
|
||||
<div class="wst-ad-line"><p></p></div>
|
||||
<div class="ui-form">
|
||||
<div class="ui-form-item ui-form-item-switch wst-ad-operate">
|
||||
<p>设为默认地址</p>
|
||||
<label class="ui-switch">
|
||||
<input type="checkbox" id="defaults" onclick="javascript:setToDefault(this)">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-ad-submit"><button class="ui-btn-lg button" onclick="javascript:saveAddress(0);">保存</button></div>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 地址框 */}
|
||||
<div class="wst-fr-box" id="frame" style="display:none;">
|
||||
<input type="hidden" name="" value="" id="level" autocomplete="off">
|
||||
<div class="title"><span>收货地址</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
<div class="option">
|
||||
<p class="ui-nowrap-flex term active_0 active" onclick="javascript:inOption(this,0)">请选择</p>
|
||||
</div>
|
||||
<div class="wst-clear"></div>
|
||||
<div id="area_0" class="list j-areas area_0" areaId="0" level="0">
|
||||
{volist name="area" id="ar"}
|
||||
<p onclick="javascript:inChoice(this,'area_0',{$ar['areaId']},0);">{$ar['areaName']}</p>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
56
hyhproject/mobile2/view/default/users/useraddress/list.html
Executable file
56
hyhproject/mobile2/view/default/users/useraddress/list.html
Executable file
@ -0,0 +1,56 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}收货地址管理 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/iziModal.css?v={$v}">
|
||||
<link rel="stylesheet" href="__MOBILE__/css/address.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
<header style="background:#ffffff;" class="ui-header ui-header-positive ui-border-b wst-header">
|
||||
<i class="ui-icon-return" {if($type==1)}onclick="javascript:chooseAddress({$addressId});"{else}onclick="history.back();"{/if}></i><h1>我的地址</h1>
|
||||
</header>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
<div class="wst-ad-footer"><button class="button" onclick="javascript:editAddress(0);">新增</button></div>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="{$type}" id="type" autocomplete="off">
|
||||
<input type="hidden" name="" value="{$addressId}" id="addressId2" autocomplete="off">
|
||||
<section class="ui-container" id="address">
|
||||
{volist name="list" id="li"}
|
||||
<ul class="ui-list wst-listse">
|
||||
<li {if($type==1)}onclick="javascript:chooseAddress({$li['addressId']});"{/if}>
|
||||
<div class="wst-list-infose1">
|
||||
<span class="name">{$li['userName']} {$li['userPhone']}</span>
|
||||
<span class="address">{$li['areaName']}-{$li['userAddress']}</span>
|
||||
</div>
|
||||
</li>
|
||||
<div class="wst-ad-operate">
|
||||
{if($type!=1)}<span class="left">设为默认</span>{/if}
|
||||
<span class="right" onclick="javascript:delAddress({$li['addressId']});"><i class="delete"></i> 删除</span>
|
||||
<span class="right" onclick="javascript:editAddress({$li['addressId']});"><i class="edit"></i> 编辑</span>
|
||||
<div class="wst-clear"></div>
|
||||
</div>
|
||||
</ul>
|
||||
{if($type==1)}
|
||||
<i class="j-operate {if($addressId==$li['addressId'])}default{else}nodefault{/if}"></i>
|
||||
{else}
|
||||
<i class="j-operate {if($li['isDefault']==1)}default{else}nodefault{/if}" onclick="javascript:inDefault(this,{$li['addressId']});"></i>
|
||||
{/if}
|
||||
{/volist}
|
||||
{empty name="list"}
|
||||
<div class="wst-prompt-icon"><img src="__MOBILE__/img/nothing-address.png"></div>
|
||||
<div class="wst-prompt-info">
|
||||
<p>没有收货地址</p>
|
||||
</div>
|
||||
{/empty}
|
||||
</section>
|
||||
{/block}
|
||||
{block name="include"}
|
||||
{include file="default/dialog" /}<!-- 对话框模板 -->
|
||||
{include file="default/users/useraddress/edit" /}<!-- 新增/编辑收货地址模板 -->
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/js/izimodal/iziModal.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/useraddress/address.js?v={$v}'></script>
|
||||
{/block}
|
49
hyhproject/mobile2/view/default/users/userscores/list.html
Executable file
49
hyhproject/mobile2/view/default/users/userscores/list.html
Executable file
@ -0,0 +1,49 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}我的积分 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/userscores.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "我的积分"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<input type="hidden" name="" value="" id="currPage" autocomplete="off">
|
||||
<input type="hidden" name="" value="" id="totalPage" autocomplete="off">
|
||||
<section class="ui-container">
|
||||
<div class="ui-row-flex ui-whitespace ui-row-flex-ver head">
|
||||
<div class="user_scores">
|
||||
<p>我的积分</p>
|
||||
<p id="userMoney" >{$object['userScore']}<span> 个</span></p>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" id="scoreList">
|
||||
<ul class="ui-row score-detail">
|
||||
{{# for(var i=0;i<d.length;i++){ }}
|
||||
<li class="ui-col ui-col-75 wst-re-info">
|
||||
<p>{{d[i].dataRemarks}}</p>
|
||||
<span class="score-time">{{d[i].createTime}}</span>
|
||||
</li>
|
||||
<li class="ui-col ui-col-25 {{(d[i].scoreType==1)?'score-plus':'score-reduce'}}">{{(d[i].scoreType==1)?'+':'-'}} {{d[i].score}}</li>
|
||||
<div class="wst-clear"></div>
|
||||
<div class="score-line"></div>
|
||||
{{# } }}
|
||||
</ul>
|
||||
</script>
|
||||
<div class="score-detail-title">积分明细</div>
|
||||
<div id="score-list"></div>
|
||||
</section>
|
||||
{/* 遮盖层 */}
|
||||
<div class="wst-cover" id="cover"></div>
|
||||
{/* 分类层 */}
|
||||
<div class="wst-fr-box" id="frame">
|
||||
<div class="title"><span>积分使用规则</span><i class="ui-icon-close-page" onclick="javascript:dataHide();"></i><div class="wst-clear"></div></div>
|
||||
<div class="content" id="content">
|
||||
积分使用规则
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/js/jquery.min.js'></script>
|
||||
<script type='text/javascript' src='__MOBILE__/users/userscores/userscores.js?v={$v}'></script>
|
||||
{/block}
|
67
hyhproject/mobile2/view/default/users/userscores/userscores.js
Executable file
67
hyhproject/mobile2/view/default/users/userscores/userscores.js
Executable file
@ -0,0 +1,67 @@
|
||||
jQuery.noConflict();
|
||||
// 获取订单列表
|
||||
function getScoreList(){
|
||||
$('#Load').show();
|
||||
loading = true;
|
||||
var param = {};
|
||||
param.type = $('#type').val() || -1;
|
||||
param.pagesize = 10;
|
||||
param.page = Number( $('#currPage').val() ) + 1;
|
||||
$.post(WST.U('mobile/userscores/pageQuery'), param, function(data){
|
||||
var json = WST.toJson(data.data);
|
||||
var html = '';
|
||||
if(json && json.Rows && json.Rows.length>0){
|
||||
var gettpl = document.getElementById('scoreList').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#score-list').append(html);
|
||||
});
|
||||
|
||||
$('#currPage').val(json.CurrentPage);
|
||||
$('#totalPage').val(json.TotalPage);
|
||||
}else{
|
||||
html += '<div class="wst-prompt-icon"><img src="'+ window.conf.MOBILE +'/img/nothing-relevant.png"></div>';
|
||||
html += '<div class="wst-prompt-info">';
|
||||
html += '<p>暂无相关信息</p>';
|
||||
html += '</div>';
|
||||
$('#score-list').html(html);
|
||||
}
|
||||
loading = false;
|
||||
$('#Load').hide();
|
||||
echo.init();//图片懒加载
|
||||
});
|
||||
}
|
||||
var currPage = totalPage = 0;
|
||||
var loading = false;
|
||||
$(document).ready(function(){
|
||||
getScoreList();
|
||||
WST.initFooter('user');
|
||||
// 弹出层
|
||||
var w = WST.pageWidth();
|
||||
var h = WST.pageHeight();
|
||||
$('#frame .content').css('overflow-y','scroll').css('height',h-48);
|
||||
$("#frame").css('right',-w);
|
||||
|
||||
$(window).scroll(function(){
|
||||
if (loading) return;
|
||||
if ((5 + $(window).scrollTop()) >= ($(document).height() - screen.height)) {
|
||||
currPage = Number( $('#currPage').val() );
|
||||
totalPage = Number( $('#totalPage').val() );
|
||||
if( totalPage > 0 && currPage < totalPage ){
|
||||
getScoreList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//弹框
|
||||
function dataShow(){
|
||||
jQuery('#cover').attr("onclick","javascript:dataHide();").show();
|
||||
jQuery('#frame').animate({"right": 0}, 500);
|
||||
}
|
||||
function dataHide(){
|
||||
var dataHeight = $("#frame").css('height');
|
||||
var dataWidth = $("#frame").css('width');
|
||||
jQuery('#frame').animate({'right': '-'+dataWidth}, 500);
|
||||
jQuery('#cover').hide();
|
||||
}
|
39
hyhproject/mobile2/view/default/users/userset/about.html
Executable file
39
hyhproject/mobile2/view/default/users/userset/about.html
Executable file
@ -0,0 +1,39 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}关于我们 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/userset.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "关于我们"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container">
|
||||
<div class="wst-about">
|
||||
<div class="wst-brand" ><img src="__IMGURL__/{:WSTConf('CONF.mallLogo')}"></div>
|
||||
<p>{:WSTConf('CONF.seoMallTitle')}</p>
|
||||
<div class="wst-version">
|
||||
<div class="wst-border">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wst-about" >
|
||||
<ul class="ui-list ui-list-text wst-contact" style="background: transparent;">
|
||||
<li class="line">
|
||||
<span class="phone"></span><h5>联系电话:{:WSTConf('CONF.serviceTel')}</h5>
|
||||
</li>
|
||||
<li class="line">
|
||||
<span class="qq"></span><h5>客服QQ:{:WSTConf('CONF.serviceQQ')}</h5>
|
||||
</li>
|
||||
<li class="line">
|
||||
<span class="email"></span><h5>联系邮箱:{:WSTConf('CONF.serviceEmail')}</h5>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/userset/userset.js'></script>
|
||||
{/block}
|
33
hyhproject/mobile2/view/default/users/userset/list.html
Executable file
33
hyhproject/mobile2/view/default/users/userset/list.html
Executable file
@ -0,0 +1,33 @@
|
||||
{extend name="default/base" /}
|
||||
{block name="title"}用户设置 - {__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" href="__MOBILE__/css/userset.css?v={$v}">
|
||||
{/block}
|
||||
{block name="header"}
|
||||
{php}$Title = "用户设置"{/php}
|
||||
{include file="default/header" /}
|
||||
{/block}
|
||||
{block name="footer"}{/block}
|
||||
{block name="main"}
|
||||
<section class="ui-container" >
|
||||
<ul class="ui-list ui-list-text ui-list-link wst-se-l" style="margin-top: 0px;">
|
||||
<li class="line" onclick="location.href='{:url('mobile/users/edit')}'">
|
||||
<span class="pay"></span><h5 class="ui-nowrap">个人中心</h5></a>
|
||||
</li>
|
||||
<li class="line" onclick="location.href='{:url('mobile/users/security')}'">
|
||||
<span class="safety"></span><h5 class="ui-nowrap">账户安全</h5></a>
|
||||
</li>
|
||||
<li class="line" onclick="location.href='{:url('mobile/users/aboutus')}'">
|
||||
<span class="about"></span><h5 class="ui-nowrap">关于我们</h5>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="ui-btn-wrap logout" style="margin-top: 0px;">
|
||||
<button class="ui-btn-lg ui-btn-danger logout-btn" onclick="javascript:logout();">
|
||||
退出登录
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__MOBILE__/users/userset/userset.js'></script>
|
||||
{/block}
|
9
hyhproject/mobile2/view/default/users/userset/userset.js
Executable file
9
hyhproject/mobile2/view/default/users/userset/userset.js
Executable file
@ -0,0 +1,9 @@
|
||||
function logout(){
|
||||
$.post(WST.U('mobile/users/logout'),{},function(data,textStatus){
|
||||
var json = WST.toJson(data);
|
||||
if(data.status==1)
|
||||
location.href=WST.U('mobile/users/index');
|
||||
else
|
||||
WST.msg('发生未知错误','info');
|
||||
});
|
||||
}
|
0
hyhproject/mobile2/view/default/users/╨┬╜и╬─▒╛╬─╡╡.txt
Executable file
0
hyhproject/mobile2/view/default/users/╨┬╜и╬─▒╛╬─╡╡.txt
Executable file
0
hyhproject/mobile2/view/default/users/鈺ㄢ敩鈺溞糕暚鈹€鈻掆暃鈺攢鈺♀暋.txt
Executable file
0
hyhproject/mobile2/view/default/users/鈺ㄢ敩鈺溞糕暚鈹€鈻掆暃鈺攢鈺♀暋.txt
Executable file
Reference in New Issue
Block a user