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 44452f99
authored
Apr 04, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
看产值紧急需求
1 parent
d65c9f1e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
88 additions
and
28 deletions
api/api.js
api/request.js
app.js
components/proDetail/proDetail.js
package-lock.json
package.json
packagesList/pages/productDetail/productDetail.js
packagesList/pages/productDetail/productDetail.wxml
pages/tab/index/index.js
pages/tab/index/index.wxml
utils/util.js
api/api.js
View file @
44452f9
...
...
@@ -20,5 +20,8 @@ module.exports = {
getMockConfig
()
{
return
api
.
getMock
()
},
getBaseDataConfig
()
{
return
api
.
getBaseDataByMock
()
}
}
}
\ No newline at end of file
api/request.js
View file @
44452f9
...
...
@@ -139,5 +139,23 @@ class Request {
})
})
}
getBaseDataByMock
()
{
let
url
=
'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/base-data'
// if (index == 4 || index == 3) url = 'https://oss-config.test.glsx.com.cn/mock/6274e3050da5034a58680aa6/aicard-config'
return
new
Promise
((
resolve
)
=>
{
wx
.
request
({
url
,
data
:
{},
method
:
'GET'
,
header
:
{},
dataType
:
'json'
,
responseType
:
'text'
,
success
(
response
)
{
resolve
(
response
.
data
)
}
})
})
}
}
export
default
new
Request
()
\ No newline at end of file
app.js
View file @
44452f9
...
...
@@ -11,7 +11,7 @@ env.includes(accountInfo.miniProgram.envVersion) &&
import
router
from
'./router/index.js'
import
util
from
'./utils/util.js'
import
'./utils/Track'
import
{
ssoApi
,
wechatApi
}
from
'./api/api'
import
{
ssoApi
,
wechatApi
,
commonApi
}
from
'./api/api'
import
{
trackData
}
from
'./utils/data'
// import eventbus from './utils/evenbus'
// 实例化对象存储
...
...
@@ -42,6 +42,8 @@ App({
wx
.
showMeasure
=
!!
(
options
.
query
&&
options
.
query
.
scene
)
wx
.
onMemoryWarning
(
function
()
{
})
// 获取mock数据
// this.getBaseData()
},
login
(
returnResponse
)
{
let
_this
=
this
...
...
@@ -141,6 +143,17 @@ App({
})
})
},
// 获取公共数据
getBaseData
()
{
console
.
log
(
"method"
)
var
that
=
this
;
return
new
Promise
((
resolve
,
reject
)
=>
{
commonApi
.
getBaseDataConfig
().
then
(
res
=>
{
console
.
log
(
res
,
'555'
);
resolve
(
res
.
data
)
})
})
},
/**
* 下载小程序新版本并重启应用
...
...
components/proDetail/proDetail.js
View file @
44452f9
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import
{
senceData
,
productData1
}
from
'~/pages/tab/index/constant/senceData'
//
import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
const
norTabList
=
[
'海报案例'
,
'测算营销'
,
'产品介绍'
,
'项目亮点'
]
import
{
componentsMixin
}
from
"../../mixins/index"
;
Component
({
...
...
@@ -38,6 +38,10 @@ Component({
detailType
:
{
type
:
String
,
value
:
'pro'
},
productData
:
{
type
:
Object
,
value
:
{}
}
},
...
...
@@ -47,7 +51,7 @@ Component({
data
:
{
IMG_URL
:
'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
,
videoBaseUrl
:
'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/'
,
productData
:
productData1
,
//
productData: productData1,
proInfo
:
{},
prodItemVideo
:
''
,
//选中的场景下的video的第一个
tabAct
:
0
,
...
...
@@ -82,7 +86,7 @@ Component({
getInfo
()
{
let
{
activeNavIdx
,
actNum
}
=
this
.
data
const
spcList
=
[
99
]
// 订阅模块需要特殊处理
const
senceList
=
productData1
[
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
const
senceList
=
this
.
properties
.
productData
[
actNum
].
filter
(
item
=>
item
.
name
!=
'全部'
)
for
(
let
i
=
0
;
i
<
senceList
.
length
;
i
++
)
{
let
item
=
senceList
[
i
]
let
proIdList
=
item
?.
productList
.
map
(
k
=>
k
.
id
)
...
...
package-lock.json
View file @
44452f9
...
...
@@ -10,9 +10,9 @@
"integrity"
:
"sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component"
:
{
"version"
:
"1.0.5
0
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.5
0
.tgz"
,
"integrity"
:
"sha512-
SQJAWt9wrbBSvZ1Agk6v7YziXxe/WjYqnHj9SQ/TWbwZCCRIFRexiohX5SqJ0cMltQME8lxj8zqQpJe2XNysCA
=="
"version"
:
"1.0.5
1
"
,
"resolved"
:
"https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.0.5
1
.tgz"
,
"integrity"
:
"sha512-
2o5Q8i/gts/pkUMCOkWjq0ZqElnfF8ELZAigW4Duar3sxGUyvgHOuHcQXYBagSNPSlFluDtG/9gaIa7PBEkWnw
=="
}
}
}
package.json
View file @
44452f9
...
...
@@ -5,7 +5,7 @@
"main"
:
"app.js"
,
"dependencies"
:
{
"@vant/weapp"
:
"^1.10.9"
,
"glsx-applet-component"
:
"^1.0.5
0
"
"glsx-applet-component"
:
"^1.0.5
1
"
},
"devDependencies"
:
{},
"scripts"
:
{
...
...
packagesList/pages/productDetail/productDetail.js
View file @
44452f9
...
...
@@ -5,10 +5,10 @@ import {
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
senceData
,
productData
}
from
"~/pages/tab/index/constant/senceData"
//
import {
//
senceData,
//
productData
//
} from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index'
import
utils
from
'~/utils/util'
import
{
entmicroApi
}
from
"~/api/api"
...
...
@@ -22,8 +22,8 @@ Page({
behaviors
:
[
computedBehavior
],
data
:
{
IMG_URL
,
senceData
,
productData
,
//
senceData,
productData
:
{}
,
proInfo
:
{},
isShare
:
false
,
//是否是分享出去的
actNum
:
-
1
,
...
...
@@ -80,7 +80,7 @@ Page({
onRoute
(
options
)
{
if
(
!
options
||
utils
.
isEmptyObj
(
options
))
return
let
{
actNum
=
0
,
activeNavIdx
=
0
,
phone
,
hasPhoneNumber
,
name
,
proName
actNum
=
0
,
activeNavIdx
=
0
,
phone
,
hasPhoneNumber
,
name
,
proName
,
productData
}
=
options
this
.
setData
({
actNum
,
//选中的场景下标
...
...
@@ -88,7 +88,8 @@ Page({
sharephone
:
phone
,
//联系电话 (登陆的用户)
hasPhoneNumber
:
hasPhoneNumber
,
pageName
:
name
,
proName
proName
,
productData
})
if
(
name
==
'营销增值服务'
)
{
wx
.
$Track
.
sendTrack
(
this
.
data
.
trackList
[
actNum
][
activeNavIdx
])
...
...
packagesList/pages/productDetail/productDetail.wxml
View file @
44452f9
<!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail>
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"
productData="{{productData}}"
></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
\ No newline at end of file
pages/tab/index/index.js
View file @
44452f9
...
...
@@ -10,9 +10,9 @@ import Draw from '../../../utils/Draw'
import
{
entmicroApi
}
from
'../../../api/api'
import
{
commonMixin
}
from
'../../../mixins/index'
import
{
trackData
}
from
'../../../utils/data'
import
{
senceData
,
productData
}
from
'./constant/senceData'
import
{
subscriptionBannerUrl
,
subscriptionSystemData
}
from
'./constant/systemData'
import
{
scenceList
}
from
"./constant/data"
//
import { senceData, productData } from './constant/senceData'
//
import { subscriptionBannerUrl, subscriptionSystemData } from './constant/systemData'
//
import {scenceList} from "./constant/data"
let
leftMenuIndex
=
0
Page
({
behaviors
:
[
commonMixin
],
...
...
@@ -61,15 +61,19 @@ Page({
shareDisabled
:
true
,
autoplay
:
true
,
// 增值转化模块
senceData
,
productData
,
//
senceData,
//
productData,
activityList
:
[],
subscriptionBannerUrl
:
Object
.
freeze
(
subscriptionBannerUrl
),
subscriptionSystemData
:
Object
.
freeze
(
subscriptionSystemData
),
//
subscriptionBannerUrl: Object.freeze(subscriptionBannerUrl),
//
subscriptionSystemData: Object.freeze(subscriptionSystemData),
showCooperate
:
false
,
scenceList
:
scenceList
,
//
scenceList: scenceList,
// bannerUrl:'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/banner/banner0.png'
subscriptionSystemData
:
[],
subscriptionBannerUrl
:
''
,
scenceList
:
[],
productData
:
{}
},
// 一级菜单
introduce
(
e
)
{
...
...
@@ -153,7 +157,8 @@ Page({
actNum
:
isNaN
(
detail
.
scenIndex
)
?
99
:
detail
.
scenIndex
,
//选中的场景 没有就是订阅系统的
activeNavIdx
:
detail
.
id
,
//选中的产品,
hasPhoneNumber
:
this
.
data
.
hasPhoneNumber
,
proName
:
detail
.
proName
proName
:
detail
.
proName
,
productData
:
this
.
data
.
productData
}
wx
.
$router
.
go
(
'/packagesList/pages/productDetail/productDetail'
,
obj
)
},
...
...
@@ -215,7 +220,8 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
getApp
()
const
app
=
getApp
()
app
.
login
()
.
then
(({
data
})
=>
{
if
(
data
&&
data
.
phone
)
{
...
...
@@ -231,6 +237,20 @@ Page({
wx
.
hideShareMenu
({
menus
:
[
'shareAppMessage'
]
})
app
.
getBaseData
().
then
(
res
=>
{
console
.
log
(
res
,
'999'
);
const
{
subscriptionSystemData
,
subscriptionBannerUrl
,
scenceList
,
productData
}
=
res
this
.
setData
({
subscriptionSystemData
,
subscriptionBannerUrl
,
scenceList
,
productData
})
})
// this.setData({
// productData: this.addAll(this.data.productData)
// })
...
...
pages/tab/index/index.wxml
View file @
44452f9
...
...
@@ -22,7 +22,7 @@
<block wx:if="{{curTabIndex == 0}}">
<!-- 增值转化 -->
<!-- <gl-scenario currentScenIndex="{{1}}" productData="{{productData}}" senceData="{{senceData}}" activityList="{{activityList}}" data-name="增值转化" bindactivityClick="activityClick" bind:proClick="proClick" bind:videoClick="videoClick" bind:senceClick="senceClick" bindcurrentScen="getCurrentScen" /> -->
<gl-scenario discoverIndex="{{2}}" currentScenIndex="{{3}}"
productData="{{productData}}" list="{{scenceList}}" senceData="{{senceData}}" activityList="{{activity
List}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" activityList="{{activityList}}" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
<gl-scenario discoverIndex="{{2}}" currentScenIndex="{{3}}"
list="{{scence
List}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" activityList="{{activityList}}" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
</block>
<block wx:if="{{curTabIndex == 1}}">
<gl-subscription list="{{subscriptionSystemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" />
...
...
utils/util.js
View file @
44452f9
...
...
@@ -11,6 +11,7 @@ const emojiReg = /([^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-
const
getMockConfig
=
()
=>
{
return
commonApi
.
getMockConfig
()
}
Date
.
prototype
.
format
=
function
(
fmt
)
{
let
o
=
{
"M+"
:
this
.
getMonth
()
+
1
,
//月份
...
...
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