Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mall-app-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
mall-app-web
Commits
0d2250b8
提交
0d2250b8
authored
6月 04, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
埋点添加
上级
bf845e1e
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
191 行增加
和
17 行删除
+191
-17
App.vue
App.vue
+0
-1
cart.js
api/cart.js
+3
-0
event.js
api/event.js
+31
-0
home.js
api/home.js
+9
-0
request.js
js_sdk/luch-request/request.js
+1
-1
manifest.json
manifest.json
+4
-3
package-lock.json
package-lock.json
+6
-0
index.vue
pages/index/index.vue
+15
-2
pay.vue
pages/money/pay.vue
+11
-0
createOrder.vue
pages/order/createOrder.vue
+11
-0
order.vue
pages/order/order.vue
+37
-7
product.vue
pages/product/product.vue
+27
-0
login.vue
pages/public/login.vue
+17
-0
set.vue
pages/set/set.vue
+13
-0
appConfig.js
utils/appConfig.js
+3
-1
requestUtil.js
utils/requestUtil.js
+3
-2
没有找到文件。
App.vue
浏览文件 @
0d2250b8
...
...
@@ -20,7 +20,6 @@
}
});
}
},
onShow
:
function
()
{
console
.
log
(
'App Show'
)
...
...
api/cart.js
浏览文件 @
0d2250b8
...
...
@@ -4,6 +4,9 @@ export function addCartItem(data) {
return
request
({
method
:
'POST'
,
url
:
'/cart/add'
,
// header: {
// 'content-type': 'application/json;charset=utf-8'
// },
data
:
data
})
}
...
...
api/event.js
0 → 100644
浏览文件 @
0d2250b8
function
jsonToQueryString
(
json
)
{
return
Object
.
keys
(
json
)
.
map
(
key
=>
encodeURIComponent
(
key
)
+
'='
+
encodeURIComponent
(
json
[
key
]))
.
join
(
'&'
);
}
export
function
eventSite
(
params
)
{
var
p
=
jsonToQueryString
(
Object
.
assign
({
experiment_id
:
'7028276368903241728'
,
experiment_connection_id
:
'7201846824305426432'
,
},
params
))
var
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
'GET'
,
`https://saas-dml-pro.ezijing.com/api/lab/v1/experiment/member/event-create-by-shop?
${
p
}
`
,
true
);
xhr
.
withCredentials
=
true
;
xhr
.
send
();
}
export
function
getCurrentTime
()
{
var
currentTime
=
new
Date
();
var
year
=
currentTime
.
getFullYear
();
var
month
=
currentTime
.
getMonth
()
+
1
;
// 月份从0开始,因此需要1
var
day
=
currentTime
.
getDate
();
var
hours
=
currentTime
.
getHours
();
var
minutes
=
currentTime
.
getMinutes
();
var
seconds
=
currentTime
.
getSeconds
();
return
`
${
year
}
-
${
toDo
(
month
)}
-
${
toDo
(
day
)}
${
toDo
(
hours
)}
:
${
toDo
(
minutes
)}
:
${
toDo
(
seconds
)}
`
}
function
toDo
(
n
)
{
return
n
<
10
?
'0'
+
n
:
n
}
\ No newline at end of file
api/home.js
浏览文件 @
0d2250b8
...
...
@@ -37,3 +37,11 @@ export function fetchHotProductList(params) {
params
:
params
})
}
export
function
setEventSite
(
params
)
{
return
request
({
method
:
'GET'
,
url
:
'/api/lab/v1/experiment/member/event-create-by-shop'
,
params
:
params
})
}
\ No newline at end of file
js_sdk/luch-request/request.js
浏览文件 @
0d2250b8
...
...
@@ -11,7 +11,7 @@ export default class Request {
config
=
{
baseUrl
:
''
,
header
:
{
'content-type'
:
'application/json;charset=
UTF
-8'
'content-type'
:
'application/json;charset=
utf
-8'
},
method
:
'GET'
,
dataType
:
'json'
,
...
...
manifest.json
浏览文件 @
0d2250b8
...
...
@@ -63,10 +63,11 @@
},
"h5"
:
{
"devServer"
:
{
"https"
:
false
,
"port"
:
8060
"https"
:
true
,
"port"
:
8060
,
"host"
:
"dev.ezijing.com"
},
"domain"
:
"localhost
"
,
//
"domain"
:
"dev.ezijing.com
"
,
"router"
:
{
"base"
:
""
}
...
...
package-lock.json
0 → 100644
浏览文件 @
0d2250b8
{
"name"
:
"mall-app-web"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{}
}
pages/index/index.vue
浏览文件 @
0d2250b8
...
...
@@ -145,7 +145,7 @@
<view
class=
"f-header m-t"
>
<image
src=
"/static/icon_recommend_product.png"
></image>
<view
class=
"tit-box"
>
<text
class=
"tit"
>
猜你喜欢
</text>
<text
class=
"tit"
@
click=
"handleEventSite()"
>
猜你喜欢
</text>
<text
class=
"tit2"
>
你喜欢的都在这里了
</text>
</view>
<text
class=
"yticon icon-you"
v-show=
"false"
></text>
...
...
@@ -168,12 +168,14 @@
<
script
>
import
{
fetchContent
,
fetchRecommendProductList
fetchRecommendProductList
,
setEventSite
}
from
'@/api/home.js'
;
import
{
formatDate
}
from
'@/utils/date'
;
import
uniLoadMore
from
'@/components/uni-load-more/uni-load-more.vue'
;
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
export
default
{
components
:
{
uniLoadMore
...
...
@@ -199,6 +201,9 @@
loadingType
:
'more'
};
},
onShow
()
{
this
.
handleEventSite
()
},
onLoad
()
{
this
.
loadData
();
},
...
...
@@ -254,6 +259,14 @@
},
},
methods
:
{
handleEventSite
(
name
)
{
eventSite
({
event_english_name
:
'enter_brand_homepage'
,
event_name
:
'进入品牌首页'
,
action_type
:
'首页'
,
entry_time
:
getCurrentTime
(),
})
},
/**
* 加载数据
*/
...
...
pages/money/pay.vue
浏览文件 @
0d2250b8
...
...
@@ -34,6 +34,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
{
fetchOrderDetail
,
payOrderSuccess
...
...
@@ -60,6 +61,16 @@
},
//确认支付
confirm
:
async
function
()
{
eventSite
({
event_english_name
:
'payment'
,
event_name
:
'付款'
,
action_type
:
'付款'
,
product_name
:
this
.
orderInfo
.
orderItemList
[
0
].
productBrand
,
product_id
:
this
.
orderInfo
.
orderItemList
[
0
].
id
,
operation_time
:
getCurrentTime
(),
payment_channel
:
this
.
payType
!=
1
?
'微信'
:
'支付宝'
,
payment_amount
:
this
.
orderInfo
.
payAmount
})
if
(
USE_ALIPAY
){
if
(
this
.
payType
!=
1
){
uni
.
showToast
({
...
...
pages/order/createOrder.vue
浏览文件 @
0d2250b8
...
...
@@ -124,6 +124,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
{
generateConfirmOrder
,
generateOrder
...
...
@@ -229,6 +230,16 @@
}
generateOrder
(
orderParam
).
then
(
response
=>
{
let
orderId
=
response
.
data
.
order
.
id
;
eventSite
({
event_english_name
:
'place_order'
,
event_name
:
'提交订单'
,
product_name
:
this
.
cartPromotionItemList
[
0
].
productBrand
,
product_id
:
this
.
cartPromotionItemList
[
0
].
id
,
action_type
:
'提交订单'
,
operation_time
:
getCurrentTime
(),
order_number
:
orderId
,
order_amount
:
response
.
data
.
order
.
payAmount
})
uni
.
showModal
({
title
:
'提示'
,
content
:
'订单创建成功,是否要立即支付?'
,
...
...
pages/order/order.vue
浏览文件 @
0d2250b8
...
...
@@ -37,15 +37,15 @@
<text
class=
"price"
>
{{
item
.
payAmount
}}
</text>
</view>
<view
class=
"action-box b-t"
v-if=
"item.status == 0"
>
<button
class=
"action-btn"
@
click=
"cancelOrder(item
.id
)"
>
取消订单
</button>
<button
class=
"action-btn"
@
click=
"cancelOrder(item)"
>
取消订单
</button>
<button
class=
"action-btn recom"
@
click=
"payOrder(item.id)"
>
立即付款
</button>
</view>
<view
class=
"action-box b-t"
v-if=
"item.status == 2"
>
<button
class=
"action-btn"
>
查看物流
</button>
<button
class=
"action-btn recom"
@
click=
"receiveOrder(item
.id
)"
>
确认收货
</button>
<button
class=
"action-btn recom"
@
click=
"receiveOrder(item)"
>
确认收货
</button>
</view>
<view
class=
"action-box b-t"
v-if=
"item.status == 3"
>
<button
class=
"action-btn recom"
>
评价商品
</button>
<button
class=
"action-btn recom"
@
click=
"pjsp(item)"
>
评价商品
</button>
</view>
</view>
...
...
@@ -58,6 +58,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
uniLoadMore
from
'@/components/uni-load-more/uni-load-more.vue'
;
import
empty
from
"@/components/empty"
;
import
{
...
...
@@ -165,6 +166,17 @@
},
},
methods
:
{
pjsp
(
item
)
{
eventSite
({
event_english_name
:
'rate_the_product'
,
event_name
:
'评价商品'
,
action_type
:
'评价商品'
,
product_name
:
item
.
orderItemList
[
0
].
productBrand
,
product_id
:
item
.
orderItemList
[
0
].
id
,
operation_time
:
getCurrentTime
(),
order_number
:
item
.
id
,
})
},
//获取订单列表
loadData
(
type
=
'refresh'
)
{
if
(
type
==
'refresh'
){
...
...
@@ -229,17 +241,26 @@
});
},
//取消订单
cancelOrder
(
order
Id
)
{
cancelOrder
(
order
)
{
let
superThis
=
this
;
uni
.
showModal
({
title
:
'提示'
,
content
:
'是否要取消该订单?'
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
eventSite
({
event_english_name
:
'cancel_order'
,
event_name
:
'取消订单'
,
action_type
:
'取消订单'
,
product_name
:
order
.
orderItemList
[
0
].
productBrand
,
product_id
:
order
.
orderItemList
[
0
].
id
,
operation_time
:
getCurrentTime
(),
order_number
:
order
.
id
,
})
uni
.
showLoading
({
title
:
'请稍后'
})
cancelUserOrder
({
orderId
:
order
I
d
}).
then
(
response
=>
{
cancelUserOrder
({
orderId
:
order
.
i
d
}).
then
(
response
=>
{
uni
.
hideLoading
();
superThis
.
loadData
();
});
...
...
@@ -256,17 +277,26 @@
});
},
//确认收货
receiveOrder
(
order
Id
){
receiveOrder
(
order
){
let
superThis
=
this
;
uni
.
showModal
({
title
:
'提示'
,
content
:
'是否要确认收货?'
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
eventSite
({
event_english_name
:
'confirm_receipt'
,
event_name
:
'确认收货'
,
action_type
:
'确认收货'
,
product_name
:
order
.
orderItemList
[
0
].
productBrand
,
product_id
:
order
.
orderItemList
[
0
].
id
,
operation_time
:
getCurrentTime
(),
order_number
:
order
.
id
,
})
uni
.
showLoading
({
title
:
'请稍后'
})
confirmReceiveOrder
({
orderId
:
order
I
d
}).
then
(
response
=>
{
confirmReceiveOrder
({
orderId
:
order
.
i
d
}).
then
(
response
=>
{
uni
.
hideLoading
();
superThis
.
loadData
();
});
...
...
pages/product/product.vue
浏览文件 @
0d2250b8
...
...
@@ -216,6 +216,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
share
from
'@/components/share'
;
import
{
fetchProductDetail
...
...
@@ -297,6 +298,8 @@
couponList
:
[]
};
},
onShow
()
{
},
async
onLoad
(
options
)
{
let
id
=
options
.
id
;
this
.
shareList
=
defaultShareList
;
...
...
@@ -338,6 +341,14 @@
this
.
initProductDesc
();
this
.
handleReadHistory
();
this
.
initProductCollection
();
eventSite
({
event_english_name
:
'open_product_details'
,
product_name
:
this
.
product
.
brandName
,
product_id
:
this
.
product
.
id
,
event_name
:
'打开商品详情'
,
action_type
:
'打开商品详情'
,
operation_time
:
getCurrentTime
(),
})
});
},
//规格弹窗开关
...
...
@@ -452,6 +463,14 @@
});
this
.
favorite
=
!
this
.
favorite
;
});
eventSite
({
event_english_name
:
'favorite'
,
event_name
:
'收藏'
,
product_name
:
this
.
product
.
brandName
,
product_id
:
this
.
product
.
id
,
action_type
:
'收藏'
,
operation_time
:
getCurrentTime
(),
})
}
},
buy
()
{
...
...
@@ -641,6 +660,14 @@
if
(
!
this
.
checkForLogin
())
{
return
;
}
eventSite
({
event_english_name
:
'add_to_cart'
,
product_name
:
this
.
product
.
brandName
,
product_id
:
this
.
product
.
id
,
event_name
:
'加入购物车'
,
action_type
:
'加入购物车'
,
operation_time
:
getCurrentTime
(),
})
let
productSkuStock
=
this
.
getSkuStock
();
let
cartItem
=
{
price
:
this
.
product
.
price
,
...
...
pages/public/login.vue
浏览文件 @
0d2250b8
...
...
@@ -34,6 +34,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
{
mapMutations
}
from
'vuex'
;
...
...
@@ -53,14 +54,30 @@
this
.
password
=
uni
.
getStorageSync
(
'password'
)
||
''
;
},
methods
:
{
handleEventSite
(
type
)
{
window
.
localStorage
.
user_name
=
this
.
username
eventSite
({
event_english_name
:
'login_logout_register'
,
event_name
:
'登录退出注册'
,
user_id
:
new
Date
().
getTime
(),
user_name
:
this
.
username
,
mobile_number
:
this
.
username
,
action_type
:
type
===
1
?
'登录'
:
'注册'
,
timestamp
:
getCurrentTime
(),
})
},
...
mapMutations
([
'login'
]),
navBack
()
{
uni
.
navigateBack
();
},
toRegist
()
{
this
.
handleEventSite
(
2
)
uni
.
navigateTo
({
url
:
'/pages/public/register'
});
},
async
toLogin
()
{
if
(
this
.
username
!==
''
)
{
this
.
handleEventSite
(
1
)
}
this
.
logining
=
true
;
memberLogin
({
username
:
this
.
username
,
...
...
pages/set/set.vue
浏览文件 @
0d2250b8
...
...
@@ -37,6 +37,7 @@
</
template
>
<
script
>
import
{
eventSite
,
getCurrentTime
}
from
'../../api/event'
;
import
{
mapMutations
}
from
'vuex'
;
...
...
@@ -47,6 +48,17 @@
};
},
methods
:{
handleEventSite
()
{
eventSite
({
event_english_name
:
'login_logout_register'
,
event_name
:
'登录退出注册'
,
user_id
:
new
Date
().
getTime
(),
user_name
:
window
.
localStorage
.
user_name
,
mobile_number
:
window
.
localStorage
.
user_name
,
action_type
:
'退出登录'
,
timestamp
:
getCurrentTime
(),
})
},
...
mapMutations
([
'logout'
]),
navTo
(
url
){
...
...
@@ -62,6 +74,7 @@
},
//退出登录
toLogout
(){
this
.
handleEventSite
()
uni
.
showModal
({
content
:
'确定要退出登录么'
,
success
:
(
e
)
=>
{
...
...
utils/appConfig.js
浏览文件 @
0d2250b8
// appConfig.js
//配置API请求的基础路径
export
const
API_BASE_URL
=
'https://portal-api.macrozheng.com'
export
const
API_BASE_URL
=
'https://mall-portal.ezijing.com'
// export const API_BASE_URL = 'https://saas-dml-pro.ezijing.com'
// https://project-api.ezijing.com/api/passport/account/get-user-info
//是否启用支付宝支付
export
const
USE_ALIPAY
=
false
utils/requestUtil.js
浏览文件 @
0d2250b8
...
...
@@ -6,8 +6,9 @@ const http = new Request()
http
.
setConfig
((
config
)
=>
{
/* 设置全局配置 */
config
.
baseUrl
=
API_BASE_URL
/* 根域名不同 */
config
.
header
=
{
...
config
.
header
}
...
config
.
header
,
},
config
.
withCredentials
=
true
return
config
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论