Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-front
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-front
Commits
07e4a344
Commit
07e4a344
authored
Feb 06, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面串连起来
parent
8d5fddc2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
98 additions
and
29 deletions
+98
-29
app.js
app.js
+11
-11
app.json
app.json
+1
-1
apiurl.js
const/apiurl.js
+3
-0
balance.js
pages/balance/balance.js
+24
-5
balance.json
pages/balance/balance.json
+3
-1
home.js
pages/home/home.js
+16
-1
home.json
pages/home/home.json
+1
-1
scan.axml
pages/scan/scan.axml
+10
-5
scan.js
pages/scan/scan.js
+29
-4
No files found.
app.js
View file @
07e4a344
...
...
@@ -29,17 +29,17 @@ App({
}
});
//添加后屏小程序
my
.
ix
.
addExtensionApp
({
appId
:
"****************"
,
// 填入后屏小程序的 AppID
type
:
"screen"
,
success
:
(
res
)
=>
{
console
.
log
(
"addExtensionApp success:"
,
res
)
},
fail
:
(
res
)
=>
{
console
.
log
(
"addExtensionApp fail:"
,
res
)
},
})
//
my.ix.addExtensionApp({
//
appId: "****************",
//
// 填入后屏小程序的 AppID
//
type: "screen",
//
success: (res) => {
//
console.log("addExtensionApp success:", res)
//
},
//
fail: (res) => {
//
console.log("addExtensionApp fail:", res)
//
},
//
})
},
onShow
(
options
)
{
// 从后台被 scheme 重新打开
...
...
app.json
View file @
07e4a344
{
"pages"
:
[
"pages/login/login"
,
"pages/paysuccess/paysuccess"
,
"pages/balance/balance"
,
"pages/scan/scan"
,
"pages/home/home"
,
"pages/login/login"
,
"pages/index/index"
],
"window"
:
{
...
...
const/apiurl.js
0 → 100644
View file @
07e4a344
export
const
API_LOGIN
=
"store/cashier/login"
;
export
const
API_SCAN
=
"market/barcodeQuery"
;
pages/balance/balance.js
View file @
07e4a344
Page
({
data
:
{
goodsNum
:
"--"
,
payPrice
:
"--"
,
totalPrice
:
"--"
,
couponPrice
:
"--"
,
goodsNum
:
0
,
payPrice
:
0.00
,
totalPrice
:
0.00
,
couponPrice
:
0.00
,
qrPayShow
:
false
,
},
onLoad
()
{},
onLoad
(
options
)
{
var
totalQuantity
=
options
.
totalQuantity
var
totalPrice
=
options
.
totalPrice
var
totalDisc
=
options
.
totalDisc
if
(
totalQuantity
!=
null
)
{
this
.
setData
({
goodsNum
:
totalQuantity
,
})
}
//暂时没有优惠
if
(
totalPrice
!=
null
)
{
this
.
setData
({
payPrice
:
totalPrice
,
totalPrice
:
totalPrice
,
})
}
},
facePay
(){
...
...
pages/balance/balance.json
View file @
07e4a344
{}
\ No newline at end of file
{
"transparentTitle"
:
"always"
}
\ No newline at end of file
pages/home/home.js
View file @
07e4a344
import
{
Page
}
from
'../../utils/scan'
;
Page
({
data
:
{
...
...
@@ -26,5 +28,18 @@ Page({
my
.
navigateTo
({
url
:
"/pages/balance/balance"
});
}
},
//外接扫码枪事件
onKeyPress
(
r
)
{
console
.
log
(
"scan onKeyPress==>"
+
r
);
// this.getGoodInfoByBarcode(r);
my
.
navigateTo
({
url
:
"/pages/scan/scan?barcode="
+
r
,
});
},
});
pages/home/home.json
View file @
07e4a344
{
"transparentTitle"
:
"always"
,
"usingComponents"
:{
"scandialog"
:
"/custom_widgets/scandialog/scandialog"
}
...
...
pages/scan/scan.axml
View file @
07e4a344
<view class="pagex">
<view slot="header" class="scan-header">
<view>
欢迎您,
130****6170
<view
hidden="{{memberPhone == ''}}"
>
欢迎您,
{{memberPhone}}
</view>
<view>
积分:
130
<view
hidden="{{memberPoint == 0}}"
>
积分:
{{memberPoint}}
</view>
</view>
<scroll-view class="scan-good-body" scroll-y >
...
...
@@ -22,7 +22,7 @@
</view>
</block>
</scroll-view>
<view slot="footer" class="scan-bottom">
<view slot="footer" class="scan-bottom"
>
<view class="scan-bottom-item">
<view class="scan-price-total-propmt">
总额
...
...
@@ -33,6 +33,11 @@
<view class="scan-price-quantity-propmt">
(共{{totalQuantity}}件)
</view>
<button style="margin-left:120rpx;padding-left:20rpx;padding-right:20rpx;" size="default" type="primary" onTap="goBalance">
去支付
</button>
</view>
<!-- <view class="scan-bottom-item">
<view class="scan-price-total-propmt">
...
...
pages/scan/scan.js
View file @
07e4a344
var
api
=
require
(
"../../utils/api.js"
);
import
{
Page
}
from
'../../utils/scan'
;
import
{
API_SCAN
}
from
'../../const/apiurl'
Page
({
data
:
{
goods
:
[],
totalPrice
:
0.00
,
totalQuantity
:
0
totalQuantity
:
0
,
totalDisc
:
0.00
,
memberPhone
:
''
,
memberPoint
:
0
},
onLoad
:
function
(
options
)
{
var
barcode
=
options
.
barcode
if
(
barcode
!=
null
){
console
.
log
(
"首页传递过来的商品条码是 "
+
barcode
);
this
.
getGoodInfoByBarcode
(
barcode
)
}
},
//外接扫码枪事件
...
...
@@ -16,10 +30,15 @@ Page({
//获取商品信息
getGoodInfoByBarcode
(
barcode
)
{
////根据条形码查询商品接口
var
API_SCAN
=
"market/barcodeQuery"
;
my
.
showLoading
({});
var
scanGoodRequest
=
api
.
createCommonRequest
();
scanGoodRequest
.
goodsId
=
barcode
;
//管理员需要额外传一个storeid 但是目前这个设备是没有
// let storeId = getApp().globalData.localAccountInfo.storeId
// let actType = getApp().globalData.localAccountInfo.actType
// if (storeId != null && actType == 1) {
// scanGoodRequest = storeId
// }
console
.
log
(
"扫商品的请求 ==>"
+
JSON
.
stringify
(
scanGoodRequest
));
my
.
request
({
url
:
getApp
().
globalData
.
BASE_URL
+
API_SCAN
,
...
...
@@ -118,8 +137,14 @@ Page({
this
.
setData
({
totalQuantity
:
totalQuantityTemp
,
totalPrice
:
totalPriceTemp
,
})
//管理员需要额外传一个storeid
}
},
//跳转结算页面
goBalance
()
{
my
.
navigateTo
({
url
:
"/pages/balance/balance?totalPrice="
+
this
.
data
.
totalPrice
+
"&totalQuantity="
+
this
.
data
.
totalQuantity
+
"&totalDisc="
+
this
.
data
.
totalDisc
,
});
}
});
\ No newline at end of file
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