Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
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 9c540730
authored
Oct 20, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' of 192.168.3.233:saas_plus/business-assistant into develop
2 parents
0dc48bb9
dba69ae0
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
196 additions
and
130 deletions
login/index/components/Box/Box.js
login/index/index.js
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml
packageOutput/pages/summary/components/outputTransform/outputTransform.js
packageOutput/pages/summary/components/outputTransform/outputTransform.wxml
pages/checkProduct/checkProduct.js
pages/tab/index/components/product/product.js
pages/tab/index/index.js
pages/tab/index/index.wxml
pages/tab/output/components/client/client.js
pages/tab/output/output.js
router/router.js
utils/request/environment.js
utils/share.js
login/index/components/Box/Box.js
View file @
9c54073
...
@@ -28,10 +28,10 @@ Component({
...
@@ -28,10 +28,10 @@ Component({
*/
*/
data
:
{
data
:
{
formData
:
{
formData
:
{
phone
:
'
13714966184
'
,
phone
:
''
,
code
:
'
8888
'
,
code
:
''
,
account
:
'
admin
'
,
account
:
''
,
password
:
'
123456789
'
password
:
''
},
},
phoneReady
:
false
,
phoneReady
:
false
,
countDown
:
null
countDown
:
null
...
...
login/index/index.js
View file @
9c54073
import
WxValidate
from
'../../utils/
wxValidate
'
import
WxValidate
from
'../../utils/
WxValidate.js
'
Page
({
Page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
...
...
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
View file @
9c54073
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import
wxqrcode
from
'~/utils/lib/wxqrcode'
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -94,6 +95,13 @@ Component({
...
@@ -94,6 +95,13 @@ Component({
this
.
setData
({
this
.
setData
({
orderObj
:
list
orderObj
:
list
})
})
},
handleCopy
(
e
)
{
var
{
idx
}
=
e
.
currentTarget
.
dataset
var
currentItem
=
this
.
data
.
orderObj
.
activityList
[
idx
]
console
.
log
(
currentItem
)
// console.log(wxqrcode)
wxqrcode
.
createQrCodeImg
(
currentItem
.
activityUrl
)
}
}
}
}
})
})
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml
View file @
9c54073
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<view class="head">
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="head-link" bindtap="handleCopy">复制活动链接</view>
<view class="head-link" bindtap="handleCopy"
data-idx="{{index}}"
>复制活动链接</view>
</view>
</view>
<view class="content">
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
...
...
packageOutput/pages/summary/components/outputTransform/outputTransform.js
View file @
9c54073
...
@@ -6,7 +6,7 @@ Component({
...
@@ -6,7 +6,7 @@ Component({
properties
:
{
properties
:
{
formData
:
{
formData
:
{
type
:
Object
,
type
:
Object
,
value
:
()
=>
{}
value
:
()
=>
{
}
}
}
},
},
...
@@ -45,6 +45,19 @@ Component({
...
@@ -45,6 +45,19 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
// handleDetail() {
// wx.navigateToMiniProgram({
// appId: 'wx0ff4e01294eca299', //appid
// path: '/pages/web_view/web_view',//path
// extraData: { //参数
// foo: 'bar'
// },
// envVersion: 'develop', //开发版develop 开发版 trial 体验版 release 正式版
// success(res) {
// console.log('成功')
// // 打开成功
// }
// })
// }
}
}
})
})
packageOutput/pages/summary/components/outputTransform/outputTransform.wxml
View file @
9c54073
...
@@ -9,3 +9,5 @@
...
@@ -9,3 +9,5 @@
<view class="label">{{item.label}}</view>
<view class="label">{{item.label}}</view>
</view>
</view>
</view>
</view>
<navigator target="miniProgram" open-type="navigate" app-id="wx570d9331f9ace0bd" version="release">查看订单详情
</navigator>
\ No newline at end of file
\ No newline at end of file
pages/checkProduct/checkProduct.js
View file @
9c54073
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
// const navStyle = "background-color: transparent;";
// const navStyle = "background-color: transparent;";
const
navStyle
=
"background-color: #fff"
;
const
navStyle
=
"background-color: #fff"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
senceData
}
from
"~/pages/tab/index/constant/data"
;
import
{
reportData
}
from
"~/api/index.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
{
createQrCodeApi
}
from
'~/api/checkProduct.js'
import
{
createQrCodeApi
}
from
'~/api/checkProduct.js'
...
@@ -96,28 +95,6 @@ Page({
...
@@ -96,28 +95,6 @@ Page({
actNum
,
actNum
,
activeNavIdx
,
activeNavIdx
,
});
});
if
(
this
.
options
?.
shareOpenId
)
{
const
WXUSERINFO
=
wx
.
$storage
.
get
(
"wx_user_info"
),
USERINFO
=
wx
.
$storage
.
get
(
"userInfo"
),
shareInfo
=
this
.
options
;
reportData
(
{
openId
:
WXUSERINFO
.
openId
||
""
,
unionId
:
WXUSERINFO
.
unionId
||
""
,
nickName
:
WXUSERINFO
.
nickName
||
""
,
avatar
:
WXUSERINFO
.
avatarUrl
||
""
,
phone
:
USERINFO
.
phone
||
""
,
merchantId
:
shareInfo
.
merchantId
||
""
,
shareOpenId
:
shareInfo
.
shareOpenId
||
""
,
sharePhone
:
shareInfo
.
sharePhone
||
""
,
productCode
:
shareInfo
.
productCode
||
""
,
productDesc
:
shareInfo
.
productDesc
||
""
,
},
1
);
// 禁用分享功能
wx
.
hideShareMenu
();
}
},
},
// 分享按钮
// 分享按钮
handleClick
(
e
)
{
handleClick
(
e
)
{
...
@@ -292,4 +269,8 @@ Page({
...
@@ -292,4 +269,8 @@ Page({
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage() {},
onShareAppMessage() {},
/**
* 浏览埋点
*/
onViewTrack:true
});
});
pages/tab/index/components/product/product.js
View file @
9c54073
...
@@ -13,7 +13,8 @@ Component({
...
@@ -13,7 +13,8 @@ Component({
properties
:
{
properties
:
{
stickyTop
:
Number
,
stickyTop
:
Number
,
actNum
:
Number
,
actNum
:
Number
,
senceData
:
Object
,
senceData
:
Object
,
//本地数据
apiData
:
Object
,
//后端接口数据
isShare
:
{
isShare
:
{
type
:
Boolean
,
type
:
Boolean
,
value
:
false
,
value
:
false
,
...
...
pages/tab/index/index.js
View file @
9c54073
...
@@ -5,7 +5,13 @@ import { senceData } from "./constant/data";
...
@@ -5,7 +5,13 @@ import { senceData } from "./constant/data";
// `${IMG_URL}index/car2.png`,
// `${IMG_URL}index/car2.png`,
//本地图片路径
//本地图片路径
let
IMG_URLLocal
=
"../../../images/"
;
let
IMG_URLLocal
=
"../../../images/"
;
import
{
productBysceneApi
,
unreadApi
,
pageApi
,
readApi
,
tagApi
}
from
"~/api/index.js"
;
import
{
productBysceneApi
,
unreadApi
,
pageApi
,
readApi
,
tagApi
,
}
from
"~/api/index.js"
;
Page
({
Page
({
// behaviors: [kfMixin],
// behaviors: [kfMixin],
...
@@ -165,8 +171,8 @@ Page({
...
@@ -165,8 +171,8 @@ Page({
isShow
:
false
,
isShow
:
false
,
// 看线索部分
// 看线索部分
unreadClueCount
:
0
,
unreadClueCount
:
0
,
cluePageSize
:
10
,
cluePageSize
:
10
,
clueCurrentPage
:
1
clueCurrentPage
:
1
,
},
},
//引导图
//引导图
...
@@ -216,28 +222,57 @@ Page({
...
@@ -216,28 +222,57 @@ Page({
sessionId
,
sessionId
,
};
};
let
first
=
true
let
first
=
true
;
this
.
setData
({
this
.
setData
({
tabIndx
:
e
.
detail
,
tabIndx
:
e
.
detail
,
});
});
//标记线索已读
//标记线索已读
if
(
e
.
detail
==
0
&&
first
)
{
if
(
e
.
detail
==
0
&&
first
)
{
first
=
false
first
=
false
;
readApi
(
param
)
readApi
(
param
)
;
}
}
},
},
gotoApply
(
e
)
{
gotoApply
(
e
)
{
let
{
type
,
item
}
=
e
.
currentTarget
.
dataset
let
{
userInfo
}
=
wx
.
$storage
.
get
();
console
.
log
(
'type,item: '
,
type
,
item
);
let
pMerchantName
=
userInfo
.
subLoginUser
.
merchantName
if
(
type
==
"active"
){
let
pMerchantId
=
userInfo
.
subLoginUser
.
merchantId
;
let
sceneActive
;
switch
(
this
.
data
.
actNum
)
{
case
0
:
sceneActive
=
1.1
;
break
;
case
1
:
sceneActive
=
1.2
;
break
;
case
2
:
sceneActive
=
1.3
;
break
;
case
3
:
sceneActive
=
1.4
;
break
;
}
// let pMerchantId = userInfo.subLoginUser.merchantId
let
{
type
,
item
}
=
e
.
currentTarget
.
dataset
;
// console.log("type,item: ", type, item);
const
params
=
{
merchantInfo
:
{
pMerchantId
,
pMerchantName
,
merchantId
:
item
.
visitList
[
0
].
merchantId
,
merchantName
:
item
.
visitList
[
0
].
merchantName
,
},
sceneActive
,
// sceneCodeList: ['SC001', 'SC002','SC003','SC004']
};
if
(
type
==
"active"
)
{
//申请活动
//申请活动
wx
.
$router
.
go
(
"packageOutput.openBusiness"
);
wx
.
$router
.
go
(
"packageOutput.openBusiness"
,
params
);
}
else
{
}
else
{
//申请门店
//申请门店
wx
.
$router
.
go
(
"apply"
);
wx
.
$router
.
go
(
"apply"
);
}
}
// wx.$router.go('apply',1235)
// wx.$router.go('apply',1235)
},
},
getMore
(
e
)
{
getMore
(
e
)
{
console
.
log
(
"显示更多数据"
);
console
.
log
(
"显示更多数据"
);
...
@@ -448,41 +483,41 @@ Page({
...
@@ -448,41 +483,41 @@ Page({
this
.
setData
({
this
.
setData
({
apiData
:
data
,
apiData
:
data
,
});
});
this
.
compositionData
(
senceData
,
this
.
data
.
apiData
)
this
.
compositionData
(
senceData
,
this
.
data
.
apiData
);
this
.
getFirstSenceIndex
()
this
.
getFirstSenceIndex
()
;
}
}
});
});
// 看线索
// 看线索
this
.
getClueInit
()
this
.
getClueInit
()
;
},
},
//接口数据,本地数据对接
//接口数据,本地数据对接
compositionData
(
localData
,
apiData
)
{
compositionData
(
localData
,
apiData
)
{
localData
.
forEach
((
item
,
index
)
=>
{
localData
.
forEach
((
item
,
index
)
=>
{
apiData
.
forEach
((
inner
,
idx
)
=>
{
apiData
.
forEach
((
inner
,
idx
)
=>
{
if
(
item
.
name
==
inner
.
stage
)
{
if
(
item
.
name
==
inner
.
stage
)
{
item
.
sceneStatus
=
inner
.
sceneStatus
item
.
sceneStatus
=
inner
.
sceneStatus
;
item
.
productList
.
forEach
((
outChild
,
outIndex
)
=>
{
item
.
productList
.
forEach
((
outChild
,
outIndex
)
=>
{
inner
.
productList
.
forEach
((
innerChild
,
innerIndex
)
=>
{
inner
.
productList
.
forEach
((
innerChild
,
innerIndex
)
=>
{
if
(
outChild
.
proName
==
innerChild
.
productName
)
{
if
(
outChild
.
proName
==
innerChild
.
productName
)
{
outChild
.
productStatus
=
innerChild
.
productStatus
outChild
.
productStatus
=
innerChild
.
productStatus
;
}
}
})
})
;
})
})
;
}
}
})
})
;
})
})
;
// console.log('localData, apiData: ', localData);
// console.log('localData, apiData: ', localData);
this
.
setData
({
this
.
setData
({
senceData
:
localData
senceData
:
localData
,
})
})
;
},
},
getFirstSenceIndex
(
param
){
getFirstSenceIndex
(
param
)
{
let
actTndex
=
this
.
data
.
apiData
.
findIndex
(
item
=>
item
.
sceneStatus
==
1
)
let
actTndex
=
this
.
data
.
apiData
.
findIndex
(
(
item
)
=>
item
.
sceneStatus
==
1
);
// console.log('actTndex: ', actTndex);
// console.log('actTndex: ', actTndex);
this
.
setData
({
this
.
setData
({
actNum
:
actTndex
actNum
:
actTndex
,
})
})
;
},
},
// 看线索相关
// 看线索相关
...
@@ -493,8 +528,8 @@ Page({
...
@@ -493,8 +528,8 @@ Page({
this
.
prompt
=
this
.
selectComponent
(
"#toast"
);
this
.
prompt
=
this
.
selectComponent
(
"#toast"
);
},
},
showToast
:
function
(
e
)
{
showToast
:
function
(
e
)
{
let
{
type
,
item
}
=
e
.
currentTarget
.
dataset
;
let
{
type
,
item
}
=
e
.
currentTarget
.
dataset
;
console
.
log
(
'type,item: '
,
type
,
item
);
console
.
log
(
"type,item: "
,
type
,
item
);
let
tipObj
=
{};
let
tipObj
=
{};
if
(
item
.
starTag
==
1
)
{
if
(
item
.
starTag
==
1
)
{
tipObj
=
{
tipObj
=
{
...
@@ -526,60 +561,60 @@ Page({
...
@@ -526,60 +561,60 @@ Page({
//发请求
//发请求
let
{
sessionId
}
=
wx
.
$storage
.
get
();
let
{
sessionId
}
=
wx
.
$storage
.
get
();
let
params
=
{
let
params
=
{
clueId
:
item
.
clueId
,
clueId
:
item
.
clueId
,
sessionId
sessionId
,
}
}
;
this
.
getTagApi
(
params
)
this
.
getTagApi
(
params
)
;
},
},
filterTypeFn
(
e
)
{
filterTypeFn
(
e
)
{
let
index
=
e
.
currentTarget
.
dataset
.
index
;
let
index
=
e
.
currentTarget
.
dataset
.
index
;
let
itemList
=
[];
let
itemList
=
[];
let
params
=
{
let
params
=
{
clueSource
:
''
,
clueSource
:
""
,
hasPhone
:
''
,
hasPhone
:
""
,
starTag
:
''
starTag
:
""
,
}
}
;
console
.
log
(
"index: "
,
index
);
console
.
log
(
"index: "
,
index
);
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
itemList
=
[
"无"
,
"有"
];
itemList
=
[
"无"
,
"有"
];
break
;
break
;
case
1
:
case
1
:
itemList
=
[
"否"
,
"是"
];
itemList
=
[
"否"
,
"是"
];
break
;
break
;
case
2
:
case
2
:
itemList
=
[
"访客"
,
"门店"
];
//线索来源(1访客,2门店)
itemList
=
[
"访客"
,
"门店"
];
//线索来源(1访客,2门店)
break
;
break
;
case
3
:
case
3
:
params
=
{
params
=
{
clueSource
:
''
,
clueSource
:
""
,
hasPhone
:
''
,
hasPhone
:
""
,
starTag
:
''
starTag
:
""
,
}
}
;
break
;
break
;
}
}
let
_this
=
this
;
let
_this
=
this
;
wx
.
pro
.
showActionSheet
({
wx
.
pro
.
showActionSheet
({
itemList
,
itemList
,
success
(
res
)
{
success
(
res
)
{
let
num
let
num
;
if
(
index
==
2
)
{
if
(
index
==
2
)
{
num
=
res
.
tapIndex
+
1
num
=
res
.
tapIndex
+
1
;
}
else
{
}
else
{
num
=
res
.
tapIndex
num
=
res
.
tapIndex
;
}
}
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
params
.
hasPhone
=
num
params
.
hasPhone
=
num
;
break
;
break
;
case
1
:
case
1
:
params
.
starTag
=
num
params
.
starTag
=
num
;
break
;
break
;
case
2
:
case
2
:
params
.
clueSource
=
num
params
.
clueSource
=
num
;
break
;
break
;
}
}
_this
.
getPageApi
(
params
)
_this
.
getPageApi
(
params
)
;
},
},
fail
(
res
)
{
fail
(
res
)
{
console
.
log
(
res
.
errMsg
);
console
.
log
(
res
.
errMsg
);
...
@@ -588,10 +623,9 @@ Page({
...
@@ -588,10 +623,9 @@ Page({
console
.
log
(
"res: "
,
res
);
console
.
log
(
"res: "
,
res
);
},
},
});
});
if
(
index
==
3
)
{
if
(
index
==
3
)
{
this
.
getPageApi
(
params
)
this
.
getPageApi
(
params
)
;
}
}
},
},
// 打电话
// 打电话
phoneCallFn
(
e
)
{
phoneCallFn
(
e
)
{
...
@@ -604,48 +638,48 @@ Page({
...
@@ -604,48 +638,48 @@ Page({
let
{
phone
}
=
e
.
currentTarget
.
dataset
;
let
{
phone
}
=
e
.
currentTarget
.
dataset
;
wx
.
$api
.
setCopyData
(
phone
);
wx
.
$api
.
setCopyData
(
phone
);
},
},
getClueInit
(
param
){
getClueInit
(
param
)
{
this
.
getUnreadApi
(
param
)
this
.
getUnreadApi
(
param
)
;
this
.
getPageApi
(
param
)
this
.
getPageApi
(
param
)
;
},
},
//未读消息
//未读消息
async
getUnreadApi
(
param
){
async
getUnreadApi
(
param
)
{
let
{
code
,
data
}
=
await
unreadApi
(
param
)
let
{
code
,
data
}
=
await
unreadApi
(
param
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
this
.
setData
({
this
.
setData
({
unreadClueCount
:
data
.
unreadClueCount
unreadClueCount
:
data
.
unreadClueCount
,
})
});
}
}
},
},
//获取浏览线索数据列表
//获取浏览线索数据列表
async
getPageApi
(
param
){
async
getPageApi
(
param
)
{
let
{
cluePageSize
,
clueCurrentPage
}
=
this
.
data
let
{
cluePageSize
,
clueCurrentPage
}
=
this
.
data
;
let
params
=
{
let
params
=
{
...
param
,
...
param
,
pageSize
:
1000
,
pageSize
:
1000
,
currentPage
:
clueCurrentPage
currentPage
:
clueCurrentPage
,
}
}
;
let
{
code
,
data
}
=
await
pageApi
(
params
)
let
{
code
,
data
}
=
await
pageApi
(
params
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
let
arr
=
data
.
list
.
map
(
item
=>
{
let
arr
=
data
.
list
.
map
(
(
item
)
=>
{
if
(
item
.
visitList
.
length
>
5
)
{
if
(
item
.
visitList
.
length
>
5
)
{
item
.
getMoreFlag
=
true
item
.
getMoreFlag
=
true
;
}
}
return
item
return
item
;
})
})
;
this
.
setData
({
this
.
setData
({
clueList
:
arr
clueList
:
arr
,
})
})
;
}
}
},
},
//喜欢收藏功能
//喜欢收藏功能
async
getTagApi
(
param
){
async
getTagApi
(
param
)
{
let
res
=
await
tagApi
(
param
)
let
res
=
await
tagApi
(
param
)
;
console
.
log
(
'res: '
,
res
);
console
.
log
(
"res: "
,
res
);
this
.
getPageApi
(
param
)
this
.
getPageApi
(
param
)
;
},
},
onReachBottom
(){
onReachBottom
()
{
console
.
log
(
"滑到底部了"
)
console
.
log
(
"滑到底部了"
)
;
},
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
...
...
pages/tab/index/index.wxml
View file @
9c54073
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}" bindsharehandle="sharehandle" />
<product stickyTop="{{headerHeight}}" actNum="{{actNum}}" senceData="{{senceData}}"
apiData="{{apiData}}"
bindsharehandle="sharehandle" />
</view>
</view>
<!-- 看线索内容 -->
<!-- 看线索内容 -->
<view class="clue" wx:if="{{tabIndx == 0 }}" hover-class="none" hover-stop-propagation="false">
<view class="clue" wx:if="{{tabIndx == 0 }}" hover-class="none" hover-stop-propagation="false">
...
...
pages/tab/output/components/client/client.js
View file @
9c54073
...
@@ -21,7 +21,7 @@ Component({
...
@@ -21,7 +21,7 @@ Component({
totalProfit
:
0
,
totalProfit
:
0
,
pageObj
:
{
pageObj
:
{
currentPage
:
1
,
currentPage
:
1
,
pageSize
:
3
pageSize
:
10
},
},
totalPages
:
-
1
,
totalPages
:
-
1
,
list
:
[]
list
:
[]
...
@@ -44,6 +44,14 @@ Component({
...
@@ -44,6 +44,14 @@ Component({
pMerchantId
:
userInfo
.
subLoginUser
.
merchantId
pMerchantId
:
userInfo
.
subLoginUser
.
merchantId
})
})
},
},
clientRefresh
()
{
this
.
getPMerchantInfo
()
this
.
setData
({
[
'pageObj.currentPage'
]:
1
,
list
:
[]
})
this
.
getClientApi
()
},
getClientApi
()
{
getClientApi
()
{
this
.
getProfit
()
this
.
getProfit
()
this
.
getList
()
this
.
getList
()
...
...
pages/tab/output/output.js
View file @
9c54073
...
@@ -66,7 +66,7 @@ Page({
...
@@ -66,7 +66,7 @@ Page({
let
merchantModule
=
this
.
selectComponent
(
'#merchant'
)
let
merchantModule
=
this
.
selectComponent
(
'#merchant'
)
// console.log('clientModule', clientModule)
// console.log('clientModule', clientModule)
// console.log()
// console.log()
clientModule
.
getClientApi
&&
clientModule
.
getClientApi
()
clientModule
.
getClientApi
&&
clientModule
.
clientRefresh
()
merchantModule
.
init
&&
merchantModule
.
init
()
merchantModule
.
init
&&
merchantModule
.
init
()
}
}
let
{
isSuper
,
userInfo
}
=
this
.
data
let
{
isSuper
,
userInfo
}
=
this
.
data
...
...
router/router.js
View file @
9c54073
...
@@ -5,7 +5,6 @@ import { IMG_URL } from '~/utils/constantData'
...
@@ -5,7 +5,6 @@ import { IMG_URL } from '~/utils/constantData'
import
{
generateRoutList
}
from
'./wxOnAppRoute.js'
import
{
generateRoutList
}
from
'./wxOnAppRoute.js'
import
{
getNavigationBarTitleText
}
from
'~/utils/cache/storageApi'
import
{
getNavigationBarTitleText
}
from
'~/utils/cache/storageApi'
import
{
getUserInfo
}
from
'~/utils/cache/userInfo'
import
{
getUserInfo
}
from
'~/utils/cache/userInfo'
import
USERAPI
from
'~/api/usersApi/index'
class
Router
{
class
Router
{
[
_query
]
=
{};
[
_query
]
=
{};
[
_routeHooks
]
=
[];
[
_routeHooks
]
=
[];
...
@@ -13,10 +12,9 @@ class Router {
...
@@ -13,10 +12,9 @@ class Router {
constructor
(
router
)
{
constructor
(
router
)
{
this
[
_routerList
]
=
generateRoutList
(
router
)
this
[
_routerList
]
=
generateRoutList
(
router
)
wx
.
onAppRoute
&&
wx
.
onAppRoute
&&
wx
.
onAppRoute
(
async
e
=>
{
wx
.
onAppRoute
(
e
=>
{
let
thisPage
=
this
.
getPageInstance
()
let
thisPage
=
this
.
getPageInstance
()
if
(
thisPage
)
{
if
(
thisPage
)
{
if
(
!
thisPage
.
route
.
includes
(
'login'
))
await
USERAPI
.
getWXUserInfo
()
thisPage
.
setData
({
IMG_URL
})
thisPage
.
setData
({
IMG_URL
})
if
(
Object
.
keys
(
this
[
_query
]).
length
)
thisPage
.
options
=
this
[
_query
]
if
(
Object
.
keys
(
this
[
_query
]).
length
)
thisPage
.
options
=
this
[
_query
]
this
.
setNavigationBarTitleText
(
thisPage
)
this
.
setNavigationBarTitleText
(
thisPage
)
...
...
utils/request/environment.js
View file @
9c54073
...
@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
...
@@ -6,7 +6,7 @@ const target = ['ip', 'dev', 'uat', 'prod']
2测试
2测试
3生产
3生产
*/
*/
const
index
=
1
const
index
=
2
const
secretKey
=
{
const
secretKey
=
{
ip
:
{},
ip
:
{},
dev
:
{
dev
:
{
...
...
utils/share.js
View file @
9c54073
...
@@ -6,11 +6,14 @@
...
@@ -6,11 +6,14 @@
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @param {*} shareFun 分享页面
* @param {*} shareFun 分享页面
* @param {*} shareTrackData 分享埋点数据
* @param {*} shareTrackData 分享埋点数据
* @param {*} onViewTrack 开启浏览埋点
* @returns
* @returns
*/
*/
import
{
import
{
reportData
reportData
}
from
'~/api/index.js'
}
from
'~/api/index.js'
import
USERAPI
from
'~/api/usersApi/index'
class
Share
{
class
Share
{
constructor
()
{
constructor
()
{
console
.
log
(
'---------------- 分享初始化 ----------------'
)
console
.
log
(
'---------------- 分享初始化 ----------------'
)
...
@@ -31,6 +34,8 @@ class Share {
...
@@ -31,6 +34,8 @@ class Share {
/**设置全局分享 */
/**设置全局分享 */
pageLeaveProxy
(
page
)
{
pageLeaveProxy
(
page
)
{
const
onLoad
=
page
.
onLoad
,
that
=
this
if
(
page
.
onShareAppMessage
)
{
if
(
page
.
onShareAppMessage
)
{
const
that
=
this
const
that
=
this
page
.
onShareAppMessage
=
function
()
{
page
.
onShareAppMessage
=
function
()
{
...
@@ -78,6 +83,24 @@ class Share {
...
@@ -78,6 +83,24 @@ class Share {
}
}
}
}
}
}
page
.
onLoad
=
async
function
()
{
onLoad
&&
onLoad
.
apply
(
this
,
arguments
)
if
(
this
.
onViewTrack
)
{
const
WXUSERINFO
=
await
USERAPI
.
getWXUserInfo
(),
{
USERINFO
}
=
that
.
getCommonData
(),
shareInfo
=
this
.
options
if
(
shareInfo
.
shareOpenId
)
reportData
({
openId
:
WXUSERINFO
.
openId
||
''
,
unionId
:
WXUSERINFO
.
unionId
||
''
,
nickName
:
WXUSERINFO
.
nickName
||
''
,
avatar
:
WXUSERINFO
.
avatarUrl
||
''
,
phone
:
USERINFO
.
phone
||
''
,
...
shareInfo
},
1
)
}
}
}
}
getCommonData
()
{
getCommonData
()
{
const
WXUSERINFO
=
wx
.
$storage
.
get
(
'wx_user_info'
),
const
WXUSERINFO
=
wx
.
$storage
.
get
(
'wx_user_info'
),
...
@@ -111,8 +134,6 @@ class Share {
...
@@ -111,8 +134,6 @@ class Share {
shareOpenId
:
WXUSERINFO
.
openId
||
''
,
shareOpenId
:
WXUSERINFO
.
openId
||
''
,
sharePhone
:
USERINFO
.
phone
||
''
,
sharePhone
:
USERINFO
.
phone
||
''
,
...
shareTrackData
...
shareTrackData
}).
then
(
res
=>
{
console
.
log
(
res
)
})
})
}
}
}
}
...
...
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