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
adb321e8
Commit
adb321e8
authored
Aug 26, 2019
by
赵雅纹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-zyw-sc' into 'dev_7.1.0'
Feature zyw sc See merge request
!87
parents
c6a5e140
da7453b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
28 deletions
+41
-28
grassCommunity.js
src/subPackage/page/pages/grassCommunity/grassCommunity.js
+33
-23
grassCommunity.wxml
src/subPackage/page/pages/grassCommunity/grassCommunity.wxml
+5
-5
grassCommunity.wxss
src/subPackage/page/pages/grassCommunity/grassCommunity.wxss
+3
-0
No files found.
src/subPackage/page/pages/grassCommunity/grassCommunity.js
View file @
adb321e8
...
...
@@ -33,6 +33,8 @@ wxService.page({
if
(
options
&&
options
.
id
){
this
.
setData
({
'params.id'
:
options
.
id
},()
=>
{
this
.
getInitInfo
()
})
}
},
...
...
@@ -41,9 +43,7 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
if
(
this
.
data
.
params
.
id
)
{
this
.
getInitInfo
()
}
console
.
log
(
'onshow'
)
},
// 获取编辑详情
...
...
@@ -67,6 +67,7 @@ wxService.page({
for
(
var
i
in
data
.
sspList
){
this
.
data
.
pics
.
push
(
app
.
globalData
.
imageUrl
+
data
.
sspList
[
i
].
url
)
}
this
.
setData
({
pics
:
this
.
data
.
pics
})
...
...
@@ -118,21 +119,23 @@ wxService.page({
},
chooseImg
(){
let
that
=
this
;
let
pics
=
this
.
data
.
pics
;
let
pics
=
this
.
data
.
pics
;
wx
.
chooseImage
({
count
:
5
-
pics
.
length
,
// 最多可以选择的图片5张,
sizeType
:
[
'original'
,
'compressed'
],
// original 原图,compressed 压缩图,默认二者都有
sourceType
:
[
'album'
,
'camera'
],
// album 从相册选图,camera 使用相机,默认二者都有
success
:
function
(
res
)
{
var
imgsrc
=
res
.
tempFilePaths
;
pics
=
pics
.
concat
(
imgsrc
);
var
imgsrcs
=
res
.
tempFilePaths
;
imgsrcs
.
forEach
(
src
=>
{
pics
.
push
(
src
);
});
that
.
setData
({
pics
:
pics
});
console
.
log
(
that
.
data
.
pics
)
// console.log(',..............',
that.data.pics)
that
.
moreImgUpload
({
url
:
'http://buyer.devapi.bigaka.net/merchant/upload/pic'
,
//这里是你图片上传的接口
path
:
that
.
data
.
pi
cs
//这里是选取的图片的地址数组
path
:
imgsr
cs
//这里是选取的图片的地址数组
});
},
fail
:
function
()
{
...
...
@@ -177,28 +180,30 @@ wxService.page({
},
name
:
'imgs'
,
//这里根据自己的实际情况改
formData
:
null
,
//这里是上传图片时一起上传的数据
success
:
(
resp
)
=>
{
success
++
;
//图片上传成功,图片上传成功的变量+1
success
:
(
res
)
=>
{
if
(
res
.
statusCode
==
200
){
var
imgdata
=
JSON
.
parse
(
res
.
data
);
var
img
=
imgdata
.
data
[
0
];
success
++
;
//图片上传成功,图片上传成功的变量+1
this
.
data
.
params
.
sspList
.
push
({
cover
:
0
,
url
:
img
.
url
});
that
.
setData
({
'params.sspList'
:
this
.
data
.
params
.
sspList
})
console
.
log
(
'
\\\\\\\\\\\
\'
, that.data.params.sspList)
}
},
fail: (res) => {
fail++;//图片上传失败,图片上传失败的变量+1
},
complete: (res) => {
i++;
var
imgdata
=
JSON
.
parse
(
res
.
data
);
var
img
=
imgdata
.
data
[
0
];
var
sspList
=
[]
sspList
.
push
({
cover
:
0
,
url
:
img
.
url
});
if
(
i
==
data
.
path
.
length
)
{
//当图片传完时,停止调用
that
.
setData
({
'params.sspList'
:
sspList
})
console
.
log
(
'====='
,
that
.
data
.
params
.
sspList
)
if (i == data.path.length) { //当图片传完时,停止调用
}else {//若图片还没有传完,则继续调用函数
console
.
log
(
i
);
console.log(
'
00000
',
i);
data.i = i;
data.success = success;
data.fail = fail;
...
...
@@ -210,6 +215,11 @@ wxService.page({
// 发布笔记
formSubmit(e){
console.log(e)
this.setData({
'
params
.
headline
': e.detail.value.headline,
'
params
.
article
': e.detail.value.article
})
wxService.post(`/merchant/contentMobileTerminal/contentSave`, this.data.params).then(res => {
const { result, data } = res.data
if (result == 0) {
...
...
src/subPackage/page/pages/grassCommunity/grassCommunity.wxml
View file @
adb321e8
<!--subPackage/page/pages/grassCommunity/grassCommunity.wxml-->
<
!-- <form bindsubmit="formSubmit"> --
>
<
form bindsubmit="formSubmit"
>
<view class="grass-community border_box">
<view class="page-upload-img">
<view class="flex-wrp">
...
...
@@ -19,10 +19,10 @@
<view class="upload-tip">*只支持.jpg格式图片/ .mp4格式视频,最长60s</view>
<view class="title-border">
<input placeholder="添加标题" name="headline"
auto-focus
value="{{params.headline}}" />
<input placeholder="添加标题" name="headline" value="{{params.headline}}" />
</view>
<view class="title-border">
<input placeholder="这一刻想说什么..." name="article"
auto-focus
value="{{params.article}}" />
<input placeholder="这一刻想说什么..." name="article" value="{{params.article}}" />
</view>
<view class="related-goods" bindtap="handleRelatedGoods">关联商品</view>
...
...
@@ -30,7 +30,7 @@
<grass-item pro-goods="{{proGoods}}"/>
</view>
</view>
<button class="post-notes fixed-bottom0"
bindtap="formS
ubmit">发布笔记</button>
<
!-- </form> --
>
<button class="post-notes fixed-bottom0"
form-type="s
ubmit">发布笔记</button>
<
/form
>
<select-related-goods show="{{showSelectRelatedGoods}}" bind:_selectGoods="_selectGoods" pro-goods="{{proGoods}}"/>
src/subPackage/page/pages/grassCommunity/grassCommunity.wxss
View file @
adb321e8
/* subPackage/page/pages/grassCommunity/grassCommunity.wxss */
@import './../../../../base/base.wxss';
page{
padding-bottom: 100rpx;
}
.grass-community{
padding: 30rpx;
}
...
...
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