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
248cb915
Commit
248cb915
authored
Sep 03, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 页面更新 & 功能更新
1. 多个活动显示
parent
a2759a33
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
110 行增加
和
49 行删除
+110
-49
增值产品-小程序及app/nyx-master/config.js
+4
-3
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.js
+75
-42
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.wxml
+8
-3
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.wxss
+23
-1
没有找到文件。
增值产品-小程序及app/nyx-master/config.js
查看文件 @
248cb915
//con
fig.js API全局域名配置
//con
fig.js API全局域名配置
//config.js API全局域名配置
//config.js API全局域名配置
var
prod
=
0
;
//阿里云服务器生产版本
var
prod
=
0
;
//阿里云服务器生产版本
var
local
=
0
;
//本地java测试,需要启动java 后台
var
local
=
1
;
//本地java测试,需要启动java 后台
var
test
=
1
;
//阿里云服务器测试版本
var
test
=
0
;
//阿里云服务器测试版本
var
debug
=
0
;
//是否打印调试信息
var
debug
=
0
;
//是否打印调试信息
var
host_key
=
"https://fun.hisuhong.com"
;
var
host_key
=
"https://fun.hisuhong.com"
;
...
@@ -53,6 +53,7 @@ var config={
...
@@ -53,6 +53,7 @@ var config={
match_query_then_update_url
:
host_key
+
"/api/nyx/match/queryThenUpdate/id"
,
match_query_then_update_url
:
host_key
+
"/api/nyx/match/queryThenUpdate/id"
,
bonus_query_url
:
host_key
+
"/api/nyx/match/bonus/query/id"
,
bonus_query_url
:
host_key
+
"/api/nyx/match/bonus/query/id"
,
collect_query_url
:
host_key
+
"/api/nyx/collect/query"
,
collect_query_url
:
host_key
+
"/api/nyx/collect/query"
,
product_query_url
:
host_key
+
"/api/nyx/product/query"
,
member_query_url
:
host_key
+
"/api/nyx/member/query"
,
member_query_url
:
host_key
+
"/api/nyx/member/query"
,
socket_url
:
socket_url
,
socket_url
:
socket_url
,
oss_token_url
:
host_key
+
"/api/nyx/oss/getToken"
,
oss_token_url
:
host_key
+
"/api/nyx/oss/getToken"
,
...
...
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.js
查看文件 @
248cb915
// pa
ges/activity/activity-info/activity-info.js
// pa
ges/activity/activity-info/activity-info.js
...
@@ -20,10 +20,11 @@ Page({
...
@@ -20,10 +20,11 @@ Page({
windowWidth
:
""
,
windowWidth
:
""
,
contentHeight
:
""
,
contentHeight
:
""
,
scrollLeft
:
0
,
//切换栏的滚动条位置
scrollLeft
:
0
,
//切换栏的滚动条位置
curIndex
:
0
,
// 基础数据
// 基础数据
activityInfo
:
{},
curIndex
:
0
,
// 给选中的tab加粗
activityInfo
:
{},
// 活动基础信息
products
:
[],
// 活动类别详情
//点赞模块
//点赞模块
likeDictUpdate
:
{},
// 判断当前页面是否存在点赞操作
likeDictUpdate
:
{},
// 判断当前页面是否存在点赞操作
...
@@ -44,8 +45,11 @@ Page({
...
@@ -44,8 +45,11 @@ Page({
windowWidth
:
windowWidth
,
windowWidth
:
windowWidth
,
contentHeight
:
windowHeight
*
0.675
,
contentHeight
:
windowHeight
*
0.675
,
})
})
wx
.
setNavigationBarTitle
({
title
:
'活动详情'
,
})
//
初始化
数据
//
step1: 初始化商家及用户
数据
if
(
wx
.
getStorageSync
(
'nyxCode'
))
{
if
(
wx
.
getStorageSync
(
'nyxCode'
))
{
_this
.
setData
({
_this
.
setData
({
nyxCode
:
wx
.
getStorageSync
(
'nyxCode'
),
nyxCode
:
wx
.
getStorageSync
(
'nyxCode'
),
...
@@ -55,6 +59,7 @@ Page({
...
@@ -55,6 +59,7 @@ Page({
})
})
}
}
//step2: 获取上一页面传入的数据
var
activityInfo
=
_this
.
__data__
.
activityInfo
var
activityInfo
=
_this
.
__data__
.
activityInfo
if
(
Object
.
keys
(
activityInfo
).
length
==
0
&&
options
.
title
!=
""
)
if
(
Object
.
keys
(
activityInfo
).
length
==
0
&&
options
.
title
!=
""
)
{
{
...
@@ -74,21 +79,12 @@ Page({
...
@@ -74,21 +79,12 @@ Page({
activityInfo
[
'end_datetime'
]
=
options
.
end_datetime
;
activityInfo
[
'end_datetime'
]
=
options
.
end_datetime
;
activityInfo
[
'member_logo'
]
=
options
.
member_logo
==
""
?
'/icon/icon_avatar1.png'
:
options
.
member_logo
;
activityInfo
[
'member_logo'
]
=
options
.
member_logo
==
""
?
'/icon/icon_avatar1.png'
:
options
.
member_logo
;
}
}
_this
.
setData
({
activityInfo
})
wx
.
setNavigationBarTitle
({
//step3: 获取products, 活动的具体类别
title
:
'活动详情'
,
_this
.
getProducts
(
activityInfo
[
'activity_id'
])
})
_this
.
setData
(
{
activityInfo
:
activityInfo
,
}
)
//get the activity_item, then add to activityInfo
_this
.
getActivityItem
(
activityInfo
[
'activity_id'
])
//初始化 likeDictStorage
//
step4:
初始化 likeDictStorage
if
(
!
wx
.
getStorageSync
(
'likeDictStorage'
))
{
if
(
!
wx
.
getStorageSync
(
'likeDictStorage'
))
{
var
likeDictStorage
=
{}
var
likeDictStorage
=
{}
wx
.
setStorageSync
(
'likeDictStorage'
,
likeDictStorage
)
wx
.
setStorageSync
(
'likeDictStorage'
,
likeDictStorage
)
...
@@ -176,51 +172,88 @@ Page({
...
@@ -176,51 +172,88 @@ Page({
},
},
/**
/**
* 用户点击右上角分享
* 用户分享
* 1. 点击右上角分享
* 2. 点击tab栏分享
*/
*/
onShareAppMessage
:
function
(
options
)
{
onShareAppMessage
:
function
(
options
)
{
var
_this
=
this
;
var
url_activity
=
"/pages/activity/activity-info/activity-info?"
+
"activity_id="
+
_this
.
data
.
activityInfo
[
"activity_id"
]
+
"¬e_image="
+
_this
.
data
.
activityInfo
[
'noteImage'
]
+
"&title="
+
_this
.
data
.
activityInfo
[
"title"
]
+
"&content="
+
_this
.
data
.
activityInfo
[
"content"
]
+
"&address_name="
+
_this
.
data
.
activityInfo
[
"address_name"
]
+
"&member_id="
+
_this
.
data
.
activityInfo
[
"member_id"
]
+
"&member_name="
+
_this
.
data
.
activityInfo
[
"member_name"
]
+
"&member_slogan="
+
_this
.
data
.
activityInfo
[
"member_slogan"
]
+
"&member_logo="
+
_this
.
data
.
activityInfo
[
"member_logo"
]
+
"&start_datetime="
+
_this
.
data
.
activityInfo
[
"start_datetime"
]
+
"&end_datetime="
+
_this
.
data
.
activityInfo
[
"end_datetime"
]
var
shareObj
=
{
var
shareObj
=
{
title
:
"好友推荐: "
+
"Renaissance Bar知识竞答"
,
// 默认是小程序的名称(可以写slogan等)
title
:
"好友推荐: "
+
_this
.
data
.
activityInfo
[
'title'
],
path
:
'/pages/share/share'
,
// 默认是当前页面,必须是以'/'开头的完整路径
path
:
url_activity
,
// 默认是当前页面,必须是以'/'开头的完整路径
imageUrl
:
''
imageUrl
:
''
}
}
// 来自页面内的按钮的转发
// 来自页面内的按钮的转发
if
(
options
.
from
==
'button'
){
if
(
options
.
from
==
'button'
){
// var eData = options.target.dataset;
// console.log( eData.id); // shareBtn
// 此处可以修改 shareObj 中的内容
// 此处可以修改 shareObj 中的内容
shareObj
.
path
=
'/pages/goods/goods?goodId=123'
;
shareObj
.
path
=
url_activity
;
}
}
return
shareObj
;
return
shareObj
;
},
},
/**
/**
*
*
* 用户自定义函数
* 用户自定义函数
jscat 20200903
*/
*/
//获取活动的
子项
//获取活动的
具体子项; products
get
ActivityItem
(
activity_id
){
get
Products
(
activity_id
){
var
_this
=
this
;
var
_this
=
this
;
var
activityInfo
=
_this
.
__data__
.
activityInfo
var
activity_item
=
[
var
pageCount
=
10
{
var
pageNum
=
1
product_desc
:
"会员"
,
var
query_url
=
'&activityId='
+
activity_id
unit_price
:
59.00
,
var
strUrl
=
config
.
product_query_url
+
"?pageCount="
+
pageCount
default_status
:
"01"
,
+
"&pageNum="
+
pageNum
+
query_url
},
config
.
debug
==
1
?
console
.
log
(
"===strUrl is:
\"
"
+
strUrl
+
"
\"
"
)
:
""
{
wx
.
request
({
product_desc
:
"普通用户"
,
url
:
strUrl
,
unit_price
:
99.00
,
method
:
'GET'
,
default_status
:
"00"
,
header
:
{
'Cookie'
:
wx
.
getStorageSync
(
'cookieKey'
),
},
},
]
success
:
function
(
res
)
{
activityInfo
[
'activity_item'
]
=
activity_item
if
(
res
.
data
.
resultCode
==
200
)
{
//表示HTTP请求成功
console
.
log
(
res
.
data
);
var
products
=
[]
_this
.
setData
({
for
(
var
i
=
0
;
i
<
res
.
data
.
data
.
length
;
i
++
)
{
activityInfo
:
activityInfo
,
var
result
=
{}
result
[
"product_id"
]
=
res
.
data
.
data
[
i
].
productId
result
[
"product_desc"
]
=
res
.
data
.
data
[
i
].
productDesc
result
[
"unit_price"
]
=
res
.
data
.
data
[
i
].
unitPrice
result
[
"stock"
]
=
res
.
data
.
data
[
i
].
stock
result
[
"default_status"
]
=
res
.
data
.
data
[
i
].
defaultStatus
products
.
push
(
result
)
}
_this
.
setData
({
products
})
}
}
})
})
},
//切换所选的类别
switchCategory
(
e
)
{
var
_this
=
this
;
var
curIndex
=
e
.
currentTarget
.
dataset
.
index
?
e
.
currentTarget
.
dataset
.
index
:
0
this
.
setData
({
curIndex
})
},
},
...
...
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.wxml
查看文件 @
248cb915
<wxs
module="tutil" src="./../../../utils/date.wxs"></wxs>
<wxs
module="tutil" src="./../../../utils/date.wxs"></wxs>
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<view class="note">
<view class="note">
<view class="note-price" style="font-weight: bold">
<view class="note-price" style="font-weight: bold">
<view class="clone">
<view class="clone">
<view class="clone-left">¥{{
activityInfo
.unit_price}}</view>
<view class="clone-left">¥{{
products[curIndex]
.unit_price}}</view>
<!-- start 点赞 like -->
<!-- start 点赞 like -->
<block>
<block>
...
@@ -43,7 +43,12 @@
...
@@ -43,7 +43,12 @@
<view class="note-content" style="display: flex; flex-direction: column">
<view class="note-content" style="display: flex; flex-direction: column">
<span>主题: {{activityInfo.title}}</span>
<span>主题: {{activityInfo.title}}</span>
<span>类别: {{activityInfo.product_desc}}</span>
<span>类别:
<view class="cate-list {{curIndex==index?'on':''}}" wx:for="{{products}}"
wx:for-item="sub_item" wx:key="{{index}}" data-index="{{index}}" bindtap="switchCategory">
{{sub_item.product_desc}}
</view>
</span>
<!-- 日期 -->
<!-- 日期 -->
<span>日期: {{tutil.formatDate_ymdw_today_interval(activityInfo.start_datetime, activityInfo.end_datetime)}}</span>
<span>日期: {{tutil.formatDate_ymdw_today_interval(activityInfo.start_datetime, activityInfo.end_datetime)}}</span>
...
...
增值产品-小程序及app/nyx-master/pages/activity/activity-info/activity-info.wxss
查看文件 @
248cb915
.scro
ll-view_H{
.scro
ll-view_H{
...
@@ -223,3 +223,24 @@
...
@@ -223,3 +223,24 @@
right:0;
right:0;
}
}
.cate-list{
display: inline;
/* margin: 15rpx 22rpx; */
text-align: center;
font-size: 32rpx;
/* color: #9d9d9d; */
background: #F4F4F4;
margin-right: 20rpx;
padding-right: 10rpx;
padding-top: 10rpx;
padding-bottom: 10rpx;
}
.cate-list.on {
color: #FF6600;
font-weight: bold;
/*
border:1px solid #FF6600;
border-radius: 6rpx;
*/
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论