Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 83ff14ec
authored
Sep 09, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码
1 parent
e28e4aaf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
26 deletions
app.js
components/UserInfo/UserInfo.wxml
pages/addTransform/addTransformDetail/addTransformDetail.js
pages/addTransform/addTransformDetail/addTransformDetail.wxml
utils/Draw.js
utils/Track.js
utils/util.js
app.js
View file @
83ff14e
...
...
@@ -14,12 +14,10 @@ App({
wx
.
$router
=
router
wx
.
$imgUrl
=
'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx
.
$appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
this
.
globalData
.
appId
=
wx
.
getAccountInfoSync
().
miniProgram
.
appId
const
systemInfo
=
wx
.
getStorageSync
(
'srcm_shopmall_system_info'
)
const
systemInfo
=
wx
.
getStorageSync
(
'aicard_system_info'
)
if
(
!
systemInfo
)
wx
.
getSystemInfo
({
success
(
res
)
{
util
.
setStorageSync
(
'
srcm_shopmall
_system_info'
,
res
)
util
.
setStorageSync
(
'
aicard
_system_info'
,
res
)
}
})
if
(
options
.
path
!=
'pages/tab/index/index'
)
{
...
...
@@ -36,7 +34,7 @@ App({
})
{
ssoApi
.
jsCodeLogin
({
code
,
appId
:
_this
.
globalData
.
appId
appId
:
wx
.
$
appId
}).
then
(
res
=>
{
wx
.
$authStatus
=
res
.
code
!=
0
util
.
setSessionId
(
res
.
data
.
sessionId
)
...
...
@@ -47,12 +45,10 @@ App({
if
(
returnResponse
)
{
resolve
(
result
)
}
else
{
if
(
result
.
code
!=
-
1
)
{
if
(
result
.
code
==
0
)
{
util
.
setUserInfo
(
result
.
data
)
}
else
{
util
.
showToast
(
result
.
message
||
'网络异常'
)
}
if
(
result
.
code
==
0
)
{
util
.
setUserInfo
(
result
.
data
)
}
else
{
util
.
showToast
(
result
.
message
||
'网络异常'
)
}
resolve
(
result
)
}
...
...
@@ -63,10 +59,9 @@ App({
})
if
(
wx
.
$trackData
.
scene
)
{
_this
.
getScene
(
wx
.
$trackData
.
scene
).
then
(
res
=>
{
console
.
log
(
'scene'
,
wx
.
$trackData
.
scene
)
wx
.
$trackData
.
merchant
=
res
.
merchantId
wx
.
$trackData
.
cardId
=
res
.
cardId
const
systemInfo
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
srcm_shopmall
_system_info'
))
const
systemInfo
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
aicard
_system_info'
))
wx
.
$trackData
.
type
=
systemInfo
.
environment
?
2
:
1
wx
.
$Track
.
sendTrack
(
trackData
.
COMPANY
)
})
...
...
components/UserInfo/UserInfo.wxml
View file @
83ff14e
...
...
@@ -4,7 +4,6 @@
<block wx:if="{{!showWechant}}">
<view class="user-company">
<image class="company-logo" src="{{IMGURL}}home/logo.png"></image>
<!-- <text>汽车流通行业数字化运营服务商</text> -->
</view>
<view class="user-name">
<view class="name">{{cardInfo.staffName || ''}}</view>
...
...
pages/addTransform/addTransformDetail/addTransformDetail.js
View file @
83ff14e
// pages/addTransform/detail/detail.js
import
pageData
from
'../constant/data'
import
util
from
'../../../utils/util'
Page
({
/**
...
...
@@ -10,13 +11,20 @@ Page({
attrName
:
''
,
proName
:
''
,
addDatailObj
:
pageData
.
addDatailObj
,
detailObj
:
{}
detailObj
:
{},
hasShare
:
false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
console
.
log
(
util
.
getUserInfo
())
if
(
util
.
getUserInfo
().
phone
)
{
this
.
setData
({
hasShare
:
true
})
}
wx
.
$router
.
getData
(({
attrName
,
proName
...
...
pages/addTransform/addTransformDetail/addTransformDetail.wxml
View file @
83ff14e
...
...
@@ -23,10 +23,10 @@
<video class="video" wx:for="{{detailObj.videoList}}" wx:key="index" title="案例视频:{{proName}}" src="{{IMGURL}}{{item.url}}?v={{img_version}}"></video>
</view>
<view class="fixed-btn">
<
view class="btn-share" bindtap="handleS
hare">
<view class="fixed-btn"
wx:if="{{hasShare}}"
>
<
button class="btn-share" open-type="s
hare">
<image class="btn-icon" src="{{IMGURL}}addTransform/detail/share.png?v={{img_version}}"/>
<text>分享此页面</text>
</
view
>
</
button
>
</view>
</view>
\ No newline at end of file
utils/Draw.js
View file @
83ff14e
...
...
@@ -10,7 +10,7 @@ class Draw {
constructor
(
_this_
,
canvasObject
)
{
let
{
pixelRatio
}
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
srcm_shopmall
_system_info'
))
}
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
aicard
_system_info'
))
this
[
_canvasObject_
]
=
canvasObject
this
[
_pixelRatio_
]
=
canvasObject
.
pixelRatio
||
pixelRatio
||
2
const
height
=
this
.
toRpx
(
canvasObject
.
height
),
...
...
utils/Track.js
View file @
83ff14e
...
...
@@ -176,7 +176,7 @@ class TRACK {
model
,
system
,
version
}
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
srcm_shopmall
_system_info'
))
}
=
JSON
.
parse
(
wx
.
getStorageSync
(
'
aicard
_system_info'
))
return
{
SDK_version
:
SDKVersion
,
brand
,
...
...
utils/util.js
View file @
83ff14e
...
...
@@ -246,14 +246,14 @@ const isFullSucreen = (isComponents) => {
}
/** */
const
getSessionId
=
()
=>
{
return
wx
.
getStorageSync
(
'
scrm_shopmall
_sessionId'
)
return
wx
.
getStorageSync
(
'
aicard
_sessionId'
)
}
const
setSessionId
=
sessionId
=>
{
wx
.
setStorageSync
(
'
scrm_shopmall
_sessionId'
,
sessionId
)
wx
.
setStorageSync
(
'
aicard
_sessionId'
,
sessionId
)
}
const
removeSystemStorage
=
()
=>
{
wx
.
removeStorageSync
(
'
srcm_shopmall
_user_info'
)
wx
.
removeStorageSync
(
'
scrm_shopmall
_sessionId'
)
wx
.
removeStorageSync
(
'
aicard
_user_info'
)
wx
.
removeStorageSync
(
'
aicard
_sessionId'
)
wx
.
removeStorageSync
(
'guest_no'
)
wx
.
removeStorageSync
(
'equity_info'
)
wx
.
removeStorageSync
(
'packageList'
)
...
...
@@ -303,12 +303,12 @@ const phoneCall = phoneNumber => {
}
/**获取用户信息 */
const
getUserInfo
=
()
=>
{
let
user
=
wx
.
getStorageSync
(
'
srcm_shopmall
_user_info'
)
||
null
let
user
=
wx
.
getStorageSync
(
'
aicard
_user_info'
)
||
null
return
JSON
.
parse
(
user
)
}
/**设置用户信息 */
const
setUserInfo
=
userInfo
=>
{
wx
.
setStorageSync
(
'
srcm_shopmall
_user_info'
,
JSON
.
stringify
(
userInfo
))
wx
.
setStorageSync
(
'
aicard
_user_info'
,
JSON
.
stringify
(
userInfo
))
}
/**IOS时间兼容 */
const
iosTimeFormat
=
time
=>
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment