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
e7927409
Commit
e7927409
authored
Aug 11, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 数据优化, 页面优化
1. 更新my-orders 的页面和测试数据
parent
f8740917
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
501 行增加
和
12 行删除
+501
-12
增值产品-小程序及app/nyx-master/config.js
+3
-3
增值产品-小程序及app/nyx-master/icon/my/activity.png
+0
-0
增值产品-小程序及app/nyx-master/pages/activity/activity.wxml
+6
-6
增值产品-小程序及app/nyx-master/pages/activity/activity.wxss
+2
-2
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.js
+369
-0
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.json
+3
-0
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.wxml
+109
-0
增值产品-小程序及app/nyx-master/pages/my/my.wxml
+9
-1
没有找到文件。
增值产品-小程序及app/nyx-master/config.js
查看文件 @
e7927409
//con
fig.js API全局域名配置
//con
fig.js API全局域名配置
//config.js API全局域名配置
var
prod
=
0
;
//阿里云服务器生产版本
var
local
=
1
;
//本地java测试,需要启动java 后台
var
test
=
0
;
//阿里云服务器测试版本
var
local
=
0
;
//本地java测试,需要启动java 后台
var
test
=
1
;
//阿里云服务器测试版本
var
debug
=
0
;
//是否打印调试信息
var
host_key
=
"https://fun.hisuhong.com"
;
...
...
增值产品-小程序及app/nyx-master/icon/my/activity.png
0 → 100644
查看文件 @
e7927409
4.47 KB
增值产品-小程序及app/nyx-master/pages/activity/activity.wxml
查看文件 @
e7927409
<view
class="page">
<view
class="page">
...
...
@@ -39,12 +39,12 @@
<text>积分</text>
</view>
<!-- todo 0728 热销暂时也不实现 -->
<
!-- <
view class="items">
<navigator url="
matchStudyDetail/matchStudyDetail?studyType=wset3
">
<image src="../../icon/
activity/top
.png"></image>
<view class="items">
<navigator url="
/pages/my/my-orders/my-orders
">
<image src="../../icon/
my/activity
.png"></image>
</navigator>
<text>
热销
</text>
</view>
-->
<text>
预订
</text>
</view>
</view>
</view>
...
...
增值产品-小程序及app/nyx-master/pages/activity/activity.wxss
查看文件 @
e7927409
/*
/*
...
...
@@ -93,7 +93,7 @@
text-align: center;
line-height: 38px;
font-size: 28rpx;
color: #F00;
color: #F
F66
00;
font-weight: bold;
}
.writer image{
...
...
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.js
0 → 100644
查看文件 @
e7927409
// pages/my/my-order/my-order.js
// pages/my/my-order/my-order.js
var
config
=
wx
.
getStorageSync
(
"config"
);
var
app
=
getApp
();
Page
({
/**
* 页面的初始数据
*/
data
:
{
//用户信息初始化
nyxCode
:
""
,
authStatus
:
""
,
userInfo
:
{},
//活动列表
orders
:
[],
//活动信息
orderInfo_2
:
{
member_name
:
"Renaissance Bar"
,
title
:
"酒市集"
,
total_price
:
149.00
,
order_id
:
"oid_123"
,
order_status
:
"交易成功"
,
product_image
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/user-dir/sakura.jpg"
,
order_qrcode
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/qrcode-dir/mid_11235813.png"
,
item_height
:
130
+
20
+
120
*
2
+
30
*
3
,
// basic + margin-bottom(20rpx) + item(n) + margin(n+1)
order_item
:[
{
product_desc
:
"会员"
,
unit_price
:
"59.00"
,
quantity
:
1
,
},
{
product_desc
:
"普通用户"
,
unit_price
:
"99.00"
,
quantity
:
1
,
}
]
},
orderInfo_1
:
{
member_name
:
"Renaissance Bar"
,
title
:
"酒市集"
,
total_price
:
149.00
,
order_id
:
"oid_123"
,
order_status
:
"交易成功"
,
product_image
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/user-dir/sakura.jpg"
,
order_qrcode
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/qrcode-dir/mid_11235813.png"
,
item_height
:
130
+
20
+
120
+
30
*
2
,
// 控制item的高度
order_item
:[
{
product_desc
:
"普通用户"
,
unit_price
:
"99.00"
,
quantity
:
1
,
}
]
},
orderInfo_3
:
{
member_name
:
"Renaissance Bar"
,
title
:
"酒市集"
,
total_price
:
149.00
,
order_id
:
"oid_123"
,
order_status
:
"交易成功"
,
product_image
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/user-dir/sakura.jpg"
,
order_qrcode
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/qrcode-dir/mid_11235813.png"
,
item_height
:
130
+
20
+
120
*
3
+
30
*
4
,
// 控制item的高度
order_item
:[
{
product_desc
:
"普通用户"
,
unit_price
:
"99.00"
,
quantity
:
1
,
},
{
product_desc
:
"普通用户"
,
unit_price
:
"99.00"
,
quantity
:
2
,
},
{
product_desc
:
"普通用户"
,
unit_price
:
"99.00"
,
quantity
:
3
,
},
]
},
//选中barcode的qrcode和url
qrcode
:
""
,
qrcode_url
:
""
,
// {
// rankId : "rid_001",
// defaultType : "1",
// matchType : "竞答",
// title : "泥煤怪兽",
// rank : "1",
// score : "200",
// ratio : "96%",
// },
isHideLoadMore
:
false
,
/* 模态框 */
showModalPoints
:
false
,
showModalBarcode
:
false
,
/* 订单 可使用/不可用状态 */
selectTab
:
true
,
matchStatus
:
""
,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
var
_this
=
this
;
wx
.
setNavigationBarTitle
({
title
:
'我的预订'
,
})
//初始化数据
if
(
wx
.
getStorageSync
(
'nyxCode'
))
{
_this
.
setData
({
nyxCode
:
wx
.
getStorageSync
(
'nyxCode'
),
userInfo
:
wx
.
getStorageSync
(
'userInfo'
),
authStatus
:
wx
.
getStorageSync
(
'authStatus'
),
matchSeason
:
wx
.
getStorageSync
(
'matchSeason'
),
})
}
//初始载入四个积分
if
(
_this
.
__data__
.
orders
.
length
==
0
)
{
//getPoints(scrollType, pageNum, pageCount, matchStatus)
//onLoad的时候展示可使用的积分
var
orders
=
[]
orders
.
push
(
_this
.
__data__
.
orderInfo_2
)
orders
.
push
(
_this
.
__data__
.
orderInfo_3
)
orders
.
push
(
_this
.
__data__
.
orderInfo_1
)
//_this.getPoints(0, 1, 4, matchStatus);
_this
.
setData
({
orders
:
orders
,
selectTab
:
'20'
,
// 默认为可使用 tab
isHideLoadMore
:
orders
.
length
<
4
?
true
:
false
,
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
console
.
log
(
'页面上拉触底'
)
var
_this
=
this
;
var
matchStatus
=
_this
.
__data__
.
matchStatus
var
isHideLoadMore
=
_this
.
__data__
.
isHideLoadMore
;
var
pageIndex
=
_this
.
__data__
.
pageIndex
;
//控制逻辑, 在onClick之后或者onGetComment事件之后再允许下拉更新操作
//判断是否已经全部加载完毕
//没有则加载更多
if
(
!
isHideLoadMore
)
{
console
.
log
(
'加载更多'
)
setTimeout
(()
=>
{
_this
.
getPoints
(
1
,
pageIndex
,
4
,
matchStatus
);
},
1000
)
}
else
{
console
.
log
(
'没有更多'
)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
},
// 用户自定义函数
/*
*/
/* 点击好友助力 */
onClickPoints
:
function
(
e
){
var
_this
=
this
;
var
indexId
=
e
.
currentTarget
.
dataset
.
id
var
match_id
=
_this
.
__data__
.
points
[
indexId
].
match_id
_this
.
getBonus
(
match_id
)
_this
.
setData
({
showModalPoints
:
true
})
},
/* 点击barcode */
onClickBarcode
:
function
(
e
){
var
_this
=
this
;
//指明具体是list的哪一个item
var
indexId
=
e
.
currentTarget
.
dataset
.
id
var
qrcode_url
=
_this
.
__data__
.
points
[
indexId
].
qrcode_url
var
qrcode
=
_this
.
__data__
.
points
[
indexId
].
match_id
this
.
setData
({
showModalBarcode
:
true
,
qrcode
:
qrcode
,
qrcode_url
:
qrcode_url
})
},
// 弹出层里面的弹窗
ok
:
function
()
{
this
.
setData
({
showModalPoints
:
false
,
showModalBarcode
:
false
})
},
/**
* tab切换
*/
tab
:
function
(
e
)
{
var
_this
=
this
;
//js的e.currentTarget.id 对应wxml的 id="tab0"
//js的e.currentTarget.dataSet.id 对应wxml的 data-id="tab0"
var
id
=
e
.
currentTarget
.
id
;
var
dataId
=
e
.
currentTarget
.
dataset
.
id
_this
.
setData
({
selectTab
:
dataId
,
})
},
/**
* 用户自定义函数
*
*/
// 获取points数据
// scrollType: 是否是翻页, 0-不翻页 | 1-翻页
getPoints
:
function
(
scrollType
,
pageNum
,
pageCount
,
memberStatus
)
{
var
_this
=
this
;
var
query_url
=
'&matchStatus='
+
memberStatus
var
strUrl
=
config
.
match_query_url
+
"?pageCount="
+
pageCount
+
"&pageNum="
+
pageNum
+
query_url
config
.
debug
==
1
?
console
.
log
(
"===strUrl is:
\"
"
+
strUrl
+
"
\"
"
)
:
""
wx
.
request
({
url
:
strUrl
,
method
:
'GET'
,
header
:
{
'Cookie'
:
wx
.
getStorageSync
(
'cookieKey'
),
},
success
:
function
(
res
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
//表示HTTP请求成功
console
.
log
(
res
.
data
);
var
list
=
[]
var
bisHideLoadMoreType
=
false
;
if
(
res
.
data
.
data
.
length
<
pageCount
)
{
bisHideLoadMoreType
=
true
;
}
for
(
var
i
=
0
;
i
<
res
.
data
.
data
.
length
;
i
++
)
{
var
result
=
{}
result
[
"total_point"
]
=
res
.
data
.
data
[
i
].
totalPoint
result
[
"member_name"
]
=
res
.
data
.
data
[
i
].
memberName
result
[
"bonus_count"
]
=
res
.
data
.
data
[
i
].
bonusCount
result
[
"bonus_point"
]
=
res
.
data
.
data
[
i
].
bonusPoint
result
[
"match_id"
]
=
res
.
data
.
data
[
i
].
matchId
result
[
"qrcode_url"
]
=
res
.
data
.
data
[
i
].
qrcodeUrl
list
.
push
(
result
)
}
//进行翻页设置(加载更多)
if
(
scrollType
==
1
)
{
var
pointsList
=
_this
.
__data__
.
points
;
list
=
pointsList
.
concat
(
list
)
}
_this
.
setData
({
points
:
list
,
pageIndex
:
pageNum
+
1
,
isHideLoadMore
:
bisHideLoadMoreType
,
})
}
}
})
},
// 获取bonus points数据
getBonus
:
function
(
matchId
)
{
var
_this
=
this
;
var
query_url
=
'?matchId='
+
matchId
var
strUrl
=
config
.
bonus_query_url
+
query_url
config
.
debug
==
1
?
console
.
log
(
"===strUrl is:
\"
"
+
strUrl
+
"
\"
"
)
:
""
wx
.
request
({
url
:
strUrl
,
method
:
'GET'
,
header
:
{
'Cookie'
:
wx
.
getStorageSync
(
'cookieKey'
),
},
success
:
function
(
res
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
//表示HTTP请求成功
console
.
log
(
res
.
data
);
var
list
=
[]
for
(
var
i
=
0
;
i
<
res
.
data
.
data
.
length
;
i
++
)
{
var
result
=
{}
result
[
"match_id"
]
=
res
.
data
.
data
[
i
].
matchId
result
[
"user_name"
]
=
res
.
data
.
data
[
i
].
userName
result
[
"bonus_point"
]
=
res
.
data
.
data
[
i
].
bonusPoint
list
.
push
(
result
)
}
_this
.
setData
({
bonus_info
:
list
,
})
}
}
})
},
})
\ No newline at end of file
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.json
0 → 100644
查看文件 @
e7927409
{}
{}
\ No newline at end of file
增值产品-小程序及app/nyx-master/pages/my/my-orders/my-orders.wxml
0 → 100644
查看文件 @
e7927409
<view class="page">
<view class="page">
<!-- Tab: refer to 有品·优惠券 -->
<view class="weui-flex" style="height: 120rpx;">
<view class="weui-flex__item weui-flex justify align border" data-id="20" id="id-20" bindtap="tab">
<view class="placeholder">
<text class="text {{selectTab=='20'?'selected':''}}">可使用</text>
</view></view>
<view class="weui-flex__item weui-flex justify align border" data-id="10" id="id-10" bindtap="tab">
<view class="placeholder">
<text class="text {{selectTab=='10'?'selected':''}}">代付款</text>
</view></view>
<view class="weui-flex__item weui-flex justify align border" data-id="00::30" id="id-00::30" bindtap="tab">
<view class="placeholder">
<text class="text {{selectTab=='00::30'?'selected':''}}">不可用</text>
</view></view>
</view>
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list" wx:for="{{orders}}" wx:for-item="item" wx:key="{{index}}">
<view class="item stamp stamp01" style="height:{{item.item_height}}rpx;">
<!-- 商家信息 -->
<view class="note-info">
<view class="note-title" style="font-weight: bold">
<view class="title-left">{{item.member_name}}</view>
<view class="title-right" bindtap="onClickBarcode" data-id='{{index}}'>
<image src="../../../icon/my/logo-barcode.png"></image>
</view>
</view>
</view>
<!-- 商品信息 -->
<block wx:for="{{item.order_item}}" wx:for-item="sub_item" wx:key="{{index}}">
<view class="note-row">
<image class="writer-image" src="{{item.product_image}}"/>
<view class="note-column">
<span>{{sub_item.product_desc}} {{sub_item.unit_price}}</span>
<span> x {{sub_item.quantity}}</span>
</view>
</view>
</block>
<view class="note-price" style="font-weight: bold">
<span>总价: ¥{{item.total_price}}</span>
</view>
</view>
</view>
<!-- 加载更多 -->
<view class="weui-loadmore" hidden="{{isHideLoadMore}}">
<view class="weui-loading"></view>
<view class="weui-loadmore__tips">正在加载</view>
</view>
<view class="weui-loadmore" hidden="{{!isHideLoadMore}}">
<view class="weui-loadmore__tips">没有更多啦 {{'>'}}_{{'<'}} </view>
</view>
<!-- 查看好友助力-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalPoints}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalPoints}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">助力清单</text>
</view>
<view class="title-close" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-point">
<view class="text" wx:for="{{bonus_info}}" wx:for-item="item" wx:key="{{index}}" >
{{item.user_name}}助力{{item.bonus_point}}积分
</view>
</view>
</view>
<!-- end 遮罩层 -->
<!-- 查看优惠券码-->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85104827 -->
<!-- 微信小程序自定义弹框 https://blog.csdn.net/qq_39702981/article/details/85320926 -->
<!-- start 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModalBarcode}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModalBarcode}}">
<!-- 二维码或其他图片 -->
<view class="title">
<text style="color:#666666">请扫描以下券码验券 </text>
</view>
<view class="title-right" bindtap="ok">
<image src="../../../icon/close.png"></image>
</view>
<view class="list-barcode">
<view class="text">券码:{{qrcode}}</view>
<image src="{{qrcode_url}}"></image>
</view>
<view class="list-barcode-image">
</view>
</view>
<!-- end 遮罩层 -->
</view>
\ No newline at end of file
增值产品-小程序及app/nyx-master/pages/my/my.wxml
查看文件 @
e7927409
<view
class="page">
<view
class="page">
...
...
@@ -30,5 +30,12 @@
<view class="weui-cell__bd">我的积分</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
<navigator class="weui-cell weui-cell_access" hover-class="weui-cell_active" url="/pages/my/my-orders/my-orders">
<view class="weui-cell__hd">
<image src="/icon/my/activity.png" />
</view>
<view class="weui-cell__bd">我的预订</view>
<view class="weui-cell__ft weui-cell__ft_in-access"></view>
</navigator>
</view>
</view>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论