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
8db28035
You need to sign in or sign up before continuing.
Commit
8db28035
authored
Apr 01, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化功能
parent
209423dc
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
225 additions
and
43 deletions
+225
-43
productListStyleOne.wxml
src/component/productListStyleOne/productListStyleOne.wxml
+9
-0
productListStyleOne.wxss
src/component/productListStyleOne/productListStyleOne.wxss
+3
-0
productListStyleTwo.wxml
src/component/productListStyleTwo/productListStyleTwo.wxml
+10
-1
scrollDel.wxml
src/component/scrollDel/scrollDel.wxml
+12
-1
skuPopup.wxml
src/component/skuPopup/skuPopup.wxml
+11
-2
cart.wxml
src/pages/cart/cart.wxml
+1
-17
extendProduct.js
src/pages/extendProduct/extendProduct.js
+33
-7
extendProduct.wxml
src/pages/extendProduct/extendProduct.wxml
+1
-3
productDetail.js
src/pages/productDetail/productDetail.js
+22
-6
productDetail.wxml
src/pages/productDetail/productDetail.wxml
+10
-1
productDetail.wxss
src/pages/productDetail/productDetail.wxss
+6
-0
home.js
src/shoppingGuid/page/pages/home/home.js
+17
-1
moreProducts.js
src/shoppingGuid/page/pages/moreProducts/moreProducts.js
+18
-1
selectProductList.js
...ingGuid/page/pages/selectProductList/selectProductList.js
+16
-0
taskNotice.js
src/shoppingGuid/page/pages/taskNotice/taskNotice.js
+19
-1
categoryPro.js
src/subPackage/page/pages/categoryPro/categoryPro.js
+20
-1
utils.wxs
src/wxs/utils.wxs
+17
-1
No files found.
src/component/productListStyleOne/productListStyleOne.wxml
View file @
8db28035
...
@@ -16,11 +16,20 @@
...
@@ -16,11 +16,20 @@
<template name="water-list">
<template name="water-list">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{productId}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{productId}}">
<view class="item">
<view class="item">
<!-- 图片主图时 -->
<image class="item-img"
<image class="item-img"
src="{{indexUrl}}"
src="{{indexUrl}}"
mode="widthFix" lazy-load
mode="widthFix" lazy-load
wx:if="{{!utils.isVideo(indexUrl)}}"
binderror="imgLoadError"
binderror="imgLoadError"
data-index="{{index}}"></image>
data-index="{{index}}"></image>
<video id="myVideo"
class="item-img video-cover"
src="{{indexUrl}}"
muted
wx:if="{{utils.isVideo(indexUrl)}}"></video>
<view class="item-title-box">
<view class="item-title-box">
<view class="item-title">{{productName}}</view>
<view class="item-title">{{productName}}</view>
</view>
</view>
...
...
src/component/productListStyleOne/productListStyleOne.wxss
View file @
8db28035
...
@@ -31,6 +31,9 @@
...
@@ -31,6 +31,9 @@
border-top-left-radius: 10rpx;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
border-top-right-radius: 10rpx;
}
}
.video-cover{
max-height: 188px;
}
.item-title{
.item-title{
font-size: 25rpx;
font-size: 25rpx;
text-overflow: ellipsis;
text-overflow: ellipsis;
...
...
src/component/productListStyleTwo/productListStyleTwo.wxml
View file @
8db28035
...
@@ -4,7 +4,16 @@
...
@@ -4,7 +4,16 @@
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{item.productId}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{item.productId}}">
<view class="hot-item border_box" >
<view class="hot-item border_box" >
<view class="hot-img-box">
<view class="hot-img-box">
<image class="hot-img" src="{{item.indexUrl}}" mode="widthFix" lazy-load />
<image class="hot-img"
src="{{item.indexUrl}}"
mode="aspectFit" lazy-load
wx:if="{{!utils.isVideo(item.indexUrl)}}"/>
<video id="myVideo"
class="hot-img"
src="{{item.indexUrl}}"
muted
wx:if="{{utils.isVideo(item.indexUrl)}}"></video>
</view>
</view>
<view class="hot-item-desc border_box">
<view class="hot-item-desc border_box">
<view class="item-name">{{item.productName}}</view>
<view class="item-name">{{item.productName}}</view>
...
...
src/component/scrollDel/scrollDel.wxml
View file @
8db28035
<!--component/scrollDel/scrollDel.wxml-->
<!--component/scrollDel/scrollDel.wxml-->
<!--<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px'>-->
<!--<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px'>-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<scroll-view scroll-y="{{isScroll}}">
<scroll-view scroll-y="{{isScroll}}">
<block class="cart-item" wx:key="item" wx:for="{{cartList}}">
<block class="cart-item" wx:key="item" wx:for="{{cartList}}">
<view data-index='{{index}}'
<view data-index='{{index}}'
...
@@ -16,7 +17,17 @@
...
@@ -16,7 +17,17 @@
<!-- productStatus 0未发布1下架2上架3删除 -->
<!-- productStatus 0未发布1下架2上架3删除 -->
<view class="pro-info" bindtap="bindTapItem" data-id="{{item.productId}}"
<view class="pro-info" bindtap="bindTapItem" data-id="{{item.productId}}"
style='border-bottom:{{index == (cartList.length -1) ? "none" : "1rpx solid #eeeeee" }};opacity:{{(item.productStatus == 1 || item.productStatus == 1 || item.productStatus == 3) ? 0.2 : 1}};'>
style='border-bottom:{{index == (cartList.length -1) ? "none" : "1rpx solid #eeeeee" }};opacity:{{(item.productStatus == 1 || item.productStatus == 1 || item.productStatus == 3) ? 0.2 : 1}};'>
<image class="pro-img" src="{{item.skuImgUrl}}" mode="widthFix"></image>
<image class="pro-img" src="{{item.skuImgUrl}}"
wx:if="{{!utils.isVideo(item.skuImgUrl)}}"
mode="widthFix"></image>
<video id="myVideo"
class="hot-img"
src="{{item.skuImgUrl}}"
muted
wx:if="{{utils.isVideo(item.skuImgUrl)}}"></video>
<view class="pro-right-info">
<view class="pro-right-info">
<view class="pro-name">{{item.productName}}</view>
<view class="pro-name">{{item.productName}}</view>
<view class="pro-sku">{{item.skuSpec}}</view>
<view class="pro-sku">{{item.skuSpec}}</view>
...
...
src/component/skuPopup/skuPopup.wxml
View file @
8db28035
...
@@ -6,11 +6,20 @@
...
@@ -6,11 +6,20 @@
<image
<image
class="popup-close"
class="popup-close"
mode="widthFix"
mode="widthFix"
src="/
image
s/close.png"
src="/
assets/img
s/close.png"
bindtap="hidePopup"
bindtap="hidePopup"
/>
/>
<view class="top-info clearfix">
<view class="top-info clearfix">
<image mode="widthFix" src="{{picUrl && picUrl != 'undefined' ? picUrl : indexImg}}" />
<image mode="widthFix"
wx:if="{{!utils.isVideo(picUrl && picUrl != 'undefined' ? picUrl : indexImg)}}"
src="{{picUrl && picUrl != 'undefined' ? picUrl : indexImg}}" />
<video
style="width:210rpx;height:210rpx;"
src="{{picUrl && picUrl != 'undefined' ? picUrl : indexImg}}"
muted
wx:if="{{utils.isVideo(picUrl && picUrl != 'undefined' ? picUrl : indexImg)}}"></video>
<view class="top-text">
<view class="top-text">
<!-- <view class="price-text" wx:if="{{exchangePrice <= 0}}">¥{{price / 100}}</view> -->
<!-- <view class="price-text" wx:if="{{exchangePrice <= 0}}">¥{{price / 100}}</view> -->
<view class="price-text">¥{{utils.numberFormat(salePrice /100)}}</view>
<view class="price-text">¥{{utils.numberFormat(salePrice /100)}}</view>
...
...
src/pages/cart/cart.wxml
View file @
8db28035
...
@@ -13,23 +13,7 @@
...
@@ -13,23 +13,7 @@
/>
/>
</view>
</view>
<!-- 失效宝贝 -->
<view class="overdue-pro" wx:if="{{outGoods.length}}">
<view class="clear-btn">清除失效商品</view>
<view class="overdue-list clearflex">
<view class="overdue-status">失效</view>
<view class="pro-info">
<image class="pro-img" src="https://img3.bigaka.com/prd/3001/202003/20200331/3001a1a3d3df-d083-426c-b4cd-388886e44360.png" mode="widthFix" />
<view class="pro-right-info">
<view class="pro-name overdue-name">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
<view class="pro-sku">规格</view>
<view class="pro-price">
<view class="price overdue-price">¥256</view>
</view>
</view>
</view>
</view>
</view>
<!-- 空状态时 -->
<!-- 空状态时 -->
<view class="empty" wx-if="{{cartList !== null && cartList.length == 0}}">
<view class="empty" wx-if="{{cartList !== null && cartList.length == 0}}">
<view class="empty-img">
<view class="empty-img">
...
...
src/pages/extendProduct/extendProduct.js
View file @
8db28035
...
@@ -248,6 +248,22 @@ wxService.page({
...
@@ -248,6 +248,22 @@ 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
;
},
//获取商品详情
//获取商品详情
getProductInfoById
(
productId
){
getProductInfoById
(
productId
){
return
wxService
.
get
(
`/sale/product/buyer/findByProductId?productId=
${
productId
}
`
);
return
wxService
.
get
(
`/sale/product/buyer/findByProductId?productId=
${
productId
}
`
);
...
@@ -307,19 +323,29 @@ wxService.page({
...
@@ -307,19 +323,29 @@ wxService.page({
if
(
res
)
{
if
(
res
)
{
const
{
result
,
data
}
=
res
.
data
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
if
(
result
==
0
)
{
wx
.
hideLoading
()
wx
.
hideLoading
();
let
list
=
data
.
content
?
data
.
content
:
[];
list
.
forEach
(
item
=>
{
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
productImgUrl
)
?
item
.
productImgUrl
:
defaultProImg
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultProImg
;
});
if
(
this
.
data
.
pageNo
==
1
){
this
.
data
.
extendProList
=
list
;
}
else
{
this
.
data
.
extendProList
=
this
.
data
.
extendProList
.
concat
(
list
);
}
this
.
setData
({
this
.
setData
({
extendProList
:
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]
:
[...
this
.
data
.
extendProList
,
...
data
.
content
]
,
extendProList
:
this
.
data
.
extendProList
,
totalPages
:
data
.
totalPages
totalPages
:
data
.
totalPages
},
()
=>
{
});
// this.setData({
// no_data: this.data.extendProList.length ? true : false
// })
})
}
}
}
}
})
})
},
},
// 获取我的推广订单列表
// 获取我的推广订单列表
getMyExtendOrderList
(
pageNum
,
pageSize
){
getMyExtendOrderList
(
pageNum
,
pageSize
){
...
...
src/pages/extendProduct/extendProduct.wxml
View file @
8db28035
...
@@ -51,9 +51,7 @@
...
@@ -51,9 +51,7 @@
<view class="buy-product-content">
<view class="buy-product-content">
<view class="buy-list" wx:if="{{extendProList.length}}" wx:for="{{extendProList}}" wx:key="{{index}}">
<view class="buy-list" wx:if="{{extendProList.length}}" wx:for="{{extendProList}}" wx:key="{{index}}">
<view class="prod-img">
<view class="prod-img">
<image
<image src="{{item.productImgUrl}}" mode='aspectFit'/>
src="{{item.productImgUrl || 'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'}}"
mode='aspectFit'/>
</view>
</view>
<view class="prod-info">
<view class="prod-info">
<view class="prod-name">{{item.productName}}</view>
<view class="prod-name">{{item.productName}}</view>
...
...
src/pages/productDetail/productDetail.js
View file @
8db28035
...
@@ -117,7 +117,7 @@ wxService.page({
...
@@ -117,7 +117,7 @@ wxService.page({
let
content
=
{
let
content
=
{
title
:
this
.
data
.
productInfo
.
productName
,
title
:
this
.
data
.
productInfo
.
productName
,
id
:
this
.
data
.
productInfo
.
productId
,
id
:
this
.
data
.
productInfo
.
productId
,
url
:
this
.
data
.
productInfo
.
indexUrl
url
:
this
.
getFirstImgUrl
(
this
.
data
.
productInfo
.
listUrls
)
}
}
let
tentacleInfo
=
{
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
content
:
JSON
.
stringify
(
content
),
...
@@ -140,13 +140,29 @@ wxService.page({
...
@@ -140,13 +140,29 @@ wxService.page({
this
.
setData
({
this
.
setData
({
showCardModal
:
true
,
showCardModal
:
true
,
cardTitle
:
this
.
data
.
productInfo
.
productName
,
cardTitle
:
this
.
data
.
productInfo
.
productName
,
cardUrl
:
this
.
data
.
productInfo
.
indexUrl
,
cardUrl
:
this
.
getFirstImgUrl
(
this
.
data
.
productInfo
.
listUrls
)
,
pagePath
:
path
,
pagePath
:
path
,
scene
:
scene
scene
:
scene
});
});
}
}
})
})
},
},
//获取第一个不是视频的主图
//获取数组中第一个图片格式的url
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
;
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
...
@@ -323,8 +339,8 @@ wxService.page({
...
@@ -323,8 +339,8 @@ wxService.page({
let
parmas
=
{
let
parmas
=
{
trolleySku2Buy
:
JSON
.
stringify
(
trolleySku2Buy
)
trolleySku2Buy
:
JSON
.
stringify
(
trolleySku2Buy
)
}
}
const
{
fromZc
}
=
this
.
data
const
{
fromZc
}
=
this
.
data
;
console
.
log
(
'fromZc'
,
fromZc
)
//判断是否从种草商品过来购买
//判断是否从种草商品过来购买
if
(
fromZc
)
{
if
(
fromZc
)
{
wxService
.
updateLocalTentacleInfo
();
wxService
.
updateLocalTentacleInfo
();
...
@@ -376,7 +392,7 @@ wxService.page({
...
@@ -376,7 +392,7 @@ wxService.page({
return
{
return
{
title
:
this
.
data
.
productInfo
.
productName
,
title
:
this
.
data
.
productInfo
.
productName
,
path
:
path
,
path
:
path
,
imageUrl
:
this
.
data
.
productInfo
.
indexUrl
imageUrl
:
this
.
getFirstImgUrl
(
this
.
data
.
productInfo
.
listUrls
)
}
}
}
else
{
}
else
{
//修改为参数memberId
//修改为参数memberId
...
@@ -393,7 +409,7 @@ wxService.page({
...
@@ -393,7 +409,7 @@ wxService.page({
return
{
return
{
title
:
this
.
data
.
productInfo
.
productName
,
title
:
this
.
data
.
productInfo
.
productName
,
path
:
path
,
path
:
path
,
imageUrl
:
this
.
data
.
productInfo
.
indexUrl
imageUrl
:
this
.
getFirstImgUrl
(
this
.
data
.
productInfo
.
listUrls
)
}
}
}
}
...
...
src/pages/productDetail/productDetail.wxml
View file @
8db28035
...
@@ -14,7 +14,16 @@
...
@@ -14,7 +14,16 @@
<swiper autoplay="true" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<swiper autoplay="true" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<block wx:for="{{productInfo.listUrls}}" wx:key="index">
<block wx:for="{{productInfo.listUrls}}" wx:key="index">
<swiper-item>
<swiper-item>
<image class="swiper-image" mode="widthFix" src="{{item}}" lazy-load/>
<image class="swiper-image"
mode="widthFix" src="{{item}}"
wx:if="{{!utils.isVideo(item)}}"
lazy-load/>
<video id="myVideo{{index}}"
class="swiper-image video-cover"
src="{{item}}"
muted
wx:if="{{utils.isVideo(item)}}"></video>
</swiper-item>
</swiper-item>
</block>
</block>
</swiper>
</swiper>
...
...
src/pages/productDetail/productDetail.wxss
View file @
8db28035
...
@@ -12,6 +12,12 @@ page{
...
@@ -12,6 +12,12 @@ page{
.swiper-image{
.swiper-image{
width: 100%;
width: 100%;
}
}
.video-cover{
width: 100%;
height: 100%;
}
.product-price {
.product-price {
display: flex;
display: flex;
justify-content: space-between;
justify-content: space-between;
...
...
src/shoppingGuid/page/pages/home/home.js
View file @
8db28035
...
@@ -132,7 +132,8 @@ wxService.page({
...
@@ -132,7 +132,8 @@ wxService.page({
this
.
data
.
goods
.
goodsList
=
list
;
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
item
.
indexUrl
;
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultGoodsImg
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultGoodsImg
;
});
});
this
.
setData
({
this
.
setData
({
...
@@ -141,6 +142,21 @@ wxService.page({
...
@@ -141,6 +142,21 @@ 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
;
},
//跳转到商品详情
//跳转到商品详情
onTapToGoodsDetail
(
e
){
onTapToGoodsDetail
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
let
item
=
e
.
currentTarget
.
dataset
.
item
;
...
...
src/shoppingGuid/page/pages/moreProducts/moreProducts.js
View file @
8db28035
// shoppingGuid/page/pages/moreProducts/moreProducts.js
// shoppingGuid/page/pages/moreProducts/moreProducts.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
defaultUrl
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
const
app
=
getApp
();
const
app
=
getApp
();
wxService
.
page
({
wxService
.
page
({
...
@@ -126,7 +127,8 @@ wxService.page({
...
@@ -126,7 +127,8 @@ wxService.page({
this
.
data
.
goods
.
goodsList
=
list
;
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
item
.
indexUrl
;
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultUrl
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultUrl
;
});
});
this
.
setData
({
this
.
setData
({
...
@@ -136,6 +138,21 @@ wxService.page({
...
@@ -136,6 +138,21 @@ 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
;
},
//跳转到商品详情
//跳转到商品详情
onTapToGoodsDetail
(
e
)
{
onTapToGoodsDetail
(
e
)
{
let
item
=
e
.
currentTarget
.
dataset
.
item
;
let
item
=
e
.
currentTarget
.
dataset
.
item
;
...
...
src/shoppingGuid/page/pages/selectProductList/selectProductList.js
View file @
8db28035
...
@@ -54,6 +54,7 @@ wxService.page({
...
@@ -54,6 +54,7 @@ wxService.page({
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
item
.
checked
=
false
;
item
.
checked
=
false
;
item
.
minSalePriceText
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
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'
});
});
this
.
data
.
productList
=
this
.
data
.
productList
.
concat
(
list
);
this
.
data
.
productList
=
this
.
data
.
productList
.
concat
(
list
);
...
@@ -72,6 +73,21 @@ wxService.page({
...
@@ -72,6 +73,21 @@ 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
(){
handlerChecked
(){
let
checkedProduct
=
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
?
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
:
[];
let
checkedProduct
=
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
?
wx
.
getStorageSync
(
'guiderReleaseProducts'
)
:
[];
...
...
src/shoppingGuid/page/pages/taskNotice/taskNotice.js
View file @
8db28035
// shoppingGuid/page/pages/taskNotice/taskNotice.js
// shoppingGuid/page/pages/taskNotice/taskNotice.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
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
app
=
getApp
();
wxService
.
page
({
wxService
.
page
({
/**
/**
...
@@ -85,7 +86,8 @@ wxService.page({
...
@@ -85,7 +86,8 @@ wxService.page({
this
.
data
.
goods
.
goodsList
=
list
;
this
.
data
.
goods
.
goodsList
=
list
;
list
.
forEach
(
item
=>
{
list
.
forEach
(
item
=>
{
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
price
=
parseFloat
(
item
.
minSalePrice
/
10
/
10
).
toFixed
(
2
);
item
.
productImgUrl
=
item
.
indexUrl
;
item
.
productImgUrl
=
!
this
.
isVideoUrl
(
item
.
indexUrl
)
?
item
.
indexUrl
:
defaultImg
;
item
.
productImgUrl
=
item
.
productImgUrl
?
item
.
productImgUrl
:
defaultImg
;
});
});
this
.
setData
({
this
.
setData
({
...
@@ -95,6 +97,22 @@ wxService.page({
...
@@ -95,6 +97,22 @@ 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
;
},
//定向发送
//定向发送
//定向转发商品给用户 分享功能
//定向转发商品给用户 分享功能
onTapToShare
(
e
)
{
onTapToShare
(
e
)
{
...
...
src/subPackage/page/pages/categoryPro/categoryPro.js
View file @
8db28035
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
var
app
=
getApp
()
var
app
=
getApp
()
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
import
{
Integer
}
from
'../../../../utils/integerDigitalConvertion'
let
defaultImg
=
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
wxService
.
page
({
wxService
.
page
({
...
@@ -145,7 +146,7 @@ wxService.page({
...
@@ -145,7 +146,7 @@ wxService.page({
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
data
.
proData
=
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]
:
[...
this
.
data
.
proData
,
...
data
.
content
];
this
.
data
.
proData
=
this
.
data
.
pageNo
==
1
?
[...
data
.
content
]
:
[...
this
.
data
.
proData
,
...
data
.
content
];
this
.
data
.
proData
.
forEach
(
item
=>
{
this
.
data
.
proData
.
forEach
(
item
=>
{
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
'https://img3.bigaka.com/prd/3001/202003/20200331/30019aa78220-546f-41e0-8075-c2feb69e10b8.jpg'
;
item
.
indexUrl
=
item
.
indexUrl
?
item
.
indexUrl
:
defaultImg
;
});
});
this
.
setData
({
this
.
setData
({
proData
:
this
.
data
.
proData
,
proData
:
this
.
data
.
proData
,
...
@@ -165,6 +166,24 @@ wxService.page({
...
@@ -165,6 +166,24 @@ wxService.page({
wx
.
hideLoading
()
wx
.
hideLoading
()
})
})
},
},
//找到第一个是图片的主图
//获取数组中第一个图片格式的url
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
;
},
//获取商品列表 通过tagid
//获取商品列表 通过tagid
getProductListByTagId
(
refresh
){
getProductListByTagId
(
refresh
){
wx
.
showLoading
({
wx
.
showLoading
({
...
...
src/wxs/utils.wxs
View file @
8db28035
...
@@ -53,6 +53,21 @@ function hanlerLinkNeedAuth(link){
...
@@ -53,6 +53,21 @@ function hanlerLinkNeedAuth(link){
return flag
return flag
}
}
//判断是否是视频格式
function isVideo(url){
if(url){
var lastIndexOfPoint = url.lastIndexOf('.');
var extd = url.substring(lastIndexOfPoint).toUpperCase();
if(extd != '.MP4' && extd != '.MP3' && extd != ".MOV"){
return false;
}
return true;
}
return false;
}
module.exports = {
module.exports = {
toPercent:toPercent,
toPercent:toPercent,
...
@@ -61,5 +76,6 @@ module.exports = {
...
@@ -61,5 +76,6 @@ module.exports = {
numberFormat: numberFormat,
numberFormat: numberFormat,
date: date,
date: date,
handerNickName: handerNickName,
handerNickName: handerNickName,
hanlerLinkNeedAuth: hanlerLinkNeedAuth
hanlerLinkNeedAuth: hanlerLinkNeedAuth,
isVideo : isVideo,
}
}
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