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 880358ba
authored
Oct 28, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改手机授权
1 parent
4cbc97a2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
23 deletions
components/PhoneNumber/PhoneNumber.js
components/PhoneNumber/PhoneNumber.wxml
components/PhoneNumber/PhoneNumber.wxss
pages/checkProduct/checkProduct.js
pages/scene/scene.js
pages/scene/scene.wxml
pages/tab/index/index.js
utils/data.js
components/PhoneNumber/PhoneNumber.js
View file @
880358b
...
@@ -6,7 +6,12 @@ Component({
...
@@ -6,7 +6,12 @@ Component({
/**
/**
* 组件的属性列表
* 组件的属性列表
*/
*/
properties
:
{},
properties
:
{
isHidden
:
{
type
:
Boolean
,
value
:
false
}
},
observers
:
{},
observers
:
{},
/**
/**
* 组件的初始数据
* 组件的初始数据
...
@@ -24,17 +29,18 @@ Component({
...
@@ -24,17 +29,18 @@ Component({
// e.detail.errMsg == "getPhoneNumber:fail user deny"
// e.detail.errMsg == "getPhoneNumber:fail user deny"
detail
.
errMsg
.
indexOf
(
'user deny'
)
!==
-
1
detail
.
errMsg
.
indexOf
(
'user deny'
)
!==
-
1
)
{
)
{
wx
.
hideLoading
()
return
;
return
;
}
else
{
}
else
{
// wx.$util.showLoading('正在授权...')
// wx.$util.showLoading('正在授权...')
}
}
// this.triggerEvent("updatePhoneNumber", '18873336682');
// this.triggerEvent("updatePhoneNumber", '18873336682');
wx
.
$util
.
showLoading
(
'正在授权...'
)
getApp
()
getApp
()
.
login
(
true
)
.
login
(
true
)
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
delete
detail
.
errMsg
;
delete
detail
.
errMsg
;
if
(
detail
.
iv
&&
detail
.
encryptedData
)
{
if
(
detail
.
iv
&&
detail
.
encryptedData
)
{
wx
.
$util
.
showLoading
(
'正在授权...'
)
ssoApi
.
authUserPhone
(
detail
).
then
(({
data
,
code
,
message
})
=>
{
ssoApi
.
authUserPhone
(
detail
).
then
(({
data
,
code
,
message
})
=>
{
wx
.
hideLoading
()
wx
.
hideLoading
()
if
(
code
==
0
)
{
if
(
code
==
0
)
{
...
...
components/PhoneNumber/PhoneNumber.wxml
View file @
880358b
<button class="
phone-number
" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<button class="
{{isHidden ? 'hidden-phone':'phone-number'}}
" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
了解更多案例
了解更多案例
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
<image class="icon-arrow" src="{{IMGURL}}home/icon-arrow.png"></image>
...
...
components/PhoneNumber/PhoneNumber.wxss
View file @
880358b
...
@@ -20,4 +20,13 @@
...
@@ -20,4 +20,13 @@
}
}
.icon-arrow:last-child {
.icon-arrow:last-child {
margin-left: 48rpx;
margin-left: 48rpx;
}
.hidden-phone {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: transparent;
}
}
\ No newline at end of file
\ No newline at end of file
pages/checkProduct/checkProduct.js
View file @
880358b
...
@@ -573,12 +573,12 @@ Page({
...
@@ -573,12 +573,12 @@ Page({
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage() {
onShareAppMessage() {
let {senceData,actNum,activeNavIdx} = this.data
//
let {senceData,actNum,activeNavIdx} = this.data
let product = senceData[actNum]?.productList[activeNavIdx].proName
//
let product = senceData[actNum]?.productList[activeNavIdx].proName
console.log('product: ', product);
//
console.log('product: ', product);
return {
//
return {
title: `
给你分享一个活动
$
{
product
}
,戳我参与
~
`,
//
title: `
给你分享一个活动
$
{
product
}
,戳我参与
~
`,
}
//
}
},
},
/**
/**
* 浏览埋点
* 浏览埋点
...
...
pages/scene/scene.js
View file @
880358b
const
navStyle
=
'background-color: transparent;'
const
navStyle
=
'background-color: transparent;'
import
util
from
"../../utils/util"
;
// import { IMG_URL } from '~/utils/constantData.js'
// import { IMG_URL } from '~/utils/constantData.js'
// wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
// wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
import
{
senceData
}
from
'./constant/data'
import
{
senceData
}
from
'./constant/data'
...
@@ -94,7 +95,8 @@ Page({
...
@@ -94,7 +95,8 @@ Page({
// 看线索部分
// 看线索部分
unreadClueCount
:
0
,
unreadClueCount
:
0
,
cluePageSize
:
10
,
cluePageSize
:
10
,
clueCurrentPage
:
1
clueCurrentPage
:
1
,
hasPhoneNumber
:
false
},
},
//引导图
//引导图
...
@@ -232,7 +234,7 @@ Page({
...
@@ -232,7 +234,7 @@ Page({
},
},
clickDialog
(
e
)
{
clickDialog
(
e
)
{
console
.
log
(
e
.
changedTouches
[
0
].
clientY
)
console
.
log
(
e
.
changedTouches
[
0
].
clientY
)
if
(
e
.
changedTouches
[
0
].
clientY
<
352
)
{
if
(
e
.
changedTouches
[
0
].
clientY
<
471
)
{
this
.
setData
({
this
.
setData
({
visible
:
false
,
visible
:
false
,
isReset
:
false
,
isReset
:
false
,
...
@@ -396,6 +398,14 @@ Page({
...
@@ -396,6 +398,14 @@ Page({
})
})
return
false
return
false
},
},
// 更新手机号
updatePhoneNumber
(
e
)
{
if
(
e
.
detail
)
{
this
.
setData
({
hasPhoneNumber
:
true
,
});
}
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
...
@@ -431,6 +441,11 @@ Page({
...
@@ -431,6 +441,11 @@ Page({
})
})
wx
.
$storage
.
set
(
'firstLogin'
,
'firstLogin'
)
wx
.
$storage
.
set
(
'firstLogin'
,
'firstLogin'
)
}
}
if
(
util
.
getUserInfo
().
phone
)
{
this
.
setData
({
hasPhoneNumber
:
true
})
}
},
},
//接口数据,本地数据对接
//接口数据,本地数据对接
compositionData
(
localData
,
apiData
)
{
compositionData
(
localData
,
apiData
)
{
...
...
pages/scene/scene.wxml
View file @
880358b
<navigation-bar bindnavbarReady="navbarReady" navStyle="{{navStyle}}">D+增值转化</navigation-bar>
<page-meta page-style="overflow: {{hasPhoneNumber ? 'visible' : 'hidden'}}" />
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">D+增值转化</navigation-bar>
<view class="reclaim" style="{{tabIndx == 1 ? 'background: #fff;' : ''}}">
<view class="reclaim" style="{{tabIndx == 1 ? 'background: #fff;' : ''}}">
<!-- 头部 -->
<!-- 头部 -->
<view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')">
<view class="header-wrap" style="height:{{headerHeight}}rpx; background-image: url('{{IMG_URL}}index/head.png')">
...
@@ -121,3 +123,6 @@
...
@@ -121,3 +123,6 @@
</view>
</view>
</view>
</view>
<block wx:if="{{!hasPhoneNumber}}">
<phone-number isHidden="{{true}}" bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</block>
\ No newline at end of file
\ No newline at end of file
pages/tab/index/index.js
View file @
880358b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2022-08-30 11:26:21
* @Date: 2022-08-30 11:26:21
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2022-
09-09 14:41:59
* @LastEditTime: 2022-
10-28 10:30:34
*/
*/
// pages/tab/index/index.js
// pages/tab/index/index.js
import
{
menuMixin
}
from
"../../../mixins/index"
;
import
{
menuMixin
}
from
"../../../mixins/index"
;
...
@@ -214,6 +214,9 @@ Page({
...
@@ -214,6 +214,9 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
()
{
onShow
()
{
this
.
setData
({
hasPhoneNumber
:
util
.
getUserInfo
().
phone
})
const
options
=
wx
.
getEnterOptionsSync
()
const
options
=
wx
.
getEnterOptionsSync
()
wx
.
$trackData
=
options
.
query
wx
.
$trackData
=
options
.
query
if
(
wx
.
$trackData
.
merchant
)
{
if
(
wx
.
$trackData
.
merchant
)
{
...
...
utils/data.js
View file @
880358b
...
@@ -23,45 +23,85 @@ const trackData = {
...
@@ -23,45 +23,85 @@ const trackData = {
pageKey
:
5
,
pageKey
:
5
,
pageName
:
"D+增值转化"
,
pageName
:
"D+增值转化"
,
},
},
// EQUITYCARD: {
// pageKey: 6,
// pageName: "数字无忧权益卡",
// },
// SOLARFILM: {
// pageKey: 7,
// pageName: "汽车太阳膜",
// },
// CHANGEFILM: {
// pageKey: 8,
// pageName: "改色膜",
// },
// PAINTPROTECT: {
// pageKey: 9,
// pageName: "漆面保护膜",
// },
// CARBEAUTY: {
// pageKey: 10,
// pageName: "热络期-数字化美容",
// },
// SEATVENTILATE: {
// pageKey: 11,
// pageName: "座椅通风系统",
// },
// ARNAVIGATION: {
// pageKey: 12,
// pageName: "AR导航",
// },
// LIGHT: {
// pageKey: 13,
// pageName: "氛围灯",
// },
// NAVIGATIONARROUND: {
// pageKey: 14,
// pageName: "360全景导航",
// },
// LOSSPGASE: {
// pageKey: 15,
// pageName: "流失期-数字化美容",
// },
EQUITYCARD
:
{
EQUITYCARD
:
{
pageKey
:
6
,
pageKey
:
6
,
pageName
:
"数字无忧权益卡"
,
pageName
:
"
新车洽谈场景-
数字无忧权益卡"
,
},
},
SOLARFILM
:
{
SOLARFILM
:
{
pageKey
:
7
,
pageKey
:
7
,
pageName
:
"汽车太阳膜"
,
pageName
:
"
新车交付场景-
汽车太阳膜"
,
},
},
CHANGEFILM
:
{
CHANGEFILM
:
{
pageKey
:
8
,
pageKey
:
8
,
pageName
:
"改色膜"
,
pageName
:
"
0-12个月-
改色膜"
,
},
},
PAINTPROTECT
:
{
PAINTPROTECT
:
{
pageKey
:
9
,
pageKey
:
9
,
pageName
:
"漆面保护膜"
,
pageName
:
"
0-12个月-
漆面保护膜"
,
},
},
CARBEAUTY
:
{
CARBEAUTY
:
{
pageKey
:
10
,
pageKey
:
10
,
pageName
:
"
热络期
-数字化美容"
,
pageName
:
"
12个月以上
-数字化美容"
,
},
},
SEATVENTILATE
:
{
SEATVENTILATE
:
{
pageKey
:
11
,
pageKey
:
11
,
pageName
:
"
座椅通风系统
"
,
pageName
:
"
12个月以上-座椅通风
"
,
},
},
ARNAVIGATION
:
{
ARNAVIGATION
:
{
pageKey
:
12
,
pageKey
:
12
,
pageName
:
"AR导航"
,
pageName
:
"
12个月以上-
AR导航"
,
},
},
LIGHT
:
{
LIGHT
:
{
pageKey
:
13
,
pageKey
:
13
,
pageName
:
"氛围灯"
,
pageName
:
"
12个月以上-
氛围灯"
,
},
},
NAVIGATIONARROUND
:
{
NAVIGATIONARROUND
:
{
pageKey
:
14
,
pageKey
:
14
,
pageName
:
"360全景导航"
,
pageName
:
"
12个月以上-
360全景导航"
,
},
},
LOSSPGASE
:
{
LOSSPGASE
:
{
pageKey
:
15
,
pageKey
:
15
,
pageName
:
"
流失期-数字化美容
"
,
pageName
:
"
3年以上-新能源0元换购
"
,
},
},
NEWENERGY
:
{
NEWENERGY
:
{
pageKey
:
16
,
pageKey
:
16
,
...
...
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