Commit 116e8c72 authored by jiangjiantao's avatar jiangjiantao

扫商品页面布局

parents 2ead6f2e a5aec0d3
{"tinyType":"alipayiot","tinyCnName":"支付宝 IoT","tinyProjectType":"xpaas-mini","alipay:alipay-mini:tinyIcon":"https://gw.alipayobjects.com/zos/rmsportal/rcwFIauzePpMqlTzzanK.svg","alipay:alipay-mini:compilePreviewTime":"","alipay:alipay-mini:compilePreviewWholePackSize":"","alipay:alipay-mini:compilePreviewSubpackSizes":"","alipay:alipay-mini:_appIdList":[{"appid":"2019072465945502","name":"名称释放00253830","logoUrl":"https://appstoreisvpic.alipayobjects.com/prod/eebdb2f7-2747-499e-9a22-2b89664d7739.png"},{"appid":"2019072465958445","name":"名称释放00253829","logoUrl":"https://appstoreisvpic.alipayobjects.com/prod/eebdb2f7-2747-499e-9a22-2b89664d7739.png"},{"appid":"2019071065828181","name":"米雅快捷收银服务","logoUrl":"https://appstoreisvpic.alipayobjects.com/prod/82b9108c-6db6-4713-b2e4-d0aac92613fc.png"}],"alipay:alipay-mini:preAuditLimit":5,"alipay:alipay-mini:preAuditUsed":0,"alipay:alipay-mini:uploadTime":"","alipay:alipay-mini:packageSize":"","alipay:alipay-mini:auditLink":null,"alipay:alipay-mini:whiteListLink":null,"alipay:alipay-mini:_enableAutoPush":true,"alipay:alipay-mini:_appId":"2019072465958445","alipay:alipay-mini:_appName":"名称释放00253829","alipay:alipay-mini:remoteVersion":"0.0.0","alipay:alipay-mini:currentVersion":"0.0.1","alipay:alipay-mini:whiteList":[],"alipay:alipay-mini:h5WhiteList":[],"alipay:alipay-mini:appLogo":"https://appstoreisvpic.alipayobjects.com/prod/eebdb2f7-2747-499e-9a22-2b89664d7739.png","alipayiot:xpaas-mini:tinyIcon":"https://gw.alipayobjects.com/mdn/rms_c763d8/afts/img/A*vNMFT7X_u3sAAAAAAAAAAABkARQnAQ","alipayiot:xpaas-mini:compilePreviewTime":"2020-02-04 17:23:34","alipayiot:xpaas-mini:compilePreviewWholePackSize":"65.2 KB","alipayiot:xpaas-mini:compilePreviewSubpackSizes":"","alipayiot:xpaas-mini:_appIdList":[],"alipayiot:xpaas-mini:preAuditLimit":5,"alipayiot:xpaas-mini:preAuditUsed":0,"alipayiot:xpaas-mini:uploadTime":"","alipayiot:xpaas-mini:packageSize":"","alipayiot:xpaas-mini:auditLink":null,"alipayiot:xpaas-mini:whiteListLink":null,"alipayiot:xpaas-mini:_enableAutoPush":true,"alipayiot:xpaas-mini:lastDeviceName":"蜻蜓F4","alipayiot:xpaas-mini:_appId":"2021001107603212","alipayiot:xpaas-mini:_appName":"米雅双屏收银小程序-前屏","alipayiot:xpaas-mini:remoteVersion":"0.0.0","alipayiot:xpaas-mini:currentVersion":"0.0.1","alipayiot:xpaas-mini:whiteList":[],"alipayiot:xpaas-mini:h5WhiteList":[],"alipayiot:xpaas-mini:appLogo":"https://appstoreisvpic.alipayobjects.com/prod/eebdb2f7-2747-499e-9a22-2b89664d7739.png","isSimulatorOpen":false,"alipayiot:xpaas-mini:MockStore":{},"isNotFirstToggleSimulator":true,"storageVersion":"1.5.5"} {"tinyType":"alipayiot","tinyCnName":"支付宝 IoT","tinyProjectType":"xpaas-mini","alipayiot:xpaas-mini:tinyIcon":"https://gw.alipayobjects.com/mdn/rms_c763d8/afts/img/A*vNMFT7X_u3sAAAAAAAAAAABkARQnAQ","alipayiot:xpaas-mini:auditLink":null,"alipayiot:xpaas-mini:whiteListLink":null,"alipayiot:xpaas-mini:createLink":null,"alipayiot:xpaas-mini:component2":false,"alipayiot:xpaas-mini:_enableAutoPush":false,"alipayiot:xpaas-mini:_appIdList":[],"alipayiot:xpaas-mini:uploadTime":"","alipayiot:xpaas-mini:packageSize":0,"alipayiot:xpaas-mini:lastDeviceName":"蜻蜓F4","isSimulatorOpen":true,"isNotFirstToggleSimulator":true,"alipayiot:xpaas-mini:MockStore":{"localLoginInfo":{"name":"ywxadmin","password":"1234567a","sn":""},"localAccountInfo":{"accountId":126,"actType":1,"agreement":1,"isShopCart":0,"merchantId":"2088222276054714","merchantName":"一网鲜(杭州)信息科技有限公司","realName":"力拔山兮气盖世时不利兮骓不逝","storeList":[{"address":"杭州市江干区科技园路2号","hasStoreManager":1,"storeId":"001","storeName":"一网鲜"}],"token":"431398226761175040","userName":"ywxadmin","userPhone":"13858057743"}},"storageVersion":"1.5.7"}
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
const g = typeof global !== 'undefined' ? global : self; const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = { g.appXAppJson = {
"app": { "app": {
"$homepage": "pages/login/login" "$homepage": "pages/paysuccess/paysuccess"
} }
}; };
require('@alipay/appx-compiler/lib/sjsEnvInit'); require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$'); require('./config$');
require('../../custom_widgets/spin/spin?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../node_modules/mini-antui/es/input-item/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../node_modules/mini-antui/es/input-item/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../pages/paysuccess/paysuccess?hash=8a39df616008c86a406618844f053cdc5567752b');
require('../../pages/login/login?hash=4ebd76d5932655db30c27bd67ebeb700d746609f'); require('../../pages/login/login?hash=4ebd76d5932655db30c27bd67ebeb700d746609f');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68'); require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
...@@ -29,7 +29,9 @@ if(AFAppX.registerApp) { ...@@ -29,7 +29,9 @@ if(AFAppX.registerApp) {
function success() { function success() {
require('../../app'); require('../../app');
require('../../custom_widgets/spin/spin?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../node_modules/mini-antui/es/input-item/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43'); require('../../node_modules/mini-antui/es/input-item/index?hash=05d2a9730dd6009bf9446182f9c985f40f8c0f43');
require('../../pages/paysuccess/paysuccess?hash=8a39df616008c86a406618844f053cdc5567752b');
require('../../pages/login/login?hash=4ebd76d5932655db30c27bd67ebeb700d746609f'); require('../../pages/login/login?hash=4ebd76d5932655db30c27bd67ebeb700d746609f');
require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68'); require('../../pages/index/index?hash=32d7d2807ed4e666ef03b4b3fe8c38ecf2e34e68');
} }
......
App({ App({
globalData: {
version: "1.0.0.20200203",
//是否使用测试支付数据
useTestPayInfo: false,
printerId: null,
printerName: null,
TEST_URL: "https://cashier.test.miyahub.net/",
RELEASE_URL: "https://cashier.miyahub.com/",
BASE_URL: null,
appId:"1542075029346",
//小程序容器版本
containerVersionCode: null
},
onLaunch(options) { onLaunch(options) {
// 第一次打开 // 第一次打开
// options.query == {number:1} // options.query == {number:1}
console.info('App onLaunch'); console.info('App onLaunch');
//初始化baseUrl
this.globalData.BASE_URL = this.globalData.TEST_URL;
}, },
onShow(options) { onShow(options) {
// 从后台被 scheme 重新打开 // 从后台被 scheme 重新打开
......
{ {
"pages": [ "pages": [
"pages/scan/scan", "pages/scan/scan",
"pages/paysuccess/paysuccess",
"pages/login/login", "pages/login/login",
"pages/index/index" "pages/index/index"
], ],
"window": { "window": {
"defaultTitle": "" "defaultTitle": ""
......
.cirqueBox {
position: relative;
width: 186rpx;
height: 186rpx;
border-radius: 50%;
-webkit-mask: radial-gradient(transparent, transparent 83rpx, #000 0);
mask: radial-gradient(transparent 83rpx, #000 0);
}
.cirque2 {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: #0e7afa;
z-index: 1;
}
.cirque1 {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
background-color: #aaa;
z-index: 2;
animation: mymove 1.5s linear infinite;
}
@keyframes mymove {
0% {
clip-path: polygon(93rpx 93rpx, 93rpx -207rpx, -207rpx 93rpx, 93rpx 393rpx, 393rpx 93rpx, 93rpx -207rpx);
}
25% {
clip-path: polygon(93rpx 93rpx, 93rpx -207rpx, -207rpx 93rpx, 93rpx 393rpx, 393rpx 93rpx, 393rpx 93rpx);
}
50% {
clip-path: polygon(93rpx 93rpx, 93rpx -207rpx, -207rpx 93rpx, 93rpx 393rpx, 93rpx 393rpx, 93rpx 393rpx);
}
75% {
clip-path: polygon(93rpx 93rpx, 93rpx -207rpx, -207rpx 93rpx, -207rpx 93rpx, -207rpx 93rpx, -207rpx 93rpx);
}
100% {
clip-path: polygon(93rpx 93rpx, 93rpx -207rpx, 93rpx -207rpx, 93rpx -207rpx, 93rpx -207rpx, 93rpx -207rpx);
}
}
\ No newline at end of file
<view class="cirqueBox">
<view class="cirque2"></view>
<view class="cirque1"></view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {},
didMount() {},
didUpdate() {},
didUnmount() {},
methods: {},
});
{
"component": true
}
\ No newline at end of file
...@@ -116,9 +116,10 @@ Page({ ...@@ -116,9 +116,10 @@ Page({
var loginCallbackTemp = this.loginCallback.bind(this); var loginCallbackTemp = this.loginCallback.bind(this);
api.login({ api.login({
baseUrl: getApp().globalData.BASE_URL, baseUrl: getApp().globalData.BASE_URL,
appId:getApp().globalData.appId,
name: this.data.name, name: this.data.name,
password: this.data.password, password: this.data.password,
sn: this.data.sn, sn: this.data.sn+"xx",
callback: loginCallbackTemp callback: loginCallbackTemp
}); });
}, },
...@@ -133,7 +134,7 @@ Page({ ...@@ -133,7 +134,7 @@ Page({
}); });
//跳转广告页 //跳转广告页
my.reLaunch({ my.reLaunch({
url: "/pages/ad/ad" url: "/pages/paysuccess/paysuccess"
}); });
my.showToast({ my.showToast({
type: 'success', type: 'success',
......
page {
display: flex;
flex-direction: column;
background-color: #ffffff;
width: 100%;
height: 100%;
align-items: center;
}
.topTitle {
display: flex;
width: 662rpx;
align-content: center;
align-items: center;
/* border: 2px solid red; */
font-size: 45rpx;
font-weight: bold;
margin: 0 auto;
}
.payInfo {
position: relative;
width: 624rpx;
height: 430rpx;
margin: 0 auto;
margin-top: 38rpx;
/* align-content: center;
align-items: center; */
/* border: 2px solid red; */
}
.orderPrice {
display: absolute;
width: 464rpx;
height: 34rpx;
font-size: 34rpx;
color: #7A8599;
margin: 0 auto;
margin-top: 148rpx;
align-content: center;
align-items: center;
/* border: 2px solid red; */
}
.discount {
display: absolute;
width: 464rpx;
height: 34rpx;
font-size: 34rpx;
color: #7A8599;
margin: 0 auto;
margin-top: 30rpx;
align-content: center;
align-items: center;
/* border: 2px solid red; */
}
.payPrice {
display: absolute;
width: 464rpx;
height: 34rpx;
font-size: 34rpx;
font-weight: bold;
color: #000000;
margin: 0 auto;
margin-top: 64rpx;
align-content: center;
align-items: center;
/* border: 2px solid red; */
}
.printLoading {
position: relative;
width: 186rpx;
height: 186rpx;
margin: 0 auto;
margin-top: 38rpx;
/* border: 2px solid red; */
}
.voucher{
display: flex;
position: fixed;
flex-direction: column;
width: 662rpx;
align-content: center;
height: 100%;
margin-bottom: 0rpx;
border: 2px solid red;
}
\ No newline at end of file
<view class="page">
<view class="topTitle">
<view style="margin:0 auto;margin-top:38rpx;">
<image mode="aspectFit" style="width:53rpx;height:53rpx;margin-right:26rpx;float:left;" src="/images/ic_success.png"/>
<view style="height:53rpx;display:flex;">
<text>支付成功</text>
</view>
</view>
</view>
<view class="payInfo">
<image mode="aspectFit" style="width:624rpx;height:430rpx;" src="/images/bg_print_paper.png"/>
<view style="position:absolute;left:0rpx;top:0rpx;width:624rpx;height:430rpx;">
<view class="orderPrice">
<text style="float:left;">订单总额</text>
<text style="font-weight:bold;float:right;">¥--.--</text>
</view>
<view class="discount">
<text style="float:left;">商家优惠</text>
<text style="font-weight:bold;float:right;">-¥--.--</text>
</view>
<view class="payPrice">
<text style="float:left;" decode=true>共计 {{}} 件&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;实付:</text>
<text style="font-weight:bold;float:right;color:#F72911;">-¥--.--</text>
</view>
</view>
</view>
<view class="printLoading">
<i-spin></i-spin>
<view style="position:absolute;width:100%;height:100%;left:0rpx;top:0rpx;color:#000000;font-weight:bold;">
<view style="display: absolute;margin:0 auto;align-content: center;align-items: center;text-align:center;line-height:186rpx;">
<text>{{}}</text>
</view>
</view>
</view>
<view class="voucher">
</view>
</view>
\ No newline at end of file
Page({
data: {},
onLoad() {},
});
{
"usingComponents": {
"i-spin": "/custom_widgets/spin/spin"
}
}
\ No newline at end of file
//login //login
var API_LOGIN = "verify/auth/token"; var API_LOGIN = "store/cashier/login";
//返回的数据都为code、data的形式 //返回的数据都为code、data的形式
function login({ baseUrl,name, password, sn, callback }) { function login({ baseUrl, appId, name, password, sn, callback }) {
var loginRequest = { var loginRequest = createCommonRequest(appId,null,sn);
username: name, loginRequest.username = name;
password: password, loginRequest.password = password;
serialNo: sn loginRequest.loginType = "1";
};
console.log("login request==>" + JSON.stringify(loginRequest)); console.log("login request==>" + JSON.stringify(loginRequest));
var loginResponse = { code: {}, data: {} }; var loginResponse = { code: {}, data: {} };
my.request({ my.request({
...@@ -22,10 +23,10 @@ function login({ baseUrl,name, password, sn, callback }) { ...@@ -22,10 +23,10 @@ function login({ baseUrl,name, password, sn, callback }) {
console.log("login success==>" + JSON.stringify(res)); console.log("login success==>" + JSON.stringify(res));
if (callback != null) { if (callback != null) {
if (res.data.code != "200") { if (res.data.success != true) {
loginResponse.code = -1; loginResponse.code = -1;
//重置data内容 //重置data内容
loginResponse.data = res.data.msg; loginResponse.data = res.data.errorMsg;
} else { } else {
loginResponse.code = 0; loginResponse.code = 0;
loginResponse.data = res.data.data; loginResponse.data = res.data.data;
...@@ -45,6 +46,37 @@ function login({ baseUrl,name, password, sn, callback }) { ...@@ -45,6 +46,37 @@ function login({ baseUrl,name, password, sn, callback }) {
}); });
} }
function createCommonRequest(appId, token, deviceNo) {
var commonRequest = {
};
commonRequest.appId = appId;
commonRequest.token = token;
commonRequest.deviceNo = deviceNo;
commonRequest.batchNo = "";
commonRequest.timestamp = timestampToTime();
commonRequest.format = "JSON";
commonRequest.charset = "utf-8";
commonRequest.signType = "RSA2";
commonRequest.version = "1.0";
commonRequest.sign = "qt-pos";
return commonRequest;
}
function timestampToTime() {
var date = new Date();
var Y = date.getFullYear() + '-';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = date.getDate() < 10 ? '0'+date.getDate()+ ' ' : date.getDate()+ ' ';
var h = date.getHours() + ':';
var m = date.getMinutes() + ':';
var s = date.getSeconds();
return Y + M + D + h + m + s;
}
function decodeErrorMessage(error) { function decodeErrorMessage(error) {
if (error == null) { if (error == null) {
return "请求失败"; return "请求失败";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment