Files
damai-wx/pages/mine/index.js
MagicalKudzu 8079e6c819 首次提交
2025-12-12 10:35:12 +08:00

625 lines
23 KiB
JavaScript

;(wx.webpackJsonp = wx.webpackJsonp || []).push([
[2312],
{
5358: function (t, e, n) {
var s = n(4160),
r = n(5652),
i = n(2555),
a = n(4107),
c = n(4576),
o = n(758),
u = n(2573),
l = n.n(u),
m = n(4269),
d = n(4752),
f = n(3526),
p = n(6070),
h = function (t) {
var e = t.showSetting,
n = t.userInfoData,
s = n.userInfo,
r = n.statusEntrys,
i = n.settingEntry,
a = t.userLogin,
c = t.onClick
if (!s) return null
var o = s.imgUrl,
u = s.vip,
l = s.vtag,
d = s.userNick
return (0, p.jsxs)(m.Ss, {
className: 'mine-head',
children: [
(0, p.jsxs)(m.Ss, {
className: 'user-info-section',
children: [
(0, p.jsxs)(m.Ss, {
className: 'mine-head-avatar',
children: [
(0, p.jsx)(m._V, { src: o, className: (0, f.A)('common-img', { 'vip-img': u }), onClick: a }),
u ? (0, p.jsx)(m.Ss, { className: 'vip-icon' }) : null,
l > '0' ? (0, p.jsx)(m.Ss, { className: 'v-tag' }) : null,
],
}),
(0, p.jsxs)(m.Ss, {
className: 'user-info',
children: [
(0, p.jsx)(m.Ss, {
className: 'user-info-top',
onClick: a,
children: (0, p.jsx)(m.EY, { className: 'user-info-username', children: d }),
}),
e
? (0, p.jsx)(m.Ss, {
className: 'user-info-setting',
onClick: function () {
c(i)
},
children: (0, p.jsx)(m.EY, { className: 'user-info-setting-text', children: '设置' }),
})
: null,
],
}),
],
}),
(0, p.jsx)(m.Ss, {
className: 'user-status',
children:
null == r
? void 0
: r.map(function (t, e) {
return (0, p.jsxs)(
m.Ss,
{
className: 'user-status-item',
onClick: function () {
c(t)
},
children: [
(0, p.jsx)(m.EY, { className: 'item-number', children: t.number }),
(0, p.jsx)(m.EY, { className: 'item-text', children: t.text }),
],
},
e,
)
}),
}),
],
})
},
x = function (t) {
var e = t.fixedEntrys,
n = t.onClick
if (!e) return null
var s = e.topEntryFrist,
r = e.topEntrySecond,
i = e.entryList
return (0, p.jsxs)(m.Ss, {
className: 'section-fixed-entry',
children: [
(0, p.jsxs)(m.Ss, {
className: 'fixed-entry-top',
children: [
s
? (0, p.jsxs)(m.Ss, {
className: 'fixed-entry-top-item',
'data-item': '{{sectionData.topEntryFrist}}',
onClick: function () {
n(s)
},
children: [
(0, p.jsx)(m._V, { className: 'top-item-icon', src: s.icon }),
(0, p.jsx)(m.EY, { className: 'top-item-text', children: s.text }),
],
})
: null,
(0, p.jsx)(m.Ss, { className: 'top-item-line' }),
r
? (0, p.jsxs)(m.Ss, {
className: 'fixed-entry-top-item',
onClick: function () {
n(r)
},
children: [
(0, p.jsx)(m._V, { className: 'top-item-icon', src: r.icon }),
(0, p.jsx)(m.EY, { className: 'top-item-text', children: r.text }),
],
})
: null,
],
}),
(0, p.jsx)(m.Ss, { className: 'fixed-entry-center-line' }),
(0, p.jsx)(m.Ss, {
className: 'fixed-entry-entrys',
children: i.map(function (t) {
return (0, p.jsxs)(
m.Ss,
{
className: 'entry-item',
'data-item': '{{item}}',
onClick: function () {
n(t)
},
children: [
(0, p.jsx)(m._V, { className: 'entry-item-icon', src: t.icon }),
(0, p.jsx)(m.EY, { className: 'entry-item-text', children: t.text }),
],
},
t.text,
)
}),
}),
],
})
},
g = n(8477),
v = n(4911),
y = n(7422),
S = n(469),
j = n(4694),
N = n(5765),
w = '登录/注册',
b = 'mine-user-data',
k = { type: 'common', text: '设置', spm: 'top.setting', url: '/subPackages/setting/index' }
function A(t) {
var e,
n = new N.g(t)
return (
!(null === (e = n.host) || void 0 === e || !e.endsWith('damai.cn')) ||
('V1' === n.host && ('/ProjectPage' === n.pathname || '/DiscountPage' === n.pathname)) ||
!!(n.host && n.host.indexOf('alimebot') > -1)
)
}
function E() {
var t = {},
e = [
{ number: 0, text: '想看的演出', url: '/pages/want2see/index', spm: 'userstatus.dfavorite_perform' },
{
number: 0,
text: '关注',
url: 'https://m.damai.cn/shows/mine/follow.html?tab=0&hideTab=true',
spm: 'userstatus.dfavorite_person',
},
{
number: 0,
text: '我的评价',
url: 'https://m.damai.cn/shows/pages/my-comment.html',
spm: 'userstatus.dcomment',
},
{
number: 0,
text: '优惠券',
url: 'https://m.damai.cn/movies/coupons/list.html',
spm: 'userstatus.dcoupon',
},
],
n = { imgUrl: 'https://gw.alicdn.com/tfs/TB1OvYEsrj1gK0jSZFuXXcrHpXa-150-150.png', userNick: w }
return (t.userInfoData = { statusEntrys: e, userInfo: n, settingEntry: k }), t
}
function C(t) {
var e = t,
n = {}
if (e) {
var s = [
{ number: 0, text: '想看的演出', url: '/pages/want2see/index', spm: 'userstatus.dfavorite_perform' },
{
number: 0,
text: '关注',
url: 'https://m.damai.cn/shows/mine/follow.html?tab=0&hideTab=true',
spm: 'userstatus.dfavorite_person',
},
{
number: 0,
text: '我的评价',
url: 'https://m.damai.cn/shows/pages/my-comment.html',
spm: 'userstatus.dcomment',
},
{
number: 0,
text: '优惠券',
url: 'https://m.damai.cn/movies/coupons/list.html',
spm: 'userstatus.dcoupon',
},
]
;(s[0].number = e.seeShowCount),
(s[1].number = e.myFollowCount),
(s[2].number = e.commentCount),
(s[3].number = e.couponCount),
e.certificateInfo &&
3 === e.certificateInfo.accountVerifyCode &&
(e.certificateInfo.accountVerifyMsg = '已认证'),
(n.userInfoData = {
statusEntrys: s,
userInfo: e.userInfo,
certificateInfo: e.certificateInfo,
settingEntry: k,
})
var r = e.dynamicMenu.itemList
if (r) {
var i,
a = [],
c = 0,
o = (0, S.A)(r)
try {
for (o.s(); !(i = o.n()).done; ) {
var u = i.value
if (
A(u.targetUrl) &&
('在线客服' !== (null == u ? void 0 : u.title) ||
('在线客服' === (null == u ? void 0 : u.title) && j.Ay.isWX))
) {
var l =
'在线客服' === (null == u ? void 0 : u.title) ? 'dymenu.donlineservice' : 'dymenu.ditem'.concat(c)
a.push({ text: u.title, icon: u.iconUrl, url: u.targetUrl, bubbleText: u.bubbleText, spm: l }), c++
}
}
} catch (t) {
o.e(t)
} finally {
o.f()
}
a.length > 0 && (n.dyEntryData = { items: a })
}
}
return n
}
function X() {
try {
var t = l().getStorageSync(b)
if (t && t.length > 0) return JSON.parse(t)
} catch (t) {}
return E()
}
function D(t) {
l().setStorage({ key: b, data: JSON.stringify(t) })
}
var T = n(3816),
I = n(9294),
F = n(7884),
B = function () {
var t = (0, o.useRef)(null),
e = (0, o.useRef)(!1),
n = (0, o.useState)({ showSetting: !1, mineData: X() }),
s = (0, c.A)(n, 2),
a = s[0],
m = s[1],
d = function () {
t.current = !1
},
f = (function () {
var t = (0, i.A)(
(0, r.A)().m(function t() {
var e, n, s, i, a
return (0, r.A)().w(function (t) {
for (;;)
switch (t.n) {
case 0:
return (t.n = 1), I.A.getUserMyContent()
case 1:
if (((e = t.v), (n = (0, c.A)(e, 2)), (s = n[0]), (i = n[1]), !s)) {
t.n = 2
break
}
return d(), t.a(2)
case 2:
i && ((a = C(i)), m({ mineData: a, showSetting: !0 }), D(a))
case 3:
return t.a(2)
}
}, t)
}),
)
return function () {
return t.apply(this, arguments)
}
})(),
p = (function () {
var e = (0, i.A)(
(0, r.A)().m(function e() {
return (0, r.A)().w(function (e) {
for (;;)
switch (e.n) {
case 0:
return (e.n = 1), T.A.isLogin()
case 1:
e.v ? ((t.current = !0), f()) : ((t.current = !1), m({ showSetting: !1, mineData: E() }))
case 2:
return e.a(2)
}
}, e)
}),
)
return function () {
return e.apply(this, arguments)
}
})(),
h = (function () {
var e = (0, i.A)(
(0, r.A)().m(function e() {
var n, s, i, c
return (0, r.A)().w(function (e) {
for (;;)
switch (e.n) {
case 0:
if (
((s = (null == a ? void 0 : a.mineData) || {}),
!1 !== t.current ||
(null != s &&
s.userInfo &&
(null == s || null === (n = s.userInfo) || void 0 === n ? void 0 : n.userNick) !== w))
) {
e.n = 2
break
}
return (t.current = !0), l().showLoading(), (e.n = 1), T.A.login()
case 1:
;(i = e.v), (c = i.success), l().hideLoading(), c ? ((t.current = !0), f()) : (t.current = !1)
case 2:
return e.a(2)
}
}, e)
}),
)
return function () {
return e.apply(this, arguments)
}
})(),
x = function () {
return F.X.getMxmAccessToken({ sid: T.A.getSid() })
},
g = (function () {
var t = (0, i.A)(
(0, r.A)().m(function t() {
var e, n, s, i, a, o, u, l, m, d
return (0, r.A)().w(function (t) {
for (;;)
switch (t.n) {
case 0:
return (e = ''), (t.n = 1), x()
case 1:
if (
((n = t.v),
(s = (0, c.A)(n, 2)),
(i = s[0]),
(a = s[1]),
!i || 'FAIL_SYS_SESSION_EXPIRED' !== i.code)
) {
t.n = 5
break
}
return (t.n = 2), T.A.login()
case 2:
if (((o = t.v), !o.success)) {
t.n = 4
break
}
return (t.n = 3), x()
case 3:
;(u = t.v), (l = (0, c.A)(u, 2)), (m = l[0]), (d = l[1]), !m && d && (e = d)
case 4:
t.n = 6
break
case 5:
!i && a && (e = a)
case 6:
return t.a(2, e)
}
}, t)
}),
)
return function () {
return t.apply(this, arguments)
}
})()
return (
(0, u.useDidShow)(function () {
e.current && ((t.current = null), (e.current = !1), p())
}),
(0, u.useDidHide)(function () {
e.current = !0
}),
(0, o.useEffect)(function () {
p()
}, []),
[{ userData: a, loginRef: t }, h, g]
)
},
_ = '1010-3721',
P = {
topEntryFrist: {
type: 'common',
icon: 'https://gw.alicdn.com/tfs/TB13jtRtYj1gK0jSZFuXXcrHpXa-72-72.png',
text: '我的订单',
url: 'https://m.damai.cn/shows/orders.html',
spm: 'list.dorder',
},
topEntrySecond: {
type: 'common',
icon: 'https://gw.alicdn.com/tfs/TB1nExMt.T1gK0jSZFhXXaAtVXa-72-72.png',
text: '票夹',
url: 'https://m.damai.cn/shows/ticket/list.html',
spm: 'list.dpiaojia',
},
entryList: [
{
type: 'common',
icon: 'https://gw.alicdn.com/tfs/TB1GsxwtkL0gK0jSZFAXXcA9pXa-72-72.png',
text: '观演人',
url: 'https://m.damai.cn/shows/mine/audience.html',
spm: 'list.dcontact',
},
{
type: 'common',
icon: 'https://gw.alicdn.com/tfs/TB1UiVytkT2gK0jSZPcXXcKkpXa-72-72.png',
text: '收货地址',
url: 'https://m.damai.cn/shows/pages/address-list.html',
spm: 'list.dreceipt',
},
{
type: 'common',
icon: 'https://gw.alicdn.com/tfs/TB1n1JutkL0gK0jSZFtXXXQCXXa-72-72.png',
text: '意见反馈',
url: 'https://t.damai.cn/yep/page/m/ctup50jlek',
spm: 'list.dresponse',
},
],
},
Y = function () {
var t,
e = B(),
n = (0, c.A)(e, 2),
s = n[0].userData,
f = n[1],
S = (0, o.useRef)(!1),
j = (0, u.useRouter)()
if (
((0, u.usePageScroll)(function (t) {
var e = t.scrollTop > 0
S.current !== e &&
((S.current = e),
(function (t) {
l().setNavigationBarTitle({ title: t })
})(e ? '我的' : ''))
}),
(0, u.useDidShow)(function () {
d.Ay.sendPV(
{ spmB: 'mydamai' },
(0, a.A)({ _pageRoute: 'pages/mine/index' }, null == j ? void 0 : j.params),
)
}),
!s)
)
return null
var N = s.mineData,
w = N.userInfoData,
b = N.dyEntryData,
k = s.showSetting,
A = (function () {
var t = (0, i.A)(
(0, r.A)().m(function t(e) {
var n, s, i
return (0, r.A)().w(function (t) {
for (;;)
switch (t.n) {
case 0:
if (!(n = (0, a.A)({}, e))) {
t.n = 2
break
}
if (
((s = {}),
n.number && n.number > 0 && (s.number = n.number),
(i = ''.concat(y.A.spmA, '.').concat('mydamai', '.').concat(n.spm)),
(s.spm = i),
y.A.sendClickEvent(i, { clicktitle: n.text }),
'设置' !== n.text)
) {
t.n = 1
break
}
return v.A.navTo(n.url), t.a(2)
case 1:
v.A.navTo(n.url, s)
case 2:
return t.a(2)
}
}, t)
}),
)
return function (e) {
return t.apply(this, arguments)
}
})(),
E = function () {}
return (0, p.jsx)(m.BM, {
scrollY: !0,
id: 'scroll-view-box',
children: (0, p.jsxs)(m.Ss, {
className: 'container',
children: [
(0, p.jsx)(m.Ss, { className: 'bg' }),
(0, p.jsx)(m.Ss, {
className: 'top-section',
children: (0, p.jsx)(m.Ss, {
className: 'section',
children: w ? (0, p.jsx)(h, { showSetting: k, onClick: A, userInfoData: w, userLogin: f }) : null,
}),
}),
P
? (0, p.jsx)(m.Ss, { className: 'section', children: (0, p.jsx)(x, { fixedEntrys: P, onClick: A }) })
: null,
(null == b || null === (t = b.items) || void 0 === t ? void 0 : t.length) > 0
? (0, p.jsx)(m.Ss, {
className: 'dy-entry-section',
children: (0, p.jsx)(m.Ss, {
className: 'dy-entrys',
children: b.items.map(function (t) {
return (0, p.jsxs)(
m.Ss,
{
className: 'entry-item',
onClick: function () {
A(t)
},
children: [
(0, p.jsx)(m._V, { className: 'entry-item-icon', src: t.icon }),
(0, p.jsx)(m.EY, { className: 'entry-item-text', children: t.text }),
],
},
t.text,
)
}),
}),
})
: null,
(0, p.jsxs)(m.Ss, {
className: 'mine-footer',
children: [
(0, p.jsxs)('text', {
className: 'mine-footer-version',
onClick: E,
children: ['版本号 ', (0, g.ZP)()],
}),
(0, p.jsxs)('text', {
className: 'mine-footer-phone',
onClick: function () {
l().makePhoneCall({ phoneNumber: _.replace(/[^\d]/g, '') })
},
children: ['客服电话:', _],
}),
(0, p.jsx)(m.Ss, {
className: 'test-view',
children: (0, p.jsx)(m.Ss, { className: 'test-block', onClick: E }),
}),
],
}),
],
}),
})
}
Page(
(0, s.eU)(
Y,
'pages/mine/index',
{ root: { cn: [] } },
{
enablePullDownRefresh: !1,
navigationBarTitleText: '',
navigationBarBackgroundColor: '#FFFFFF',
backgroundTextStyle: 'light',
navigationBarTextStyle: 'black',
spmB: 'mydamai',
} || {},
),
)
},
},
function (t) {
t.O(0, [6907, 8096, 2076], function () {
return (e = 5358), t((t.s = e))
var e
}),
t.O()
},
])