Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
667901a9
ShopXO
项目概览
jamesyang1999
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
667901a9
编写于
12月 02, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
头条小程序优化
上级
c73aa75a
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
1404 addition
and
1342 deletion
+1404
-1342
application/api/controller/User.php
application/api/controller/User.php
+10
-3
extend/base/AlipayAuth.php
extend/base/AlipayAuth.php
+7
-7
extend/base/AlipayLife.php
extend/base/AlipayLife.php
+0
-664
extend/base/Toutiao.php
extend/base/Toutiao.php
+2
-2
public/appmini/old/qq/pages/goods-detail/goods-detail.js
public/appmini/old/qq/pages/goods-detail/goods-detail.js
+0
-11
public/appmini/old/toutiao/app.js
public/appmini/old/toutiao/app.js
+129
-45
public/appmini/old/toutiao/app.json
public/appmini/old/toutiao/app.json
+2
-1
public/appmini/old/toutiao/pages/answer-form/answer-form.js
public/appmini/old/toutiao/pages/answer-form/answer-form.js
+14
-9
public/appmini/old/toutiao/pages/buy/buy.js
public/appmini/old/toutiao/pages/buy/buy.js
+52
-36
public/appmini/old/toutiao/pages/buy/buy.ttml
public/appmini/old/toutiao/pages/buy/buy.ttml
+110
-103
public/appmini/old/toutiao/pages/buy/buy.ttss
public/appmini/old/toutiao/pages/buy/buy.ttss
+8
-1
public/appmini/old/toutiao/pages/cart/cart.js
public/appmini/old/toutiao/pages/cart/cart.js
+50
-28
public/appmini/old/toutiao/pages/coupon/coupon.js
public/appmini/old/toutiao/pages/coupon/coupon.js
+52
-34
public/appmini/old/toutiao/pages/extraction-address/extraction-address.js
...ld/toutiao/pages/extraction-address/extraction-address.js
+151
-0
public/appmini/old/toutiao/pages/extraction-address/extraction-address.json
.../toutiao/pages/extraction-address/extraction-address.json
+3
-0
public/appmini/old/toutiao/pages/extraction-address/extraction-address.ttml
.../toutiao/pages/extraction-address/extraction-address.ttml
+28
-0
public/appmini/old/toutiao/pages/extraction-address/extraction-address.ttss
.../toutiao/pages/extraction-address/extraction-address.ttss
+24
-0
public/appmini/old/toutiao/pages/goods-detail/goods-detail.js
...ic/appmini/old/toutiao/pages/goods-detail/goods-detail.js
+233
-174
public/appmini/old/toutiao/pages/goods-detail/goods-detail.ttml
.../appmini/old/toutiao/pages/goods-detail/goods-detail.ttml
+2
-2
public/appmini/old/toutiao/pages/goods-detail/goods-detail.ttss
.../appmini/old/toutiao/pages/goods-detail/goods-detail.ttss
+0
-1
public/appmini/old/toutiao/pages/login/login.js
public/appmini/old/toutiao/pages/login/login.js
+7
-0
public/appmini/old/toutiao/pages/message/message.js
public/appmini/old/toutiao/pages/message/message.js
+19
-11
public/appmini/old/toutiao/pages/user-address-save/user-address-save.js
.../old/toutiao/pages/user-address-save/user-address-save.js
+34
-17
public/appmini/old/toutiao/pages/user-address/user-address.js
...ic/appmini/old/toutiao/pages/user-address/user-address.js
+29
-13
public/appmini/old/toutiao/pages/user-address/user-address.ttml
.../appmini/old/toutiao/pages/user-address/user-address.ttml
+1
-0
public/appmini/old/toutiao/pages/user-address/user-address.ttss
.../appmini/old/toutiao/pages/user-address/user-address.ttss
+8
-1
public/appmini/old/toutiao/pages/user-answer-list/user-answer-list.js
...ni/old/toutiao/pages/user-answer-list/user-answer-list.js
+19
-11
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
+19
-10
public/appmini/old/toutiao/pages/user-faovr/user-faovr.js
public/appmini/old/toutiao/pages/user-faovr/user-faovr.js
+24
-12
public/appmini/old/toutiao/pages/user-goods-browse/user-goods-browse.js
.../old/toutiao/pages/user-goods-browse/user-goods-browse.js
+24
-12
public/appmini/old/toutiao/pages/user-integral/user-integral.js
.../appmini/old/toutiao/pages/user-integral/user-integral.js
+19
-11
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.js
.../old/toutiao/pages/user-order-detail/user-order-detail.js
+58
-22
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.ttml
...ld/toutiao/pages/user-order-detail/user-order-detail.ttml
+55
-11
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.ttss
...ld/toutiao/pages/user-order-detail/user-order-detail.ttss
+92
-11
public/appmini/old/toutiao/pages/user-order/user-order.js
public/appmini/old/toutiao/pages/user-order/user-order.js
+65
-38
public/appmini/old/toutiao/pages/user-order/user-order.ttml
public/appmini/old/toutiao/pages/user-order/user-order.ttml
+3
-3
public/appmini/old/toutiao/pages/user-order/user-order.ttss
public/appmini/old/toutiao/pages/user-order/user-order.ttss
+2
-2
public/appmini/old/toutiao/pages/user-orderaftersale/user-orderaftersale.js
.../toutiao/pages/user-orderaftersale/user-orderaftersale.js
+24
-12
public/appmini/old/toutiao/pages/user/user.js
public/appmini/old/toutiao/pages/user/user.js
+25
-24
未找到文件。
application/api/controller/User.php
浏览文件 @
667901a9
...
...
@@ -92,7 +92,7 @@ class User extends Common
}
// 授权
$result
=
(
new
\
base\AlipayAuth
())
->
GetAuth
Code
(
MyC
(
'common_app_mini_alipay_appid'
),
$this
->
data_post
[
'authcode'
]);
$result
=
(
new
\
base\AlipayAuth
())
->
GetAuth
SessionKey
(
MyC
(
'common_app_mini_alipay_appid'
),
$this
->
data_post
[
'authcode'
]);
if
(
$result
[
'status'
]
==
0
)
{
// 先从数据库获取用户信息
...
...
@@ -326,10 +326,17 @@ class User extends Common
'appid'
=>
MyC
(
'common_app_mini_toutiao_appid'
),
'secret'
=>
MyC
(
'common_app_mini_toutiao_appsecret'
),
];
$result
=
(
new
\
base\Toutiao
())
->
GetAuth
Code
(
$this
->
data_post
);
$result
=
(
new
\
base\Toutiao
())
->
GetAuth
SessionKey
(
$this
->
data_post
);
if
(
$result
[
'status'
]
==
0
)
{
return
DataReturn
(
'授权登录成功'
,
0
,
$result
[
'data'
][
'openid'
]);
// 先从数据库获取用户信息
$user
=
UserService
::
AppUserInfoHandle
(
null
,
'toutiao_openid'
,
$result
);
if
(
empty
(
$user
))
{
return
DataReturn
(
'授权登录成功'
,
0
,
[
'is_alipay_user_exist'
=>
0
,
'openid'
=>
$result
[
'data'
]]);
}
$user
[
'is_alipay_user_exist'
]
=
1
;
return
DataReturn
(
'授权登录成功'
,
0
,
$user
);
}
return
DataReturn
(
$result
[
'msg'
],
-
10
);
}
...
...
extend/base/AlipayAuth.php
浏览文件 @
667901a9
...
...
@@ -18,7 +18,12 @@ namespace base;
class
AlipayAuth
{
/**
* [GetAuthCode 获取用户授权信息]
* [__construct 构造方法]
*/
public
function
__construct
(){}
/**
* [GetAuthSessionKey 获取用户授权信息]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -27,7 +32,7 @@ class AlipayAuth
* @param [string] $authcode [用户授权码]
* @return [array|boolean] [失败false, 用户授权信息]
*/
public
function
GetAuth
Code
(
$app_id
,
$authcode
=
''
)
public
function
GetAuth
SessionKey
(
$app_id
,
$authcode
=
''
)
{
if
(
empty
(
$app_id
)
||
empty
(
$authcode
))
{
...
...
@@ -70,11 +75,6 @@ class AlipayAuth
return
[
'status'
=>-
1
,
'msg'
=>
$msg
];
}
/**
* [__construct 构造方法]
*/
public
function
__construct
(){}
/**
* [GetParamSign 生成参数和签名]
* @param [array] $data [待生成的参数]
...
...
extend/base/AlipayLife.php
已删除
100755 → 0
浏览文件 @
c73aa75a
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
base
;
use
app\service\AlipayLifeService
;
/**
* 支付宝生活号
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-07-20
*/
class
AlipayLife
{
// 参数
private
$params
;
// xml
private
$xml_data
;
// 当前生活号数据
private
$life_data
;
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-22
* @desc description
* @param [array] $params [输入参数]
*/
public
function
__construct
(
$params
=
[])
{
$this
->
params
=
$params
;
$this
->
xml_data
=
isset
(
$params
[
'biz_content'
])
?
$this
->
XmlToArray
(
$params
[
'biz_content'
])
:
''
;
// 生活号
if
(
!
empty
(
$params
[
'life_data'
]))
{
$this
->
life_data
=
$params
[
'life_data'
];
}
else
{
$this
->
life_data
=
isset
(
$this
->
xml_data
[
'AppId'
])
?
AlipayLifeService
::
AppidLifeRow
([
'appid'
=>
$this
->
xml_data
[
'AppId'
]])
:
''
;
}
}
/**
* [MyRsaSign 签名字符串]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-24T08:38:28+0800
* @param [string] $prestr [需要签名的字符串]
* @return [string] [签名结果]
*/
private
function
MyRsaSign
(
$prestr
)
{
$res
=
"-----BEGIN RSA PRIVATE KEY-----
\n
"
;
$res
.
=
wordwrap
(
$this
->
life_data
[
'rsa_private'
],
64
,
"
\n
"
,
true
);
$res
.
=
"
\n
-----END RSA PRIVATE KEY-----"
;
return
openssl_sign
(
$prestr
,
$sign
,
$res
,
OPENSSL_ALGO_SHA256
)
?
base64_encode
(
$sign
)
:
null
;
}
/**
* [MyRsaDecrypt RSA解密]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-24T09:12:06+0800
* @param [string] $content [需要解密的内容,密文]
* @return [string] [解密后内容,明文]
*/
private
function
MyRsaDecrypt
(
$content
)
{
$res
=
"-----BEGIN PUBLIC KEY-----
\n
"
;
$res
.
=
wordwrap
(
$this
->
life_data
[
'rsa_private'
],
64
,
"
\n
"
,
true
);
$res
.
=
"
\n
-----END PUBLIC KEY-----"
;
$res
=
openssl_get_privatekey
(
$res
);
$content
=
base64_decode
(
$content
);
$result
=
''
;
for
(
$i
=
0
;
$i
<
strlen
(
$content
)
/
128
;
$i
++
)
{
$data
=
substr
(
$content
,
$i
*
128
,
128
);
openssl_private_decrypt
(
$data
,
$decrypt
,
$res
,
OPENSSL_ALGO_SHA256
);
$result
.
=
$decrypt
;
}
openssl_free_key
(
$res
);
return
$result
;
}
/**
* [OutRsaVerify 支付宝验证签名]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-24T08:39:50+0800
* @param [string] $prestr [需要签名的字符串]
* @param [string] $sign [签名结果]
* @return [boolean] [正确true, 错误false]
*/
private
function
OutRsaVerify
(
$prestr
,
$sign
)
{
$res
=
"-----BEGIN PUBLIC KEY-----
\n
"
;
$res
.
=
wordwrap
(
$this
->
life_data
[
'out_rsa_public'
],
64
,
"
\n
"
,
true
);
$res
.
=
"
\n
-----END PUBLIC KEY-----"
;
$pkeyid
=
openssl_pkey_get_public
(
$res
);
$sign
=
base64_decode
(
$sign
);
if
(
$pkeyid
)
{
$verify
=
openssl_verify
(
$prestr
,
$sign
,
$pkeyid
,
OPENSSL_ALGO_SHA256
);
openssl_free_key
(
$pkeyid
);
}
return
(
isset
(
$verify
)
&&
$verify
==
1
)
?
true
:
false
;
}
/**
* xml转属组
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-22
* @desc description
* @param [string] $xmltext [xml数据]
* @return [array] [属组]
*/
public
function
XmlToArray
(
$xmltext
)
{
$xmltext
=
iconv
(
"GBK"
,
"UTF-8"
,
urldecode
(
$xmltext
));
$objectxml
=
simplexml_load_string
(
$xmltext
,
'SimpleXMLElement'
,
LIBXML_NOCDATA
);
$xmljson
=
json_encode
(
$objectxml
);
return
json_decode
(
$xmljson
,
true
);
}
/**
* 属组转url字符串
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-22
* @desc description
* @param [array] $data [输入参数-数组]
* @return [string] [url字符串]
*/
public
function
ArrayToUrlString
(
$data
)
{
$url_string
=
''
;
ksort
(
$data
);
foreach
(
$data
AS
$key
=>
$val
)
{
if
(
!
in_array
(
$key
,
[
'sign'
]))
{
$url_string
.
=
"
$key
=
$val
&"
;
}
}
return
substr
(
$url_string
,
0
,
-
1
);
}
/**
* 返回操作状态
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-10-23T01:07:28+0800
* @param boolean $status [description]
*/
public
function
Respond
(
$status
=
false
)
{
if
(
$status
===
true
)
{
$response_xml
=
'<biz_content>'
.
$this
->
life_data
[
'rsa_public'
]
.
'</biz_content><success>true</success>'
;
}
else
{
$response_xml
=
'<error_code>VERIFY_FAILED</error_code><biz_content>'
.
$this
->
life_data
[
'rsa_public'
]
.
'</biz_content><success>false</success>'
;
}
$return_xml
=
'<?xml version="1.0" encoding="GBK"?>
<alipay>
<response>
<biz_content>'
.
$this
->
life_data
[
'rsa_public'
]
.
'</biz_content>
<success>true</success>
</response>
<sign>'
.
$this
->
MyRsaSign
(
$response_xml
)
.
'</sign>
<sign_type>RSA2</sign_type>
</alipay>'
;
die
(
$return_xml
);
}
/**
* [HttpRequest 网络请求]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-25T09:10:46+0800
* @param [string] $url [请求url]
* @param [array] $data [发送数据]
* @return [mixed] [请求返回数据]
*/
private
function
HttpRequest
(
$url
,
$data
)
{
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_FAILONERROR
,
false
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
$body_string
=
''
;
$encode_array
=
[];
$post_multipart
=
false
;
if
(
is_array
(
$data
)
&&
0
<
count
(
$data
))
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
'@'
!=
substr
(
$v
,
0
,
1
))
{
$body_string
.
=
$k
.
'='
.
urlencode
(
$v
)
.
'&'
;
$encode_array
[
$k
]
=
$v
;
}
else
{
$post_multipart
=
true
;
$encode_array
[
$k
]
=
new
\
CURLFile
(
substr
(
$v
,
1
));
}
}
}
curl_setopt
(
$ch
,
CURLOPT_POST
,
true
);
if
(
$post_multipart
===
true
)
{
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$encode_array
);
list
(
$s1
,
$s2
)
=
explode
(
' '
,
microtime
());
$millisecond
=
(
float
)
sprintf
(
'%.0f'
,
(
floatval
(
$s1
)
+
floatval
(
$s2
))
*
1000
);
$headers
=
array
(
'content-type: multipart/form-data;charset=UTF-8;boundary='
.
$millisecond
);
}
else
{
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
substr
(
$body_string
,
0
,
-
1
));
$headers
=
array
(
'content-type: application/x-www-form-urlencoded;charset=UTF-8'
);
}
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$headers
);
$reponse
=
curl_exec
(
$ch
);
if
(
curl_errno
(
$ch
))
{
return
false
;
}
else
{
$httpStatusCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
if
(
200
!==
$httpStatusCode
)
{
return
false
;
}
}
curl_close
(
$ch
);
return
json_decode
(
$reponse
,
true
);
}
/**
* 校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-22
* @desc description
*/
public
function
Check
()
{
// 当前生活号是否存在
if
(
empty
(
$this
->
life_data
))
{
die
(
'life error'
);
}
// 开始处理
$status
=
$this
->
OutRsaVerify
(
$this
->
ArrayToUrlString
(
$this
->
params
),
$this
->
params
[
'sign'
]);
$this
->
Respond
(
$status
);
}
/**
* 生活号事件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-10-23T00:38:21+0800
*/
public
function
Life
()
{
// 当前生活号是否存在
if
(
empty
(
$this
->
life_data
))
{
die
(
'life error'
);
}
// 开始处理
$status
=
false
;
if
(
$this
->
OutRsaVerify
(
$this
->
ArrayToUrlString
(
$this
->
params
),
$this
->
params
[
'sign'
]))
{
$userinfo
=
empty
(
$this
->
xml_data
[
'UserInfo'
])
?
''
:
json_decode
(
$this
->
xml_data
[
'UserInfo'
],
true
);
$data
=
[
'appid'
=>
$this
->
xml_data
[
'AppId'
],
'alipay_openid'
=>
$this
->
xml_data
[
'FromAlipayUserId'
],
'user_id'
=>
empty
(
$this
->
xml_data
[
'FromUserId'
])
?
''
:
$this
->
xml_data
[
'FromUserId'
],
'logon_id'
=>
empty
(
$userinfo
[
'logon_id'
])
?
''
:
$userinfo
[
'logon_id'
],
'user_name'
=>
empty
(
$userinfo
[
'user_name'
])
?
''
:
$userinfo
[
'user_name'
],
];
switch
(
$this
->
xml_data
[
'EventType'
])
{
// 取消关注
case
'unfollow'
:
$status
=
AlipayLifeService
::
UserUnfollow
(
$data
);
break
;
// 关注/进入生活号
case
'follow'
:
case
'enter'
:
$status
=
AlipayLifeService
::
UserEnter
(
$data
);
break
;
}
}
$this
->
Respond
(
$status
);
}
/**
* [SyncRsaVerify 同步返回签名验证]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-25T13:13:39+0800
* @param [array] $data [返回数据]
* @param [boolean] $key [数据key]
*/
private
function
SyncRsaVerify
(
$data
,
$key
)
{
$string
=
json_encode
(
$data
[
$key
],
JSON_UNESCAPED_UNICODE
);
return
$this
->
OutRsaVerify
(
$string
,
$data
[
'sign'
]);
}
/**
* 获取公共参数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-24
* @desc description
*/
private
function
RequestCommonParams
()
{
return
[
'app_id'
=>
$this
->
life_data
[
'appid'
],
'format'
=>
'JSON'
,
'charset'
=>
'utf-8'
,
'sign_type'
=>
'RSA2'
,
'timestamp'
=>
date
(
'Y-m-d H:i:s'
),
'version'
=>
'1.0'
,
];
}
/**
* 消息发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-24
* @desc description
* @param [array] $data [输入参数]
*/
public
function
MessageSend
(
$params
=
[])
{
// 参数处理
$p
=
$this
->
RequestCommonParams
();
$p
[
'method'
]
=
$params
[
'method'
];
$biz_content
=
[
'msg_type'
=>
(
$params
[
'msg_type'
]
==
0
)
?
'text'
:
'image-text'
,
'chat'
=>
isset
(
$params
[
'chat'
])
?
intval
(
$params
[
'chat'
])
:
0
,
];
// 消息内容
if
(
empty
(
$params
[
'content'
])
||
!
is_array
(
$params
[
'content'
]))
{
return
[
'status'
=>-
1
,
'msg'
=>
'消息内容有误'
];
}
// 发送类型 单条
if
(
$params
[
'send_type'
]
==
0
)
{
if
(
empty
(
$params
[
'alipay_openid'
]))
{
return
[
'status'
=>-
1
,
'msg'
=>
'指定用户openid不能为空'
];
}
$biz_content
[
'to_user_id'
]
=
$params
[
'alipay_openid'
];
}
// 消息类型
if
(
$params
[
'msg_type'
]
==
1
)
{
$biz_content
[
'articles'
]
=
[];
foreach
(
$params
[
'content'
]
as
$k
=>
$v
)
{
if
(
$k
<
10
)
{
$biz_content
[
'articles'
][]
=
[
'title'
=>
$v
[
'title'
],
'desc'
=>
$v
[
'content'
],
'image_url'
=>
$v
[
'out_image_url'
],
'url'
=>
$v
[
'url'
],
'action_name'
=>
$v
[
'action_name'
],
];
}
}
}
else
{
$biz_content
[
'text'
]
=
[
'content'
=>
$params
[
'content'
][
0
][
'content'
]];
}
$p
[
'biz_content'
]
=
json_encode
(
$biz_content
,
JSON_UNESCAPED_UNICODE
);
// 生成签名
$p
[
'sign'
]
=
$this
->
MyRsaSign
(
$this
->
ArrayToUrlString
(
$p
));
// 请求接口
$result
=
$this
->
HttpRequest
(
'https://openapi.alipay.com/gateway.do'
,
$p
);
$key
=
str_replace
(
'.'
,
'_'
,
$p
[
'method'
])
.
'_response'
;
// 验证签名
if
(
!
$this
->
SyncRsaVerify
(
$result
,
$key
))
{
return
[
'status'
=>-
1
,
'msg'
=>
'签名验证错误'
];
}
// 状态
if
(
isset
(
$result
[
$key
][
'code'
])
&&
$result
[
$key
][
'code'
]
==
10000
)
{
return
[
'status'
=>
0
,
'msg'
=>
'发送成功'
];
}
return
[
'status'
=>-
100
,
'msg'
=>
$result
[
$key
][
'sub_msg'
]
.
'['
.
$result
[
$key
][
'code'
]
.
']'
];
}
/**
* 单条消息发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-24
* @desc description
* @param [array] $data [输入参数]
*/
public
function
CustomSend
(
$params
=
[])
{
$params
[
'method'
]
=
'alipay.open.public.message.custom.send'
;
return
$this
->
MessageSend
(
$params
);
}
/**
* 群发消息发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-24
* @desc description
* @param [array] $data [输入参数]
*/
public
function
GroupSend
(
$params
=
[])
{
$params
[
'method'
]
=
'alipay.open.public.message.total.send'
;
return
$this
->
MessageSend
(
$params
);
}
/**
* 图片上传
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-25
* @desc description
* @param [array] $data [输入参数]
*/
public
function
UploadImage
(
$params
=
[])
{
// 参数校验
if
(
empty
(
$params
[
'file'
]))
{
return
[
'status'
=>-
1
,
'msg'
=>
'图片地址有误'
];
}
// 参数处理
$p
=
$this
->
RequestCommonParams
();
$p
[
'method'
]
=
'alipay.offline.material.image.upload'
;
// 图片参数
$p
[
'image_type'
]
=
isset
(
$params
[
'image_type'
])
?
$params
[
'image_type'
]
:
'jpg'
;
$p
[
'image_name'
]
=
isset
(
$params
[
'image_name'
])
?
$params
[
'image_name'
]
:
'image'
;
// 生成签名
$p
[
'sign'
]
=
$this
->
MyRsaSign
(
$this
->
ArrayToUrlString
(
$p
));
// 图片内容不参与签名
$p
[
'image_content'
]
=
'@'
.
$params
[
'file'
];
// 请求接口
$result
=
$this
->
HttpRequest
(
'https://openapi.alipay.com/gateway.do'
,
$p
);
// 状态
if
(
isset
(
$result
[
'alipay_offline_material_image_upload_response'
][
'code'
])
&&
$result
[
'alipay_offline_material_image_upload_response'
][
'code'
]
==
10000
)
{
return
[
'status'
=>
0
,
'msg'
=>
'上传成功'
,
'data'
=>
$result
[
'alipay_offline_material_image_upload_response'
][
'image_url'
]];
}
return
[
'status'
=>-
100
,
'msg'
=>
$result
[
'alipay_offline_material_image_upload_response'
][
'sub_msg'
]
.
'['
.
$result
[
'alipay_offline_material_image_upload_response'
][
'code'
]
.
']'
,
'data'
=>
''
];
}
/**
* 上架生活号
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-30
* @desc description
* @param [array] $data [输入参数]
*/
public
function
LifeStatus
(
$params
=
[])
{
// 参数处理
$p
=
$this
->
RequestCommonParams
();
$p
[
'method'
]
=
$params
[
'method'
];
$biz_content
=
[];
$p
[
'biz_content'
]
=
json_encode
(
$biz_content
,
JSON_UNESCAPED_UNICODE
);
// 生成签名
$p
[
'sign'
]
=
$this
->
MyRsaSign
(
$this
->
ArrayToUrlString
(
$p
));
// 请求接口
$result
=
$this
->
HttpRequest
(
'https://openapi.alipay.com/gateway.do'
,
$p
);
$key
=
str_replace
(
'.'
,
'_'
,
$p
[
'method'
])
.
'_response'
;
// 验证签名
if
(
!
$this
->
SyncRsaVerify
(
$result
,
$key
))
{
return
[
'status'
=>-
1
,
'msg'
=>
'签名验证错误'
];
}
// 状态
if
(
isset
(
$result
[
$key
][
'code'
])
&&
$result
[
$key
][
'code'
]
==
10000
)
{
return
[
'status'
=>
0
,
'msg'
=>
'操作成功'
];
}
// 是否相同状态下操作
if
(
stripos
(
$result
[
$key
][
'sub_code'
],
'LIFE_ALREADY_DEBARK'
)
!==
false
||
stripos
(
$result
[
$key
][
'sub_code'
],
'LIFE_ALREADY_ON_PLATFORM'
)
!==
false
)
{
return
[
'status'
=>
0
,
'msg'
=>
$result
[
$key
][
'sub_msg'
]
.
'['
.
$result
[
$key
][
'code'
]
.
']'
];
}
return
[
'status'
=>-
100
,
'msg'
=>
$result
[
$key
][
'sub_msg'
]
.
'['
.
$result
[
$key
][
'code'
]
.
']'
];
}
/**
* 上架生活号
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-30
* @desc description
* @param [array] $data [输入参数]
*/
public
function
LifeAboard
(
$params
=
[])
{
$params
[
'method'
]
=
'alipay.open.public.life.aboard.apply'
;
return
$this
->
LifeStatus
(
$params
);
}
/**
* 下架生活号
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-30
* @desc description
* @param [array] $data [输入参数]
*/
public
function
LifeDebark
(
$params
=
[])
{
$params
[
'method'
]
=
'alipay.open.public.life.debark.apply'
;
return
$this
->
LifeStatus
(
$params
);
}
/**
* 菜单发布
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-10-30
* @desc description
* @param [array] $data [输入参数]
*/
public
function
MenuRelease
(
$params
=
[])
{
// 参数处理
$p
=
$this
->
RequestCommonParams
();
$p
[
'method'
]
=
empty
(
$params
[
'method'
])
?
'alipay.open.public.menu.modify'
:
$params
[
'method'
];
$biz_content
=
[
'type'
=>
(
$params
[
'type'
]
==
1
)
?
'icon'
:
'text'
,
'button'
=>
[],
];
foreach
(
$params
[
'content'
]
as
$v
)
{
$button
=
[
'name'
=>
mb_substr
(
$v
[
'name'
],
0
,
5
,
'utf-8'
),
'action_type'
=>
$v
[
'action_type'
],
'action_param'
=>
$v
[
'action_value'
],
];
// 是否为图标
if
(
$params
[
'type'
]
==
1
)
{
$button
[
'icon'
]
=
$v
[
'out_icon'
];
}
// 不为图标并且存在二级
if
(
$params
[
'type'
]
!=
1
&&
!
empty
(
$v
[
'items'
]))
{
foreach
(
$v
[
'items'
]
as
$vs
)
{
$button
[
'sub_button'
][]
=
[
'name'
=>
mb_substr
(
$vs
[
'name'
],
0
,
5
,
'utf-8'
),
'action_type'
=>
$vs
[
'action_type'
],
'action_param'
=>
$vs
[
'action_value'
],
];
}
}
$biz_content
[
'button'
][]
=
$button
;
}
$p
[
'biz_content'
]
=
json_encode
(
$biz_content
,
JSON_UNESCAPED_UNICODE
);
// 生成签名
$p
[
'sign'
]
=
$this
->
MyRsaSign
(
$this
->
ArrayToUrlString
(
$p
));
// 请求接口
$result
=
$this
->
HttpRequest
(
'https://openapi.alipay.com/gateway.do'
,
$p
);
$key
=
str_replace
(
'.'
,
'_'
,
$p
[
'method'
])
.
'_response'
;
// 验证签名
if
(
!
$this
->
SyncRsaVerify
(
$result
,
$key
))
{
return
[
'status'
=>-
1
,
'msg'
=>
'签名验证错误'
];
}
// 状态
if
(
isset
(
$result
[
$key
][
'code'
])
&&
$result
[
$key
][
'code'
]
==
10000
)
{
return
[
'status'
=>
0
,
'msg'
=>
'操作成功'
];
}
// 错误是否为菜单不存在,则重新调用创建接口
if
(
stripos
(
$result
[
$key
][
'sub_code'
],
'MENU_MODIFY_NOT_EXIST'
)
!==
false
)
{
$params
[
'method'
]
=
'alipay.open.public.menu.create'
;
return
$this
->
MenuRelease
(
$params
);
}
// 失败
return
[
'status'
=>-
100
,
'msg'
=>
$result
[
$key
][
'sub_msg'
]
.
'['
.
$result
[
$key
][
'code'
]
.
'-'
.
$result
[
$key
][
'sub_code'
]
.
']'
];
}
}
?>
\ No newline at end of file
extend/base/Toutiao.php
浏览文件 @
667901a9
...
...
@@ -31,7 +31,7 @@ class Toutiao
* @desc description
* @param [array] $params [输入参数]
*/
public
function
GetAuth
Code
(
$params
=
[])
public
function
GetAuth
SessionKey
(
$params
=
[])
{
if
(
empty
(
$params
[
'authcode'
]))
{
...
...
@@ -49,7 +49,7 @@ class Toutiao
{
return
[
'status'
=>-
1
,
'msg'
=>
$result
[
'errmsg'
]];
}
return
[
'status'
=>
0
,
'msg'
=>
'授权成功'
,
'data'
=>
$result
];
return
[
'status'
=>
0
,
'msg'
=>
'授权成功'
,
'data'
=>
$result
[
'openid'
]
];
}
/**
...
...
public/appmini/old/qq/pages/goods-detail/goods-detail.js
浏览文件 @
667901a9
...
...
@@ -34,7 +34,6 @@ Page({
goods_video_is_autoplay
:
false
,
common_app_is_use_mobile_detail
:
1
,
popup_share_status
:
false
,
common_app_is_online_service
:
0
,
// 限时秒杀插件
...
...
@@ -697,16 +696,6 @@ Page({
this
.
setData
({
goods_video_is_autoplay
:
false
});
},
// 分享开启弹层
popup_share_event
(
e
)
{
this
.
setData
({
popup_share_status
:
true
});
},
// 分享弹层关闭
popup_share_close_event
(
e
)
{
this
.
setData
({
popup_share_status
:
false
});
},
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown
()
{
// 销毁之前的任务
...
...
public/appmini/old/toutiao/app.js
浏览文件 @
667901a9
...
...
@@ -67,7 +67,7 @@ App({
// 请求地址
request_url
:
"
{{request_url}}
"
,
//
request_url: 'http://tp5-dev.com/',
request_url
:
'
http://tp5-dev.com/
'
,
// request_url: 'https://test.shopxo.net/',
// 基础信息
...
...
@@ -154,6 +154,24 @@ App({
);
},
/**
* 获取用户信息,信息不存在则唤醒授权
* object 回调操作对象
* method 回调操作对象的函数
* return 有用户数据直接返回, 则回调调用者
*/
get_user_info
(
object
,
method
)
{
var
user
=
this
.
get_user_cache_info
();
if
(
user
==
false
)
{
// 唤醒用户授权
this
.
user_login
(
object
,
method
);
return
false
;
}
else
{
return
user
;
}
},
/**
* 从缓存获取用户信息
*/
...
...
@@ -195,38 +213,82 @@ App({
* method 回调操作对象的函数
*/
user_login
(
object
,
method
)
{
var
self
=
this
;
tt
.
login
({
success
:
(
res
)
=>
{
if
(
res
.
code
)
{
tt
.
request
({
url
:
self
.
get_request_url
(
'
toutiaouserauth
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
authcode
:
res
.
code
,
anonymous_code
:
res
.
anonymousCode
},
dataType
:
'
json
'
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
(
res
)
=>
{
if
(
res
.
data
.
code
==
0
)
{
tt
.
setStorage
({
key
:
self
.
data
.
cache_user_login_key
,
data
:
res
.
data
.
data
});
self
.
get_user_login_info
(
object
,
method
,
res
.
data
.
data
);
}
else
{
var
openid
=
tt
.
getStorageSync
(
this
.
data
.
cache_user_login_key
)
||
null
;
if
(
openid
==
null
)
{
var
self
=
this
;
// 加载loding
tt
.
showLoading
({
title
:
"
授权中...
"
});
tt
.
login
({
success
:
(
res
)
=>
{
if
(
res
.
code
)
{
tt
.
request
({
url
:
self
.
get_request_url
(
'
toutiaouserauth
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
authcode
:
res
.
code
,
anonymous_code
:
res
.
anonymousCode
},
dataType
:
'
json
'
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
(
res
)
=>
{
tt
.
hideLoading
();
self
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
self
.
showToast
(
'
服务器请求出错
'
);
},
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
if
((
data
.
is_alipay_user_exist
||
0
)
==
1
)
{
tt
.
setStorage
({
key
:
self
.
data
.
cache_user_info_key
,
data
:
data
,
success
:
(
res
)
=>
{
if
(
typeof
object
===
'
object
'
&&
(
method
||
null
)
!=
null
)
{
object
[
method
]();
}
},
fail
:
()
=>
{
self
.
showToast
(
'
用户信息缓存失败
'
);
}
});
}
else
{
tt
.
setStorage
({
key
:
self
.
data
.
cache_user_login_key
,
data
:
data
.
openid
});
self
.
login_to_auth
();
}
}
else
{
self
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
self
.
showToast
(
'
服务器请求出错
'
);
},
});
}
},
fail
:
(
e
)
=>
{
tt
.
hideLoading
();
self
.
showToast
(
'
授权失败
'
);
}
});
}
else
{
this
.
login_to_auth
();
}
},
/**
* 跳转到登录页面授权
*/
login_to_auth
()
{
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
授权用户信息
'
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login
"
});
}
},
fail
:
(
e
)
=>
{
tt
.
hideLoading
();
self
.
showToast
(
'
授权失败
'
);
}
});
},
...
...
@@ -582,6 +644,36 @@ App({
});
},
// 位置权限获取
location_authorize
(
object
,
method
,
params
)
{
var
self
=
this
;
tt
.
getSetting
({
success
(
res
)
{
if
(
!
res
.
authSetting
[
'
scope.userLocation
'
])
{
tt
.
authorize
({
scope
:
'
scope.userLocation
'
,
success
(
res
)
{
if
(
typeof
object
===
'
object
'
&&
(
method
||
null
)
!=
null
)
{
object
[
method
](
params
);
}
},
fail
(
res
)
{
tt
.
openSetting
();
self
.
showToast
(
'
请同意地理位置授权
'
);
}
});
}
else
{
if
(
typeof
object
===
'
object
'
&&
(
method
||
null
)
!=
null
)
{
object
[
method
](
params
);
}
}
},
fail
:
(
e
)
=>
{
self
.
showToast
(
"
授权校验失败
"
);
}
});
},
// 拨打电话
call_tel
(
value
)
{
if
((
value
||
null
)
!=
null
)
{
...
...
@@ -589,24 +681,16 @@ App({
}
},
// 登录校验
is_login_check
(
res
)
{
/**
* 登录校验
* object 回调操作对象
* method 回调操作对象的函数
*/
is_login_check
(
res
,
object
,
method
)
{
if
(
res
.
code
==
-
400
)
{
tt
.
clearStorage
();
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
授权用户信息
'
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
}
},
});
this
.
get_user_info
(
object
,
method
);
return
false
;
}
return
true
;
...
...
public/appmini/old/toutiao/app.json
浏览文件 @
667901a9
...
...
@@ -27,7 +27,8 @@
"pages/user-orderaftersale/user-orderaftersale"
,
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
,
"pages/coupon/coupon"
,
"pages/user-coupon/user-coupon"
"pages/user-coupon/user-coupon"
,
"pages/extraction-address/extraction-address"
],
"window"
:
{
"navigationBarTitleText"
:
"{{application_title}}"
,
...
...
public/appmini/old/toutiao/pages/answer-form/answer-form.js
浏览文件 @
667901a9
...
...
@@ -13,13 +13,15 @@ Page({
// 初始化
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
}
},
...
...
@@ -60,8 +62,11 @@ Page({
},
2000
);
}
else
{
this
.
setData
({
form_submit_loading
:
false
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/buy/buy.js
浏览文件 @
667901a9
...
...
@@ -8,13 +8,15 @@ Page({
payment_list
:
[],
goods_list
:
[],
address
:
null
,
address_id
:
0
,
address_id
:
null
,
total_price
:
0
,
user_note_value
:
''
,
is_first
:
1
,
extension_data
:
[],
payment_id
:
0
,
common_order_is_booking
:
0
,
common_site_type
:
0
,
extraction_address
:
[],
// 优惠劵
plugins_coupon_data
:
null
,
...
...
@@ -23,17 +25,9 @@ Page({
popup_plugins_coupon_status
:
false
,
},
onLoad
(
params
)
{
if
((
params
.
data
||
null
)
==
null
||
app
.
get_length
(
JSON
.
parse
(
params
.
data
))
==
0
)
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
if
((
params
.
data
||
null
)
!=
null
&&
app
.
get_length
(
JSON
.
parse
(
params
.
data
))
>
0
)
{
tt
.
alert
({
title
:
'
温馨提示
'
,
content
:
'
订单信息有误
'
,
buttonText
:
'
确认
'
,
success
:
()
=>
{
tt
.
navigateBack
();
},
});
}
else
{
this
.
setData
({
params
:
JSON
.
parse
(
params
.
data
)});
// 删除地址缓存
...
...
@@ -42,13 +36,22 @@ Page({
},
onShow
()
{
tt
.
setNavigationBarTitle
({
title
:
app
.
data
.
common_pages_title
.
buy
});
this
.
init
();
this
.
setData
({
is_first
:
0
});
this
.
setData
({
is_first
:
0
});
},
// 获取数据列表
init
()
{
// 订单参数信息是否正确
if
(
this
.
data
.
params
==
null
)
{
this
.
setData
({
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
订单信息有误
'
,
});
tt
.
stopPullDownRefresh
();
return
false
;
}
// 本地缓存地址
if
(
this
.
data
.
is_first
==
0
)
{
...
...
@@ -57,12 +60,7 @@ Page({
{
this
.
setData
({
address
:
cache_address
,
address_id
:
cache_address
.
id
});
}
else
{
this
.
setData
({
address
:
null
,
address_id
:
0
address_id
:
cache_address
.
id
||
null
,
});
}
}
...
...
@@ -97,6 +95,8 @@ Page({
extension_data
:
data
.
extension_data
||
[],
data_list_loding_status
:
3
,
common_order_is_booking
:
data
.
common_order_is_booking
||
0
,
common_site_type
:
data
.
common_site_type
||
0
,
extraction_address
:
data
.
base
.
extraction_address
||
[],
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
});
...
...
@@ -113,19 +113,14 @@ Page({
}
// 地址
if
(
this
.
data
.
address
==
null
||
this
.
data
.
address_id
==
0
)
{
if
((
data
.
base
.
address
||
null
)
!=
null
)
{
this
.
setData
({
address
:
data
.
base
.
address
,
address_id
:
data
.
base
.
address
.
id
,
});
tt
.
setStorage
({
key
:
app
.
data
.
cache_buy_user_address_select_key
,
data
:
data
.
base
.
address
,
});
}
}
this
.
setData
({
address
:
data
.
base
.
address
||
null
,
address_id
:
((
data
.
base
.
address
||
null
)
!=
null
&&
(
data
.
base
.
address
.
id
||
null
)
!=
null
)
?
data
.
base
.
address
.
id
:
null
,
});
tt
.
setStorage
({
key
:
app
.
data
.
cache_buy_user_address_select_key
,
data
:
data
.
base
.
address
||
null
,
});
// 支付方式
this
.
payment_list_data
(
data
.
payment_list
);
...
...
@@ -135,7 +130,9 @@ Page({
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
init
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -171,9 +168,11 @@ Page({
data
[
'
coupon_id
'
]
=
this
.
data
.
plugins_use_coupon_id
;
// 数据验证
var
validation
=
[
{
fields
:
'
address_id
'
,
msg
:
'
请选择地址
'
}
];
var
validation
=
[];
if
(
this
.
data
.
common_site_type
==
0
||
this
.
data
.
common_site_type
==
2
)
{
validation
.
push
({
fields
:
'
address_id
'
,
msg
:
'
请选择地址
'
,
is_can_zero
:
1
});
}
if
(
this
.
data
.
common_order_is_booking
!=
1
)
{
validation
.
push
({
fields
:
'
payment_id
'
,
msg
:
'
请选择支付方式
'
});
}
...
...
@@ -263,4 +262,21 @@ Page({
this
.
init
();
},
// 地址选择事件
address_event
(
e
)
{
if
(
this
.
data
.
common_site_type
==
0
)
{
tt
.
navigateTo
({
url
:
'
/pages/user-address/user-address?is_back=1
'
});
}
else
if
(
this
.
data
.
common_site_type
==
2
)
{
tt
.
navigateTo
({
url
:
'
/pages/extraction-address/extraction-address?is_back=1
'
});
}
else
{
app
.
showToast
(
'
当前模式不允许使用地址
'
);
}
},
});
public/appmini/old/toutiao/pages/buy/buy.ttml
浏览文件 @
667901a9
<view tt:if="{{goods_list.length > 0}}" class="page">
<!-- 地址 -->
<view class="address bg-white arrow-right">
<navigator url="/pages/user-address/user-address?is_back=1" hover-class="none">
<view tt:if="{{address != null}}">
<view class="address-base oh">
<text>{{address.name}}</text>
<text class="fr">{{address.tel}}</text>
<block tt:if="{{common_site_type == 1}}">
<import src="/pages/common/nodata.ttml" />
<template is="nodata" data="{{status: 2, msg: '展示型不允许提交订单'}}"></template>
</block>
<block wx:else>
<view tt:if="{{goods_list.length > 0}}" class="page">
<!-- 地址 -->
<block tt:if="{{common_site_type == 0 || common_site_type == 2}}">
<view class="address bg-white arrow-right" bindtap="address_event">
<view tt:if="{{address != null}}">
<view class="address-base oh">
<text tt:if="{{(address.alias || null) != null}}" class="address-alias">{{address.alias}}</text>
<text>{{address.name}}</text>
<text class="fr">{{address.tel}}</text>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{address.province_name}}{{address.city_name}}{{address.county_name}}{{address.address}}</view>
</view>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{address.province_name}}{{address.city_name}}{{address.county_name}}{{address.address}}</view>
<view tt:if="{{address == null}}" class="no-address cr-888">
请选择地址
</view>
</view>
<view tt:if="{{address == null}}" class="no-address cr-888">
请选择地址
</view>
</navigator>
</view>
<view class="address-divider spacing-mb"></view>
<view class="address-divider spacing-mb"></view>
</block>
<!-- 商品 -->
<view class="goods bg-white spacing-mb">
<view tt:for="{{goods_list}}" tt:key="key" class="goods-item oh">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
<view class="goods-title multi-text">{{item.title}}</view>
<block tt:if="{{item.spec != null}}">
<view class="goods-spec cr-888" tt:for="{{item.spec}}" tt:key="key" tt:for-item="spec">{{spec.type}}:{{spec.value}}
</view>
</block>
</view>
<view class="oh goods-price">
<text class="sales-price">¥{{item.price}}
</text>
<text tt:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price}}
</text>
<text class="buy-number cr-888">x{{item.stock}}
</text>
<!-- 商品 -->
<view class="goods bg-white spacing-mb">
<view tt:for="{{goods_list}}" tt:key="key" class="goods-item oh">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
<view class="goods-title multi-text">{{item.title}}</view>
<block tt:if="{{item.spec != null}}">
<view class="goods-spec cr-888" tt:for="{{item.spec}}" tt:key="key" tt:for-item="spec">{{spec.type}}:{{spec.value}}
</view>
</block>
</view>
<view class="oh goods-price">
<text class="sales-price">¥{{item.price}}
</text>
<text tt:if="{{item.original_price > 0}}" class="original-price">¥{{item.original_price}}
</text>
<text class="buy-number cr-888">x{{item.stock}}
</text>
</view>
</view>
</view>
</view>
<!-- 留言 -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea tt:if="{{!popup_plugins_coupon_status}}" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" class="wh-auto" />
<view tt:if="{{popup_plugins_coupon_status}}" class="cr-888">{{user_note_value || '留言'}}</view>
</view>
<!-- 优惠劵 -->
<view tt:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- 留言 -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea tt:if="{{!popup_plugins_coupon_status}}" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" class="wh-auto" />
<view tt:if="{{popup_plugins_coupon_status}}" class="cr-888">{{user_note_value || '留言'}}</view>
</view>
<!-- 扩展数据展示 -->
<view tt:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view tt:for="{{extension_data}}" tt:key="key" class="item oh">
<text class="cr-666 fl">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
<!-- 优惠劵 -->
<view tt:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666">优惠劵</text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
</view>
<!-- 支付方式 -->
<view tt:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
<view class="item tc fl" tt:for="{{payment_list}}" tt:key="key">
<view class="item-content br {{(item.selected || '')}}" data-value="{{item.id}}" bindtap="payment_event">
<image tt:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}</text>
<!-- 扩展数据展示 -->
<view tt:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view tt:for="{{extension_data}}" tt:key="key" class="item oh">
<text class="cr-666 fl">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
</view>
</view>
</view>
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<text>合计:</text>
<text class="sales-price">¥{{total_price}}</text>
<!-- 支付方式 -->
<view tt:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
<view class="item tc fl" tt:for="{{payment_list}}" tt:key="key">
<view class="item-content br {{(item.selected || '')}}" data-value="{{item.id}}" bindtap="payment_event">
<image tt:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}</text>
</view>
</view>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">提交订单</button>
<!-- 导航 -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<text>合计:</text>
<text class="sales-price">¥{{total_price}}</text>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none">提交订单</button>
</view>
</view>
</view>
</view>
<view tt:if="{{goods_list.length == 0}}">
<import src="/pages/common/nodata.ttml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<view tt:if="{{goods_list.length == 0}}">
<import src="/pages/common/nodata.ttml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- 优惠劵选择 -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<view tt:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">不使用优惠劵</text>
<!-- 优惠劵选择 -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<block tt:for="{{plugins_coupon_data.coupon_list}}" tt:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol">¥</text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.coupon.type_unit}}</text>
<text tt:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
<view tt:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">不使用优惠劵</text>
</view>
<block tt:for="{{plugins_coupon_data.coupon_list}}" tt:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol">¥</text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.coupon.type_unit}}</text>
<text tt:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view tt:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
<view class="base-time cr-888 single-text">{{item.time_start_text}} 至 {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-index="{{index}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
<view tt:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
<view class="base-time cr-888 single-text">{{item.time_start_text}} 至 {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-index="{{index}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
</
view
>
</
block
>
</
block
>
</
view
>
</view>
</view>
</component-popup>
\ No newline at end of file
</component-popup>
</block>
\ No newline at end of file
public/appmini/old/toutiao/pages/buy/buy.ttss
浏览文件 @
667901a9
...
...
@@ -12,7 +12,7 @@
padding: 10rpx 35rpx 10rpx 10rpx;
}
.address-detail .icon {
width: 3
5
rpx;
width: 3
0
rpx;
height: 35rpx !important;
}
.address-detail .text {
...
...
@@ -30,6 +30,13 @@
height: 85rpx;
line-height: 85rpx;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
/**
* 商品
...
...
public/appmini/old/toutiao/pages/cart/cart.js
浏览文件 @
667901a9
...
...
@@ -22,31 +22,39 @@ Page({
},
init
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
var
msg
=
(
user
==
false
)
?
'
授权用户信息
'
:
'
绑定手机号码
'
;
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
msg
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
data_list_loding_msg
:
'
请先
'
+
msg
,
});
}
},
});
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
绑定手机号码
'
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
data_list_loding_msg
:
'
请绑定手机号码
'
,
});
}
},
});
}
else
{
this
.
get_data
();
}
}
else
{
this
.
get_data
();
tt
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
data_list_loding_msg
:
'
请先授权用户信息
'
,
});
}
},
...
...
@@ -87,7 +95,9 @@ Page({
data_bottom_line_status
:
false
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -173,7 +183,11 @@ Page({
// 选择处理
this
.
selected_calculate
();
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
@@ -193,7 +207,11 @@ Page({
if
(
res
.
data
.
code
==
0
)
{
this
.
cart_delete
(
id
,
type
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
@@ -245,7 +263,11 @@ Page({
app
.
showToast
(((
type
==
'
delete
'
)
?
'
删除成功
'
:
'
收藏成功
'
),
'
success
'
);
}
else
{
app
.
showToast
((
type
==
'
delete
'
)
?
'
删除失败
'
:
'
收藏失败
'
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
((
type
==
'
delete
'
)
?
'
删除失败
'
:
'
收藏失败
'
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/coupon/coupon.js
浏览文件 @
667901a9
...
...
@@ -6,6 +6,10 @@ Page({
data_list_loding_msg
:
''
,
data_list
:
[],
data_base
:
null
,
// 优惠劵领取
temp_coupon_receive_index
:
null
,
temp_coupon_receive_value
:
null
,
},
onLoad
(
params
)
{
...
...
@@ -80,45 +84,59 @@ Page({
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_receive_event
"
});
return
false
;
// 参数处理
if
((
e
||
null
)
==
null
)
{
var
index
=
this
.
data
.
temp_coupon_receive_index
;
var
value
=
this
.
data
.
temp_coupon_receive_value
;
}
else
{
var
self
=
this
;
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
var
temp_list
=
this
.
data
.
data_list
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
data_base
!=
null
&&
self
.
data
.
data_base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
data_list
:
temp_list
});
this
.
setData
({
temp_coupon_receive_index
:
index
,
temp_coupon_receive_value
:
value
});
}
// 登录校验
var
user
=
app
.
get_user_info
(
this
,
'
coupon_receive_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=coupon_receive_event
"
});
return
false
;
}
else
{
var
self
=
this
;
var
temp_list
=
this
.
data
.
data_list
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
data_base
!=
null
&&
self
.
data
.
data_base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
data_list
:
temp_list
});
}
}
else
{
if
(
app
.
is_login_check
(
res
.
data
,
self
,
'
coupon_receive_event
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
});
}
}
}
},
...
...
public/appmini/old/toutiao/pages/extraction-address/extraction-address.js
0 → 100644
浏览文件 @
667901a9
const
app
=
getApp
();
Page
({
data
:
{
data_list_loding_status
:
1
,
data_bottom_line_status
:
false
,
data_list
:
[],
params
:
null
,
is_default
:
0
,
},
onLoad
(
params
)
{
this
.
setData
({
params
:
params
});
},
onShow
()
{
tt
.
setNavigationBarTitle
({
title
:
app
.
data
.
common_pages_title
.
extraction_address
});
this
.
init
();
},
// 初始化
init
()
{
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
// 获取数据列表
get_data_list
()
{
// 加载loding
tt
.
showLoading
({
title
:
"
加载中...
"
});
this
.
setData
({
data_list_loding_status
:
1
});
// 获取数据
tt
.
request
({
url
:
app
.
get_request_url
(
"
extraction
"
,
"
useraddress
"
),
method
:
"
POST
"
,
data
:
{},
dataType
:
"
json
"
,
success
:
res
=>
{
tt
.
hideLoading
();
tt
.
stopPullDownRefresh
();
if
(
res
.
data
.
code
==
0
)
{
if
(
res
.
data
.
data
.
length
>
0
)
{
// 获取当前默认地址
var
is_default
=
0
;
for
(
var
i
in
res
.
data
.
data
)
{
if
(
res
.
data
.
data
[
i
][
'
is_default
'
]
==
1
)
{
is_default
=
res
.
data
.
data
[
i
][
'
id
'
];
}
}
// 设置数据
this
.
setData
({
data_list
:
res
.
data
.
data
,
is_default
:
is_default
,
data_list_loding_status
:
3
,
data_bottom_line_status
:
true
,
});
}
else
{
this
.
setData
({
data_list_loding_status
:
0
});
}
}
else
{
this
.
setData
({
data_list_loding_status
:
0
});
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
tt
.
stopPullDownRefresh
();
this
.
setData
({
data_list_loding_status
:
2
});
app
.
showToast
(
"
服务器请求出错
"
);
}
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
get_data_list
();
},
// 地图查看
address_map_event
(
e
)
{
app
.
location_authorize
(
this
,
'
address_map_handle
'
,
e
);
},
// 地图查看处理
address_map_handle
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
||
0
;
var
ads
=
this
.
data
.
data_list
[
index
]
||
null
;
if
(
ads
==
null
)
{
app
.
showToast
(
"
地址有误
"
);
return
false
;
}
var
lng
=
parseFloat
(
ads
.
lng
||
0
);
var
lat
=
parseFloat
(
ads
.
lat
||
0
);
if
(
lng
<=
0
||
lat
<=
0
)
{
app
.
showToast
(
"
坐标有误
"
);
return
false
;
}
tt
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
ads
.
alias
||
''
,
address
:
(
ads
.
province_name
||
''
)
+
(
ads
.
city_name
||
''
)
+
(
ads
.
county_name
||
''
)
+
(
ads
.
address
||
''
),
});
},
// 地址内容事件
address_conent_event
(
e
)
{
var
index
=
e
.
currentTarget
.
dataset
.
index
||
0
;
var
is_back
=
this
.
data
.
params
.
is_back
||
0
;
if
(
is_back
==
1
)
{
tt
.
setStorage
({
key
:
app
.
data
.
cache_buy_user_address_select_key
,
data
:
this
.
data
.
data_list
[
index
]
});
tt
.
navigateBack
();
}
},
});
public/appmini/old/toutiao/pages/extraction-address/extraction-address.json
0 → 100644
浏览文件 @
667901a9
{
"enablePullDownRefresh"
:
true
}
\ No newline at end of file
public/appmini/old/toutiao/pages/extraction-address/extraction-address.ttml
0 → 100644
浏览文件 @
667901a9
<view class="page">
<view tt:if="{{data_list.length > 0}}">
<view class="item bg-white spacing-mb" tt:for="{{data_list}}" tt:key="key">
<view bindtap="address_conent_event" data-index="{{index}}">
<view class="base oh">
<text tt:if="{{(item.alias || null) != null}}" class="address-alias">{{item.alias}}</text>
<text>{{item.name}}</text>
<text class="fr">{{item.tel}}</text>
</view>
<view class="address oh">
<image class="item-icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{item.province_name}}{{item.city_name}}{{item.county_name}}{{item.address}}</view>
</view>
</view>
<view class="operation br-t oh">
<button tt:if="{{item.lng > 0 && item.lat > 0}}" class="fr cr-666 map-submit br" type="default" size="mini" bindtap="address_map_event" data-index="{{index}}" hover-class="none">查看地图</button>
</view>
</view>
</view>
<view tt:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.ttml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.ttml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
\ No newline at end of file
public/appmini/old/toutiao/pages/extraction-address/extraction-address.ttss
0 → 100644
浏览文件 @
667901a9
.item {
padding: 10rpx 10rpx 0 10rpx;
}
.base, .address, .operation {
padding: 20rpx 0;
}
.address .item-icon {
width: 30rpx;
height: 35rpx !important;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.address .text {
line-height: 44rpx;
width: calc(100% - 40rpx);
}
.operation .map-submit {
margin-left: 20rpx;
}
\ No newline at end of file
public/appmini/old/toutiao/pages/goods-detail/goods-detail.js
浏览文件 @
667901a9
...
...
@@ -34,6 +34,8 @@ Page({
goods_video_is_autoplay
:
false
,
common_app_is_use_mobile_detail
:
1
,
common_app_is_online_service
:
0
,
// 限时秒杀插件
common_app_is_limitedtimediscount
:
0
,
plugins_limitedtimediscount_data
:
null
,
...
...
@@ -42,6 +44,21 @@ Page({
plugins_limitedtimediscount_timer
:
null
,
plugins_limitedtimediscount_timers
:
null
,
// 好物圈分享信息
common_app_is_good_thing
:
0
,
share_product
:
{
"
item_code
"
:
""
,
"
title
"
:
""
,
"
desc
"
:
""
,
"
category_list
"
:
[],
"
image_list
"
:
[],
"
src_mini_program_path
"
:
""
,
"
brand_info
"
:
{},
},
// 海报分享
common_app_is_poster_share
:
0
,
// 优惠劵
plugins_coupon_data
:
null
,
...
...
@@ -51,6 +68,10 @@ Page({
// 站点模式
common_site_type
:
0
,
customer_service_tel
:
null
,
// 优惠劵领取
temp_coupon_receive_index
:
null
,
temp_coupon_receive_value
:
null
,
},
onLoad
(
params
)
{
...
...
@@ -123,10 +144,21 @@ Page({
show_field_price_text
:
(
data
.
goods
.
show_field_price_text
==
'
销售价
'
)
?
null
:
(
data
.
goods
.
show_field_price_text
.
replace
(
/<
[^
>
]
+>/g
,
""
)
||
null
),
common_app_is_use_mobile_detail
:
data
.
common_app_is_use_mobile_detail
||
0
,
//common_app_is_online_service: data.common_app_is_online_service || 0,
common_app_is_limitedtimediscount
:
data
.
common_app_is_limitedtimediscount
||
0
,
plugins_limitedtimediscount_data
:
data
.
plugins_limitedtimediscount_data
||
null
,
common_app_is_good_thing
:
data
.
common_app_is_good_thing
||
0
,
'
share_product.item_code
'
:
data
.
goods
.
id
.
toString
(),
'
share_product.title
'
:
data
.
goods
.
title
,
'
share_product.image_list
'
:
data
.
goods
.
photo
.
map
(
function
(
v
)
{
return
v
.
images
;}),
'
share_product.desc
'
:
data
.
goods
.
simple_desc
,
'
share_product.category_list
'
:
data
.
goods
.
category_names
||
[],
'
share_product.src_mini_program_path
'
:
'
/pages/goods-detail/goods-detail?goods_id=
'
+
data
.
goods
.
id
,
'
share_product.brand_info.name
'
:
data
.
goods
.
brand_name
,
common_app_is_poster_share
:
data
.
common_app_is_poster_share
||
0
,
plugins_coupon_data
:
data
.
plugins_coupon_data
||
null
,
quick_nav_cart_count
:
data
.
common_cart_total
||
0
,
});
...
...
@@ -259,76 +291,84 @@ Page({
// 收藏事件
goods_favor_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
goods_favor_event
'
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
处理中...
'
});
var
user
=
app
.
get_user_info
(
this
,
'
goods_favor_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=goods_favor_event
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
处理中...
'
});
tt
.
request
({
url
:
app
.
get_request_url
(
'
favor
'
,
'
goods
'
),
method
:
'
POST
'
,
data
:
{
"
id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
this
.
setData
({
'
goods.is_favor
'
:
res
.
data
.
data
.
status
,
goods_favor_text
:
res
.
data
.
data
.
text
,
goods_favor_icon
:
'
/images/goods-detail-favor-icon-
'
+
res
.
data
.
data
.
status
+
'
.png
'
});
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
tt
.
request
({
url
:
app
.
get_request_url
(
'
favor
'
,
'
goods
'
),
method
:
'
POST
'
,
data
:
{
"
id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
this
.
setData
({
'
goods.is_favor
'
:
res
.
data
.
data
.
status
,
goods_favor_text
:
res
.
data
.
data
.
text
,
goods_favor_icon
:
'
/images/goods-detail-favor-icon-
'
+
res
.
data
.
data
.
status
+
'
.png
'
});
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
goods_favor_event
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
'
服务器请求出错
'
);
}
});
app
.
showToast
(
'
服务器请求出错
'
);
}
});
}
}
},
// 加入购物车事件
goods_cart_event
(
e
,
spec
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
goods_buy_confirm_event
'
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
处理中...
'
});
tt
.
request
({
url
:
app
.
get_request_url
(
'
save
'
,
'
cart
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
,
"
stock
"
:
this
.
data
.
temp_buy_number
,
"
spec
"
:
JSON
.
stringify
(
spec
)
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
this
.
setData
({
quick_nav_cart_count
:
res
.
data
.
data
});
this
.
popup_close_event
();
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
goods_cart_event
(
spec
)
{
var
user
=
app
.
get_user_info
(
this
,
'
goods_buy_confirm_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=goods_buy_confirm_event
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
处理中...
'
});
tt
.
request
({
url
:
app
.
get_request_url
(
'
save
'
,
'
cart
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
,
"
stock
"
:
this
.
data
.
temp_buy_number
,
"
spec
"
:
JSON
.
stringify
(
spec
)
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
this
.
setData
({
quick_nav_cart_count
:
res
.
data
.
data
});
this
.
popup_close_event
();
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
goods_buy_confirm_event
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
'
服务器请求出错
'
);
}
});
app
.
showToast
(
'
服务器请求出错
'
);
}
});
}
}
},
...
...
@@ -560,61 +600,63 @@ Page({
// 确认
goods_buy_confirm_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
goods_buy_confirm_event
'
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 属性
var
temp_data
=
this
.
data
.
goods_specifications_choose
;
var
sku_count
=
temp_data
.
length
;
var
active_count
=
0
;
var
spec
=
[];
if
(
sku_count
>
0
)
{
for
(
var
i
in
temp_data
)
var
user
=
app
.
get_user_info
(
this
,
'
goods_buy_confirm_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=goods_buy_confirm_event
"
});
return
false
;
}
else
{
// 属性
var
temp_data
=
this
.
data
.
goods_specifications_choose
;
var
sku_count
=
temp_data
.
length
;
var
active_count
=
0
;
var
spec
=
[];
if
(
sku_count
>
0
)
{
for
(
var
k
in
temp_data
[
i
][
'
value
'
]
)
for
(
var
i
in
temp_data
)
{
if
((
temp_data
[
i
][
'
value
'
][
k
][
'
is_active
'
]
||
null
)
!=
null
)
for
(
var
k
in
temp_data
[
i
][
'
value
'
]
)
{
active_count
++
;
spec
.
push
({
"
type
"
:
temp_data
[
i
][
'
name
'
],
"
value
"
:
temp_data
[
i
][
'
value
'
][
k
][
'
name
'
]});
if
((
temp_data
[
i
][
'
value
'
][
k
][
'
is_active
'
]
||
null
)
!=
null
)
{
active_count
++
;
spec
.
push
({
"
type
"
:
temp_data
[
i
][
'
name
'
],
"
value
"
:
temp_data
[
i
][
'
value
'
][
k
][
'
name
'
]});
}
}
}
if
(
active_count
<
sku_count
)
{
app
.
showToast
(
'
请选择属性
'
);
return
false
;
}
}
if
(
active_count
<
sku_count
)
{
app
.
showToast
(
'
请选择属性
'
);
return
false
;
}
}
// 操作类型
switch
(
this
.
data
.
buy_event_type
)
{
case
'
buy
'
:
// 进入订单确认页面
var
data
=
{
"
buy_type
"
:
"
goods
"
,
"
goods_id
"
:
this
.
data
.
goods
.
id
,
"
stock
"
:
this
.
data
.
temp_buy_number
,
"
spec
"
:
JSON
.
stringify
(
spec
)
};
tt
.
navigateTo
({
url
:
'
/pages/buy/buy?data=
'
+
JSON
.
stringify
(
data
)
});
this
.
popup_close_event
();
break
;
// 操作类型
switch
(
this
.
data
.
buy_event_type
)
{
case
'
buy
'
:
// 进入订单确认页面
var
data
=
{
"
buy_type
"
:
"
goods
"
,
"
goods_id
"
:
this
.
data
.
goods
.
id
,
"
stock
"
:
this
.
data
.
temp_buy_number
,
"
spec
"
:
JSON
.
stringify
(
spec
)
};
tt
.
navigateTo
({
url
:
'
/pages/buy/buy?data=
'
+
JSON
.
stringify
(
data
)
});
this
.
popup_close_event
();
break
;
case
'
cart
'
:
this
.
goods_cart_event
(
e
,
spec
);
break
;
case
'
cart
'
:
this
.
goods_cart_event
(
spec
);
break
;
default
:
app
.
showToast
(
"
操作事件类型有误
"
);
default
:
app
.
showToast
(
"
操作事件类型有误
"
);
}
}
}
},
...
...
@@ -734,72 +776,32 @@ Page({
// 商品海报分享
poster_event
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
poster_event
'
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
生成中...
'
});
tt
.
request
({
url
:
app
.
get_request_url
(
'
poster
'
,
'
goods
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
tt
.
previewImage
({
current
:
res
.
data
.
data
,
urls
:
[
res
.
data
.
data
]
});
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
coupon_receive_event
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=coupon_receive_event
"
});
return
false
;
}
else
{
var
self
=
this
;
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
var
temp_list
=
this
.
data
.
plugins_coupon_data
.
data
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
var
user
=
app
.
get_user_info
(
this
,
'
poster_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=poster_event
"
});
return
false
;
}
else
{
tt
.
showLoading
({
title
:
'
生成中...
'
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
url
:
app
.
get_request_url
(
'
poster
'
,
'
goods
'
),
method
:
'
POST
'
,
data
:
{
"
goods_id
"
:
this
.
data
.
goods
.
id
},
dataType
:
'
json
'
,
success
:
(
res
)
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
plugins_coupon_data
.
base
!=
null
&&
self
.
data
.
plugins_coupon_data
.
base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
'
plugins_coupon_data.data
'
:
temp_list
});
}
tt
.
previewImage
({
current
:
res
.
data
.
data
,
urls
:
[
res
.
data
.
data
]
});
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
poster_event
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -811,6 +813,64 @@ Page({
}
},
// 优惠劵领取事件
coupon_receive_event
(
e
)
{
// 参数处理
if
((
e
||
null
)
==
null
)
{
var
index
=
this
.
data
.
temp_coupon_receive_index
;
var
value
=
this
.
data
.
temp_coupon_receive_value
;
}
else
{
var
index
=
e
.
currentTarget
.
dataset
.
index
;
var
value
=
e
.
currentTarget
.
dataset
.
value
;
this
.
setData
({
temp_coupon_receive_index
:
index
,
temp_coupon_receive_value
:
value
});
}
// 登录校验
var
user
=
app
.
get_user_info
(
this
,
'
coupon_receive_event
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=coupon_receive_event
"
});
return
false
;
}
else
{
var
self
=
this
;
var
temp_list
=
this
.
data
.
plugins_coupon_data
.
data
;
if
(
temp_list
[
index
][
'
is_operable
'
]
!=
0
)
{
tt
.
showLoading
({
title
:
"
处理中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
receive
"
,
"
coupon
"
),
method
:
"
POST
"
,
data
:
{
"
coupon_id
"
:
value
},
dataType
:
"
json
"
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
res
=>
{
tt
.
hideLoading
();
if
(
res
.
data
.
code
==
0
)
{
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
if
(
self
.
data
.
plugins_coupon_data
.
base
!=
null
&&
self
.
data
.
plugins_coupon_data
.
base
.
is_repeat_receive
!=
1
)
{
temp_list
[
index
][
'
is_operable
'
]
=
0
;
temp_list
[
index
][
'
is_operable_name
'
]
=
'
已领取
'
;
self
.
setData
({
'
plugins_coupon_data.data
'
:
temp_list
});
}
}
else
{
if
(
app
.
is_login_check
(
res
.
data
,
self
,
'
coupon_receive_event
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
tt
.
hideLoading
();
app
.
showToast
(
"
服务器请求出错
"
);
}
});
}
}
}
},
// 展示型事件
exhibition_submit_event
(
e
)
{
app
.
call_tel
(
this
.
data
.
customer_service_tel
);
...
...
@@ -818,7 +878,7 @@ Page({
// 自定义分享
onShareAppMessage
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
'
goods_favor_event
'
)
||
null
;
var
user
=
app
.
get_user_cache_info
()
||
null
;
var
user_id
=
(
user
!=
null
&&
(
user
.
id
||
null
)
!=
null
)
?
user
.
id
:
0
;
return
{
title
:
app
.
data
.
application_title
+
'
-
'
+
this
.
data
.
goods
.
title
,
...
...
@@ -826,5 +886,4 @@ Page({
path
:
'
/pages/goods-detail/goods-detail?goods_id=
'
+
this
.
data
.
goods
.
id
+
'
&referrer=
'
+
user_id
};
},
});
public/appmini/old/toutiao/pages/goods-detail/goods-detail.ttml
浏览文件 @
667901a9
...
...
@@ -132,13 +132,13 @@
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr {{common_site_type == 1 ? 'exhibition-mode' : ''}}">
<!-- 展示型 -->
<!--
站点模式 1
展示型 -->
<block tt:if="{{common_site_type == 1}}">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
<!-- 销售型,自提点,虚拟销售 -->
<block
tt
:else>
<block
wx
:else>
<button class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
<button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
</block>
...
...
public/appmini/old/toutiao/pages/goods-detail/goods-detail.ttss
浏览文件 @
667901a9
...
...
@@ -179,7 +179,6 @@
}
.goods-base button {
background: #fff;
padding: 0;
}
.goods-base .goods-share {
position: absolute;
...
...
public/appmini/old/toutiao/pages/login/login.js
浏览文件 @
667901a9
...
...
@@ -33,6 +33,13 @@ Page({
* 登录授权事件
*/
get_user_info_event
(
e
)
{
this
.
user_auth_code
();
},
/**
* 用户授权
*/
user_auth_code
()
{
var
self
=
this
;
tt
.
getSetting
({
success
(
res
)
{
...
...
public/appmini/old/toutiao/pages/message/message.js
浏览文件 @
667901a9
...
...
@@ -14,16 +14,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -91,8 +98,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-address-save/user-address-save.js
浏览文件 @
667901a9
...
...
@@ -37,22 +37,33 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取地址数据
if
((
this
.
data
.
params
.
id
||
null
)
!=
null
)
{
this
.
get_user_address
();
}
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
this
.
setData
({
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
请先绑定手机号码
'
,
});
return
false
;
}
else
{
// 获取地址数据
if
((
this
.
data
.
params
.
id
||
null
)
!=
null
)
{
this
.
get_user_address
();
}
// 获取省
this
.
get_province_list
();
// 获取省
this
.
get_province_list
();
}
}
else
{
this
.
setData
({
data_list_loding_status
:
2
,
data_list_loding_msg
:
'
请先授权用户信息
'
,
});
}
},
...
...
@@ -89,7 +100,9 @@ Page({
self
.
init_value
();
},
500
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -289,7 +302,11 @@ Page({
tt
.
navigateBack
();
},
1000
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-address/user-address.js
浏览文件 @
667901a9
...
...
@@ -19,16 +19,23 @@ Page({
// 初始化
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -77,8 +84,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -149,7 +157,11 @@ Page({
}
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
@@ -196,7 +208,11 @@ Page({
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-address/user-address.ttml
浏览文件 @
667901a9
...
...
@@ -3,6 +3,7 @@
<view class="item bg-white spacing-mb" tt:for="{{data_list}}" tt:key="key">
<view bindtap="address_conent_event" data-index="{{index}}">
<view class="base oh">
<text tt:if="{{(item.alias || null) != null}}" class="address-alias">{{item.alias}}</text>
<text>{{item.name}}</text>
<text class="fr">{{item.tel}}</text>
</view>
...
...
public/appmini/old/toutiao/pages/user-address/user-address.ttss
浏览文件 @
667901a9
...
...
@@ -5,9 +5,16 @@
padding: 20rpx 0;
}
.address .item-icon {
width: 3
5
rpx;
width: 3
0
rpx;
height: 35rpx !important;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.address .text {
line-height: 44rpx;
width: calc(100% - 40rpx);
...
...
public/appmini/old/toutiao/pages/user-answer-list/user-answer-list.js
浏览文件 @
667901a9
...
...
@@ -16,16 +16,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -91,8 +98,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-coupon/user-coupon.js
浏览文件 @
667901a9
...
...
@@ -23,16 +23,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -66,7 +73,9 @@ Page({
data_list_loding_status
:
2
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
self
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-faovr/user-faovr.js
浏览文件 @
667901a9
...
...
@@ -14,16 +14,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -89,8 +96,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -156,7 +164,11 @@ Page({
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-goods-browse/user-goods-browse.js
浏览文件 @
667901a9
...
...
@@ -14,16 +14,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -88,8 +95,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -154,7 +162,11 @@ Page({
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-integral/user-integral.js
浏览文件 @
667901a9
...
...
@@ -14,16 +14,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -91,8 +98,9 @@ Page({
this
.
setData
({
data_list_loding_status
:
0
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.js
浏览文件 @
667901a9
...
...
@@ -9,9 +9,11 @@ Page({
detail
:
null
,
detail_list
:
[],
extension_data
:
[],
site_fictitious
:
null
,
},
onLoad
(
params
)
{
//params['id'] = 5;
this
.
setData
({
params
:
params
});
this
.
init
();
},
...
...
@@ -40,29 +42,31 @@ Page({
if
(
res
.
data
.
code
==
0
)
{
var
data
=
res
.
data
.
data
;
self
.
setData
({
detail
:
data
,
detail
:
data
.
data
,
detail_list
:[
{
name
:
"
订单号
"
,
value
:
data
.
order_no
||
''
},
{
name
:
"
状态
"
,
value
:
data
.
status_name
||
''
},
{
name
:
"
支付状态
"
,
value
:
data
.
pay_status_name
||
''
},
{
name
:
"
单价
"
,
value
:
data
.
price
||
''
},
{
name
:
"
总价
"
,
value
:
data
.
total_price
||
''
},
{
name
:
"
优惠金额
"
,
value
:
data
.
preferential_price
||
''
},
{
name
:
"
增加金额
"
,
value
:
data
.
increase_price
||
''
},
{
name
:
"
支付金额
"
,
value
:
data
.
pay_price
||
''
},
{
name
:
"
支付方式
"
,
value
:
data
.
payment_name
||
''
},
{
name
:
"
快递公司
"
,
value
:
data
.
express_name
||
''
},
{
name
:
"
快递单号
"
,
value
:
data
.
express_number
||
''
},
{
name
:
"
用户留言
"
,
value
:
data
.
user_note
||
''
},
{
name
:
"
创建时间
"
,
value
:
data
.
add_time
||
''
},
{
name
:
"
确认时间
"
,
value
:
data
.
confirm_time
||
''
},
{
name
:
"
支付时间
"
,
value
:
data
.
pay_time
||
''
},
{
name
:
"
发货时间
"
,
value
:
data
.
delivery_time
||
''
},
{
name
:
"
收货时间
"
,
value
:
data
.
collect_time
||
''
},
{
name
:
"
取消时间
"
,
value
:
data
.
close_time
||
''
},
{
name
:
"
关闭时间
"
,
value
:
data
.
close_time
||
''
},
{
name
:
"
订单号
"
,
value
:
data
.
data
.
order_no
||
''
},
{
name
:
"
订单模式
"
,
value
:
data
.
data
.
order_model_name
||
''
},
{
name
:
"
状态
"
,
value
:
data
.
data
.
status_name
||
''
},
{
name
:
"
支付状态
"
,
value
:
data
.
data
.
pay_status_name
||
''
},
{
name
:
"
单价
"
,
value
:
data
.
data
.
price
||
''
},
{
name
:
"
总价
"
,
value
:
data
.
data
.
total_price
||
''
},
{
name
:
"
优惠金额
"
,
value
:
data
.
data
.
preferential_price
||
''
},
{
name
:
"
增加金额
"
,
value
:
data
.
data
.
increase_price
||
''
},
{
name
:
"
支付金额
"
,
value
:
data
.
data
.
pay_price
||
''
},
{
name
:
"
支付方式
"
,
value
:
data
.
data
.
payment_name
||
''
},
{
name
:
"
快递公司
"
,
value
:
data
.
data
.
express_name
||
''
},
{
name
:
"
快递单号
"
,
value
:
data
.
data
.
express_number
||
''
},
{
name
:
"
用户留言
"
,
value
:
data
.
data
.
user_note
||
''
},
{
name
:
"
创建时间
"
,
value
:
data
.
data
.
add_time
||
''
},
{
name
:
"
确认时间
"
,
value
:
data
.
data
.
confirm_time
||
''
},
{
name
:
"
支付时间
"
,
value
:
data
.
data
.
pay_time
||
''
},
{
name
:
"
发货时间
"
,
value
:
data
.
data
.
delivery_time
||
''
},
{
name
:
"
收货时间
"
,
value
:
data
.
data
.
collect_time
||
''
},
{
name
:
"
取消时间
"
,
value
:
data
.
data
.
close_time
||
''
},
{
name
:
"
关闭时间
"
,
value
:
data
.
data
.
close_time
||
''
},
],
extension_data
:
data
.
extension_data
||
[],
extension_data
:
data
.
data
.
extension_data
||
[],
site_fictitious
:
data
.
site_fictitious
||
null
,
data_list_loding_status
:
3
,
data_bottom_line_status
:
true
,
data_list_loding_msg
:
''
,
...
...
@@ -73,7 +77,9 @@ Page({
data_bottom_line_status
:
false
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
self
,
'
init
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -90,6 +96,36 @@ Page({
});
},
// 地图查看
address_map_event
(
e
)
{
app
.
location_authorize
(
this
,
'
address_map_handle
'
,
e
);
},
// 地图查看处理
address_map_handle
(
e
)
{
if
((
this
.
data
.
detail
.
address_data
||
null
)
==
null
)
{
app
.
showToast
(
"
地址有误
"
);
return
false
;
}
var
ads
=
this
.
data
.
detail
.
address_data
;
var
lng
=
parseFloat
(
ads
.
lng
||
0
);
var
lat
=
parseFloat
(
ads
.
lat
||
0
);
if
(
lng
<=
0
||
lat
<=
0
)
{
app
.
showToast
(
"
坐标有误
"
);
return
false
;
}
tt
.
openLocation
({
latitude
:
lat
,
longitude
:
lng
,
scale
:
18
,
name
:
ads
.
alias
||
''
,
address
:
(
ads
.
province_name
||
''
)
+
(
ads
.
city_name
||
''
)
+
(
ads
.
county_name
||
''
)
+
(
ads
.
address
||
''
),
});
},
// 下拉刷新
onPullDownRefresh
()
{
this
.
init
();
...
...
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.ttml
浏览文件 @
667901a9
<view tt:if="{{detail != null}}">
<view class="address bg-white spacing-mb">
<!-- 地址 -->
<view tt:if="{{detail.order_model == 0 || detail.order_model == 2}}" class="address bg-white spacing-mb">
<view class="address-base oh">
<text>{{detail.receive_name}}</text>
<text class="fr">{{detail.receive_tel}}</text>
<text tt:if="{{(detail.address_data.alias || null) != null}}" class="address-alias">{{detail.address_data.alias}}</text>
<text>{{detail.address_data.name}}</text>
<text class="fr">{{detail.address_data.tel}}</text>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{detail.receive_province_name}}{{detail.receive_city_name}}{{detail.receive_county_name}}{{detail.receive_address}}</view>
<view class="text fr">
{{detail.address_data.province_name}}{{detail.address_data.city_name}}{{detail.address_data.county_name}}{{detail.address_data.address}}
<text tt:if="{{detail.order_model == 2 && (detail.address_data.lng || 0) > 0 && (detail.address_data.lat || 0) > 0}}" class="cr-666 br address-map-submit" bindtap="address_map_event">查看位置</text>
</view>
</view>
</view>
<!-- 商品列表 -->
<view class="goods bg-white spacing-mb">
<view tt:for="{{detail.items}}" tt:key="item" class="goods-item oh">
<view tt:for="{{detail.items}}" tt:key="item" class="goods-item
br-b-dashed
oh">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
...
...
@@ -29,22 +35,60 @@
</view>
</navigator>
</view>
<view class="order-describe">{{detail.describe}}</view>
</view>
<!-- 虚拟销售数据 -->
<view tt:if="{{detail.order_model == 3 && detail.pay_status == 1 && (detail.status == 3 || detail.status == 4)}}" class="panel-item spacing-mt site-fictitious">
<view class="panel-title">{{site_fictitious.title || '密钥信息'}}</view>
<view class="panel-content bg-white oh">
<view tt:if="{{(site_fictitious.tips || null) != null}}" class="tips-value">
<rich-text nodes="{{site_fictitious.tips}}"></rich-text>
</view>
<view tt:for="{{detail.items}}" tt:key="item" class="item br-b-dashed oh">
<image class="left-image br fl" src="{{item.images}}" mode="aspectFill" />
<view class="right-value fr">
<view tt:if="{{(item.fictitious_goods_value || null) != null}}" class="rich-text-value">
<rich-text nodes="{{item.fictitious_goods_value}}"></rich-text>
</view>
<text tt:else class="cr-888 not-value">未配置数据</text>
</view>
</view>
</view>
</view>
<!-- 自提信息 -->
<view tt:if="{{detail.order_model == 2 && (detail.status == 2 || detail.status == 3) && (detail.extraction_data || null) != null}}" class="panel-item spacing-mt site-extraction">
<view class="panel-title">取货信息</view>
<view class="panel-content bg-white oh">
<view>
<text>取货码:</text>
<text class="code">{{detail.extraction_data.code || '取货码不存在、请联系管理员'}}</text>
</view>
<image tt:if="{{(detail.extraction_data.images || null) != null}}" class="br qrcode" src="{{detail.extraction_data.images}}" mode="aspectFill" />
</view>
</view>
<!-- 订单基础数据 -->
<view tt:if="{{detail_list.length > 0}}" class="detail-list bg-white">
<view tt:for="{{detail_list}}" tt:key="item" class="item br-b oh">
<view class="title fl">{{item.name}}</view>
<view class="content cr-888 fl br-l">{{item.value}}</view>
<view tt:if="{{detail_list.length > 0}}" class="panel-item spacing-mt">
<view class="panel-title">基础数据</view>
<view class="panel-content bg-white">
<view tt:for="{{detail_list}}" tt:key="item" class="item br-b oh">
<view class="title fl">{{item.name}}</view>
<view class="content cr-888 fl br-l">{{item.value}}</view>
</view>
</view>
</view>
<!-- 扩展数据 -->
<view tt:if="{{extension_data.length > 0}}" class="extension-list bg-white spacing-mt">
<view tt:for="{{extension_data}}" tt:key="item" class="item br-b oh">
<view tt:if="{{extension_data.length > 0}}" class="panel-item spacing-mt extension-list">
<view class="panel-title">扩展数据</view>
<view class="panel-content bg-white">
<view tt:for="{{extension_data}}" tt:key="item" class="item br-b oh">
<text class="title">{{item.name}}</text>
<text class="content cr-888 br-l">{{item.tips}}</text>
</view>
</view>
</view>
<import src="/pages/common/bottom_line.ttml" />
...
...
public/appmini/old/toutiao/pages/user-order-detail/user-order-detail.ttss
浏览文件 @
667901a9
/*
* 地址信息
*/
.address {
padding: 10rpx;
}
...
...
@@ -5,7 +8,7 @@
padding: 10rpx 35rpx 10rpx 10rpx;
}
.address-detail .icon {
width: 3
5
rpx;
width: 3
0
rpx;
height: 35rpx !important;
}
.address-detail .text {
...
...
@@ -23,13 +26,23 @@
height: 85rpx;
line-height: 85rpx;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
/*
* 商品信息
*/
.goods-base {
min-height: 160rpx;
margin-left: 180rpx;
}
.goods .goods-item:
not(:last-child)
{
border-bottom:
1px dashed #efefef
;
.goods .goods-item:
last-child
{
border-bottom:
0
;
}
.goods-item {
padding: 20rpx 10rpx;
...
...
@@ -50,26 +63,36 @@
right: 0;
bottom: 0;
}
.order-describe {
padding: 20rpx 10rpx;
}
/*
*
基础
信息
*
面板
信息
*/
.detail-list {
padding: 0 10rpx;
}
.detail-list .item {
.panel-item .panel-title {
background: #fff;
font-weight: bold;
padding: 15rpx;
border-bottom: 2px solid #eee;
font-size: 34rpx;
}
.panel-item .panel-content .item {
padding: 20rpx 0;
}
.detail-list .item .title {
.panel-item .panel-content .item:last-child {
border: 0;
}
.panel-item .panel-content .item .title {
width: 25%;
padding-left: 20rpx;
}
.
detail-lis
t .item .content {
.
panel-item .panel-conten
t .item .content {
width: calc(75% - 50rpx);
padding-left: 20rpx;
min-height: 46rpx;
}
.
detail-lis
t .item view {
.
panel-item .panel-conten
t .item view {
line-height: 46rpx;
}
...
...
@@ -84,4 +107,62 @@
}
.extension-list .item .content {
padding-left: 20rpx;
}
/*
* 虚拟销售信息
*/
.site-fictitious .panel-content {
padding: 0 20rpx;
}
.site-fictitious .panel-content .tips-value {
color: #f37b1d;
background-color: #fff2e9;
border-color: #ffebdb;
padding: 10rpx;
margin-top: 20rpx;
}
.site-fictitious .panel-content .left-image {
width: 80rpx;
height: 80rpx;
}
.site-fictitious .panel-content .right-value,
.site-fictitious .panel-content .right-value .rich-text-value {
width: calc(100% - 100rpx);
}
.site-fictitious .panel-content .item {
position: relative;
}
.site-fictitious .panel-content .right-value .rich-text-value {
position: absolute;
top: 0;
right: 0;
}
.site-fictitious .panel-content .right-value .not-value {
margin-left: 10rpx;
}
/*
* 自提信息
*/
.site-extraction .panel-content {
padding: 20rpx;
}
.site-extraction .panel-content .code {
background: #5eb95e;
color: #fff;
}
.site-extraction .panel-content .code,
.address-map-submit {
padding: 1rpx 16rpx;
border-radius: 6rpx;
}
.site-extraction .panel-content .qrcode {
margin-top: 15rpx;
width: 300rpx;
height: 300rpx;
}
.address-map-submit {
margin-left: 20rpx;
background: #f5f5f5;
}
\ No newline at end of file
public/appmini/old/toutiao/pages/user-order/user-order.js
浏览文件 @
667901a9
...
...
@@ -49,16 +49,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
'
init
'
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -156,8 +163,9 @@ Page({
data_list_loding_status
:
0
,
load_status
:
1
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -215,7 +223,7 @@ Page({
tt
.
showLoading
({
title
:
"
请求中...
"
});
tt
.
request
({
url
:
app
.
get_request_url
(
"
pay
"
,
"
toutiao
"
),
url
:
app
.
get_request_url
(
"
pay
"
,
"
order
"
),
method
:
"
POST
"
,
data
:
{
id
:
order_id
,
...
...
@@ -227,36 +235,29 @@ Page({
if
(
res
.
data
.
code
==
0
)
{
// 是否在线支付,非在线支付则支付成功
if
(
res
.
data
.
data
.
is_online_pay
==
0
)
{
var
temp_data_list
=
this
.
data
.
data_list
;
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待发货
'
;
this
.
setData
({
data_list
:
temp_data_list
});
// 数据设置
self
.
order_item_pay_success_handle
(
index
);
app
.
showToast
(
"
支付成功
"
,
"
success
"
);
}
else
{
tt
.
pay
({
orderInfo
:
res
.
data
.
data
.
order_info
,
service
:
res
.
data
.
data
.
service
,
success
(
res
)
{
if
(
res
.
code
==
0
)
{
// 数据设置
var
temp_data_list
=
self
.
data
.
data_list
;
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待发货
'
;
self
.
setData
({
data_list
:
temp_data_list
});
// 跳转支付页面
wx
.
navigateTo
({
url
:
"
/pages/paytips/paytips?code=9000&total_price=
"
+
self
.
data
.
data_list
[
index
][
'
total_price
'
]
});
}
else
{
app
.
showToast
(
'
支付失败
'
);
}
tt
.
requestPayment
({
timeStamp
:
res
.
data
.
data
.
data
.
timeStamp
,
nonceStr
:
res
.
data
.
data
.
data
.
nonceStr
,
package
:
res
.
data
.
data
.
data
.
package
,
signType
:
res
.
data
.
data
.
data
.
signType
,
paySign
:
res
.
data
.
data
.
data
.
paySign
,
success
:
function
(
res
)
{
// 数据设置
self
.
order_item_pay_success_handle
(
index
);
// 跳转支付页面
tt
.
navigateTo
({
url
:
"
/pages/paytips/paytips?code=9000&total_price=
"
+
self
.
data
.
data_list
[
index
][
'
total_price
'
]
});
},
fail
(
res
)
{
console
.
log
(
res
,
'
pay-fail
'
)
app
.
showToast
(
'
调起收银台失败-
'
+
res
.
data
.
code
);
fail
:
function
(
res
)
{
app
.
showToast
(
'
支付失败
'
);
}
});
}
...
...
@@ -271,6 +272,32 @@ Page({
});
},
// 支付成功数据设置
order_item_pay_success_handle
(
index
)
{
// 数据设置
var
temp_data_list
=
this
.
data
.
data_list
;
switch
(
parseInt
(
temp_data_list
[
index
][
'
order_model
'
]))
{
// 销售模式
case
0
:
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待发货
'
;
break
;
// 自提模式
case
2
:
temp_data_list
[
index
][
'
status
'
]
=
2
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待取货
'
;
break
;
// 虚拟模式
case
3
:
temp_data_list
[
index
][
'
status
'
]
=
3
;
temp_data_list
[
index
][
'
status_name
'
]
=
'
待收货
'
;
break
;
}
this
.
setData
({
data_list
:
temp_data_list
});
},
// 取消
cancel_event
(
e
)
{
tt
.
showModal
({
...
...
public/appmini/old/toutiao/pages/user-order/user-order.ttml
浏览文件 @
667901a9
...
...
@@ -14,7 +14,7 @@
<text class="cr-666">{{item.add_time}}</text>
<text class="fr cr-main">{{item.status_name}}</text>
</view>
<view tt:for="{{item.items}}" tt:key="key" tt:for-item="detail" class="goods-item oh">
<view tt:for="{{item.items}}" tt:key="key" tt:for-item="detail" class="goods-item
br-b-dashed
oh">
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
<image class="goods-image fl" src="{{detail.images}}" mode="aspectFill" />
<view class="goods-base">
...
...
@@ -34,10 +34,10 @@
</navigator>
</view>
<view class="item-describe tr cr-666">{{item.describe}}</view>
<view tt:if="{{item.status
<= 3 || (item.status == 4 && item.user_is_comments == 0
)}}" class="item-operation tr br-t">
<view tt:if="{{item.status
== 1 || item.status == 3 || (item.status == 4 && item.user_is_comments == 0) || (item.status == 2 && item.order_model != 2
)}}" class="item-operation tr br-t">
<button tt:if="{{item.status <= 1}}" class="submit-cancel" type="default" size="mini" bindtap="cancel_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">取消</button>
<button tt:if="{{item.status == 1}}" class="submit-pay cr-666 br" type="default" size="mini" bindtap="pay_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">支付</button>
<button tt:if="{{item.status == 2}}" class="submit-rush cr-666 br" type="default" size="mini" bindtap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">催催</button>
<button tt:if="{{item.status == 2
&& item.order_model != 2
}}" class="submit-rush cr-666 br" type="default" size="mini" bindtap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">催催</button>
<button tt:if="{{item.status == 3}}" class="submit-success cr-666 br" type="default" size="mini" bindtap="collect_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">收货</button>
<button tt:if="{{item.status == 4 && item.user_is_comments == 0}}" class="submit-success cr-666 br" type="default" size="mini" bindtap="comments_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none">评论</button>
</view>
...
...
public/appmini/old/toutiao/pages/user-order/user-order.ttss
浏览文件 @
667901a9
...
...
@@ -24,8 +24,8 @@
.goods-title {
line-height: 36rpx;
}
.list-item .goods-item:
not(:last-child)
{
border-bottom:
1px dashed #efefef
;
.list-item .goods-item:
last-child
{
border-bottom:
0
;
}
.goods-item {
padding: 20rpx 10rpx;
...
...
public/appmini/old/toutiao/pages/user-orderaftersale/user-orderaftersale.js
浏览文件 @
667901a9
...
...
@@ -51,16 +51,23 @@ Page({
},
init
()
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
);
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
var
user
=
app
.
get_user_info
(
this
,
"
init
"
);
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
redirectTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
return
false
;
}
else
{
// 获取数据
this
.
get_data_list
();
}
}
else
{
// 获取数据
this
.
get_data_list
();
this
.
setData
({
data_list_loding_status
:
0
,
data_bottom_line_status
:
false
,
});
}
},
...
...
@@ -134,8 +141,9 @@ Page({
data_list_loding_status
:
0
,
data_list_loding_msg
:
res
.
data
.
msg
,
});
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
,
this
,
'
get_data_list
'
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
}
},
fail
:
()
=>
{
...
...
@@ -209,7 +217,11 @@ Page({
app
.
showToast
(
res
.
data
.
msg
,
"
success
"
);
}
else
{
app
.
showToast
(
res
.
data
.
msg
);
if
(
app
.
is_login_check
(
res
.
data
))
{
app
.
showToast
(
res
.
data
.
msg
);
}
else
{
app
.
showToast
(
'
提交失败,请重试!
'
);
}
}
},
fail
:
()
=>
{
...
...
public/appmini/old/toutiao/pages/user/user.js
浏览文件 @
667901a9
...
...
@@ -32,31 +32,32 @@ Page({
},
init
(
e
)
{
var
user
=
app
.
get_user_cache_info
(
this
,
"
init
"
),
self
=
this
;
// 用户未绑定用户则转到登录页面
var
msg
=
(
user
==
false
)
?
'
授权用户信息
'
:
'
绑定手机号码
'
;
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
msg
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
tt
.
stopPullDownRefresh
();
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
var
user
=
app
.
get_user_info
(
this
,
"
init
"
),
self
=
this
;
if
(
user
!=
false
)
{
// 用户未绑定用户则转到登录页面
if
(
app
.
user_is_need_login
(
user
))
{
tt
.
showModal
({
title
:
'
温馨提示
'
,
content
:
'
绑定手机号码
'
,
confirmText
:
'
确认
'
,
cancelText
:
'
暂不
'
,
success
:
(
result
)
=>
{
tt
.
stopPullDownRefresh
();
if
(
result
.
confirm
)
{
tt
.
navigateTo
({
url
:
"
/pages/login/login?event_callback=init
"
});
}
self
.
setData
({
avatar
:
user
.
avatar
||
app
.
data
.
default_user_head_src
,
nickname
:
user
.
user_name_view
||
'
用户名
'
,
});
}
self
.
setData
({
avatar
:
user
.
avatar
||
app
.
data
.
default_user_head_src
,
nickname
:
user
.
user_name_view
||
'
用户名
'
,
});
},
});
}
else
{
self
.
get_data
();
},
});
}
else
{
self
.
get_data
();
}
}
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录