Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-back
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
doublescreen-back
Commits
468cc91e
Commit
468cc91e
authored
Jun 22, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了loading
parent
ab951129
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
36 deletions
+120
-36
icon_dialog_loading.png
images/icon_dialog_loading.png
+0
-0
index.acss
pages/index/index.acss
+73
-1
index.axml
pages/index/index.axml
+9
-4
index.js
pages/index/index.js
+38
-31
No files found.
images/icon_dialog_loading.png
0 → 100644
View file @
468cc91e
16.5 KB
pages/index/index.acss
View file @
468cc91e
...
@@ -306,7 +306,7 @@
...
@@ -306,7 +306,7 @@
.shopcart-list-hidden {
.shopcart-list-hidden {
height: 0;
height: 0;
width:0;
width:
0;
}
}
/* 顶部空白 */
/* 顶部空白 */
...
@@ -1308,6 +1308,78 @@
...
@@ -1308,6 +1308,78 @@
margin-right: 6rpx;
margin-right: 6rpx;
}
}
/* loading样式 */
.loadingLayout {
text-align: center;
width: 100%;
height: 100%;
position: absolute;
top: 0rpx;
/* border: 2px solid red; */
align-items: center;
align-content: center;
box-sizing: border-box;
white-space: nowrap;
display: flex;
background: rgba(0, 0, 0, 0.5);
}
.loading {
box-sizing: border-box;
/* border: 2px solid red; */
float: left;
position: relative;
padding-left: 15rpx;
padding-right: 15rpx;
padding-top: 14rpx;
padding-bottom: 14rpx;
background: rgba(255, 255, 255, 1);
border-radius: 5rpx;
margin: 0 auto;
font-size: 19rpx;
color: white;
}
.loadingIcon {
position: relative;
width: 92rpx;
height: 92rpx;
margin: 0 auto;
-webkit-animation: loadingAnim .8s linear infinite;
animation: loadingAnim .8s linear infinite
}
.loadingText {
position: absolute;
width: 92rpx;
font-size: 19rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
top: 44rpx;
text-align: center;
color: rgba(0, 0, 0, 0.85);
line-height: 30rpx;
}
@keyframes loadingAnim {
0% {
-webkit-transform: rotate(0deg);
}
25% {
-webkit-transform: rotate(90deg);
}
50% {
-webkit-transform: rotate(180deg);
}
75% {
-webkit-transform: rotate(270deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
/* 吐司样式 */
/* 吐司样式 */
.toastLayout {
.toastLayout {
...
...
pages/index/index.axml
View file @
468cc91e
...
@@ -176,7 +176,7 @@
...
@@ -176,7 +176,7 @@
<!--扫码页-->
<!--扫码页-->
<view hidden="{{!pageShow['landscan']}}">
<view hidden="{{!pageShow['landscan']}}">
<view class="{{scene != 0 ? 'pfilter' : 'pageland' }}">
<view class="{{scene != 0 ? 'pfilter' : 'pageland' }}">
<view class="land-scan-boottom">
<view class="land-scan-boottom">
<!-- 空购物车 -->
<!-- 空购物车 -->
<view class="shopcart-list-empty" hidden="{{goods.length > 0}}">
<view class="shopcart-list-empty" hidden="{{goods.length > 0}}">
<view class="empty-remind-text">请扫描商品条码添加商品</view>
<view class="empty-remind-text">请扫描商品条码添加商品</view>
...
@@ -220,8 +220,7 @@
...
@@ -220,8 +220,7 @@
<button class="go-pay" size="default" type="primary" onTap="goPay">收款</button>
<button class="go-pay" size="default" type="primary" onTap="goPay">收款</button>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="land-scan-top">
<view class="land-scan-top">
<button class="land-scan-top-member-login" size="default" type="ghost" catchTap="onMemberTap" a:if="{{memberPhoneShown == ''}}">会员登录</button>
<button class="land-scan-top-member-login" size="default" type="ghost" catchTap="onMemberTap" a:if="{{memberPhoneShown == ''}}">会员登录</button>
<view class="land-scan-member" hidden="{{memberPhoneShown == ''}}">会员,{{memberPhoneShown}}</view>
<view class="land-scan-member" hidden="{{memberPhoneShown == ''}}">会员,{{memberPhoneShown}}</view>
...
@@ -231,7 +230,6 @@
...
@@ -231,7 +230,6 @@
<text class="go-home-text">首页</text>
<text class="go-home-text">首页</text>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 扫描优惠券 -->
<!-- 扫描优惠券 -->
<view class="page-coupon" a:if="{{discCouponState != 0 && discCouponState != 3 }}">
<view class="page-coupon" a:if="{{discCouponState != 0 && discCouponState != 3 }}">
...
@@ -556,6 +554,13 @@
...
@@ -556,6 +554,13 @@
</view>
</view>
</view>
</view>
</view>
</view>
<!-- -->
<view class="loadingLayout" hidden="{{!showLoading}}">
<view class="loading">
<image mode="aspectFit" src="/images/icon_dialog_loading.png" class="loadingIcon"/>
<view class="loadingText">加载中</view>
</view>
</view>
<!--全局吐司-->
<!--全局吐司-->
<view class="toastLayout" hidden="{{!isShowToast}}">
<view class="toastLayout" hidden="{{!isShowToast}}">
<view class="toast">
<view class="toast">
...
...
pages/index/index.js
View file @
468cc91e
...
@@ -20,6 +20,7 @@ Page({
...
@@ -20,6 +20,7 @@ Page({
//吐司显示
//吐司显示
isShowToast
:
false
,
isShowToast
:
false
,
toastText
:
"------"
,
toastText
:
"------"
,
showLoading
:
false
,
pageShow
:
{
pageShow
:
{
"home"
:
true
,
"home"
:
true
,
"landscan"
:
false
,
"landscan"
:
false
,
...
@@ -234,7 +235,7 @@ Page({
...
@@ -234,7 +235,7 @@ Page({
})
})
}
else
if
(
res
.
action
==
ACTION_GOODS
)
{
}
else
if
(
res
.
action
==
ACTION_GOODS
)
{
//商品信息同步
//商品信息同步
my
.
hideLoading
();
this
.
hideLoading
();
let
viewGoodsInfo
=
res
.
data
let
viewGoodsInfo
=
res
.
data
if
(
viewGoodsInfo
.
goods
!=
null
&&
viewGoodsInfo
.
goods
.
length
>
0
)
{
if
(
viewGoodsInfo
.
goods
!=
null
&&
viewGoodsInfo
.
goods
.
length
>
0
)
{
context
.
setData
({
context
.
setData
({
...
@@ -453,8 +454,16 @@ Page({
...
@@ -453,8 +454,16 @@ Page({
},
},
showLoading
()
{
this
.
setData
({
showLoading
:
true
})
},
hideLoading
()
{
this
.
setData
({
showLoading
:
false
})
},
//回到首页
//回到首页
goHome
:
throttle
(
2000
,
function
()
{
goHome
:
throttle
(
2000
,
function
()
{
console
.
log
(
"goHome"
);
console
.
log
(
"goHome"
);
let
context
=
this
;
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
...
@@ -497,7 +506,7 @@ Page({
...
@@ -497,7 +506,7 @@ Page({
/**首页相关 */
/**首页相关 */
/**立即收款 */
/**立即收款 */
onHomeCashierImmediatelyClicked
:
throttle
(
2000
,
function
()
{
onHomeCashierImmediatelyClicked
:
throttle
(
2000
,
function
()
{
this
.
setData
({
scene
:
3
,
flowType
:
FLOW_DIRECT_PAYMENT
})
this
.
setData
({
scene
:
3
,
flowType
:
FLOW_DIRECT_PAYMENT
})
}),
}),
...
@@ -505,7 +514,7 @@ Page({
...
@@ -505,7 +514,7 @@ Page({
/**
/**
* 兑换
* 兑换
*/
*/
onHomeExchangeClicked
:
throttle
(
2000
,
function
()
{
onHomeExchangeClicked
:
throttle
(
2000
,
function
()
{
this
.
setData
({
convertCouponState
:
1
})
this
.
setData
({
convertCouponState
:
1
})
this
.
sendConvertCouponToFront
(
1
)
this
.
sendConvertCouponToFront
(
1
)
}),
}),
...
@@ -513,7 +522,7 @@ Page({
...
@@ -513,7 +522,7 @@ Page({
/**
/**
* 海报
* 海报
*/
*/
onHomePosterClicked
:
throttle
(
2000
,
function
()
{
onHomePosterClicked
:
throttle
(
2000
,
function
()
{
//发送指令至前屏,获取当前正在显示的广告页面
//发送指令至前屏,获取当前正在显示的广告页面
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
target
:
getApp
().
globalData
.
frontScreenAppId
,
...
@@ -533,7 +542,7 @@ Page({
...
@@ -533,7 +542,7 @@ Page({
/**
/**
* 退款
* 退款
*/
*/
onHomeRefundClicked
:
throttle
(
2000
,
function
()
{
onHomeRefundClicked
:
throttle
(
2000
,
function
()
{
this
.
setData
({
this
.
setData
({
flowType
:
FLOW_REFUND
,
flowType
:
FLOW_REFUND
,
scene
:
4
scene
:
4
...
@@ -544,7 +553,7 @@ Page({
...
@@ -544,7 +553,7 @@ Page({
/**
/**
* 打印上一单
* 打印上一单
*/
*/
onHomePrintLastOrderClicked
:
throttle
(
2000
,
function
()
{
onHomePrintLastOrderClicked
:
throttle
(
2000
,
function
()
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
return
;
return
;
}
}
...
@@ -573,7 +582,7 @@ Page({
...
@@ -573,7 +582,7 @@ Page({
/**
/**
* 核验
* 核验
*/
*/
onHomeVerifyClicked
:
throttle
(
2000
,
function
()
{
onHomeVerifyClicked
:
throttle
(
2000
,
function
()
{
this
.
setData
({
this
.
setData
({
flowType
:
FLOW_VERIFY
,
flowType
:
FLOW_VERIFY
,
})
})
...
@@ -603,7 +612,7 @@ Page({
...
@@ -603,7 +612,7 @@ Page({
/**
/**
* 提货
* 提货
*/
*/
onHomePickUpGoodsClicked
:
throttle
(
2000
,
function
()
{
onHomePickUpGoodsClicked
:
throttle
(
2000
,
function
()
{
let
context
=
this
;
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
target
:
getApp
().
globalData
.
frontScreenAppId
,
...
@@ -622,7 +631,7 @@ Page({
...
@@ -622,7 +631,7 @@ Page({
}),
}),
/**日结 */
/**日结 */
onHomeDayCheckClicked
:
throttle
(
2000
,
function
()
{
onHomeDayCheckClicked
:
throttle
(
2000
,
function
()
{
//发送打印日结订单到前屏
//发送打印日结订单到前屏
let
context
=
this
;
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
...
@@ -645,14 +654,14 @@ Page({
...
@@ -645,14 +654,14 @@ Page({
}),
}),
/**关于系统(实际上是关于应用) */
/**关于系统(实际上是关于应用) */
onHomeAboutAppClicked
:
throttle
(
2000
,
function
()
{
onHomeAboutAppClicked
:
throttle
(
2000
,
function
()
{
this
.
goPage
(
"aboutsystem"
);
this
.
goPage
(
"aboutsystem"
);
}),
}),
/**
/**
* 系统设置
* 系统设置
*/
*/
onHomeSysSettingClicked
:
throttle
(
2000
,
function
()
{
onHomeSysSettingClicked
:
throttle
(
2000
,
function
()
{
this
.
showToast
(
"请在前屏操作"
);
this
.
showToast
(
"请在前屏操作"
);
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
// 填入目标小程序的 AppID
...
@@ -673,7 +682,7 @@ Page({
...
@@ -673,7 +682,7 @@ Page({
/**
/**
* 应用设置
* 应用设置
*/
*/
onHomeAppSettingClicked
:
throttle
(
2000
,
function
()
{
onHomeAppSettingClicked
:
throttle
(
2000
,
function
()
{
this
.
goPage
(
"appsetting"
);
this
.
goPage
(
"appsetting"
);
}),
}),
...
@@ -684,7 +693,7 @@ Page({
...
@@ -684,7 +693,7 @@ Page({
//跳转至结算页
//跳转至结算页
this
.
goPage
(
'waitoperate'
);
this
.
goPage
(
'waitoperate'
);
},
},
onReprint
:
throttle
(
2000
,
function
()
{
onReprint
:
throttle
(
2000
,
function
()
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
return
;
return
;
}
}
...
@@ -725,10 +734,8 @@ Page({
...
@@ -725,10 +734,8 @@ Page({
},
},
//跳转到收银页面
//跳转到收银页面
sendGoToCollections
:
throttle
(
2000
,
function
()
{
sendGoToCollections
:
throttle
(
2000
,
function
()
{
//首先清除数据
//首先清除数据
this
.
setData
({
this
.
setData
({
...
@@ -846,7 +853,7 @@ Page({
...
@@ -846,7 +853,7 @@ Page({
//把手输条码发生到前屏
//把手输条码发生到前屏
sendGoodsInfoToFront
(
barcode
)
{
sendGoodsInfoToFront
(
barcode
)
{
let
context
=
this
;
let
context
=
this
;
my
.
showLoading
({}
);
this
.
showLoading
(
);
var
commonRequest
=
{
var
commonRequest
=
{
action
:
ACTION_REQUEST_GOOD_INFO
,
action
:
ACTION_REQUEST_GOOD_INFO
,
data
:
barcode
data
:
barcode
...
@@ -859,7 +866,7 @@ Page({
...
@@ -859,7 +866,7 @@ Page({
},
},
fail
:
(
res
)
=>
{
fail
:
(
res
)
=>
{
console
.
log
(
"发送商品条码到前屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
console
.
log
(
"发送商品条码到前屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
my
.
hideLoading
();
this
.
hideLoading
();
context
.
showToast
(
"操作失败"
);
context
.
showToast
(
"操作失败"
);
}
}
})
})
...
@@ -884,13 +891,13 @@ Page({
...
@@ -884,13 +891,13 @@ Page({
//清空商品信息
//清空商品信息
clearGood
:
throttle
(
2000
,
function
(
e
)
{
clearGood
:
throttle
(
2000
,
function
(
e
)
{
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
calculation
([]);
this
.
calculation
([]);
}),
}),
//删除商品
//删除商品
deleteGood
:
throttle
(
2000
,
function
(
e
)
{
deleteGood
:
throttle
(
2000
,
function
(
e
)
{
let
barcode
=
e
.
target
.
id
;
let
barcode
=
e
.
target
.
id
;
let
lastgoods
=
this
.
data
.
goods
;
let
lastgoods
=
this
.
data
.
goods
;
let
newGoods
=
[]
let
newGoods
=
[]
...
@@ -904,7 +911,7 @@ Page({
...
@@ -904,7 +911,7 @@ Page({
}),
}),
//减少商品
//减少商品
decreaseGood
:
throttle
(
2000
,
function
(
e
)
{
decreaseGood
:
throttle
(
2000
,
function
(
e
)
{
let
barcode
=
e
.
target
.
id
;
let
barcode
=
e
.
target
.
id
;
let
lastgoods
=
this
.
data
.
goods
;
let
lastgoods
=
this
.
data
.
goods
;
...
@@ -925,7 +932,7 @@ Page({
...
@@ -925,7 +932,7 @@ Page({
}),
}),
//增加商品
//增加商品
increaseGood
:
throttle
(
2000
,
function
(
e
)
{
increaseGood
:
throttle
(
2000
,
function
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
let
barcode
=
e
.
target
.
id
;
let
barcode
=
e
.
target
.
id
;
let
lastgoods
=
this
.
data
.
goods
;
let
lastgoods
=
this
.
data
.
goods
;
...
@@ -993,7 +1000,7 @@ Page({
...
@@ -993,7 +1000,7 @@ Page({
},
},
//跳转到结算等待页
//跳转到结算等待页
goPay
:
throttle
(
2000
,
function
(
e
)
{
goPay
:
throttle
(
2000
,
function
(
e
)
{
//购物车不能为空
//购物车不能为空
if
(
this
.
data
.
goods
.
length
==
0
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
this
.
showToast
(
"等待收银员录入商品"
,
3000
)
this
.
showToast
(
"等待收银员录入商品"
,
3000
)
...
@@ -1031,7 +1038,7 @@ Page({
...
@@ -1031,7 +1038,7 @@ Page({
});
});
}),
}),
waitOperateBack
:
throttle
(
2000
,
function
()
{
waitOperateBack
:
throttle
(
2000
,
function
()
{
//直接返回到扫码页面,并且通知前屏返回
//直接返回到扫码页面,并且通知前屏返回
if
(
this
.
data
.
flowType
==
FLOW_REFUND
)
{
if
(
this
.
data
.
flowType
==
FLOW_REFUND
)
{
this
.
operateResultClose
();
this
.
operateResultClose
();
...
@@ -1058,7 +1065,7 @@ Page({
...
@@ -1058,7 +1065,7 @@ Page({
}),
}),
//等待操作页,取消付款/收款等按钮
//等待操作页,取消付款/收款等按钮
waitOperateCancel
:
throttle
(
2000
,
function
()
{
waitOperateCancel
:
throttle
(
2000
,
function
()
{
//todo 是否需要加上当接口在请求时,则屏蔽取消按钮的操作?
//todo 是否需要加上当接口在请求时,则屏蔽取消按钮的操作?
console
.
log
(
"取消操作等待页"
);
console
.
log
(
"取消操作等待页"
);
...
@@ -1084,7 +1091,7 @@ Page({
...
@@ -1084,7 +1091,7 @@ Page({
}),
}),
//提货关闭
//提货关闭
pickGoodsClose
:
throttle
(
2000
,
function
(
e
)
{
pickGoodsClose
:
throttle
(
2000
,
function
(
e
)
{
let
context
=
this
;
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
target
:
getApp
().
globalData
.
frontScreenAppId
,
...
@@ -1102,7 +1109,7 @@ Page({
...
@@ -1102,7 +1109,7 @@ Page({
})
})
}),
}),
//兑换券界面关闭
//兑换券界面关闭
convertCouponClose
:
throttle
(
2000
,
function
(
e
)
{
convertCouponClose
:
throttle
(
2000
,
function
(
e
)
{
this
.
setData
({
convertCouponState
:
0
})
this
.
setData
({
convertCouponState
:
0
})
this
.
sendConvertCouponToFront
(
0
)
this
.
sendConvertCouponToFront
(
0
)
}),
}),
...
@@ -1146,12 +1153,12 @@ Page({
...
@@ -1146,12 +1153,12 @@ Page({
},
},
//用券返回
//用券返回
couponBack
:
throttle
(
2000
,
function
(
e
)
{
couponBack
:
throttle
(
2000
,
function
(
e
)
{
this
.
setData
({
discCouponState
:
0
})
this
.
setData
({
discCouponState
:
0
})
this
.
sendDiscCouponToFront
(
0
)
this
.
sendDiscCouponToFront
(
0
)
}),
}),
//使用券
//使用券
useCoupon
:
throttle
(
2000
,
function
(
e
)
{
useCoupon
:
throttle
(
2000
,
function
(
e
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
this
.
showToast
(
"请先录入商品"
)
this
.
showToast
(
"请先录入商品"
)
...
@@ -1238,7 +1245,7 @@ Page({
...
@@ -1238,7 +1245,7 @@ Page({
},
},
onPrintLastOrderBackClicked
:
throttle
(
2000
,
function
(
e
)
{
onPrintLastOrderBackClicked
:
throttle
(
2000
,
function
(
e
)
{
//回首页
//回首页
this
.
setData
({
this
.
setData
({
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrintSuccess
:
false
,
...
...
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