Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
高淑倩
7-Eleven
Commits
8127fd2b
Commit
8127fd2b
authored
Apr 04, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改视频图片
parent
8db28035
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
165 additions
and
46 deletions
+165
-46
productListStyleOne.wxml
src/component/productListStyleOne/productListStyleOne.wxml
+1
-1
activateCardCallback.js
src/pages/activateCard/activateCardCallback.js
+2
-1
consumptionDetails.wxml
src/pages/consumptionDetails/consumptionDetails.wxml
+1
-1
productDetail.js
src/pages/productDetail/productDetail.js
+42
-5
productDetail.wxml
src/pages/productDetail/productDetail.wxml
+5
-2
project.config.json
src/project.config.json
+8
-1
home.js
src/shoppingGuid/page/pages/home/home.js
+11
-3
home.wxml
src/shoppingGuid/page/pages/home/home.wxml
+8
-5
moreProducts.js
src/shoppingGuid/page/pages/moreProducts/moreProducts.js
+12
-3
moreProducts.wxml
src/shoppingGuid/page/pages/moreProducts/moreProducts.wxml
+1
-1
selectProductList.js
...ingGuid/page/pages/selectProductList/selectProductList.js
+13
-17
taskNotice.js
src/shoppingGuid/page/pages/taskNotice/taskNotice.js
+12
-3
taskNotice.wxml
src/shoppingGuid/page/pages/taskNotice/taskNotice.wxml
+1
-1
welfare.js
src/shoppingGuid/page/pages/welfare/welfare.js
+11
-2
categoryPro.js
src/subPackage/page/pages/categoryPro/categoryPro.js
+2
-0
util.js
src/utils/util.js
+35
-0
No files found.
src/component/productListStyleOne/productListStyleOne.wxml
View file @
8127fd2b
...
...
@@ -27,7 +27,7 @@
<video id="myVideo"
class="item-img video-cover"
src="{{indexUrl}}"
muted
muted
="{{true}}"
wx:if="{{utils.isVideo(indexUrl)}}"></video>
<view class="item-title-box">
...
...
src/pages/activateCard/activateCardCallback.js
View file @
8127fd2b
...
...
@@ -85,8 +85,9 @@ wxService.page({
wxService
.
post
(
`/member/minaLogin`
,
param
).
then
(
response
=>
{
let
dataResp
=
response
.
data
.
data
wx
.
setStorageSync
(
'token'
,
dataResp
.
token
)
dataResp
.
memberActivateStatus
=
true
;
wx
.
setStorageSync
(
'_baseUserInfo'
,
dataResp
)
this
.
goUserCenter
()
this
.
goUserCenter
()
;
return
Promise
.
resolve
({
response
})
}).
catch
(
err
=>
{
this
.
goUserCenter
()
...
...
src/pages/consumptionDetails/consumptionDetails.wxml
View file @
8127fd2b
...
...
@@ -48,7 +48,7 @@
</view>
</view>
<
view class="consumption-tips">-香烟与服务类商品不计分-</view
>
<
!-- <view class="consumption-tips">-香烟与服务类商品不计分-</view> --
>
</view>
<!--goHome-->
...
...
src/pages/productDetail/productDetail.js
View file @
8127fd2b
...
...
@@ -25,6 +25,7 @@ wxService.page({
currentShareContent
:
null
,
fromZc
:
false
,
scene
:
''
,
//触点参数
autoplay
:
true
},
handelToHome
()
{
wx
.
reLaunch
({
...
...
@@ -81,11 +82,7 @@ wxService.page({
}
},
swiperChange
(
e
)
{
this
.
setData
({
swiperCurrent
:
e
.
detail
.
current
})
},
// 立即开通plus
openPlus
(){
...
...
@@ -374,6 +371,46 @@ wxService.page({
}
})
},
//点击播放
onVideoPlay
(
e
){
this
.
setData
({
autoplay
:
false
,
})
},
//视频暂停
onVideoPause
(
e
){
this
.
setData
({
autoplay
:
true
,
})
},
//swiper改变
swiperChange
(
e
)
{
this
.
setData
({
swiperCurrent
:
e
.
detail
.
current
});
this
.
swiperChangePauseVideo
();
},
//切换的时候
swiperChangePauseVideo
(){
this
.
videoContext
=
[];
this
.
data
.
productInfo
.
listUrls
.
forEach
((
item
,
index
)
=>
{
let
isVideo
=
utils
.
isVideo
(
item
);
if
(
isVideo
){
this
.
videoContext
.
push
(
wx
.
createVideoContext
(
'myVideo'
+
index
,
this
));
}
});
setTimeout
(()
=>
{
this
.
videoContext
.
forEach
(
item
=>
{
item
.
pause
();
});
this
.
setData
({
autoplay
:
true
,
})
});
},
/**
* 用户点击右上角分享
*/
...
...
src/pages/productDetail/productDetail.wxml
View file @
8127fd2b
...
...
@@ -11,7 +11,7 @@
<view>
<!-- <buy-image-swiper image-data="{{imageData}}"/>
-->
<swiper autoplay="
true
" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<swiper autoplay="
{{autoplay}}
" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<block wx:for="{{productInfo.listUrls}}" wx:key="index">
<swiper-item>
<image class="swiper-image"
...
...
@@ -22,7 +22,10 @@
<video id="myVideo{{index}}"
class="swiper-image video-cover"
src="{{item}}"
muted
play-btn-position="center"
enable-play-gesture="{{true}}"
data-index="{{index}}"
bindplay="onVideoPlay"
wx:if="{{utils.isVideo(item)}}"></video>
</swiper-item>
</block>
...
...
src/project.config.json
View file @
8127fd2b
...
...
@@ -149,7 +149,7 @@
"id"
:
16
,
"name"
:
"商品详情页"
,
"pathName"
:
"pages/productDetail/productDetail"
,
"query"
:
"id=69
3123742469066752
"
,
"query"
:
"id=69
4920880513486848
"
,
"scene"
:
null
},
{
...
...
@@ -623,6 +623,13 @@
"pathName"
:
"subPackageA/page/pages/pointExchangeGoods/pointExchangeGoods"
,
"query"
:
""
,
"scene"
:
null
},
{
"id"
:
-1
,
"name"
:
"选择商品"
,
"pathName"
:
"shoppingGuid/page/pages/selectProductList/selectProductList"
,
"query"
:
""
,
"scene"
:
null
}
]
}
...
...
src/shoppingGuid/page/pages/home/home.js
View file @
8127fd2b
// shoppingGuid/page/pages/home/home.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
const
app
=
getApp
();
...
...
@@ -125,15 +126,22 @@ wxService.page({
title
:
'获取商品信息中..'
,
});
wxService
.
post
(
`/sale/product/listPage?pageNo=1&pageSize=10000`
,{
productIds
:
proIds
productIds
:
proIds
,
showListUrls
:
true
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultGoodsImg
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultGoodsImg
;
item
.
listUrls
=
item
.
listUrls
?
item
.
listUrls
:
[];
if
(
!
this
.
isVideoUrl
(
item
.
indexUrl
)){
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
else
{
item
.
indexUrl
=
utils
.
getFirstImgUrl
(
item
.
listUrls
);
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
});
this
.
setData
({
...
...
src/shoppingGuid/page/pages/home/home.wxml
View file @
8127fd2b
<!--shoppingGuid/page/pages/home/home.wxml-->
<wxs src="../../../../wxs/utils.wxs" module="utils" />
<!-- 常用工具 -->
<view class='top-items'>
<view class='header'>常用工具</view>
...
...
@@ -83,11 +84,13 @@
wx:for="{{goods.goodsList}}"
wx:for-item="item"
wx:for-index="idx"
wx:key="
goodslist{{idx}}
"
wx:key="
*this
"
data-item="{{item}}"
bindtap='onTapToGoodsDetail'
data-index="{{idx}}">
<image class='goods-lf-icon' src='{{item.productImgUrl}}' mode='aspectFit'></image>
<image class='goods-lf-icon' src='{{item.productImgUrl}}'
mode='aspectFit'></image>
<view class='goods-rg-info'>
<view class='goods-title'>{{item.productName}}</view>
<view class='goods-second-title'>{{item.subtitle}}</view>
...
...
@@ -118,7 +121,7 @@
<view class='half-item {{item.isActive ? "active" : ""}}'
wx:for="{{navBar}}"
wx:for-item="item"
wx:key="
topbar{{idx}}
"
wx:key="
*this
"
wx:for-index="idx"
bindtap='onTopBarTap'
data-index="{{idx}}"
...
...
@@ -133,7 +136,7 @@
<!-- 招募榜 -->
<view wx:if="{{current == 1}}">
<view class='rank-list' wx:if="{{rankList.length}}">
<block wx:for="{{rankList}}" wx:key="
{{index}}
" wx:for-item="item">
<block wx:for="{{rankList}}" wx:key="
*this
" wx:for-item="item">
<view class='rank-item'>
<image class='u-logo' src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit'></image>
<view class='rank-u-info'>
...
...
@@ -149,7 +152,7 @@
<!-- 门店榜 -->
<view wx:if="{{current == 2}}">
<view class='rank-list' wx:if="{{storeList.length}}">
<block wx:for="{{storeList}}" wx:key="
{{index}}
" wx:for-item="item">
<block wx:for="{{storeList}}" wx:key="
*this
" wx:for-item="item">
<view class='rank-item'>
<image class='u-logo' src='{{item.member.avatar? item.member.avatar : defaultAvatar}}' mode='aspectFit'></image>
<view class='rank-u-info'>
...
...
src/shoppingGuid/page/pages/moreProducts/moreProducts.js
View file @
8127fd2b
// shoppingGuid/page/pages/moreProducts/moreProducts.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
defaultUrl
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
const
defaultGoodsImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
const
app
=
getApp
();
wxService
.
page
({
...
...
@@ -120,15 +122,22 @@ wxService.page({
title
:
'获取商品信息中..'
,
});
wxService
.
post
(
`/sale/product/listPage?pageNo=1&pageSize=10000`
,{
productIds
:
proIds
productIds
:
proIds
,
showListUrls
:
true
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultUrl
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultUrl
;
item
.
listUrls
=
item
.
listUrls
?
item
.
listUrls
:
[];
if
(
!
utils
.
isVideo
(
item
.
indexUrl
)){
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
else
{
item
.
indexUrl
=
utils
.
getFirstImgUrl
(
item
.
listUrls
);
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
});
this
.
setData
({
...
...
src/shoppingGuid/page/pages/moreProducts/moreProducts.wxml
View file @
8127fd2b
...
...
@@ -24,7 +24,7 @@
wx:for-index="idx"
data-item="{{item}}"
bindtap='onTapToGoodsDetail'
wx:key="
{{idx}}
">
wx:key="
*this
">
<image class='goods-lf-icon' src='{{item.productImgUrl}}' mode='aspectFit'></image>
<view class='goods-rg-info'>
<view class='goods-title'>{{item.productName}}</view>
...
...
src/shoppingGuid/page/pages/selectProductList/selectProductList.js
View file @
8127fd2b
...
...
@@ -3,6 +3,8 @@ const app = getApp()
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
const
envInfo
=
require
(
'../../../../config/index'
).
envInfo
;
const
defaultGoodsImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
wxService
.
page
({
/**
...
...
@@ -45,16 +47,24 @@ wxService.page({
},
//获取商品列表
getProductList
(
refresh
){
wxService
.
post
(
`/sale/product/
buyer/
listPage?pageNo=
${
this
.
data
.
pageNo
}
&pageSize=
${
this
.
data
.
pageSize
}
`
,
{
wxService
.
post
(
`/sale/product/listPage?pageNo=
${
this
.
data
.
pageNo
}
&pageSize=
${
this
.
data
.
pageSize
}
`
,
{
productName
:
this
.
data
.
productName
,
productStatus
:
2
,
showListUrls
:
true
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
list
.
forEach
(
item
=>
{
item
.
checked
=
false
;
item
.
minSalePriceText
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
indexUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
item
.
listUrls
=
item
.
listUrls
?
item
.
listUrls
:
[];
if
(
!
utils
.
isVideo
(
item
.
indexUrl
)){
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
else
{
item
.
indexUrl
=
utils
.
getFirstImgUrl
(
item
.
listUrls
);
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
});
this
.
data
.
productList
=
this
.
data
.
productList
.
concat
(
list
);
...
...
@@ -73,21 +83,7 @@ wxService.page({
}
});
},
//获取数组中第一个图片格式的url
isVideoUrl
(
url
){
if
(
url
){
let
lastIndexOfPoint
=
url
.
lastIndexOf
(
'.'
);
let
extd
=
url
.
substring
(
lastIndexOfPoint
).
toUpperCase
();
if
(
extd
!=
'.MP4'
&&
extd
!=
'.MP3'
&&
extd
!=
".MOV"
){
return
false
;
}
else
{
return
true
;
}
}
return
false
;
},
//处理选中
handlerChecked
(){
let
checkedProduct
=
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
?
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
:
[];
...
...
src/shoppingGuid/page/pages/taskNotice/taskNotice.js
View file @
8127fd2b
// shoppingGuid/page/pages/taskNotice/taskNotice.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
defaultImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
const
app
=
getApp
();
const
defaultGoodsImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
wxService
.
page
({
/**
* 页面的初始数据
...
...
@@ -79,15 +81,22 @@ wxService.page({
title
:
'获取商品信息中..'
,
});
wxService
.
post
(
`/sale/product/listPage?pageNo=1&pageSize=10000`
,{
productIds
:
proIds
productIds
:
proIds
,
showListUrls
:
true
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultImg
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultImg
;
item
.
listUrls
=
item
.
listUrls
?
item
.
listUrls
:
[];
if
(
!
this
.
isVideoUrl
(
item
.
indexUrl
)){
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
else
{
item
.
indexUrl
=
utils
.
getFirstImgUrl
(
item
.
listUrls
);
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
});
this
.
setData
({
...
...
src/shoppingGuid/page/pages/taskNotice/taskNotice.wxml
View file @
8127fd2b
...
...
@@ -19,7 +19,7 @@
data-item="{{item}}"
bindtap='onTapToGoodsDetail'
wx:key="{{idx}}">
<image class='goods-lf-icon' src='{{item.
index
Url}}' mode='aspectFit'></image>
<image class='goods-lf-icon' src='{{item.
productImg
Url}}' mode='aspectFit'></image>
<view class='goods-rg-info'>
<view class='goods-title'>{{item.productName}}</view>
<view class='goods-second-title'>{{item.subtitle}}</view>
...
...
src/shoppingGuid/page/pages/welfare/welfare.js
View file @
8127fd2b
// shoppingGuid/page/pages/welfare/welfare.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
utils
=
require
(
'../../../../utils/util'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
var
app
=
getApp
()
...
...
@@ -119,14 +120,22 @@ wxService.page({
title
:
'获取商品信息中..'
,
});
wxService
.
post
(
`/sale/product/listPage?pageNo=1&pageSize=10000`
,{
productIds
:
proIds
productIds
:
proIds
,
showListUrls
:
true
,
}).
then
(
res
=>
{
if
(
res
){
let
list
=
res
.
data
.
data
.
content
?
res
.
data
.
data
.
content
:
[];
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
item
.
indexUrl
;
item
.
listUrls
=
item
.
listUrls
?
item
.
listUrls
:
[];
if
(
!
utils
.
isVideo
(
item
.
indexUrl
)){
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
else
{
item
.
indexUrl
=
utils
.
getFirstImgUrl
(
item
.
listUrls
);
item
.
productImgUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultGoodsImg
;
}
});
this
.
setData
({
...
...
src/subPackage/page/pages/categoryPro/categoryPro.js
View file @
8127fd2b
// subPackage/page/pages/fun/fun.js
var
app
=
getApp
()
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
defaultImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
...
...
@@ -197,6 +198,7 @@ wxService.page({
categoryIds
:
[],
productTagIds
:
[
this
.
data
.
tagId
],
productStatus
:
2
,
showListUrls
:
true
,
// sortType : this.data.form.sortType,
// order : this.data.form.order,
}).
then
(
res
=>
{
...
...
src/utils/util.js
View file @
8127fd2b
...
...
@@ -419,6 +419,39 @@ function configSliderBlock(app){
}
}
//判断链接是不是视频格式
function
isVideo
(
url
){
if
(
url
){
let
lastIndexOfPoint
=
url
.
lastIndexOf
(
'.'
);
let
extd
=
url
.
substring
(
lastIndexOfPoint
).
toUpperCase
();
if
(
extd
!=
'.MP4'
&&
extd
!=
'.MP3'
&&
extd
!=
".MOV"
){
return
false
;
}
else
{
return
true
;
}
}
return
false
;
}
//获取第一个图片格式的图片
function
getFirstImgUrl
(
urls
){
let
retUrl
=
''
;
for
(
let
i
=
0
;
i
<
urls
.
length
;
i
++
){
let
url
=
urls
[
i
];
let
lastIndexOfPoint
=
url
.
lastIndexOf
(
'.'
);
let
extd
=
url
.
substring
(
lastIndexOfPoint
).
toUpperCase
();
if
(
extd
!=
'.MP4'
&&
extd
!=
'.MP3'
&&
extd
!=
".MOV"
){
retUrl
=
url
;
break
;
}
}
return
retUrl
;
}
wxService
.
setGetAuthUserInfo
(
_getUserInfo
);
module
.
exports
=
{
...
...
@@ -435,6 +468,8 @@ module.exports = {
parseUrl
,
getDateDiff
,
_
,
isVideo
,
getFirstImgUrl
,
// _: underscore,
HandlerDataOnPage
,
formatTime
:
formatTime
,
...
...
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