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
3a595e4c
Commit
3a595e4c
authored
Sep 05, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formateUrl
parent
22c344e2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
9 deletions
+26
-9
announcement.js
src/component/announcement/announcement.js
+5
-3
announcement.wxml
src/component/announcement/announcement.wxml
+5
-1
imageSwiper.wxml
src/component/imageSwiper/imageSwiper.wxml
+2
-1
personCenter.wxml
src/component/personCenter/personCenter.wxml
+2
-1
picNav.wxml
src/component/picNav/picNav.wxml
+2
-1
project.config.json
src/project.config.json
+2
-2
utils.wxs
src/wxs/utils.wxs
+8
-0
No files found.
src/component/announcement/announcement.js
View file @
3a595e4c
...
...
@@ -14,9 +14,11 @@ Component({
value
:
null
}
},
attached
()
{
},
attached
()
{
this
.
setData
({
baseImgUrl
:
app
.
globalData
.
imageUrl
})
},
/**
* 组件的初始数据
*/
...
...
src/component/announcement/announcement.wxml
View file @
3a595e4c
<!--component/announcement/announcement.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<view class="announcement df" style="background-color:{{notice.backgroundColor}}" data-redirectId="{{notice.redirectId}}" bindtap="handelToAnn">
<view class="horn">
<image class="img" src="{{notice.iconImageUrl? 'notice.iconImageUrl': '/assets/imgs/7_1_0/notice.png'}}" mode="widthFix" lazy-load="false" binderror="" bindload="" />
<image class="img" src="{{notice.iconImageUrl? utils.formateUrl(notice.iconImageUrl,baseImgUrl) : '/assets/imgs/7_1_0/notice.png'}}" mode="widthFix" />
<!--<image class="img" src="{{notice.iconImageUrl? 'notice.iconImageUrl': '/assets/imgs/7_1_0/notice.png'}}" mode="widthFix" />-->
</view>
<text class="text" style="color:{{notice.fontColor}}">{{notice.content}}</text>
</view>
\ No newline at end of file
src/component/imageSwiper/imageSwiper.wxml
View file @
3a595e4c
<!--component/imageSwiper/imageSwiper.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<swiper
class="image-swiper"
indicator-dots="{{indicatorDots}}"
...
...
@@ -18,7 +19,7 @@
data-item="{{item}}"
bindtap='preview'
>
<image bindload="imageLoad" src="{{
item.imageUrl
}}" id="swiperImg{{index}}" mode="widthFix" class="slide-image" />
<image bindload="imageLoad" src="{{
utils.formateUrl(item.imageUrl,baseImgUrl)
}}" id="swiperImg{{index}}" mode="widthFix" class="slide-image" />
</view>
</swiper-item>
</block>
...
...
src/component/personCenter/personCenter.wxml
View file @
3a595e4c
<!--component/personCenter/personCenter.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<view wx:if='{{!currentMobile}}' class="member-unActive {{personCenter.noactiveBackgroundImageUrl ?'':'member-unActive-bgc'}}" bindtap="handleTtoActiveMemebr">
<image
wx:if="{{baseImgUrl}}" src="{{baseImgUrl}}{{personCenter.noactiveBackgroundImageUrl
}}" class="no-active-img" mode="widthFix"></image>
<image
src="{{utils.formateUrl(personCenter.noactiveBackgroundImageUrl,baseImgUrl)
}}" class="no-active-img" mode="widthFix"></image>
</view>
<view wx:if='{{currentMobile}}' catchtap="handleToMemberOfOwn" class="activation-content activation-bg {{true ? 'user-content' : ''}}" style="{{personData.backgroundImageUrl ? 'background-image: url('+ baseImgUrl +''+ personData.backgroundImageUrl +');' : 'background-color: ' + baseUrl + ';'}}">
<view class='user-info' wx:if='{{currentMobile}}'>
...
...
src/component/picNav/picNav.wxml
View file @
3a595e4c
<!--component/picNav/picNav.wxml-->
<wxs src="../../wxs/utils.wxs" module="utils" />
<view class="pic-nav">
<view
wx:for="{{picNav}}"
...
...
@@ -10,7 +11,7 @@
wx:if="{{baseImgUrl}}"
class="pic-img"
style="width: {{100}}%;height: {{100}}px;"
src="{{
item.imageUrl
}}"
src="{{
utils.formateUrl(item.imageUrl,baseImgUrl)
}}"
data-appid="{{item.link.appid}}"
data-path="{{item.link.url}}"
data-link="{{item.link}}"
...
...
src/project.config.json
View file @
3a595e4c
...
...
@@ -39,7 +39,7 @@
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
40
,
"current"
:
13
,
"list"
:
[
{
"id"
:
-1
,
...
...
@@ -123,7 +123,7 @@
"id"
:
13
,
"name"
:
"subPage"
,
"pathName"
:
"subPackage/page/pages/subPage/subPage"
,
"query"
:
"pageId=1
4
"
,
"query"
:
"pageId=1
6
"
,
"scene"
:
null
},
{
...
...
src/wxs/utils.wxs
View file @
3a595e4c
...
...
@@ -20,8 +20,16 @@ function handerNickName (nickName,limitLength) {
return nickName || ''
}
// 处理 http 地址
function formateUrl(url, BASE_IMG_URL){
if(url){
url = url.indexOf('http') > -1 ? url : BASE_IMG_URL + url;
}
return url;
}
module.exports = {
formateUrl:formateUrl,
numberFormat: numberFormat,
date: date,
handerNickName: handerNickName
...
...
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