Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
ace48180
Commit
ace48180
authored
Oct 10, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 页面更新
1. 新增活动类型字段
parent
ce96e91b
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
141 行增加
和
40 行删除
+141
-40
增值产品-小程序及app/nyx-dev/app.js
+2
-1
增值产品-小程序及app/nyx-dev/app.json
+3
-3
增值产品-小程序及app/nyx-dev/pages/activity/activity.js
+23
-12
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.js
+52
-6
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.wxml
+30
-9
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.wxss
+6
-3
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-submit/activity-submit.js
+25
-6
没有找到文件。
增值产品-小程序及app/nyx-dev/app.js
查看文件 @
ace48180
//app
.js
//app
.js
...
...
@@ -67,6 +67,7 @@ App({
photoTitle
:
""
,
photoContent
:
""
,
photoProduct
:
[],
photoCbs
:
[],
startDatetime
:
""
,
endDatetime
:
""
,
...
...
增值产品-小程序及app/nyx-dev/app.json
查看文件 @
ace48180
{
{
{
"pages"
:
[
"pages"
:
[
"pages/activity/activity"
,
"pages/community/community"
,
"pages/fair/fair"
,
...
...
@@ -37,7 +37,7 @@
"list"
:
[
{
"pagePath"
:
"pages/activity/activity"
,
"text"
:
"
活动
"
,
"text"
:
"
饮事
"
,
"iconPath"
:
"./icon/my/activity.png"
,
"selectedIconPath"
:
"./icon/my/activity.png"
},
...
...
增值产品-小程序及app/nyx-dev/pages/activity/activity.js
查看文件 @
ace48180
// pa
ges/activity/activity.js
// pa
ges/activity/activity.js
...
...
@@ -57,18 +57,22 @@ Page({
//二维码信息
qRCodeMsg
:
""
,
//活动类型
activityType
:
"00-饮事"
,
},
switchCategory
(
e
)
{
var
_this
=
this
;
var
curIndex
=
e
.
currentTarget
.
dataset
.
index
?
e
.
currentTarget
.
dataset
.
index
:
0
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
strSearch
=
_this
.
__data__
.
strSearch
var
curIndex
=
e
.
currentTarget
.
dataset
.
index
?
e
.
currentTarget
.
dataset
.
index
:
0
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
strSearch
=
_this
.
__data__
.
strSearch
var
activityType
=
_this
.
__data__
.
activityType
this
.
setData
({
curIndex
:
curIndex
,
})
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
strCategory
,
strSearch
);
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
},
// 搜索点击事件
entrySearch
(
e
)
{
...
...
@@ -189,12 +193,13 @@ Page({
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
strSearch
=
_this
.
__data__
.
strSearch
var
activityType
=
_this
.
__data__
.
activityType
this
.
setData
({
curIndex
:
curIndex
,
});
app
.
globalData
.
switchId
=
""
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
strCategory
,
strSearch
);
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
}
...
...
@@ -291,6 +296,8 @@ Page({
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
strSearch
=
_this
.
__data__
.
strSearch
var
activityType
=
_this
.
__data__
.
activityType
var
isHideLoadMore
=
_this
.
__data__
.
isHideLoadMore
;
var
pageIndex
=
_this
.
__data__
.
pageIndex
;
...
...
@@ -301,7 +308,7 @@ Page({
console
.
log
(
'加载更多'
)
setTimeout
(()
=>
{
_this
.
getActivities
(
1
,
pageIndex
,
4
,
strCity
,
strCategory
,
strSearch
);
_this
.
getActivities
(
1
,
pageIndex
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
},
1000
)
}
else
{
...
...
@@ -328,12 +335,13 @@ Page({
2. tab, tag=strSearch
3. 新增的search tab, '搜索'tab的时候,需要转换为搜索的关键词(_this.__data__.strSearch)
*/
getActivities
:
function
(
scrollType
,
pageNum
,
pageCount
,
strCity
,
strCategory
,
strSearch
)
{
getActivities
:
function
(
scrollType
,
pageNum
,
pageCount
,
strCity
,
activityType
,
strCategory
,
strSearch
)
{
var
_this
=
this
;
// 如果是"推荐"和"搜索",需要单独处理
// '搜索'tab的时候, 需要转换为搜索的关键词(_this.__data__.strSearch)
var
query_url
=
'&title='
+
strSearch
+
'&orderType='
+
strCategory
+
'&city='
+
strCity
+
'&activityType='
+
activityType
var
strUrl
=
config
.
activity_query_url
+
"?pageCount="
+
pageCount
+
"&pageNum="
+
pageNum
+
query_url
...
...
@@ -438,6 +446,7 @@ Page({
var
curIndex
=
_this
.
__data__
.
curIndex
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
activityType
=
_this
.
__data__
.
activityType
var
strSearch
=
""
this
.
setData
({
...
...
@@ -445,7 +454,7 @@ Page({
inputShowed
:
false
,
});
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
strCategory
,
strSearch
);
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
},
// * 删除输入字符串
...
...
@@ -462,8 +471,9 @@ Page({
var
curIndex
=
_this
.
__data__
.
curIndex
var
strCity
=
_this
.
__data__
.
city
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
activityType
=
_this
.
__data__
.
activityType
console
.
log
(
"===input search text_"
+
strSearch
)
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
strCategory
,
strSearch
);
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
_this
.
setData
({
strSearch
:
strSearch
,
...
...
@@ -597,7 +607,8 @@ Page({
var
curIndex
=
_this
.
__data__
.
curIndex
var
strCategory
=
_this
.
__data__
.
category
[
curIndex
].
order
var
strSearch
=
_this
.
__data__
.
strSearch
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
strCategory
,
strSearch
);
var
activityType
=
_this
.
__data__
.
activityType
_this
.
getActivities
(
0
,
1
,
4
,
strCity
,
activityType
,
strCategory
,
strSearch
);
},
...
...
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.js
查看文件 @
ace48180
// pa
ges/member/activity-post/activity-edit/activity-edit.js
// pa
ges/member/activity-post/activity-edit/activity-edit.js
...
...
@@ -19,6 +19,12 @@ Page({
attributeArray
:
[
'活动类别'
,
'价格'
,
'库存'
],
cbs
:
[
{
name
:
''
,
type
:
'00-饮事'
,
value
:
'饮事'
,
holder
:
'饮事活动'
,
checked
:
false
},
{
name
:
''
,
type
:
'01-集市'
,
value
:
'集市'
,
holder
:
'是否集市?'
,
checked
:
false
},
{
name
:
''
,
type
:
'02-园区'
,
value
:
'园区'
,
holder
:
'是否园区?'
,
checked
:
false
},
],
},
...
...
@@ -128,13 +134,53 @@ Page({
// 输入该组图片的标签
bindKeyTag
(
e
)
{
var
_this
=
this
;
_this
.
setData
({
inputTag
:
e
.
detail
.
value
})
//全局赋值
app
.
globalData
.
postData
.
photoTag
=
e
.
detail
.
value
var
cbs
=
_this
.
data
.
cbs
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var
values
=
parseInt
(
e
.
currentTarget
.
id
)
cbs
[
values
].
name
=
e
.
detail
.
value
this
.
setData
({
cbs
})
app
.
globalData
.
postData
.
photoCbs
=
cbs
;
},
//点击checkbox
radioTap
:
function
(
e
){
var
_this
=
this
var
cbs
=
_this
.
data
.
cbs
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var
values
=
parseInt
(
e
.
currentTarget
.
id
)
cbs
[
values
].
checked
=
cbs
[
values
].
checked
==
true
?
false
:
true
cbs
[
values
].
holder
=
cbs
[
values
].
checked
==
true
?
cbs
[
values
].
value
+
'名称?'
:
'是否'
+
cbs
[
values
].
value
+
'?'
this
.
setData
({
cbs
})
app
.
globalData
.
postData
.
photoCbs
=
cbs
;
},
//点击input
inputTap
:
function
(
e
){
var
_this
=
this
var
cbs
=
_this
.
data
.
cbs
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var
values
=
parseInt
(
e
.
currentTarget
.
id
)
cbs
[
values
].
checked
=
cbs
[
values
].
checked
==
true
?
false
:
true
cbs
[
values
].
holder
=
cbs
[
values
].
checked
==
true
?
cbs
[
values
].
value
+
'名称?'
:
'是否'
+
cbs
[
values
].
value
+
'?'
this
.
setData
({
cbs
})
app
.
globalData
.
postData
.
photoCbs
=
cbs
;
},
bindKeyText
(
e
){
var
_this
=
this
;
//js的e.currentTarget.id 对应wxml的 id="0"
...
...
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.wxml
查看文件 @
ace48180
<!--
/page/post/edit/edit 添加分类的特点,以及自定义特点 -->
<!--
/page/post/edit/edit 添加分类的特点,以及自定义特点 -->
...
...
@@ -13,14 +13,35 @@
</view>
</view>
<!-- <view class="weui-cells__title">#添加亮点</view>
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell ">
<view class="weui-cell__bd">
<input class="weui-input" bindinput="bindKeyTag" placeholder="请输入亮点" />
</view>
</view>
</view> -->
<view class="weui-cells__title">#添加活动类型</view>
<view class="weui-cells weui-cells_after-title" style="font-size:30rpx;">
<view style="display:flex; flex-direction: row;">
<label class="weui-cell" style="padding-right:6px;">
<view class="weui-cell__hd">
<checkbox value="0" id="0" checked="{{cbs[0].checked}}" bindtap="radioTap"/>
</view>
<view class="weui-cell__bd {{cbs[0].checked==false?'.check-box-off':''}}" style="width:120rpx" id="0" bindtap="inputTap">
饮事活动
</view>
</label>
<label class="weui-cell" style="padding-left:6px;padding-right:6px;">
<view class="weui-cell__hd">
<checkbox value="1" id="1" checked="{{cbs[1].checked}}" bindtap="radioTap"/>
</view>
<view class="weui-cell__bd {{cbs[1].checked==false?'.check-box-off':''}}">
<input class="weui-input" id="1" bindtap="inputTap" bindinput="bindKeyTag" placeholder="{{cbs[1].holder}}" value="{{cbs[1].name}}"/>
</view>
</label>
<label class="weui-cell" style="padding-left:6px;padding-right:6px;">
<view class="weui-cell__hd">
<checkbox value="2" id="2" checked="{{cbs[2].checked}}" bindtap="radioTap"/>
</view>
<view class="weui-cell__bd {{cbs[2].checked==false?'.check-box-off':''}}">
<input class="weui-input" id="2" bindtap="inputTap" bindinput="bindKeyTag" placeholder="{{cbs[2].holder}}" value="{{cbs[2].name}}"/>
</view>
</label>
</view>
</view>
<view style="display:flex; flex-direction: row;">
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:55%">
...
...
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-edit/activity-edit.wxss
查看文件 @
ace48180
page{
page{
...
...
@@ -91,4 +91,8 @@ page{
color: rgba(55, 134, 244, 1);
width: 100%;
word-break: normal;
}
\ No newline at end of file
}
.check-box-off {
color:rgba(0,0,0,0.6);
}
增值产品-小程序及app/nyx-dev/pages/member/activity-post/activity-submit/activity-submit.js
查看文件 @
ace48180
// pa
ges/member/activity-post/activity-submit/activity-submit.js
// pa
ges/member/activity-post/activity-submit/activity-submit.js
...
...
@@ -332,7 +332,7 @@ Page({
},
success
:
res
=>
{
if
(
res
.
statusCode
==
200
)
{
console
.
log
(
"=== oss getToken
返回值_
"
,
res
.
data
)
console
.
log
(
"=== oss getToken
_"
+
dir
+
"_ done
"
,
res
.
data
)
var
dict
=
{
accessid
:
res
.
data
.
data
.
accessid
,
policy
:
res
.
data
.
data
.
policy
,
...
...
@@ -388,7 +388,7 @@ Page({
},
//上传照片(阿里云)
uploadAli
:
function
(
tag
,
title
,
content
,
photoArr
,
product
,
startDatetime
,
endDatetime
)
{
uploadAli
:
function
(
tag
,
title
,
content
,
photoArr
,
product
,
activityType
,
fairName
,
communityName
,
startDatetime
,
endDatetime
)
{
var
_this
=
this
;
console
.
log
(
"===uploadAli_data_tag: "
,
tag
)
console
.
log
(
"===uploadAli_data_title: "
,
title
)
...
...
@@ -447,7 +447,10 @@ Page({
}
var
callback_param
=
{
'callbackUrl'
:
strUrl
,
'callbackBody'
:
'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag='
+
encodeURI
(
encodeURI
(
tag
))
+
'&title='
+
encodeURI
(
encodeURI
(
title
))
+
'&content='
+
encodeURI
(
encodeURI
(
content
))
+
'&image='
+
image
+
'&userId='
+
user_id
+
'&memberId='
+
member_id
+
'&addressId='
+
address_id
+
encodeURI
(
encodeURI
(
strParam
))
+
'&startDatetime='
+
startDatetime
+
'&endDatetime='
+
endDatetime
,
'callbackBody'
:
'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag='
+
encodeURI
(
encodeURI
(
tag
))
+
'&title='
+
encodeURI
(
encodeURI
(
title
))
+
'&content='
+
encodeURI
(
encodeURI
(
content
))
+
'&image='
+
image
+
'&userId='
+
user_id
+
'&memberId='
+
member_id
+
'&addressId='
+
address_id
+
encodeURI
(
encodeURI
(
strParam
))
+
'&startDatetime='
+
startDatetime
+
'&endDatetime='
+
endDatetime
+
'&activityType='
+
encodeURI
(
encodeURI
(
activityType
))
+
'&fairName='
+
encodeURI
(
encodeURI
(
fairName
))
+
'&communityName='
+
encodeURI
(
encodeURI
(
communityName
)),
'callbackBodyType'
:
"application/x-www-form-urlencoded"
,
}
var
base64_callback_body
=
base64
.
encode
(
JSON
.
stringify
(
callback_param
));
...
...
@@ -490,8 +493,23 @@ Page({
var
photoArr
=
app
.
globalData
.
postData
.
photoArray
;
var
tag
=
app
.
globalData
.
postData
.
photoTag
var
product
=
app
.
globalData
.
postData
.
photoProduct
var
cbs
=
app
.
globalData
.
postData
.
photoCbs
var
startDatetime
=
app
.
globalData
.
postData
.
startDatetime
var
endDatetime
=
app
.
globalData
.
postData
.
endDatetime
var
list
=
[]
var
activityType
=
""
var
fairName
=
""
var
communityName
=
""
for
(
var
i
=
0
;
i
<
cbs
.
length
;
i
++
)
{
if
(
cbs
[
i
].
checked
==
true
)
{
list
.
push
(
cbs
[
i
].
type
)
}
}
activityType
=
list
.
join
(
"::"
)
fairName
=
cbs
[
1
].
checked
==
true
?
cbs
[
1
].
name
:
""
communityName
=
cbs
[
2
].
checked
==
true
?
cbs
[
2
].
name
:
""
//时间戳
var
expire
=
this
.
data
.
oss
[
'userToken'
].
expire
;
...
...
@@ -507,13 +525,13 @@ Page({
promise_oss
.
then
(
function
(
value
)
{
console
.
log
(
"===enter promise_oss user_token then_pass"
)
_this
.
uploadAli
(
tag
,
title
,
content
,
photoArr
,
product
,
startDatetime
,
endDatetime
)
_this
.
uploadAli
(
tag
,
title
,
content
,
photoArr
,
product
,
activityType
,
fairName
,
communityName
,
startDatetime
,
endDatetime
)
});
}
else
{
_this
.
uploadAli
(
tag
,
title
,
content
,
photoArr
,
product
,
startDatetime
,
endDatetime
)
_this
.
uploadAli
(
tag
,
title
,
content
,
photoArr
,
product
,
activityType
,
fairName
,
communityName
,
startDatetime
,
endDatetime
)
}
},
...
...
@@ -529,6 +547,7 @@ Page({
photoTitle
:
""
,
photoContent
:
""
,
photoProduct
:
[],
photoCbs
:
[],
startDatetime
:
""
,
endDatetime
:
""
,
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论