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
a4f534de
Commit
a4f534de
authored
Sep 16, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 控制流
1. 为order页面和活动提交页面添加空值提醒
parent
8c84e0d3
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
188 行增加
和
45 行删除
+188
-45
增值产品-小程序及app/nyx-master/app.js
+11
-11
增值产品-小程序及app/nyx-master/pages/mall/order/order.js
+34
-4
增值产品-小程序及app/nyx-master/pages/mall/order/order.wxml
+4
-1
增值产品-小程序及app/nyx-master/pages/mall/order/order.wxss
+15
-3
增值产品-小程序及app/nyx-master/pages/member/activity-post/activity-edit/activity-edit.js
+53
-12
增值产品-小程序及app/nyx-master/pages/member/activity-post/activity-submit/activity-submit.js
+71
-14
没有找到文件。
增值产品-小程序及app/nyx-master/app.js
查看文件 @
a4f534de
//app
.js
//app
.js
...
@@ -10,16 +10,16 @@ App({
...
@@ -10,16 +10,16 @@ App({
authStatus
:
""
,
//授权状态, 00表示未授权, 01表示已授权
authStatus
:
""
,
//授权状态, 00表示未授权, 01表示已授权
userInfo
:
{},
//用户信息
userInfo
:
{},
//用户信息
members
:
[],
// 商家列表
members
:
[],
// 商家列表
memberInfo
:
{
},
memberInfo
:
{
// 商家信息
//
member_id: "",
member_id
:
""
,
//
address_id: "",
address_id
:
""
,
//
default_member: "",
default_member
:
""
,
//
member_name: "",
member_name
:
""
,
//
member_city: "",
member_city
:
""
,
//
member_address: "",
member_address
:
""
,
//
member_slogan: "",
member_slogan
:
""
,
//
member_logo: "",
member_logo
:
""
,
//}, // 商家信息
},
emotionHost
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/"
,
emotionHost
:
"https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/"
,
onOpenOp
:
{},
onOpenOp
:
{},
...
...
增值产品-小程序及app/nyx-master/pages/mall/order/order.js
查看文件 @
a4f534de
// pa
ges/my/my-orders/my-orders.js
// pa
ges/my/my-orders/my-orders.js
...
@@ -24,6 +24,9 @@ Page({
...
@@ -24,6 +24,9 @@ Page({
curIndex
:
0
,
curIndex
:
0
,
selected_all
:
0
,
selected_all
:
0
,
// 消息提示框的遮罩层
showToast
:
false
,
},
},
/**
/**
...
@@ -388,9 +391,36 @@ Page({
...
@@ -388,9 +391,36 @@ Page({
//跳转到首页
//跳转到首页
toHome
:
function
(
e
)
{
toHome
:
function
(
e
)
{
wx
.
switchTab
({
var
_this
=
this
;
url
:
"/pages/activity/activity"
// jscat 20200913 消息提示框
});
/*
需求:
1, 消息提示
2, 延迟3000ms
3, 遮罩层
*/
var
showToast
=
true
_this
.
setData
({
showToast
})
wx
.
showToast
({
icon
:
'none'
,
title
:
'预订成功'
,
duration
:
3000
,
success
:
function
(){
setTimeout
(
function
(){
wx
.
switchTab
({
url
:
'/pages/activity/activity'
,
success
:
function
(
e
)
{
var
page
=
getCurrentPages
().
pop
();
if
(
page
==
undefined
||
page
==
null
)
return
;
// 更新首页的数据
console
.
log
(
"===switchTab page"
,
page
)
}
});
},
3000
)
}
})
},
},
...
...
增值产品-小程序及app/nyx-master/pages/mall/order/order.wxml
查看文件 @
a4f534de
<view
class="page">
<view
class="page">
<view class="page">
<view class="page">
<!-- 定义遮罩层 -->
<view class="mask" wx:if="{{showToast}}"></view>
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<!-- Content: refer to 有品·优惠券 + 点评(可使用) -->
<view class="coupon-list">
<view class="coupon-list">
<view class="item stamp stamp01" style="height:{{orderInfo.item_height}}rpx;">
<view class="item stamp stamp01" style="height:{{orderInfo.item_height}}rpx;">
...
...
增值产品-小程序及app/nyx-master/pages/mall/order/order.wxss
查看文件 @
a4f534de
.page
{
.page
{
...
@@ -459,4 +459,16 @@
...
@@ -459,4 +459,16 @@
.stepper .disabled{
.stepper .disabled{
color: #ccc;
color: #ccc;
}
}
/* end of 数量加减 */
/* end of 数量加减 */
\ No newline at end of file
/* 消息提示框的遮罩层 */
.mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.5;
}
\ No newline at end of file
增值产品-小程序及app/nyx-master/pages/member/activity-post/activity-edit/activity-edit.js
查看文件 @
a4f534de
// pa
ges/member/activity-post/activity-edit/activity-edit.js
// pa
ges/member/activity-post/activity-edit/activity-edit.js
...
@@ -97,17 +97,20 @@ Page({
...
@@ -97,17 +97,20 @@ Page({
var
product
=
_this
.
__data__
.
products
var
product
=
_this
.
__data__
.
products
app
.
globalData
.
postData
.
photoProduct
=
_this
.
__data__
.
products
app
.
globalData
.
postData
.
photoProduct
=
_this
.
__data__
.
products
let
promise
=
app
.
onCheckText
(
app
.
globalData
.
postData
.
photoTag
)
if
(
checkField
())
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
{
//then后的括号里应该是参数param
let
promise
=
app
.
onCheckText
(
app
.
globalData
.
postData
.
photoTag
)
//https://www.cnblogs.com/qlongbg/p/11603328.html
//在本轮event loop(事件循环)运行完成之前,回调函数是不会被调用的
promise
.
then
(
function
(
value
)
{
//then后的括号里应该是参数param
console
.
log
(
"===enter promise then_pass_"
+
value
)
//https://www.cnblogs.com/qlongbg/p/11603328.html
wx
.
navigateTo
({
url
:
'./../activity-submit/activity-submit'
})
promise
.
then
(
function
(
value
)
{
},
console
.
log
(
"===enter promise then_pass_"
+
value
)
function
(
value
)
{
wx
.
navigateTo
({
url
:
'./../activity-submit/activity-submit'
})
console
.
log
(
"===enter promise then_failed_"
+
value
)
},
},);
function
(
value
)
{
console
.
log
(
"===enter promise then_failed_"
+
value
)
},);
}
},
},
...
@@ -212,3 +215,41 @@ Page({
...
@@ -212,3 +215,41 @@ Page({
})
})
function
checkField
(){
var
info
=
""
var
products
=
app
.
globalData
.
postData
.
photoProduct
for
(
var
i
=
0
;
i
<
products
.
length
;
i
++
)
{
if
(
products
[
i
].
productDesc
==
undefined
||
products
[
i
].
productDesc
==
""
)
{
info
=
"请输入第"
+
i
+
"项活动类别"
}
}
if
(
app
.
globalData
.
postData
.
photoTitle
.
length
==
0
)
{
info
=
"请输入活动标题"
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
else
if
(
info
!=
""
)
{
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
console
.
log
(
"字段校验成功"
)
return
true
;
}
增值产品-小程序及app/nyx-master/pages/member/activity-post/activity-submit/activity-submit.js
查看文件 @
a4f534de
// pa
ges/member/activity-post/activity-submit/activity-submit.js
// pa
ges/member/activity-post/activity-submit/activity-submit.js
...
@@ -91,6 +91,7 @@ Page({
...
@@ -91,6 +91,7 @@ Page({
_this
.
setData
({
defaultCity
})
_this
.
setData
({
defaultCity
})
var
memberInfo
=
app
.
globalData
.
memberInfo
||
{}
var
memberInfo
=
app
.
globalData
.
memberInfo
||
{}
memberInfo
[
"member_city"
]
=
defaultCity
memberInfo
[
"member_city"
]
=
defaultCity
memberInfo
[
"member_slogan"
]
=
"标语待完善"
app
.
globalData
.
memberInfo
=
memberInfo
app
.
globalData
.
memberInfo
=
memberInfo
},
},
...
@@ -107,7 +108,17 @@ Page({
...
@@ -107,7 +108,17 @@ Page({
// Date Flow
// Date Flow
// 提交 tbl_member, oss 和数据库
// 提交 tbl_member, oss 和数据库
onSubmitPost
:
function
()
{
// 活动提交入口
onSubmit
:
function
(
e
)
{
var
_this
=
this
;
if
(
_this
.
checkField
())
{
_this
.
submitPost
()
}
},
submitPost
:
function
()
{
var
_this
=
this
;
var
_this
=
this
;
var
title
=
app
.
globalData
.
postData
.
photoTitle
var
title
=
app
.
globalData
.
postData
.
photoTitle
var
content
=
app
.
globalData
.
postData
.
photoContent
;
//获取content
var
content
=
app
.
globalData
.
postData
.
photoContent
;
//获取content
...
@@ -434,13 +445,6 @@ Page({
...
@@ -434,13 +445,6 @@ Page({
},
},
// 活动提交入口
onSubmit
:
function
(
e
)
{
var
_this
=
this
;
_this
.
onSubmitPost
()
},
// 授权入口: 获取用户授权信息
// 授权入口: 获取用户授权信息
// authStatus=='00' && members.length == 0
// authStatus=='00' && members.length == 0
getUserInfo
:
function
(
e
)
{
getUserInfo
:
function
(
e
)
{
...
@@ -461,7 +465,7 @@ Page({
...
@@ -461,7 +465,7 @@ Page({
promise_login
.
then
(
promise_login
.
then
(
function
(
value
)
{
function
(
value
)
{
console
.
log
(
"===enter promise_login then_pass_"
+
value
)
console
.
log
(
"===enter promise_login then_pass_"
+
value
)
_this
.
onSubmit
Post
()
_this
.
onSubmit
()
},
},
function
(
value
)
{
function
(
value
)
{
console
.
log
(
"===enter promise_login then_failed_"
+
value
)
console
.
log
(
"===enter promise_login then_failed_"
+
value
)
...
@@ -493,7 +497,7 @@ Page({
...
@@ -493,7 +497,7 @@ Page({
// 添加口号
// 添加口号
bindSlogan
(
e
)
{
bindSlogan
(
e
)
{
var
_this
=
this
;
var
_this
=
this
;
var
memberInfo
=
_this
.
d
ata
.
memberInfo
||
{}
var
memberInfo
=
app
.
globalD
ata
.
memberInfo
||
{}
memberInfo
[
"member_slogan"
]
=
e
.
detail
.
value
memberInfo
[
"member_slogan"
]
=
e
.
detail
.
value
app
.
globalData
.
memberInfo
=
memberInfo
app
.
globalData
.
memberInfo
=
memberInfo
_this
.
setData
({
memberInfo
})
_this
.
setData
({
memberInfo
})
...
@@ -501,7 +505,7 @@ Page({
...
@@ -501,7 +505,7 @@ Page({
// 添加名称
// 添加名称
bindName
(
e
)
{
bindName
(
e
)
{
var
_this
=
this
;
var
_this
=
this
;
var
memberInfo
=
_this
.
d
ata
.
memberInfo
||
{}
var
memberInfo
=
app
.
globalD
ata
.
memberInfo
||
{}
memberInfo
[
"member_name"
]
=
e
.
detail
.
value
memberInfo
[
"member_name"
]
=
e
.
detail
.
value
app
.
globalData
.
memberInfo
=
memberInfo
app
.
globalData
.
memberInfo
=
memberInfo
_this
.
setData
({
memberInfo
})
_this
.
setData
({
memberInfo
})
...
@@ -510,7 +514,7 @@ Page({
...
@@ -510,7 +514,7 @@ Page({
// jscat 20200915,
// jscat 20200915,
bindCity
(
e
)
{
bindCity
(
e
)
{
var
_this
=
this
;
var
_this
=
this
;
var
memberInfo
=
_this
.
d
ata
.
memberInfo
||
{}
var
memberInfo
=
app
.
globalD
ata
.
memberInfo
||
{}
memberInfo
[
"member_city"
]
=
e
.
detail
.
value
memberInfo
[
"member_city"
]
=
e
.
detail
.
value
app
.
globalData
.
memberInfo
=
memberInfo
app
.
globalData
.
memberInfo
=
memberInfo
_this
.
setData
({
memberInfo
})
_this
.
setData
({
memberInfo
})
...
@@ -518,7 +522,7 @@ Page({
...
@@ -518,7 +522,7 @@ Page({
//添加地址
//添加地址
bindAddress
(
e
)
{
bindAddress
(
e
)
{
var
_this
=
this
;
var
_this
=
this
;
var
memberInfo
=
_this
.
d
ata
.
memberInfo
||
{}
var
memberInfo
=
app
.
globalD
ata
.
memberInfo
||
{}
memberInfo
[
"member_address"
]
=
e
.
detail
.
value
memberInfo
[
"member_address"
]
=
e
.
detail
.
value
app
.
globalData
.
memberInfo
=
memberInfo
app
.
globalData
.
memberInfo
=
memberInfo
_this
.
setData
({
memberInfo
})
_this
.
setData
({
memberInfo
})
...
@@ -734,5 +738,58 @@ Page({
...
@@ -734,5 +738,58 @@ Page({
})
})
},
},
checkField
(){
var
_this
=
this
;
var
info
=
""
if
(
app
.
globalData
.
postData
.
photoContent
.
length
==
0
)
{
info
=
"请输入活动内容"
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
else
if
(
_this
.
data
.
logoArray
.
length
==
0
)
{
info
=
"请上传店铺logo"
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
else
if
(
app
.
globalData
.
memberInfo
.
member_name
==
undefined
||
app
.
globalData
.
memberInfo
.
member_name
.
length
==
0
)
{
info
=
"请输入店铺名称"
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
else
if
(
app
.
globalData
.
memberInfo
.
member_address
==
undefined
||
app
.
globalData
.
memberInfo
.
member_address
.
length
==
0
)
{
info
=
"请输入店铺地址"
wx
.
showModal
({
content
:
info
,
showCancel
:
false
,
confirmText
:
'确认'
})
return
false
;
}
console
.
log
(
"字段校验成功"
)
return
true
;
},
})
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论