Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
fc194110
Commit
fc194110
authored
Jun 29, 2020
by
ziyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: eslint修改
parent
72df9cb8
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
120 additions
and
120 deletions
+120
-120
.eslintcache
.eslintcache
+1
-1
app.wpy
src/app.wpy
+1
-1
raffleProbability.js
src/common/raffleProbability.js
+11
-11
wxRequest.js
src/common/wxRequest.js
+2
-2
activityList.wpy
src/components/custom/activityList.wpy
+1
-1
goloading.wpy
src/components/custom/goloading.wpy
+7
-7
goodsList.wpy
src/components/custom/goodsList.wpy
+17
-15
popup.wpy
src/components/custom/popup.wpy
+2
-2
sharedPopup.wpy
src/components/custom/sharedPopup.wpy
+1
-1
sign.wpy
src/components/custom/sign.wpy
+1
-1
video.wpy
src/components/custom/video.wpy
+42
-43
index.wpy
src/pages/index.wpy
+12
-12
raffle.wpy
src/pages/raffle.wpy
+4
-4
search.wpy
src/pages/search.wpy
+18
-19
No files found.
.eslintcache
View file @
fc194110
{"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy":{"size":1382,"mtime":1591613433299,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js":{"size":1635,"mtime":1592215601788,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js":{"size":85,"mtime":1589422331949,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js":{"size":665,"mtime":1592213686500,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js":{"size":2283,"mtime":1591932403845,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js":{"size":98459,"mtime":1591238093273,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy":{"size":1200,"mtime":1591932403848,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy":{"size":1449,"mtime":1591613433302,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy":{"size":17057,"mtime":1591613433303,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy":{"size":4345,"mtime":1592215601790,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy":{"size":7858,"mtime":1591613433305,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy":{"size":11701,"mtime":1592215601790,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy":{"size":3928,"mtime":1590659119391,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy":{"size":898,"mtime":1589889870499,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy":{"size":3088,"mtime":1591786781412,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy":{"size":253,"mtime":1590498072492,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy":{"size":3149,"mtime":1591776725635,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy":{"size":7686,"mtime":1592218750771,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy":{"size":12698,"mtime":1592216321629,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js":{"size":816,"mtime":1591777292874,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/prizeList.wpy":{"size":7838,"mtime":1592216321628,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/prizeList.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/activityList.wpy":{"size":2430,"mtime":1592215601789,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goodsList.wpy":{"size":10585,"mtime":1592215630500,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy":{"size":16109,"mtime":1592216321629,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy","messages":[],"errorCount":0,"warningCount":0}}}
{"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy":{"size":1489,"mtime":1593414427222,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/app.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js":{"size":1883,"mtime":1592808132670,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/api.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js":{"size":85,"mtime":1589422331949,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js":{"size":1732,"mtime":1593414427224,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js":{"size":2437,"mtime":1593414749561,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/common/wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js":{"size":98459,"mtime":1591238093273,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/china.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy":{"size":1200,"mtime":1592561147880,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy":{"size":1449,"mtime":1591613433302,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/network.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy":{"size":17057,"mtime":1591613433303,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy":{"size":4787,"mtime":1593414427232,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy":{"size":8245,"mtime":1593414427234,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy":{"size":11721,"mtime":1593414427235,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy":{"size":3927,"mtime":1592296708688,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy":{"size":898,"mtime":1589889870499,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy":{"size":3088,"mtime":1591786781412,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/help.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy":{"size":253,"mtime":1590498072492,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy":{"size":3149,"mtime":1591776725635,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy":{"size":7710,"mtime":1592983633308,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy":{"size":12912,"mtime":1593414427238,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js":{"size":816,"mtime":1591777292874,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/store/index.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/activityList.wpy":{"size":2520,"mtime":1593414427226,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy":{"size":19050,"mtime":1593414427236,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/index.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goloading.wpy":{"size":1050,"mtime":1593414427227,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goloading.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/agreement.wpy":{"size":210,"mtime":1592903977922,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/agreement.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/search.wpy":{"size":5487,"mtime":1593414427239,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/pages/search.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goodsList.wpy":{"size":9202,"mtime":1593414506553,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/video.wpy":{"size":12052,"mtime":1593414554361,"hashOfConfig":"qbd0oj","results":{"filePath":"/Users/fukiyoshi/work/quantgroup/mini-program-wepy/src/components/custom/video.wpy","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
\ No newline at end of file
src/app.wpy
View file @
fc194110
...
@@ -15,7 +15,7 @@ import promisify from '@wepy/use-promisify';
...
@@ -15,7 +15,7 @@ import promisify from '@wepy/use-promisify';
wepy.use(promisify);
wepy.use(promisify);
wepy.use(vuex);
wepy.use(vuex);
import { checkUpdateVersion } from './common/raffleProbability'
import { checkUpdateVersion } from './common/raffleProbability'
;
wepy.app({
wepy.app({
hooks: {
hooks: {
...
...
src/common/raffleProbability.js
View file @
fc194110
...
@@ -23,14 +23,14 @@ function getProbability (quantity, coinQuantity) {
...
@@ -23,14 +23,14 @@ function getProbability (quantity, coinQuantity) {
}
}
function
checkUpdateVersion
()
{
function
checkUpdateVersion
()
{
//创建 UpdateManager 实例
//
创建 UpdateManager 实例
const
updateManager
=
wx
.
getUpdateManager
();
const
updateManager
=
wx
.
getUpdateManager
();
//检测版本更新
//
检测版本更新
updateManager
.
onCheckForUpdate
(
function
(
res
)
{
updateManager
.
onCheckForUpdate
(
function
(
res
)
{
console
.
log
(
res
,
'
版本更新
'
);
console
.
log
(
res
,
'
版本更新
'
);
// 请求完新版本信息的回调
// 请求完新版本信息的回调
if
(
res
.
hasUpdate
)
{
if
(
res
.
hasUpdate
)
{
//监听小程序有版本更新事件
//
监听小程序有版本更新事件
updateManager
.
onUpdateReady
(
function
()
{
updateManager
.
onUpdateReady
(
function
()
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'
更新提示
'
,
title
:
'
更新提示
'
,
...
@@ -41,20 +41,20 @@ function checkUpdateVersion() {
...
@@ -41,20 +41,20 @@ function checkUpdateVersion() {
updateManager
.
applyUpdate
();
updateManager
.
applyUpdate
();
}
}
}
}
})
})
;
})
})
;
updateManager
.
onUpdateFailed
(
function
()
{
updateManager
.
onUpdateFailed
(
function
()
{
// 新版本下载失败
// 新版本下载失败
wx
.
showModal
({
wx
.
showModal
({
title
:
'
已经有新版本咯~
'
,
title
:
'
已经有新版本咯~
'
,
content
:
'
请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开呦~
'
,
content
:
'
请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开呦~
'
})
})
;
})
})
;
}
}
})
})
;
}
}
module
.
exports
=
{
module
.
exports
=
{
getProbability
,
getProbability
,
checkUpdateVersion
,
checkUpdateVersion
};
};
src/common/wxRequest.js
View file @
fc194110
...
@@ -10,10 +10,10 @@ if (env === 'test') {
...
@@ -10,10 +10,10 @@ if (env === 'test') {
const
request
=
async
(
url
,
options
)
=>
{
const
request
=
async
(
url
,
options
)
=>
{
const
pages
=
getCurrentPages
()
||
[];
const
pages
=
getCurrentPages
()
||
[];
let
safeAreaInsetTop
=
false
;
let
safeAreaInsetTop
=
false
;
if
(
pages
.
length
===
0
)
{
if
(
pages
.
length
===
0
)
{
// 如果页面还没加载出来,只能说明现在刚进入首页
// 如果页面还没加载出来,只能说明现在刚进入首页
safeAreaInsetTop
=
true
;
safeAreaInsetTop
=
true
;
}
else
if
(
pages
[
pages
.
length
-
1
].
route
===
'
pages/index
'
)
{
}
else
if
(
pages
[
pages
.
length
-
1
].
route
===
'
pages/index
'
)
{
safeAreaInsetTop
=
true
;
safeAreaInsetTop
=
true
;
}
}
const
defaultOptions
=
{
const
defaultOptions
=
{
...
...
src/components/custom/activityList.wpy
View file @
fc194110
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
activityList(val) {
activityList(val) {
let list = val || [];
let list = val || [];
this.list = list;
this.list = list;
if(list.length && list.length < 3) {
if
(list.length && list.length < 3) {
this.onActivityChange();
this.onActivityChange();
}
}
}
}
...
...
src/components/custom/goloading.wpy
View file @
fc194110
...
@@ -12,21 +12,21 @@
...
@@ -12,21 +12,21 @@
wepy.component({
wepy.component({
props: {
props: {
show:{
show:
{
type:Boolean,
type:
Boolean,
default: false
,
default: false
}
}
},
},
data: {
data: {
overLayStyle: 'background-color:transparent'
,
overLayStyle: 'background-color:transparent'
},
},
watch: {
watch: {
show(val) {
show(val) {
if
(val)
{
if
(val)
{
this.overLayStyle = 'background-color:transparent';
this.overLayStyle = 'background-color:transparent';
setTimeout(()
=>
{
setTimeout(()
=>
{
this.overLayStyle = '';
this.overLayStyle = '';
},
500)
},
500);
}
}
}
}
},
},
...
...
src/components/custom/goodsList.wpy
View file @
fc194110
...
@@ -40,8 +40,10 @@
...
@@ -40,8 +40,10 @@
</template>
</template>
<script>
<script>
import wepy from '@wepy/core';
import wepy from '@wepy/core';
import { getGoodsList, getGoodsUrl } from '../../common/api'
import { getGoodsList, getGoodsUrl } from '../../common/api';
let touchDotX = 0, touchDotY = 0, page = 0;
let touchDotX = 0;
let touchDotY = 0;
let page = 0;
wepy.component({
wepy.component({
data: {
data: {
swiperItem: 2,
swiperItem: 2,
...
@@ -49,8 +51,8 @@
...
@@ -49,8 +51,8 @@
currentIndex: 1, // 商品当前滑动到第几个
currentIndex: 1, // 商品当前滑动到第几个
circular: false, // 商品是否无限循环
circular: false, // 商品是否无限循环
list: [],
list: [],
showLoading:false,
showLoading:
false,
isListDone:
false,
isListDone:
false
},
},
attached() {
attached() {
this.getList();
this.getList();
...
@@ -82,32 +84,32 @@
...
@@ -82,32 +84,32 @@
debounce(setTimeout(function() {
debounce(setTimeout(function() {
that.getList();
that.getList();
// 当新得到的list长度不足20个时,表明商品全部得到,开启无限循环
// 当新得到的list长度不足20个时,表明商品全部得到,开启无限循环
/*if(nextlist.length < goodsNum) {
/*
if(nextlist.length < goodsNum) {
that.circular = true;
that.circular = true;
}
}
that.list = [...that.list, ...nextlist];*/
that.list = [...that.list, ...nextlist];
*/
}, 1000), 500);
}, 1000), 500);
}
}
}
}
},
},
getList() {
getList() {
if(this.isListDone) return;
if
(this.isListDone) return;
page++;
page++;
getGoodsList(page).then(data => {
getGoodsList(page).then(data => {
// 没有更多了
// 没有更多了
if(!data.hasMore) {
if
(!data.hasMore) {
//如果小于4个商品,一行就能显示,不用循环
//
如果小于4个商品,一行就能显示,不用循环
this.list.length
>
4 && (this.circular = true);
this.list.length
>
4 && (this.circular = true);
this.isListDone = true;
this.isListDone = true;
}
}
this.list = [...this.list,...data.items];
this.list = [...this.list,
...data.items];
});
});
},
},
toViewPage(e) {
toViewPage(e) {
let item = e.$wx.currentTarget.dataset.item;
let item = e.$wx.currentTarget.dataset.item;
if(this.showLoading) return;
if
(this.showLoading) return;
this.showLoading = true;
this.showLoading = true;
getGoodsUrl({skuId:
item.sourceId,couponUrl:item.couponUrl||null}).then(data=>
{
getGoodsUrl({skuId:
item.sourceId, couponUrl: item.couponUrl || null}).then(data =>
{
wx.navigateToMiniProgram({
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
appId: 'wx91d27dbf599dff74',
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
...
@@ -117,9 +119,9 @@
...
@@ -117,9 +119,9 @@
}
}
});
});
this.showLoading = false;
this.showLoading = false;
}).catch(()
=>
{
}).catch(()
=>
{
this.showLoading = false;
this.showLoading = false;
})
})
;
},
},
touchStart (event) {
touchStart (event) {
touchDotX = event.touches[0].pageX; // 获取触摸时的原点
touchDotX = event.touches[0].pageX; // 获取触摸时的原点
...
...
src/components/custom/popup.wpy
View file @
fc194110
...
@@ -55,10 +55,10 @@
...
@@ -55,10 +55,10 @@
},
},
goNextPage: function(path) {
goNextPage: function(path) {
this.$emit('showMenu', false);
this.$emit('showMenu', false);
if(path === 'jd') {
if
(path === 'jd') {
wx.navigateToMiniProgram({
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
appId: 'wx91d27dbf599dff74',
path:'pages/order/list/list',
path:
'pages/order/list/list',
// 有效值 develop(开发版),trial(体验版),release(正式版)
// 有效值 develop(开发版),trial(体验版),release(正式版)
envVersion: 'release',
envVersion: 'release',
success(res) {
success(res) {
...
...
src/components/custom/sharedPopup.wpy
View file @
fc194110
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
inviteinfo: {
inviteinfo: {
type: Array
type: Array
},
},
type: String
,
type: String
},
},
computed: {
computed: {
goldNum() {
goldNum() {
...
...
src/components/custom/sign.wpy
View file @
fc194110
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
lotteryUrl: '/static/images/lottery@2x.png',
lotteryUrl: '/static/images/lottery@2x.png',
containerStyle: '',
containerStyle: '',
flyAnimation: false,
flyAnimation: false,
isFirst:
true,
isFirst:
true
},
},
props: {
props: {
title: '',
title: '',
...
...
src/components/custom/video.wpy
View file @
fc194110
...
@@ -64,9 +64,9 @@
...
@@ -64,9 +64,9 @@
}
}
},
},
options: {
options: {
styleIsolation: 'shared'
,
styleIsolation: 'shared'
},
},
data:{
data:
{
nextQueue: [],
nextQueue: [],
prevQueue: [],
prevQueue: [],
curQueue: [],
curQueue: [],
...
@@ -75,10 +75,10 @@
...
@@ -75,10 +75,10 @@
_invalidUp: 0,
_invalidUp: 0,
_invalidDown: 0,
_invalidDown: 0,
_videoContexts: [],
_videoContexts: [],
currentIndex:1,
currentIndex:
1,
videoPause: false,
videoPause: false,
showPopup: false,
showPopup: false,
videoLoading: true
,
videoLoading: true
},
},
watch: {
watch: {
videoList (list) {
videoList (list) {
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
this.compute(newVal);
this.compute(newVal);
}
}
},
},
attached(){
attached()
{
this._videoContexts = [
this._videoContexts = [
wx.createVideoContext('video_0', this.$wx),
wx.createVideoContext('video_0', this.$wx),
wx.createVideoContext('video_1', this.$wx),
wx.createVideoContext('video_1', this.$wx),
...
@@ -116,23 +116,23 @@
...
@@ -116,23 +116,23 @@
_videoListChanged (newVal) {
_videoListChanged (newVal) {
const _this = this;
const _this = this;
if (this.curQueue.length === 0) {
if (this.curQueue.length === 0) {
//因为列表默认展示1的位置,而后端逻辑会把要展示的放在0的位置,所以交换位置,展示出来
//
因为列表默认展示1的位置,而后端逻辑会把要展示的放在0的位置,所以交换位置,展示出来
//同时展示的元素只有三个,curQueue中始终只有三个元素,用来解决吧video过多时,资源加载问题
//
同时展示的元素只有三个,curQueue中始终只有三个元素,用来解决吧video过多时,资源加载问题
//当前的资源加载解决方案是参考小程序的video-swiper源码
//
当前的资源加载解决方案是参考小程序的video-swiper源码
newVal.forEach(function (item,index) {
newVal.forEach(function (item,
index) {
if(index === 1) {
if
(index === 1) {
_this.curQueue[0] = item;
_this.curQueue[0] = item;
}
else if (index === 0)
{
}
else if (index === 0)
{
_this.curQueue[1] = item;
_this.curQueue[1] = item;
}else if (index === 2) {
}
else if (index === 2) {
_this.curQueue[2] = item;
_this.curQueue[2] = item;
} else {
} else {
_this.nextQueue.push(item);
_this.nextQueue.push(item);
}
}
});
});
this.playCurrent(1);
this.playCurrent(1);
}
else
{
}
else
{
//新进入的数组要去重,新进入的数组去重是需求的逻辑
//
新进入的数组要去重,新进入的数组去重是需求的逻辑
const curIds = this.curQueue.map(item => item.id);
const curIds = this.curQueue.map(item => item.id);
const nextIds = _this.nextQueue.map(item => item.id);
const nextIds = _this.nextQueue.map(item => item.id);
const allIds = [...curIds, ...nextIds];
const allIds = [...curIds, ...nextIds];
...
@@ -147,36 +147,36 @@
...
@@ -147,36 +147,36 @@
this.videoPause = false;
this.videoPause = false;
this.videoLoading = true;
this.videoLoading = true;
if (e.$wx.detail.source === 'touch') {
if (e.$wx.detail.source === 'touch') {
//增加一个透明遮罩层,控制用户滑动速度,500ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug
//
增加一个透明遮罩层,控制用户滑动速度,500ms内只能滑动一次,解决用户滑动过快,不触发animationfinish的bug
this.showPopup = true;
this.showPopup = true;
setTimeout(()
=>
{
setTimeout(()
=>
{
this.showPopup = false
this.showPopup = false
;
},500);
},
500);
const current = e.$wx.detail.current;
const current = e.$wx.detail.current;
this.currentIndex = current;
this.currentIndex = current;
//如果next中如果就剩下4个了,请求下一页
//
如果next中如果就剩下4个了,请求下一页
if(this.nextQueue.length === 4) {
if
(this.nextQueue.length === 4) {
getPrizeList().then(data
=>
{
getPrizeList().then(data
=>
{
this._videoListChanged(data);
this._videoListChanged(data);
})
})
;
}
}
}
}
},
},
animationfinish (e) {
animationfinish (e) {
var _last = this._last,
let _last = this._last;
curQueue = this.curQueue,
let curQueue = this.curQueue;
prevQueue = this.prevQueue,
let prevQueue = this.prevQueue;
nextQueue = this.nextQueue;
let
nextQueue = this.nextQueue;
//一共三个数组,curQueue是要显示的数组,prevQueue放上滑过去的元素,nextQueue放即将进入的元素
//
一共三个数组,curQueue是要显示的数组,prevQueue放上滑过去的元素,nextQueue放即将进入的元素
//一次最多只展示3个video标签,提高加载视频的速度
//
一次最多只展示3个video标签,提高加载视频的速度
const current = e.$wx.detail.current;
const current = e.$wx.detail.current;
const diff = current - _last;
const diff = current - _last;
if (diff === 0) return;
if (diff === 0) return;
this._last = current;
this._last = current;
this.playCurrent(current);
this.playCurrent(current);
// 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解
// 如果上滑的时候,当前滑动到第0元素,那么被划走,放入prevQueue是第一个元素,这个要自己画图才会更理解
const upChange = [1,
2,
0];
const upChange = [1,
2,
0];
const downChange = [2,
0,
1];
const downChange = [2,
0,
1];
this.$emit('change', { activeId: curQueue[current].id });
this.$emit('change', { activeId: curQueue[current].id });
const direction = (diff === 1 || diff === -2) ? 'up' : 'down';
const direction = (diff === 1 || diff === -2) ? 'up' : 'down';
if (direction === 'up') {
if (direction === 'up') {
...
@@ -209,7 +209,7 @@
...
@@ -209,7 +209,7 @@
this._invalidUp -= 1;
this._invalidUp -= 1;
}
}
}
}
//当滑动到头时,circular改成false
//
当滑动到头时,circular改成false
let circular = true;
let circular = true;
if (nextQueue.length === 0 && current !== 0) {
if (nextQueue.length === 0 && current !== 0) {
circular = false;
circular = false;
...
@@ -222,31 +222,31 @@
...
@@ -222,31 +222,31 @@
},
},
playCurrent (current) {
playCurrent (current) {
this.curQueue[current] && this.getProgress(this.curQueue[current].id);
this.curQueue[current] && this.getProgress(this.curQueue[current].id);
//滑动到当前元素时,其他video都暂停,只播放当前video
//
滑动到当前元素时,其他video都暂停,只播放当前video
this._videoContexts.forEach(function (ctx, index) {
this._videoContexts.forEach(function (ctx, index) {
if(ctx) {
if
(ctx) {
if(index !== current) {
if
(index !== current) {
ctx.pause()
ctx.pause()
;
}else {
}
else {
ctx.play();
ctx.play();
}
}
}
}
});
});
this.updateAwardsInfo(current)
this.updateAwardsInfo(current)
;
},
},
videoTap(e) {
videoTap(e) {
const current = e.currentTarget.dataset.index;
const current = e.currentTarget.dataset.index;
const ctx = this._videoContexts[current];
const ctx = this._videoContexts[current];
if(this.videoPause) {
if
(this.videoPause) {
ctx.play();
ctx.play();
this.videoPause = false;
this.videoPause = false;
}else {
}
else {
ctx.pause();
ctx.pause();
this.videoPause = true;
this.videoPause = true;
}
}
},
},
updateAwardsInfo(current) {
updateAwardsInfo(current) {
if(this.curQueue[current]) {
if
(this.curQueue[current]) {
const { id, photoUrl, name, probability } = this.curQueue[current];
const { id, photoUrl, name, probability } = this.curQueue[current];
this.$emit('getAwardsInfo', {
this.$emit('getAwardsInfo', {
id,
id,
...
@@ -276,9 +276,9 @@
...
@@ -276,9 +276,9 @@
this.curQueue = [...this.curQueue];
this.curQueue = [...this.curQueue];
},
},
loadMedia() {
loadMedia() {
//如果只是视频数据加载完触发,则当再滑到这个视频的视频loading还在,如果只是paly的时候触发,初始化的时候会有问题
//
如果只是视频数据加载完触发,则当再滑到这个视频的视频loading还在,如果只是paly的时候触发,初始化的时候会有问题
this.videoLoading = false;
this.videoLoading = false;
}
,
}
}
}
});
});
</script>
</script>
...
@@ -372,4 +372,3 @@
...
@@ -372,4 +372,3 @@
background-color: transparent;
background-color: transparent;
}
}
</style>
</style>
src/pages/index.wpy
View file @
fc194110
...
@@ -253,9 +253,9 @@
...
@@ -253,9 +253,9 @@
cornCode: '', // 克币充值码
cornCode: '', // 克币充值码
cornText: '',
cornText: '',
cornTextShow: true,
cornTextShow: true,
searchStyle:'',
searchStyle:
'',
avtivityModal: false, //展示活动弹窗
avtivityModal: false, //
展示活动弹窗
awardsInfo:
{},
awardsInfo:
{}
},
},
computed: {
computed: {
...
@@ -394,7 +394,7 @@
...
@@ -394,7 +394,7 @@
this.mainInfo.account.quantity = quantity + v.quantity;
this.mainInfo.account.quantity = quantity + v.quantity;
this.isReceive = true;
this.isReceive = true;
setTimeout(() => {
setTimeout(() => {
if(this.mainInfo.buyRecord && this.mainInfo.buyRecord.length && modal !== 4) {
if
(this.mainInfo.buyRecord && this.mainInfo.buyRecord.length && modal !== 4) {
this.showModal = 4;
this.showModal = 4;
return;
return;
}
}
...
@@ -414,17 +414,17 @@
...
@@ -414,17 +414,17 @@
wx.setStorageSync('innerActivity', '');
wx.setStorageSync('innerActivity', '');
}
}
// 弹窗有多个,展示顺序 活动弹窗->邀请好友->购买获得克币->开奖宝箱
// 弹窗有多个,展示顺序 活动弹窗->邀请好友->购买获得克币->开奖宝箱
if(this.mainInfo.activity && this.mainInfo.activity.id && this.mainInfo.activity.id !== +activityId) {
if
(this.mainInfo.activity && this.mainInfo.activity.id && this.mainInfo.activity.id !== +activityId) {
//活动弹窗
//
活动弹窗
this.avtivityModal = true;
this.avtivityModal = true;
} else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
} else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
//邀请好友
//
邀请好友
this.showModal = 1;
this.showModal = 1;
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
//购买获得金币
//
购买获得金币
this.showModal = 4;
this.showModal = 4;
} else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {
} else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {
//开奖宝箱
//
开奖宝箱
this.showModal = 2;
this.showModal = 2;
}
}
},
},
...
@@ -457,7 +457,7 @@
...
@@ -457,7 +457,7 @@
},
},
ModalClose() {
ModalClose() {
this.cornModal && (this.cornModal = false);
this.cornModal && (this.cornModal = false);
if(this.avtivityModal) {
if
(this.avtivityModal) {
wx.setStorageSync('activityId', this.mainInfo.activity.id);
wx.setStorageSync('activityId', this.mainInfo.activity.id);
this.avtivityModal = false;
this.avtivityModal = false;
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
...
@@ -506,7 +506,7 @@
...
@@ -506,7 +506,7 @@
// 获取头像安全距离
// 获取头像安全距离
let statusHeight = this.$app.$options.globalData.statusBarHeight || '';
let statusHeight = this.$app.$options.globalData.statusBarHeight || '';
this.setSafeAreaStyle('top:' + statusHeight + 'px');
this.setSafeAreaStyle('top:' + statusHeight + 'px');
this.searchStyle = 'top:' + (statusHeight
+
12) + 'px';
this.searchStyle = 'top:' + (statusHeight
+
12) + 'px';
// 获取openid
// 获取openid
await this.getOpenId();
await this.getOpenId();
...
@@ -535,7 +535,7 @@
...
@@ -535,7 +535,7 @@
},
},
async onShow() {
async onShow() {
// 获取主页信息
// 获取主页信息
if(flag) {
if
(flag) {
this.getMainInfo();
this.getMainInfo();
}
}
...
...
src/pages/raffle.wpy
View file @
fc194110
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
import Dialog from '../components/vant/dialog/dialog';
import Dialog from '../components/vant/dialog/dialog';
import { updateUserPhone, confirmRaffle, register, login, getAwardsDetail, checkInnerCode } from '../common/api';
import { updateUserPhone, confirmRaffle, register, login, getAwardsDetail, checkInnerCode } from '../common/api';
import store from '../store';
import store from '../store';
let innerActivity= '';
let innerActivity
= '';
wepy.page({
wepy.page({
store,
store,
data: {
data: {
...
@@ -276,7 +276,7 @@
...
@@ -276,7 +276,7 @@
errorText: '',
errorText: '',
errorBtn: '确定',
errorBtn: '确定',
hasPhone: false,
hasPhone: false,
batchId: null
,
batchId: null
},
},
methods: {
methods: {
check() {
check() {
...
@@ -341,7 +341,7 @@
...
@@ -341,7 +341,7 @@
title: title[code],
title: title[code],
message: message[code]
message: message[code]
}).then(() => {
}).then(() => {
wx.navigateBack({delta: 1})
wx.navigateBack({delta: 1})
;
});
});
}).catch(() => {
}).catch(() => {
this.btnfont = '立即参与';
this.btnfont = '立即参与';
...
@@ -386,7 +386,7 @@
...
@@ -386,7 +386,7 @@
this.code = '';
this.code = '';
},
},
toAgreement() {
toAgreement() {
wx.navigateTo({url:'/pages/agreement'});
wx.navigateTo({url:
'/pages/agreement'});
},
},
checkCode () {
checkCode () {
if (this.code === '') {
if (this.code === '') {
...
...
src/pages/search.wpy
View file @
fc194110
...
@@ -31,17 +31,17 @@
...
@@ -31,17 +31,17 @@
</template>
</template>
<script>
<script>
import wepy from '@wepy/core';
import wepy from '@wepy/core';
import { getSearchList, getGoodsUrl } from '../common/api'
import { getSearchList, getGoodsUrl } from '../common/api'
;
let page = 1;
let page = 1;
wepy.page({
wepy.page({
data: {
data: {
list:[],
list:
[],
isDone:false,
isDone:
false,
isLoading:false,
isLoading:
false,
showLoading:false,
showLoading:
false,
value:''
value:
''
},
},
methods:{
methods:
{
setValue(event) {
setValue(event) {
this.value = event.$wx.detail || '';
this.value = event.$wx.detail || '';
},
},
...
@@ -53,23 +53,22 @@
...
@@ -53,23 +53,22 @@
getList() {
getList() {
this.isLoading = true;
this.isLoading = true;
this.isDone = false;
this.isDone = false;
getSearchList({keyword:
this.value,page:page}).then(data=>
{
getSearchList({keyword:
this.value, page: page}).then(data =>
{
this.isLoading = false;
this.isLoading = false;
if(!data.hasMore) {
if
(!data.hasMore) {
this.isDone = true;
this.isDone = true;
}
}
this.list = [...this.list,...data.items];
this.list = [...this.list, ...data.items];
}).catch(() => {
}).catch(()=>{
this.isLoading = false;
this.isLoading = false;
});
});
},
},
toJingdong(event) {
toJingdong(event) {
const item = event.$wx.currentTarget.dataset.item;
const item = event.$wx.currentTarget.dataset.item;
if(item === undefined) return;
if
(item === undefined) return;
if(this.showLoading) return;
if
(this.showLoading) return;
this.showLoading = true;
this.showLoading = true;
getGoodsUrl({skuId:
item.sourceId,couponUrl:item.couponUrl||null}).then(data=>
{
getGoodsUrl({skuId:
item.sourceId, couponUrl: item.couponUrl || null}).then(data =>
{
wx.navigateToMiniProgram({
wx.navigateToMiniProgram({
appId: 'wx91d27dbf599dff74',
appId: 'wx91d27dbf599dff74',
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
path: 'pages/union/proxy/proxy?spreadUrl=' + encodeURIComponent(data), // 跳转小程序的路径
...
@@ -79,16 +78,16 @@
...
@@ -79,16 +78,16 @@
}
}
});
});
this.showLoading = false;
this.showLoading = false;
}).catch(()
=>
{
}).catch(()
=>
{
this.showLoading = false;
this.showLoading = false;
})
})
;
}
}
},
},
onReachBottom() {
onReachBottom() {
if(this.isDone) return;
if
(this.isDone) return;
page++;
page++;
this.getList();
this.getList();
}
,
}
});
});
</script>
</script>
<config>
<config>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment