@ -0,0 +1,24 @@
|
||||
<script> |
||||
export default { |
||||
onLaunch: function() { |
||||
console.log('App Launch') |
||||
}, |
||||
onShow: function() { |
||||
console.log('App Show') |
||||
}, |
||||
onHide: function() { |
||||
console.log('App Hide') |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
/*每个页面公共css */ |
||||
|
||||
@import url("/static/font/iconfont/iconfont.css"); |
||||
|
||||
page { |
||||
background-color: #F7F7F7; |
||||
} |
||||
|
||||
</style> |
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request' |
||||
|
||||
export function getOrderInfo(query) { |
||||
return request.get({ |
||||
url: '/order/user-pay-order-info', |
||||
data: query |
||||
}) |
||||
} |
||||
|
||||
export function useUserPay(query) { |
||||
return request.get({ |
||||
url: '/order/user-pay', |
||||
data: query |
||||
}) |
||||
} |
||||
|
||||
export function pay(query) { |
||||
return request.post({ |
||||
url: '/ali/pay', |
||||
data: query, |
||||
type: 'form' |
||||
}) |
||||
} |
||||
|
||||
export function checkLogin(query) { |
||||
return request.get({ |
||||
url: '/menu/check-login', |
||||
data: query |
||||
}) |
||||
} |
||||
|
||||
export function showStoreMenu(query) { |
||||
return request.get({ |
||||
url: '/menu/show-store-menu', |
||||
data: query |
||||
}) |
||||
} |
||||
|
||||
export function getTemplate(query) { |
||||
return request.get({ |
||||
url: '/menu/getStr', |
||||
data: query |
||||
}) |
||||
} |
||||
@ -0,0 +1,11 @@
|
||||
import Vue from 'vue' |
||||
import App from './App' |
||||
|
||||
Vue.config.productionTip = false |
||||
|
||||
App.mpType = 'app' |
||||
|
||||
const app = new Vue({ |
||||
...App |
||||
}) |
||||
app.$mount()
|
||||
@ -0,0 +1,118 @@
|
||||
{ |
||||
"name" : "优客菜单", |
||||
"appid" : "__UNI__A096421", |
||||
"description" : "", |
||||
"versionName" : "1.0.0", |
||||
"versionCode" : "100", |
||||
"transformPx" : false, |
||||
"app-plus" : { |
||||
/* 5+App特有相关 */ |
||||
"usingComponents" : true, |
||||
"splashscreen" : { |
||||
"alwaysShowBeforeRender" : true, |
||||
"waiting" : true, |
||||
"autoclose" : true, |
||||
"delay" : 0 |
||||
}, |
||||
"modules" : {}, |
||||
/* 模块配置 */ |
||||
"distribute" : { |
||||
/* 应用发布信息 */ |
||||
"android" : { |
||||
/* android打包配置 */ |
||||
"permissions" : [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||
] |
||||
}, |
||||
"ios" : {}, |
||||
/* ios打包配置 */ |
||||
"sdkConfigs" : {}, |
||||
"icons" : { |
||||
"ios" : { |
||||
"appstore" : "C:/Users/艺术生/Desktop/摄像头文档/微信图片_20190710100225.png", |
||||
"ipad" : { |
||||
"app" : "unpackage/res/icons/76x76.png", |
||||
"app@2x" : "unpackage/res/icons/152x152.png", |
||||
"notification" : "unpackage/res/icons/20x20.png", |
||||
"notification@2x" : "unpackage/res/icons/40x40.png", |
||||
"proapp@2x" : "unpackage/res/icons/167x167.png", |
||||
"settings" : "unpackage/res/icons/29x29.png", |
||||
"settings@2x" : "unpackage/res/icons/58x58.png", |
||||
"spotlight" : "unpackage/res/icons/40x40.png", |
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png" |
||||
}, |
||||
"iphone" : { |
||||
"app@2x" : "unpackage/res/icons/120x120.png", |
||||
"app@3x" : "unpackage/res/icons/180x180.png", |
||||
"notification@2x" : "unpackage/res/icons/40x40.png", |
||||
"notification@3x" : "unpackage/res/icons/60x60.png", |
||||
"settings@2x" : "unpackage/res/icons/58x58.png", |
||||
"settings@3x" : "unpackage/res/icons/87x87.png", |
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png", |
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png" |
||||
} |
||||
}, |
||||
"android" : { |
||||
"hdpi" : "unpackage/res/icons/72x72.png", |
||||
"ldpi" : "unpackage/res/icons/48x48.png", |
||||
"mdpi" : "unpackage/res/icons/48x48.png", |
||||
"xhdpi" : "unpackage/res/icons/96x96.png", |
||||
"xxhdpi" : "unpackage/res/icons/144x144.png", |
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png" |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
/* SDK配置 */ |
||||
"quickapp" : {}, |
||||
/* 快应用特有相关 */ |
||||
"mp-weixin" : { |
||||
/* 小程序特有相关 */ |
||||
"appid" : "", |
||||
"setting" : { |
||||
"urlCheck" : false |
||||
}, |
||||
"usingComponents" : true |
||||
}, |
||||
"h5" : { |
||||
"devServer" : { |
||||
"port" : 8000, |
||||
"disableHostCheck" : true, |
||||
"proxy" : { |
||||
"/api" : { |
||||
"target" : "https:\/\/fsb.biutag.com\/\/:9902", |
||||
"changeOrigin" : true, |
||||
"secure" : false, |
||||
"pathRewrite" : { |
||||
"^/api" : "" //匹配请求路径里面有 /api |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
"router" : { |
||||
"mode" : "hash", |
||||
"base" : "/ukeerStore/" |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,22 @@
|
||||
<script> |
||||
export default { |
||||
onLaunch: function () { |
||||
// console.log('App Launch') |
||||
}, |
||||
onShow: function () { |
||||
// console.log('App Show') |
||||
}, |
||||
onHide: function () { |
||||
// console.log('App Hide') |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
/*每个页面公共css */ |
||||
|
||||
page, |
||||
view { |
||||
display: flex;/* uni-app默认使用flex布局。因为flex布局有利于跨更多平台,尤其是采用原生渲染的平台。如不了解flex布局,请参考http://www.w3.org/TR/css3-flexbox/。若不需要flex布局可删除本行*/ |
||||
} |
||||
</style> |
||||
@ -0,0 +1,111 @@
|
||||
# uni-app 二维码生成器 |
||||
### 作者:诗小柒 |
||||
|
||||
1. H5、微信小程序、支付宝小程序、APP,其它平台的小程序没有测试 |
||||
2. 使用canvas生成 |
||||
3. 可设置二维码背景色,前景色,角标色 |
||||
4. 可设置二维码logo |
||||
5. 不懂如何使用可以去[github](https://github.com/q310550690/uni-app-qrcode)直接打包下载运行 |
||||
|
||||
## 声明 |
||||
此程序我测试在 xzp8.0 xzp9.0 真机上通过,没有出现问题,H5 测试了好几台手机也都是正常的,小程序真机测试也是正常的,IOS设备没有测试过,因为我不用苹果的东西,周围也没有什么人在用,所以无法测试,在使用次程序时产生的问题可以先去github 直接打包下载运行看看,如果还是不行请直接在 github 提交问题,最好配图,我好定位问题所在,还有就是,最近身体状态不是很好,可能也不会太上心这些插件了,出问题了又急用的可以自己看下源代码改下,多数都有中文注释的,谢谢 |
||||
+ 图片1 是微信小程序真机实测 |
||||
+ 图片2 是微信小程序模拟实测 |
||||
+ 图片3 是支付宝小程序模拟器实测 |
||||
+ 图片4 是安卓真机实测 |
||||
+ 图片5 H5 |
||||
|
||||
## 开始使用 |
||||
NPM |
||||
``` |
||||
npm i tki-qrcode |
||||
``` |
||||
GIT |
||||
``` |
||||
git clone https://github.com/q310550690/uni-app-qrcode |
||||
``` |
||||
|
||||
### 更新说明 |
||||
|
||||
* 0.1.5 新增showLoading、loadingText属性 |
||||
* 0.1.4 新增usingComponents属性,修复非自定义组件下 v-if 无法生成二维码的问题(非自定义组件下设置为false) |
||||
* 0.1.3 新增unit属性 |
||||
* 0.1.2 适配新版uni-app编译器 感谢 "DCloud_UNI_Trust" (如果github上下载后使用新版HbuilderX1.7.1.20190320编译后无法启动请等待Dcloud更新即可) |
||||
* 0.1.1 新增监听val值变化时自动生成二维码(onval)、新增组件初始化时自动生成二维码(loadMake) 属性,具体说明看文档说明 |
||||
* 0.1.0 常规更新 |
||||
* 0.0.9 修复小程序真机生成二维码错乱问题(其实这是小程序canvas的锅) |
||||
* 0.0.8 修复官方 uni.canvasToTempFilePath 在有些平台返回字段不统一而导致的支付宝无法生成二维码的问题。 |
||||
* 0.0.7 常规修复 |
||||
* 0.0.6 新增角标色、二维码logo |
||||
|
||||
### 使用方法 |
||||
在 `script` 中引入组件 |
||||
``` javascript |
||||
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue" |
||||
export default { |
||||
components: {tkiQrcode} |
||||
} |
||||
``` |
||||
在 `template` 中使用 |
||||
``` javascript |
||||
<view class="qrimg"> |
||||
<tki-qrcode |
||||
ref="qrcode" |
||||
:val="val" |
||||
:size="size" |
||||
:unit="unit" |
||||
:background="background" |
||||
:foreground="foreground" |
||||
:pdground="pdground" |
||||
:icon="icon" |
||||
:iconSize="iconsize" |
||||
:lv="lv" |
||||
:onval="onval" |
||||
:loadMake="loadMake" |
||||
:usingComponents="usingComponents" |
||||
:showLoading="showLoading" |
||||
:loadingText="loadingText" |
||||
@result="qrR" /> |
||||
</view> |
||||
``` |
||||
### 属性 |
||||
|
||||
|属性名|类型|默认值|可选值|说明| |
||||
|:-|:-:|:--:|:--:|-:| |
||||
|size|Number|200| |生成的二维码大小| |
||||
|unit|String|upx|px|大小单位尺寸| |
||||
|show|Boolean|true| |默认使用组件中的image标签显示二维码| |
||||
|val|String|二维码| |要生成的内容| |
||||
|background|String|#000000| |二维码背景色| |
||||
|foreground|String|#ffffff| |二维码前景色| |
||||
|pdground|String|#ffffff| |二维码角标色| |
||||
|icon|String| | |二维码图标URL(必须是本地图片,网络图需要先下载至本地)| |
||||
|iconSize|Number|40<br/>注意此大小不会跟随二维码size 动态变化,设置时需注意大小,不要太大,以免无法识别| |二维码图标大小| |
||||
|lv|Number|3(一般不用设置)| |容错级别| |
||||
|onval|Boolean|false| |监听val值变化自动重新生成二维码| |
||||
|loadMake|Boolean|false| |组件初始化完成后自动生成二维码,val需要有值| |
||||
|usingComponents|Boolean|true| false |是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)| |
||||
|showLoading|Boolean|true| false |是否显示loading| |
||||
|loadingText|String|二维码生成中| |loading文字| |
||||
|
||||
### 方法 |
||||
|方法名|参数|默认值|说明| |
||||
|:-|:-:|:--:|-:| |
||||
|_makeCode()| | |生成二维码| |
||||
|_clearCode()| | |清空二维码(清空二维码会触发result回调 返回值为空)| |
||||
|_saveCode()| | |保存二维码到图库| |
||||
|
||||
### 事件 |
||||
|事件名|返回值|说明| |
||||
|:-|:-:|-:| |
||||
|result|生成的图片base64或图片临时地址|返回二维码路径 注:_clearCode()后返回空| |
||||
|
||||
|
||||
|
||||
### 问题 |
||||
暂无问题 |
||||
|
||||
### 感谢 |
||||
|
||||
[uni-app](https://uniapp.dcloud.io/ "uni-app") |
||||
[qrcode](https://github.com/aralejs/qrcode "qrcode") |
||||
@ -0,0 +1,200 @@
|
||||
<template xlang="wxml" minapp="mpvue"> |
||||
<view class="_qrCode"> |
||||
<canvas class="_qrCodeCanvas" id="_myQrCodeCanvas" canvas-id="_myQrCodeCanvas" :style="{width:cpSize+'px',height:cpSize+'px'}" /> |
||||
<image v-show="show" :src="result" :style="{width:cpSize+'px',height:cpSize+'px'}" /> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import QRCode from "./qrcode.js" |
||||
let qrcode |
||||
export default { |
||||
name: "tki-qrcode", |
||||
props: { |
||||
size: { |
||||
type: Number, |
||||
default: 200 |
||||
}, |
||||
unit: { |
||||
type: String, |
||||
default: 'upx' |
||||
}, |
||||
show: { |
||||
type: Boolean, |
||||
default: true |
||||
}, |
||||
val: { |
||||
type: String, |
||||
default: '' |
||||
}, |
||||
background: { |
||||
type: String, |
||||
default: '#ffffff' |
||||
}, |
||||
foreground: { |
||||
type: String, |
||||
default: '#000000' |
||||
}, |
||||
pdground: { |
||||
type: String, |
||||
default: '#000000' |
||||
}, |
||||
icon: { |
||||
type: String, |
||||
default: '' |
||||
}, |
||||
iconSize: { |
||||
type: Number, |
||||
default: 40 |
||||
}, |
||||
lv: { |
||||
type: Number, |
||||
default: 3 |
||||
}, |
||||
onval: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
loadMake: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
usingComponents: { |
||||
type: Boolean, |
||||
default: true |
||||
}, |
||||
showLoading: { |
||||
type: Boolean, |
||||
default: true |
||||
}, |
||||
loadingText: { |
||||
type: String, |
||||
default: '二维码生成中' |
||||
}, |
||||
}, |
||||
data() { |
||||
return { |
||||
result: '', |
||||
} |
||||
}, |
||||
methods: { |
||||
_makeCode() { |
||||
let that = this |
||||
if (!this._empty(this.val)) { |
||||
qrcode = new QRCode({ |
||||
context: that, |
||||
usingComponents: that.usingComponents, |
||||
showLoading: that.showLoading, |
||||
loadingText: that.loadingText, |
||||
text: that.val, // 生成内容 |
||||
size: that.cpSize, // 二维码大小 |
||||
background: that.background, // 背景色 |
||||
foreground: that.foreground, // 前景色 |
||||
pdground: that.pdground, // 定位角点颜色 |
||||
correctLevel: that.lv, // 容错级别 |
||||
image: that.icon, // 二维码图标 |
||||
imageSize: that.iconSize,// 二维码图标大小 |
||||
cbResult: function (res) { // 生成二维码的回调 |
||||
that._result(res) |
||||
}, |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: '二维码内容不能为空', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}); |
||||
} |
||||
}, |
||||
_clearCode() { |
||||
this._result('') |
||||
qrcode.clear() |
||||
}, |
||||
_saveCode() { |
||||
let that = this; |
||||
if (this.result != "") { |
||||
uni.saveImageToPhotosAlbum({ |
||||
filePath: that.result, |
||||
success: function () { |
||||
uni.showToast({ |
||||
title: '二维码保存成功', |
||||
icon: 'success', |
||||
duration: 2000 |
||||
}); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
_result(res) { |
||||
this.result = res; |
||||
this.$emit('result', res) |
||||
}, |
||||
_empty(v) { |
||||
let tp = typeof v, |
||||
rt = false; |
||||
if (tp == "number" && String(v) == "") { |
||||
rt = true |
||||
} else if (tp == "undefined") { |
||||
rt = true |
||||
} else if (tp == "object") { |
||||
if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true |
||||
} else if (tp == "string") { |
||||
if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true |
||||
} else if (tp == "function") { |
||||
rt = false |
||||
} |
||||
return rt |
||||
} |
||||
}, |
||||
watch: { |
||||
size: function (n, o) { |
||||
if (n != o && !this._empty(n)) { |
||||
this.cSize = n |
||||
if (!this._empty(this.val)) { |
||||
setTimeout(() => { |
||||
this._makeCode() |
||||
}, 100); |
||||
} |
||||
} |
||||
}, |
||||
val: function (n, o) { |
||||
if (this.onval) { |
||||
if (n != o && !this._empty(n)) { |
||||
setTimeout(() => { |
||||
this._makeCode() |
||||
}, 0); |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
cpSize() { |
||||
if(this.unit == "upx"){ |
||||
return uni.upx2px(this.size) |
||||
}else{ |
||||
return this.size |
||||
} |
||||
} |
||||
}, |
||||
mounted: function () { |
||||
if (this.loadMake) { |
||||
if (!this._empty(this.val)) { |
||||
setTimeout(() => { |
||||
this._makeCode() |
||||
}, 0); |
||||
} |
||||
} |
||||
}, |
||||
} |
||||
</script> |
||||
<style> |
||||
._qrCode { |
||||
position: relative; |
||||
} |
||||
._qrCodeCanvas { |
||||
position: fixed; |
||||
top: -99999upx; |
||||
left: -99999upx; |
||||
z-index: -99999; |
||||
} |
||||
</style> |
||||
@ -0,0 +1,11 @@
|
||||
import Vue from 'vue' |
||||
import App from './App' |
||||
|
||||
Vue.config.productionTip = false |
||||
|
||||
App.mpType = 'app' |
||||
|
||||
const app = new Vue({ |
||||
...App |
||||
}) |
||||
app.$mount() |
||||
@ -0,0 +1,60 @@
|
||||
{ |
||||
"name" : "qrcode", |
||||
"appid" : "__UNI__2A8D346", |
||||
"description" : "", |
||||
"versionName" : "1.0.0", |
||||
"versionCode" : "100", |
||||
"transformPx" : false, |
||||
"usingComponents": true, |
||||
"debug": true, |
||||
"app-plus" : { |
||||
/* 5+App特有相关 */ |
||||
"modules" : {}, |
||||
/* 模块配置 */ |
||||
"distribute" : { |
||||
/* 应用发布信息 */ |
||||
"android" : { |
||||
/* android打包配置 */ |
||||
"permissions" : [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||
] |
||||
}, |
||||
"ios" : {}, |
||||
/* ios打包配置 */ |
||||
"sdkConfigs" : {} |
||||
}, |
||||
"usingComponents": true |
||||
}, |
||||
/* SDK配置 */ |
||||
"quickapp" : {}, |
||||
/* 快应用特有相关 */ |
||||
"mp-weixin" : { |
||||
/* 小程序特有相关 */ |
||||
"appid" : "wx7d67739c63a7f3e0", |
||||
"setting" : { |
||||
"urlCheck" : true |
||||
}, |
||||
"usingComponents": true |
||||
} |
||||
} |
||||
@ -0,0 +1,54 @@
|
||||
{ |
||||
"_from": "tki-qrcode", |
||||
"_id": "tki-qrcode@0.1.5", |
||||
"_inBundle": false, |
||||
"_integrity": "sha512-zxRe5g7Lt7yHpuNs7OTHpZPsg8NBo/lfowtQqC4ERdfHZgGPN6FIqr98KUg9lgple3CNVnpQG31AfWZYyJZgrw==", |
||||
"_location": "/tki-qrcode", |
||||
"_phantomChildren": {}, |
||||
"_requested": { |
||||
"type": "tag", |
||||
"registry": true, |
||||
"raw": "tki-qrcode", |
||||
"name": "tki-qrcode", |
||||
"escapedName": "tki-qrcode", |
||||
"rawSpec": "", |
||||
"saveSpec": null, |
||||
"fetchSpec": "latest" |
||||
}, |
||||
"_requiredBy": [ |
||||
"#USER", |
||||
"/" |
||||
], |
||||
"_resolved": "https://registry.npmjs.org/tki-qrcode/-/tki-qrcode-0.1.5.tgz", |
||||
"_shasum": "b699aeef8dd6ddc2e09ca21270b351122823fa8c", |
||||
"_spec": "tki-qrcode", |
||||
"_where": "E:\\svn\\test-echarts\\ukeer-store-pay", |
||||
"author": { |
||||
"name": "sxq" |
||||
}, |
||||
"bugs": { |
||||
"url": "https://github.com/q310550690/uni-app-qrcode/issues" |
||||
}, |
||||
"bundleDependencies": false, |
||||
"deprecated": false, |
||||
"description": "qrcode", |
||||
"homepage": "https://github.com/q310550690/uni-app-qrcode#readme", |
||||
"keywords": [ |
||||
"qrcode", |
||||
"mpvue", |
||||
"uni-app", |
||||
"tki-qrcode", |
||||
"TikiUi" |
||||
], |
||||
"license": "MIT", |
||||
"main": "components/tki-qrcode/tki-qrcode.vue", |
||||
"name": "tki-qrcode", |
||||
"repository": { |
||||
"type": "git", |
||||
"url": "git+https://github.com/q310550690/uni-app-qrcode.git" |
||||
}, |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
||||
"version": "0.1.5" |
||||
} |
||||
@ -0,0 +1,16 @@
|
||||
{ |
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||
{ |
||||
"path": "pages/index/index", |
||||
"style": { |
||||
"navigationBarTitleText": "uni-app" |
||||
} |
||||
} |
||||
], |
||||
"globalStyle": { |
||||
"navigationBarTextStyle": "black", |
||||
"navigationBarTitleText": "uni-app", |
||||
"navigationBarBackgroundColor": "#F8F8F8", |
||||
"backgroundColor": "#F8F8F8" |
||||
} |
||||
} |
||||
@ -0,0 +1,124 @@
|
||||
<template xlang="wxml"> |
||||
<view class="container"> |
||||
<view class="qrimg"> |
||||
<tki-qrcode v-if="ifShow" ref="qrcode" :val="val" :size="size" :unit="unit" :background="background" :foreground="foreground" :pdground="pdground" :icon="icon" :iconSize="iconsize" :lv="lv" :onval="onval" :loadMake="loadMake" :usingComponents="true" @result="qrR" /> |
||||
</view> |
||||
<view class="uni-padding-wrap"> |
||||
<view class="uni-title">请输入要生成的二维码内容</view> |
||||
</view> |
||||
<view class="uni-list"> |
||||
<input class="uni-input" placeholder="请输入要生成的二维码内容" v-model="val" /> |
||||
</view> |
||||
<view class="uni-padding-wrap uni-common-mt"> |
||||
<view class="uni-title">设置二维码大小</view> |
||||
</view> |
||||
<view class="body-view"> |
||||
<slider :value="size" @change="sliderchange" min="50" max="500" show-value /> |
||||
</view> |
||||
<view class="uni-padding-wrap"> |
||||
<view class="btns"> |
||||
<button type="primary" @tap="selectIcon">选择二维码图标</button> |
||||
<button type="primary" @tap="creatQrcode">生成二维码</button> |
||||
<button type="primary" @tap="saveQrcode">保存到图库</button> |
||||
<button type="warn" @tap="clearQrcode">清除二维码</button> |
||||
<button type="warn" @tap="ifQrcode">显示隐藏二维码</button> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue' |
||||
export default { |
||||
data() { |
||||
return { |
||||
ifShow: true, |
||||
val: '二维码', // 要生成的二维码值 |
||||
size: 200, // 二维码大小 |
||||
unit: 'upx', // 单位 |
||||
background: '#b4e9e2', // 背景色 |
||||
foreground: '#309286', // 前景色 |
||||
pdground: '#32dbc6', // 角标色 |
||||
icon: '', // 二维码图标 |
||||
iconsize: 40, // 二维码图标大小 |
||||
lv: 3, // 二维码容错级别 , 一般不用设置,默认就行 |
||||
onval: false, // val值变化时自动重新生成二维码 |
||||
loadMake: true, // 组件加载完成后自动生成二维码 |
||||
src: '' // 二维码生成后的图片地址或base64 |
||||
} |
||||
}, |
||||
methods: { |
||||
sliderchange(e) { |
||||
this.size = e.detail.value |
||||
}, |
||||
creatQrcode() { |
||||
this.$refs.qrcode._makeCode() |
||||
}, |
||||
saveQrcode() { |
||||
this.$refs.qrcode._saveCode() |
||||
}, |
||||
qrR(res) { |
||||
this.src = res |
||||
}, |
||||
clearQrcode() { |
||||
this.$refs.qrcode._clearCode() |
||||
this.val = '' |
||||
}, |
||||
ifQrcode() { |
||||
this.ifShow = !this.ifShow |
||||
}, |
||||
selectIcon() { |
||||
let that = this |
||||
uni.chooseImage({ |
||||
count: 1, //默认9 |
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
||||
sourceType: ['album'], //从相册选择 |
||||
success: function (res) { |
||||
that.icon = res.tempFilePaths[0] |
||||
setTimeout(() => { |
||||
that.creatQrcode() |
||||
}, 100); |
||||
// console.log(res.tempFilePaths); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
components: { |
||||
tkiQrcode |
||||
}, |
||||
onLoad: function () { }, |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
/* @import "../../../common/icon.css"; */ |
||||
.container { |
||||
display: flex; |
||||
flex-direction: column; |
||||
width: 100%; |
||||
} |
||||
|
||||
.qrimg { |
||||
display: flex; |
||||
justify-content: center; |
||||
} |
||||
|
||||
slider { |
||||
width: 100%; |
||||
} |
||||
|
||||
input { |
||||
width: 100%; |
||||
margin-bottom: 20upx; |
||||
} |
||||
|
||||
.btns { |
||||
display: flex; |
||||
flex-direction: column; |
||||
width: 100%; |
||||
} |
||||
|
||||
button { |
||||
width: 100%; |
||||
margin-top: 10upx; |
||||
} |
||||
</style> |
||||
@ -0,0 +1,2 @@
|
||||
# 静态资源 |
||||
占位 |
||||
@ -0,0 +1,11 @@
|
||||
{ |
||||
"requires": true, |
||||
"lockfileVersion": 1, |
||||
"dependencies": { |
||||
"tki-qrcode": { |
||||
"version": "0.1.5", |
||||
"resolved": "https://registry.npmjs.org/tki-qrcode/-/tki-qrcode-0.1.5.tgz", |
||||
"integrity": "sha512-zxRe5g7Lt7yHpuNs7OTHpZPsg8NBo/lfowtQqC4ERdfHZgGPN6FIqr98KUg9lgple3CNVnpQG31AfWZYyJZgrw==" |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,33 @@
|
||||
{ |
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||
{ |
||||
"path" : "pages/confirm-code/confirm-code", |
||||
"style" : {} |
||||
}, |
||||
{ |
||||
"path" : "pages/store-commodity/store-commodity", |
||||
"style" : {} |
||||
}, |
||||
{ |
||||
"path" : "pages/menu/menu", |
||||
"style" : {} |
||||
} |
||||
// ,{ |
||||
// "path" : "pages/error/error", |
||||
// "style" : {} |
||||
// },{ |
||||
// "path": "pages/index/index", |
||||
// "style": {} |
||||
// },{ |
||||
// "path" : "pages/pay-ok/pay-ok", |
||||
// "style" : {} |
||||
// } |
||||
], |
||||
"globalStyle": { |
||||
"navigationBarTextStyle": "black", //导航栏标题颜色 |
||||
"navigationBarTitleText": "uni-app", //导航栏标题文字内容 |
||||
"navigationBarBackgroundColor": "#F8F8F8", //导航栏背景颜色 |
||||
"backgroundColor": "#F8F8F8", |
||||
"navigationStyle": "custom" |
||||
} |
||||
} |
||||
@ -0,0 +1,99 @@
|
||||
<template> |
||||
<view v-if="showCode"> |
||||
<view class="code-view"> |
||||
<tki-qrcode |
||||
ref="qrcode" |
||||
:val="val" |
||||
:size="100" |
||||
unit="upx" |
||||
:onval="true" |
||||
:loadMake="true" |
||||
:showLoading="false" |
||||
:usingComponents="true" |
||||
/> |
||||
</view> |
||||
<text class="code-text">请使用微信扫码验证</text> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import tkiQrcode from 'tki-qrcode/components/tki-qrcode/tki-qrcode.vue' |
||||
import {createUUID} from '../../utils/uuid.js' |
||||
import * as api from '@/api/index/index.js' |
||||
import webSocket from '@/utils/weSocket.js' |
||||
export default { |
||||
components:{tkiQrcode}, |
||||
data() { |
||||
return { |
||||
val:'https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4', |
||||
showCode:false, |
||||
socketMsgQueue:'', |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.checkLogin() |
||||
}, |
||||
onShow() { |
||||
//页面每次显示判断是否已经登录(防止websocket断掉),往后端发送请求,看请求是否能通过 |
||||
// this.checkLogin(); |
||||
// uni.setStorageSync("wxObj", this) |
||||
}, |
||||
methods: { |
||||
checkLogin(){ |
||||
api.checkLogin().then(res=>{ |
||||
if(res.message == 'success'){//已经登录过 |
||||
//跳转页面 |
||||
uni.redirectTo({ |
||||
url:"/pages/store-commodity/store-commodity" |
||||
}) |
||||
}else{//未登录,显示二维码,并建立websocket连接 |
||||
this.showCode=true; |
||||
this.getWebSocketRes() |
||||
} |
||||
}) |
||||
}, |
||||
VXCode(val){ |
||||
this.showCode = true |
||||
this.val = val |
||||
uni.setStorageSync('id', val) |
||||
}, |
||||
loginPage(val){ |
||||
uni.setStorageSync('openId', val.openId) |
||||
//登录成功 |
||||
uni.redirectTo({ |
||||
url:'/pages/menu/menu?id=' + val.menuId |
||||
}) |
||||
}, |
||||
getWebSocketRes(){ |
||||
let socket = webSocket.getWebSocket(this) |
||||
uni.setStorageSync('socket', socket) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
page{ |
||||
background: #f5f5f5; |
||||
} |
||||
|
||||
.code-view{ |
||||
position: absolute; |
||||
left: calc(50% - 50upx); |
||||
top: calc(50% - 60upx); |
||||
width: 100upx; |
||||
height: 100upx; |
||||
} |
||||
|
||||
.code-text{ |
||||
position: absolute; |
||||
width: 100upx; |
||||
text-align: center; |
||||
font-size:10.41upx; |
||||
left: calc(50% - 50upx); |
||||
top: calc(50% + 60upx); |
||||
display: block; |
||||
} |
||||
|
||||
</style> |
||||
@ -0,0 +1,72 @@
|
||||
<template> |
||||
<view class="body"> |
||||
<image class="qie" src="../../static/images/qie.svg"></image> |
||||
<text class="iconfont iconalipaylogo i-iconalipaylogo"></text> |
||||
<text class="iconfont iconwechatlogo i-iconwechatlogo"></text> |
||||
<text class="alert">请使用微信或者支付宝扫码</text> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
// document.title = '访问错误' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
|
||||
} |
||||
}, |
||||
methods: { |
||||
|
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
.body{ |
||||
position: relative; |
||||
} |
||||
|
||||
.qie{ |
||||
position: absolute; |
||||
width: 283.33upx; |
||||
height: 200upx; |
||||
left: 193.75upx; |
||||
top: 277.08upx; |
||||
} |
||||
|
||||
.i-iconalipaylogo { |
||||
font-size: 72.91upx; |
||||
position: absolute; |
||||
left: 416.66upx; |
||||
top: 120.83upx; |
||||
color: #079ADF; |
||||
} |
||||
|
||||
.i-iconwechatlogo { |
||||
font-size: 58.33upx; |
||||
position: absolute; |
||||
left: 550upx; |
||||
top: 277.08upx; |
||||
color: #30AD37; |
||||
} |
||||
|
||||
.alert { |
||||
width:485.41upx; |
||||
height:54.16upx; |
||||
font-size:37.5upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color:rgba(102,102,102,1); |
||||
line-height:54.16upx; |
||||
position: absolute; |
||||
margin: 0 auto; |
||||
left: 0; |
||||
right: 0; |
||||
text-align: center; |
||||
top: 591.66upx; |
||||
} |
||||
|
||||
</style> |
||||
@ -0,0 +1,429 @@
|
||||
<template> |
||||
<view class="content"> |
||||
<view class="bk-top"></view> |
||||
<view class="order-card"> |
||||
<view class="order-title"> |
||||
<text class="order-title-text">订单详情</text> |
||||
</view> |
||||
<view class="commodity-list" v-for="(commodity,index) in commdodiryList" :key="index"> |
||||
<text class="commodity-name">{{ commodity.commodityName }}</text> |
||||
<text class="commodity-name-en">{{ commodity.commodityNameEn }}</text> |
||||
<text class="commodity-number">x{{ commodity.number }}</text> |
||||
<text class="commodity-money">¥{{ commodity.money }}</text> |
||||
</view> |
||||
<view class="order-hr"></view> |
||||
<view class="order-all-money"> |
||||
<text class="all-money">¥{{ order.money == undefined ? 0 : order.money }}</text> |
||||
<text class="all-money-remark">合计</text> |
||||
</view> |
||||
<view class="bk-on"></view> |
||||
<radio-group @change="radioChange"> |
||||
<view class="pay-way"> |
||||
<view class="pay-way-view"> |
||||
<icon class="iconfont iconwallet i-iconwallet" :class="iconwallet"></icon> |
||||
<text class="pay-name" :class="payNameColor">余额支付</text> |
||||
<text class="pay-money" :class="payNameColor">(剩余:¥{{ money }})</text> |
||||
<text class="pay-money pay-name-no" v-if="!userMoneyOK">余额不足</text> |
||||
<radio value="userPay" class="pay-radio" v-if="userMoneyOK" color="#8ADE4D" /> |
||||
</view> |
||||
</view> |
||||
<view class="pay-way"> |
||||
<view class="pay-way-view pay-way-view-no"> |
||||
<icon class="iconfont iconzfbpay i-iconwallet i-iconwechatpay"></icon> |
||||
<text class="pay-name pay-name-yes">支付宝支付</text> |
||||
<radio value="aliApy" class="pay-radio" :checked="true" color="#8ADE4D" /> |
||||
</view> |
||||
</view> |
||||
</radio-group> |
||||
</view> |
||||
<view class="order-bottom"> |
||||
<text class="bottom-all-money">合计:¥{{ order.money == undefined ? 0 : order.money }}</text> |
||||
<button class="to-pay" :class="toPayColor" @click="toPay">去支付({{ order.number === undefined ? 0 : order.number }})</button> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
import {getOrderInfo,unifiedOrder,useUserPay,pay} from '@/api/index/index.js' |
||||
|
||||
// document.title = '确认订单' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
commdodiryList: [], |
||||
money: 0, |
||||
order: {}, |
||||
userId: '', |
||||
sysOpenId: '', |
||||
code: '', |
||||
openId: '', |
||||
wxPayResult: {}, |
||||
isPay: false, |
||||
iconwallet: 'i-iconwallet-no', |
||||
payNameColor: 'pay-name-no', |
||||
userMoneyOK: false, |
||||
toPayColor: 'to-pay-no', |
||||
isOrder: false, |
||||
payWay: 'aliApy', |
||||
isPaySuccess: false |
||||
} |
||||
}, |
||||
onLoad(param) { |
||||
this.userId = param.userId |
||||
this.sysOpenId = param.sysOpenId |
||||
// this.userId = '59c7808b-c098-41ca-abe0-e2035ce39f78' |
||||
// this.sysOpenId = 'oMt0N5KE4QbBPvovuJt6OrIk_wuI' |
||||
this.getOrderInfo() |
||||
}, |
||||
methods: { |
||||
radioChange(event){ |
||||
this.payWay = event.detail.value |
||||
}, |
||||
toPay(){ |
||||
if(this.isOrder){ |
||||
if(!this.isPaySuccess){ |
||||
if(this.payWay == 'aliApy'){ |
||||
this.aliApy() |
||||
}else if(this.payWay == 'userPay'){ |
||||
this.useUserPay() |
||||
}else { |
||||
uni.showToast({ |
||||
title: '请选择支付方式', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}else { |
||||
uni.showToast({ |
||||
title: '请勿重复提交订单', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}else { |
||||
uni.showToast({ |
||||
title: '数据加载中', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}, |
||||
aliApy(){ |
||||
let body = '' |
||||
for(var i = 0; i < this.commdodiryList; i++){ |
||||
body = body + this.commdodiryList[i].commodityName |
||||
} |
||||
let query = { |
||||
outTradeNo: this.order.orderId, |
||||
subject: '商品', |
||||
totalAmount: this.order.money, |
||||
body: body |
||||
} |
||||
pay(query).then(res=>{ |
||||
document.querySelector('body').innerHTML = res |
||||
document.forms[0].submit() |
||||
}) |
||||
}, |
||||
useUserPay(){ |
||||
let query = { |
||||
sysOpenId: this.sysOpenId, |
||||
userId: this.userId |
||||
} |
||||
useUserPay(query).then(res=>{ |
||||
if(res.success){ |
||||
uni.showToast({ |
||||
title: '付款成功', |
||||
icon: 'success' |
||||
}) |
||||
this.isPaySuccess = true |
||||
this.toreLaunchPage() |
||||
}else { |
||||
uni.showToast({ |
||||
title: '支付失败', |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
getOrderInfo(){ |
||||
let query = { |
||||
userId: this.userId |
||||
} |
||||
getOrderInfo(query).then(res=>{ |
||||
this.sysOpenId = res |
||||
if(res.success){ |
||||
this.order = res.data.order |
||||
this.commdodiryList = res.data.order.orderCommodityList |
||||
this.money = res.data.money |
||||
if(this.order.money != undefined && this.order.money > 0){ |
||||
this.isOrder = true |
||||
this.toPayColor = 'to-pay-yes' |
||||
if(this.order.money <= this.money){ |
||||
this.iconwallet = 'i-iconwallet-yes' |
||||
this.payNameColor = 'pay-name-yes' |
||||
this.userMoneyOK = true |
||||
} |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
toreLaunchPage(){ |
||||
let vm = this |
||||
uni.reLaunch({ |
||||
url: '/pages/pay-ok/pay-ok?money=' + vm.order.money |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
page { |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.content { |
||||
width: 750upx; |
||||
width: 750upx; |
||||
} |
||||
|
||||
.bk-top { |
||||
background: #F7F7F7; |
||||
width: 750upx; |
||||
height: 10.41upx; |
||||
} |
||||
|
||||
.order-card { |
||||
width: 750upx; |
||||
width: 100%; |
||||
margin-bottom: 625upx; |
||||
} |
||||
|
||||
.order-title { |
||||
height: 97.91upx; |
||||
width: 750upx; |
||||
} |
||||
|
||||
.order-title-text { |
||||
height:45.83upx; |
||||
font-size:33.33upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:700; |
||||
color:rgba(17,17,17,1); |
||||
line-height:45.83upx; |
||||
margin-top: 31.25upx; |
||||
margin-left: 31.25upx; |
||||
float: left; |
||||
} |
||||
|
||||
.commodity-list { |
||||
width: 750upx; |
||||
height: 118.75upx; |
||||
position: relative; |
||||
} |
||||
|
||||
.commodity-name { |
||||
height:41.66upx; |
||||
font-size:29.16upx; |
||||
font-family:PingFangSC-Semibold; |
||||
font-weight:700; |
||||
color:rgba(17,17,17,1); |
||||
line-height:41.66upx; |
||||
position: absolute; |
||||
left: 41.66upx; |
||||
top: 0; |
||||
} |
||||
|
||||
.commodity-name-en { |
||||
height:29.16upx; |
||||
font-size:25upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color: #333333; |
||||
line-height:29.16upx; |
||||
position: absolute; |
||||
left: 41.66upx; |
||||
top: 47.91upx; |
||||
} |
||||
|
||||
.commodity-number { |
||||
height:35.41upx; |
||||
font-size:25upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color:rgba(17,17,17,1); |
||||
line-height:35.41upx; |
||||
position: absolute; |
||||
left: 550upx; |
||||
top: 52.08upx; |
||||
} |
||||
|
||||
.commodity-money { |
||||
height:35.41upx; |
||||
font-size:25upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:700; |
||||
color:rgba(17,17,17,1); |
||||
line-height:35.41upx; |
||||
position: absolute; |
||||
right: 31.25upx; |
||||
top: 52.08upx; |
||||
} |
||||
|
||||
.order-hr { |
||||
width:687.5upx; |
||||
height:2.08upx; |
||||
margin-left: 31.25upx; |
||||
background: #F0F0F0; |
||||
} |
||||
|
||||
.order-all-money { |
||||
width: 750upx; |
||||
height: 45.83upx; |
||||
margin-top: 29.16upx; |
||||
} |
||||
|
||||
.all-money-remark { |
||||
height:33.33upx; |
||||
font-size:22.91upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color:rgba(17,17,17,1); |
||||
line-height:33.33upx; |
||||
margin-top: 37.5upx; |
||||
margin-right: 12.5upx; |
||||
float: right; |
||||
} |
||||
|
||||
.all-money { |
||||
height:45.83upx; |
||||
font-size:33.33upx; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:700; |
||||
color:rgba(17,17,17,1); |
||||
line-height:45.83upx; |
||||
margin-top: 29.16upx; |
||||
margin-right: 31.25upx; |
||||
float: right; |
||||
} |
||||
|
||||
.order-bottom { |
||||
width: 750upx; |
||||
height: 112.5upx; |
||||
border-top: 4.16upx solid #EFEFEF; |
||||
position: fixed; |
||||
bottom: 0; |
||||
left: 0; |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.bottom-all-money { |
||||
height:112.5upx; |
||||
font-size:33.33upx; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:650; |
||||
color:rgba(17,17,17,1); |
||||
line-height:112.5upx; |
||||
margin-left: 20.83upx; |
||||
} |
||||
|
||||
.to-pay { |
||||
padding: 0; |
||||
margin: 0; |
||||
border: 0 solid #38ADFF !important; |
||||
width:281.25upx; |
||||
height:114.58upx; |
||||
margin-top: -2.08upx; |
||||
line-height: 114.58upx; |
||||
float: right; |
||||
border-radius: 0; |
||||
font-size:37.5upx; |
||||
font-family:PingFangSC-Medium; |
||||
color: #FFFFFF; |
||||
font-weight:500; |
||||
} |
||||
|
||||
.to-pay-no { |
||||
background: #98D4FF; |
||||
} |
||||
|
||||
.to-pay-yes { |
||||
background: #38ADFF; |
||||
} |
||||
|
||||
.to-pay:after { |
||||
border: 0 solid #38ADFF !important; |
||||
} |
||||
|
||||
.bk-on { |
||||
width:750upx; |
||||
height:20.83upx; |
||||
background:rgba(247,247,247,1); |
||||
margin-top: 47.91upx; |
||||
} |
||||
|
||||
.pay-way { |
||||
width: 750upx; |
||||
height: 102.08upx; |
||||
} |
||||
|
||||
.pay-way-view { |
||||
width: 687.5upx; |
||||
height: 102.08upx; |
||||
margin-left: 31.25upx; |
||||
border-bottom: 2.08upx solid #F0F0F0; |
||||
} |
||||
|
||||
.pay-way-view-no { |
||||
border-bottom: 0upx; |
||||
} |
||||
|
||||
.i-iconwallet { |
||||
width:35.41upx; |
||||
height:41.66upx; |
||||
font-size: 39.58upx; |
||||
line-height: 102.08upx; |
||||
} |
||||
|
||||
.i-iconwallet-yes { |
||||
color: #FD9B2F; |
||||
} |
||||
|
||||
.i-iconwallet-no { |
||||
color: #FFCD97; |
||||
} |
||||
|
||||
.pay-name { |
||||
font-size:29.16upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
line-height:102.08upx; |
||||
margin-left: 35.41upx; |
||||
} |
||||
|
||||
.pay-name-yes { |
||||
color: #111111; |
||||
} |
||||
|
||||
.pay-name-no { |
||||
color: #C3C3C3; |
||||
} |
||||
|
||||
.pay-money { |
||||
font-size:25upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
line-height:102.08upx; |
||||
margin-left: 4.16upx; |
||||
} |
||||
|
||||
.pay-radio { |
||||
text-align: center; |
||||
line-height: 102.08upx; |
||||
float: right; |
||||
transform:scale(0.8) |
||||
} |
||||
|
||||
.i-iconwechatpay { |
||||
color: #1AACEB; |
||||
} |
||||
|
||||
</style> |
||||
@ -0,0 +1,218 @@
|
||||
<template> |
||||
<view class="menu-div"> |
||||
<view v-if="template.imageBg" class="workspace" :style="'width:' + template.scaleWidth + 'upx;height:' + template.scaleHeight + 'upx;background: url(' + baseUrl + '/' +template.imageBg + ');backgroundSize:' + template.scaleWidth + 'upx ' + template.scaleHeight + 'upx;'"> |
||||
<view v-for="(citem, index) in items" :key="index" :style="'position: absolute;top:' + citem.y + 'upx;left:' + citem.x + 'upx;z-index:' + index + ';width:' + citem.width + 'upx;height:' + citem.height + 'upx;white-space:pre;'"> |
||||
<view class="template-item" :style="citem.style"> |
||||
<text :style="citem.itemType == 'qrcode' ? 'background: #FFFFFF;position:absolute;width:100%;top:'+citem.height+'upx;text-align:'+citem.align+';font-size:'+citem.fontSize+'upx;letter-spacing:'+citem.wordSpace+'upx;font-family:'+citem.fontFamily : ''" v-cloak>{{citem.itemType == 'qrcode' ? citem.style.itemText : citem.itemText}}</text> |
||||
</view> |
||||
</view> |
||||
<view class="qrimg"> |
||||
<tki-qrcode v-if="ifShow" ref="qrcode" :val="val" :size="size" :unit="unit" :onval="onval" :loadMake="loadMake" |
||||
:usingComponents="true" @result="qrR" /> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getTemplate |
||||
} from '@/api/index/index' |
||||
|
||||
import tkiQrcode from 'tki-qrcode/components/tki-qrcode/tki-qrcode.vue' |
||||
import webSocket from '@/utils/weSocket1.js' |
||||
|
||||
var baseUrl = 'https://fsb.biutag.com:9900/ukeer-pc'; |
||||
|
||||
var wid = document.body.clientWidth |
||||
|
||||
export default { |
||||
components:{tkiQrcode}, |
||||
data() { |
||||
return { |
||||
id: '6fdfec14-8a86-4ae5-9c3a-8a098fe08726', |
||||
baseUrl: 'https://fsb.biutag.com:9900/ukeer-pc', |
||||
template: { |
||||
templateId: '', |
||||
name: '', |
||||
imageBg: '', |
||||
imageReal: '', |
||||
realWidth: 0, |
||||
realHeight: 0, |
||||
scaleWidth: 450, |
||||
scaleHeight: 600, |
||||
scale: 0, |
||||
bl: '' |
||||
}, |
||||
ifShow: true, |
||||
items: [], |
||||
val: '', // 要生成的二维码值 |
||||
size: 100, // 二维码大小 |
||||
unit: 'upx', // 单位 |
||||
onval: true, // val值变化时自动重新生成二维码 |
||||
loadMake: true, // 组件加载完成后自动生成二维码 |
||||
src: '' ,// 二维码生成后的图片地址或base64 |
||||
wxcode: undefined, |
||||
codeObj: [] |
||||
} |
||||
}, |
||||
mounted() {}, |
||||
onLoad(e) { |
||||
this.id = e.id |
||||
this.bl = this.template.scaleWidth / 750 |
||||
console.log(this.bl) |
||||
// this.bl = 1 |
||||
this.getTemplate() |
||||
webSocket.getWebSocket(this) |
||||
}, |
||||
methods: { |
||||
getTemplate() { |
||||
let query = { |
||||
id: this.id |
||||
} |
||||
let vm = this |
||||
getTemplate(query).then(res => { |
||||
var qrcodeTemplate = res.data; |
||||
vm.bl = qrcodeTemplate.scaleWidth / 750 |
||||
vm.template.templateId = qrcodeTemplate.templateId; |
||||
vm.template.name = qrcodeTemplate.templateName; |
||||
vm.template.imageReal = qrcodeTemplate.imageReal; |
||||
vm.template.imageBg = qrcodeTemplate.imageBg; |
||||
vm.template.realWidth = qrcodeTemplate.realWidth; |
||||
vm.template.realHeight = qrcodeTemplate.realHeight; |
||||
vm.template.scaleWidth = qrcodeTemplate.scaleWidth / vm.bl; |
||||
vm.template.scaleHeight = qrcodeTemplate.scaleHeight / vm.bl; |
||||
vm.template.scale = qrcodeTemplate.scale; |
||||
vm.imageBg = baseUrl + "/" + qrcodeTemplate.imageBg; |
||||
|
||||
for (var i = 0; i < qrcodeTemplate.elementList.length; i++) { |
||||
var item = qrcodeTemplate.elementList[i]; |
||||
var itemdefalut = {}; |
||||
itemdefalut.x = item.elementX / vm.bl; |
||||
itemdefalut.y = item.elementY / vm.bl; |
||||
itemdefalut.width = item.elementWidth / vm.bl; |
||||
itemdefalut.height = item.elementHeight / vm.bl; |
||||
itemdefalut.fontBold = item.fontWeight == "true" ? true : false; |
||||
itemdefalut.orgFields = item.orgFields ? item.orgFields.split(',') : []; |
||||
itemdefalut.addrFields = item.addrFields ? item.addrFields.split(',') : []; |
||||
itemdefalut.fontFamily = item.fontFamily; |
||||
itemdefalut.fontSize = item.fontSize / vm.bl; |
||||
itemdefalut.fontColor = item.fontColor ? item.fontColor : ''; |
||||
itemdefalut.align = item.align; |
||||
itemdefalut.wordSpace = item.wordSpace; |
||||
itemdefalut.qrcodeType = item.qrcodeType; |
||||
itemdefalut.qrcodeUrl = item.qrcodeUrl; |
||||
|
||||
if (item.imageUrl) { |
||||
itemdefalut.imageUrl = item.imageUrl; |
||||
vm.qrImage = item.imageUrl; |
||||
} |
||||
|
||||
itemdefalut.codeType = item.codeType; |
||||
itemdefalut.itemText = item.itemText; |
||||
itemdefalut.itemType = item.itemType; |
||||
// let style = this.getItemStyle(0,itemdefalut) |
||||
itemdefalut['style'] = this.getItemStyle(i,itemdefalut) |
||||
this.items.push(itemdefalut); |
||||
} |
||||
}) |
||||
}, |
||||
getItemStyle: function(index, item) { |
||||
let vm = this |
||||
const style = { |
||||
borderColor: (index == this.currIndex ? '#FF0000' : '#CFCFCF'), |
||||
width: item.width + 'upx', |
||||
height: item.height + 'upx' |
||||
}; |
||||
|
||||
if ((item.itemType == 'qrcode' && item.qrcodeUrl) || (item.itemType == 'image' && item.imageUrl)) { |
||||
style.background = 'url(' + (item.qrcodeUrl || item.imageUrl) + ')' |
||||
style.backgroundSize = '100% 100%' |
||||
style.backgroundRepeat = 'no-repeat'; |
||||
} |
||||
|
||||
if (item.itemType == 'qrcode' && item.qrcodeUrl){ |
||||
style.background = 'url(' + item.qrcodeUrl + ')' |
||||
let itemTextBlack = item.itemText |
||||
style['itemText'] = item.itemText |
||||
style['itemTextBlack'] = itemTextBlack |
||||
style['imageUrl'] = 'url(' + item.imageUrl + ')' |
||||
this.codeObj[this.codeObj.length] = style |
||||
} |
||||
|
||||
if ((item.itemType == 'code' || item.itemType == 'org' || item.itemType == 'address' || item.itemType == 'text') && |
||||
item.itemText) { |
||||
style.color = item.fontColor; |
||||
style.textAlign = item.align; |
||||
style.fontFamily = item.fontFamily; |
||||
style.fontWeight = item.fontBold ? 'bold' : ''; |
||||
style.lineHeight = item.height + 'upx' |
||||
style.fontSize = item.fontSize + 'upx' |
||||
style.letterSpacing = item.wordSpace + 'upx' |
||||
|
||||
} |
||||
return style; |
||||
}, |
||||
workspaceStyle: function() { |
||||
let vm = this |
||||
const template = this.template; |
||||
if (!template.imageBg) { |
||||
return {}; |
||||
} |
||||
return { |
||||
backgroundRepeat: 'no-repeat', |
||||
width: template.scaleWidth / vm.bl + 'upx', |
||||
height: template.scaleHeight + 'upx', |
||||
background: 'url(' + baseUrl + '/' + template.imageBg + ')', |
||||
backgroundSize: template.scaleWidth / vm.bl + 'upx ' + template.scaleHeight / vm.bl + 'upx' |
||||
}; |
||||
}, |
||||
qrR(res){ |
||||
this.wxcode = res |
||||
if(this.val != ''){ |
||||
for (var i = 0; i < this.codeObj.length; i++) { |
||||
this.codeObj[i].background = 'url(' + this.wxcode + ')' |
||||
this.codeObj[i].itemText = '扫码支付' |
||||
console.log(this.codeObj[i]) |
||||
} |
||||
} |
||||
}, |
||||
getWxCode(code){ |
||||
if(code != undefined && code != this.val){ |
||||
this.val = code |
||||
} |
||||
if(code == undefined){ |
||||
for (var i = 0; i < this.codeObj.length; i++) { |
||||
this.val = '' |
||||
this.codeObj[i].background = this.codeObj[i].imageUrl |
||||
this.codeObj[i].itemText = this.codeObj[i].itemTextBlack |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
.menu-div { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.workspace { |
||||
width: 100%; |
||||
position: relative; |
||||
backgroundRepeat: 'no-repeat'; |
||||
} |
||||
|
||||
.template-item { |
||||
background-size: 100% 100% !important; |
||||
white-space:pre; |
||||
} |
||||
|
||||
.qrimg { |
||||
opacity: 0; |
||||
width: 0; |
||||
height: 0; |
||||
} |
||||
</style> |
||||
@ -0,0 +1,84 @@
|
||||
<template> |
||||
<view> |
||||
<text class="iconfont iconpayok i-iconpayok"></text> |
||||
<text class="pay-ok-title">付款成功</text> |
||||
<text class="moeny">{{ money }}元</text> |
||||
<navigator class="pay-ok" open-type="exit" target="miniProgram" @click="close">完成</navigator> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
document.title = '支付结果' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
money: 0 |
||||
} |
||||
}, |
||||
onLoad(val) { |
||||
this.money = val.money |
||||
}, |
||||
methods: { |
||||
close(){ |
||||
window.AlipayJSBridge.call('closeWebview') |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
.i-iconpayok { |
||||
width: 329.16upx; |
||||
height: 218.75upx; |
||||
font-size: 239.58upx; |
||||
margin-top: 164.58upx; |
||||
margin-left: 225upx; |
||||
color: #68D751; |
||||
float: left; |
||||
} |
||||
|
||||
.pay-ok-title { |
||||
width: 750upx; |
||||
height:77.08upx; |
||||
font-size:54.16upx; |
||||
font-family:PingFangSC-Semibold; |
||||
font-weight:600; |
||||
color:rgba(0,0,0,1); |
||||
line-height:77.08upx; |
||||
text-align: center; |
||||
float: left; |
||||
margin-top: 25upx; |
||||
} |
||||
|
||||
.moeny { |
||||
width: 750upx; |
||||
font-size:58.33upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color:rgba(0,0,0,1); |
||||
line-height:83.33upx; |
||||
float: left; |
||||
margin-top: 58.33upx; |
||||
text-align: center; |
||||
} |
||||
|
||||
.pay-ok { |
||||
width:354.16upx; |
||||
height:93.75upx; |
||||
background:rgba(104,215,81,1); |
||||
border-radius:52.08upx; |
||||
margin-top: 108.33upx; |
||||
margin-left: 197.91upx; |
||||
float: left; |
||||
font-size:37.5upx; |
||||
font-family:PingFangSC-Regular; |
||||
font-weight:400; |
||||
color:rgba(255,255,255,1); |
||||
line-height:93.75upx; |
||||
text-align: center; |
||||
} |
||||
|
||||
</style> |
||||
@ -0,0 +1,550 @@
|
||||
<template> |
||||
<view class="content"> |
||||
<view class="content-left" :style="{backgroundImage:`url(${bgLeft})`}"> |
||||
<view class="content-left content-left-black"> |
||||
<view class="interval-view-one"></view> |
||||
<text class="content-left-discounts"> |
||||
充值 |
||||
<text class="content-push-money">777</text> |
||||
,立享全场 |
||||
<text class="content-push-money">7</text> |
||||
折 |
||||
</text> |
||||
<view class="interval-view-two"></view> |
||||
<text class="content-left-discounts"> |
||||
账户余额 |
||||
<text class="content-push-money">1010.10</text> |
||||
元尊享 |
||||
</text> |
||||
<view class="interval-view-two"></view> |
||||
<text class="content-left-discounts"> |
||||
会议区/茶室 |
||||
</text> |
||||
<view class="interval-view-three content-left-discounts-1"> |
||||
<text class="content-left-discounts-2"> |
||||
{{ wxtitle }} |
||||
</text> |
||||
</view> |
||||
<view class="wx-code-view"> |
||||
<image class="wx-code" :src="wxcode"></image> |
||||
<view class="qrimg"> |
||||
<tki-qrcode v-if="ifShow" |
||||
ref="qrcode" |
||||
:val="val" |
||||
:size="size" |
||||
:unit="unit" |
||||
:onval="onval" |
||||
:loadMake="loadMake" |
||||
:usingComponents="true" |
||||
@result="qrR" /> |
||||
</view> |
||||
<text class="code-remark">{{ wxtitle }}</text> |
||||
</view> |
||||
<view class="interval-view-four"></view> |
||||
<text class="content-left-discounts content-left-discounts-botton"> |
||||
添加回复 |
||||
<text class="content-push-money">【 进群 】</text> |
||||
即可加入 |
||||
</text> |
||||
<view class="interval-view-two"></view> |
||||
<text class="content-left-discounts content-left-discounts-botton"> |
||||
桃子湖畔高颜值的面对面群 |
||||
</text> |
||||
</view> |
||||
</view> |
||||
<view class="content-right" :style="{backgroundImage:`url(${bgRight})`}"> |
||||
<view class="content-right content-right-black"> |
||||
<view class="tea-view"> |
||||
<view class="tea-title-view"> |
||||
<image class="tea-image" src="../../static/images/cha.png"></image> |
||||
<text class="tea-title">茶(Tea)</text> |
||||
</view> |
||||
<view class="tea-list" v-for="(tea,index) in teaList" :key="index"> |
||||
<text class="tea-name"> |
||||
<text class="tea-name-font" :class="tea.animation" :style="'animation-delay: ' + 0.16*indexName + 's;'" v-for="(name,indexName) in tea.name" :key="indexName"> |
||||
{{ name }} |
||||
</text> |
||||
</text> |
||||
<text class="tea-name tea-name-en"> |
||||
<text class="tea-name-font" :class="tea.animation" :style="'animation-delay: ' + (0.16*(tea.name.length + indexName)) + 's;'" v-for="(nameEn,indexName) in tea.nameEn" :key="indexName"> |
||||
{{ nameEn }} |
||||
</text> |
||||
</text> |
||||
<text class="tea-money"> |
||||
<text class="tea-name-font" :class="tea.animation" :style="'animation-delay: ' + (0.16*(tea.name.length + tea.nameEn.length + indexName)) + 's;'" v-for="(Imoney,indexName) in tea.money" :key="indexName"> |
||||
{{ Imoney }} |
||||
</text> |
||||
</text> |
||||
<image src="../../static/images/new.svg" class="commodity-new" v-if="tea.showNew"></image> |
||||
<image src="../../static/images/dztj.svg" class="commodity-dztj" v-if="tea.showNew === '' ? false : !tea.showNew"></image> |
||||
</view> |
||||
</view> |
||||
<view class="coffee-view"> |
||||
<view class="tea-title-view"> |
||||
<text class="tea-title coffee-title" @click="testAlertAn">咖啡(coffee)</text> |
||||
<image class="tea-image coffee-image" src="../../static/images/kafei.png"></image> |
||||
</view> |
||||
<view class="tea-list" v-for="(coffee,index) in coffeeList" :key="index"> |
||||
<text class="tea-name coffee-name"> |
||||
<text class="tea-name-font" :class="coffee.animation" :style="'animation-delay: ' + 0.16*indexName + 's;'" v-for="(name,indexName) in coffee.name" :key="indexName"> |
||||
{{ name }} |
||||
</text> |
||||
</text> |
||||
<text class="tea-name tea-name-en coffee-name-en"> |
||||
<text class="tea-name-font" :class="coffee.animation" :style="'animation-delay: ' + (0.16*(coffee.name.length + indexName)) + 's;'" v-for="(nameEn,indexName) in coffee.nameEn" :key="indexName"> |
||||
{{ nameEn }} |
||||
</text> |
||||
</text> |
||||
<text class="tea-money coffee-money"> |
||||
<text class="tea-name-font" :class="coffee.animation" :style="'animation-delay: ' + (0.16*(coffee.name.length + coffee.nameEn.length + indexName)) + 's;'" v-for="(Imoney,indexName) in coffee.money" :key="indexName"> |
||||
{{ Imoney }} |
||||
</text> |
||||
</text> |
||||
</view> |
||||
<!-- <view class="hot-view"> |
||||
<text class="hot-title">热门推荐</text> |
||||
<view class="hot-list-view"> |
||||
<view class="hot-list" v-for="(hot,index) in hotList" :key="index"> |
||||
<text class="hot-name">{{ hot.name }}</text> |
||||
<text class="hot-nameEn">{{ hot.nameEn }}</text> |
||||
<text class="hot-money">¥{{ hot.money }}</text> |
||||
</view> |
||||
</view> |
||||
</view> --> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import bgLeft from '@/static/images/yuansuleft.jpg' |
||||
import bgRight from '@/static/images/yuansuright.png' |
||||
import tkiQrcode from 'tki-qrcode/components/tki-qrcode/tki-qrcode.vue' |
||||
import webSocket from '@/utils/weSocket1.js' |
||||
import * as api from '@/api/index/index.js' |
||||
|
||||
// document.title = '商品菜单' |
||||
|
||||
export default { |
||||
components:{tkiQrcode}, |
||||
data() { |
||||
return { |
||||
storeId:'100001', |
||||
menuHtml:'', |
||||
bgLeft: bgLeft, |
||||
bgRight: bgRight, |
||||
ifShow: true, |
||||
val: 'https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4', // 要生成的二维码值 |
||||
// val: 'http://kd.biutag.com/ukeer/59c7808b-c098-41ca-abe0-e2035ce39f78&oMt0N5KE4QbBPvovuJt6OrIk_wuI', |
||||
size: 100, // 二维码大小 |
||||
unit: 'upx', // 单位 |
||||
onval: true, // val值变化时自动重新生成二维码 |
||||
loadMake: true, // 组件加载完成后自动生成二维码 |
||||
src: '', // 二维码生成后的图片地址或base64 |
||||
code: '', |
||||
wxcode: '', |
||||
wxtitle: '扫码付款', |
||||
teaList: [ |
||||
{name: '正山小种(红茶)',nameEn: 'Black tea', money: '¥20.00', showNew: '', animation: ''}, |
||||
{name: '南迫冰岛普洱(生茶)',nameEn: 'Puer tea', money: '¥29.99', showNew: true, animation: ''}, |
||||
{name: '大红袍',nameEn: 'Wuyi oolong tea', money: '¥29.99', showNew: true, animation: ''}, |
||||
{name: '雨前龙井(绿茶)',nameEn: 'Green tea', money: '¥25.99', showNew: '', animation: ''}, |
||||
{name: '冻顶(乌龙茶)',nameEn: 'Dongding oolong tea', money: '¥25.99', showNew: '', animation: ''}, |
||||
{name: '茉莉花茶',nameEn: 'Jasmine tea', money: '¥25.99', showNew: true, animation: ''}, |
||||
{name: '荔枝红茶',nameEn: 'Lychee', money: '25.99', showNew: '', animation: ''}, |
||||
{name: '玫瑰花红茶/冷萃',nameEn: 'Rose black tea', money: '¥25.99/19.99', showNew: false, animation: ''}, |
||||
{name: '蜜桃乌龙茶/冷萃',nameEn: 'Peach oolong tea', money: '¥25.99/19.99', showNew: '', animation: ''}, |
||||
{name: '桂花乌龙茶',nameEn: 'Osmanthus oolong tea', money: '¥25.99', showNew: '', animation: ''}, |
||||
{name: '苹果乌龙茶',nameEn: 'Apple oolong tea', money: '¥29.99', showNew: '', animation: ''}, |
||||
{name: '鲜牛奶',nameEn: 'Fresh Milk', money: '¥15.99', showNew: '', animation: ''}, |
||||
{name: '巴旦木/混合坚果',nameEn: 'Almond/Mixed nuts', money: '¥25.99', showNew: '', animation: ''} |
||||
], |
||||
coffeeList: [ |
||||
{name: '猿子弹咖啡(冰/热)',nameEn: 'Apesos coffee(lced/Hot)', money: '¥25.99', animation: ''}, |
||||
{name: '热防弹咖啡',nameEn: 'Hot bulletproof coffee', money: '¥25.99', animation: ''}, |
||||
{name: '爱尔兰冰猿',nameEn: 'lrish coffee', money: '¥49.99', animation: ''}, |
||||
{name: '美式(冰/热)',nameEn: 'A mericano(lced/Hot)', money: '¥19.99', animation: ''}, |
||||
{name: '卡布奇诺(热)',nameEn: 'Cappucino(Hot)', money: '¥29.99', animation: ''}, |
||||
{name: '澳白(热)',nameEn: 'Flat white(Hot)', money: '¥29.99', animation: ''}, |
||||
{name: '浓缩Espresso',nameEn: '', money: '', animation: ''}, |
||||
{name: '(Double)(Single)',nameEn: '', money: '¥15.99/19.99', animation: ''}, |
||||
{name: '手冲咖啡',nameEn: 'Pour-over coffee', money: '¥39.99', animation: ''}, |
||||
{name: '拿铁(冰/热)',nameEn: 'Latte(Lced/Hot)', money: '¥29.99', animation: ''}, |
||||
], |
||||
hotList: [ |
||||
{name: '正山小种(红茶)',nameEn: 'Black tea', money: '20.00'}, |
||||
{name: '猿子弹咖啡(冰/热)',nameEn: 'Apesos coffee(lced/Hot)', money: '25.99'}, |
||||
{name: '澳白(热)',nameEn: 'Flat white(Hot)', money: '29.99'}, |
||||
] |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getWxCode() |
||||
}, |
||||
onLoad() { |
||||
//修改时请将以下代码打开注释获取店铺id |
||||
// this.storeId=uni.getStorageSync("selectedStore"); |
||||
//发送请求获取菜单 |
||||
// this.loadMenu(); |
||||
this.getWxCode() |
||||
webSocket.getWebSocket(this); |
||||
// this.getWxCode('https://kd.biutag.com:9903/user/weChat_or_ali/' + uni.getStorageSync('openId')); |
||||
}, |
||||
onShow() { |
||||
// uni.setStorageSync("wxObj", this) |
||||
}, |
||||
methods: { |
||||
loadMenu(){ |
||||
let query={ |
||||
storeId:this.storeId |
||||
} |
||||
api.showStoreMenu(query).then(res=>{ |
||||
if(res.code==0){//菜单获取成功 |
||||
this.menuHtml=res.data.commodityMenuHtml; |
||||
}else{ |
||||
uni.showToast({ |
||||
title:"菜单获取失败", |
||||
icon:"none" |
||||
}) |
||||
} |
||||
}) |
||||
}, |
||||
qrR(res){ |
||||
this.wxcode = res |
||||
}, |
||||
getWxCode(code){ |
||||
if(code == undefined){ |
||||
this.val = 'https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4' |
||||
// this.val = 'http://kd.biutag.com/ukeer/59c7808b-c098-41ca-abe0-e2035ce39f78&oMt0N5KE4QbBPvovuJt6OrIk_wuI' |
||||
this.wxtitle = '扫码进群' |
||||
}else { |
||||
this.val = code |
||||
this.wxtitle = '扫码付款' |
||||
} |
||||
}, |
||||
testAlertAn(){ |
||||
this.teaList[5].animation = 'animation-font' |
||||
}, |
||||
VXCode(val){ |
||||
uni.setStorageSync('id', val) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
|
||||
page { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.content { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.content-left { |
||||
width: 18.69%; |
||||
height: 100%; |
||||
/* background: url("~@/static/images/yuansuleft.jpg"); */ |
||||
background-size: 100% 100%; |
||||
float: left; |
||||
} |
||||
|
||||
.content-right { |
||||
width: 81.31%; |
||||
height: 100%; |
||||
/* background: url("../../static/images/yuansuright.png"); */ |
||||
background-size: 100% 100%; |
||||
float: left; |
||||
} |
||||
|
||||
.content-left-black { |
||||
width: 100%; |
||||
background:rgba(0,0,0,0.7); |
||||
} |
||||
|
||||
.content-right-black { |
||||
width: 100%; |
||||
background:rgba(0,0,0,0.85); |
||||
} |
||||
|
||||
.interval-view-one { |
||||
width: 100%; |
||||
height: 11%; |
||||
} |
||||
|
||||
.content-left-discounts { |
||||
margin-left: 8.36%; |
||||
font-size: 28%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
color:rgba(255,255,255,1); |
||||
float: left; |
||||
} |
||||
|
||||
.content-left-discounts-1 { |
||||
width: 100%; |
||||
font-size: 28%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
color:rgba(255,255,255,1); |
||||
text-align: center; |
||||
float: left; |
||||
margin-top: 20%; |
||||
} |
||||
|
||||
.content-left-discounts-2 { |
||||
margin-top: 60%; |
||||
} |
||||
|
||||
.content-push-money { |
||||
color: #E26910; |
||||
} |
||||
|
||||
.interval-view-two { |
||||
width: 100%; |
||||
height: 1.61%; |
||||
float: left; |
||||
} |
||||
|
||||
.interval-view-three { |
||||
width: 100%; |
||||
height: 4.51%; |
||||
float: left; |
||||
} |
||||
|
||||
.wx-code-view { |
||||
width: 79.38%; |
||||
height: 26.38%; |
||||
margin-top: 8.51%; |
||||
margin: 0 auto; |
||||
clear: left; |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.wx-code { |
||||
width: 70.71%; |
||||
height: 70.71%; |
||||
margin-left: 15.08%; |
||||
margin-top: 9.82%; |
||||
} |
||||
|
||||
.code-remark { |
||||
width: 100%; |
||||
font-size:24%; |
||||
font-family:PingFangSC-Regular; |
||||
color:rgba(3,3,3,1); |
||||
text-align: center; |
||||
margin-top: -2%; |
||||
line-height: 20.35%; |
||||
float: left; |
||||
} |
||||
|
||||
.interval-view-four { |
||||
height: 4.5%; |
||||
width: 100%; |
||||
float: left; |
||||
} |
||||
|
||||
.content-left-discounts-botton { |
||||
margin-left: 2.78%; |
||||
} |
||||
|
||||
.tea-view { |
||||
width:57.42%; |
||||
height: 100%; |
||||
float: left; |
||||
} |
||||
|
||||
.tea-title-view { |
||||
width: 100%; |
||||
height: 11.94%; |
||||
} |
||||
|
||||
.tea-image { |
||||
width: 7.8%; |
||||
height: 87.59%; |
||||
margin-top: 0; |
||||
margin-left: 18.39%; |
||||
float: left; |
||||
} |
||||
|
||||
.tea-title { |
||||
font-size:30%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
margin-left: 10.81%; |
||||
margin-top: 4.72%; |
||||
float: left; |
||||
} |
||||
|
||||
.tea-list { |
||||
width: 100%; |
||||
height: 6.75%; |
||||
position: relative; |
||||
} |
||||
|
||||
.tea-name { |
||||
font-size:30%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 7.8%; |
||||
} |
||||
|
||||
.tea-name-en { |
||||
font-size: 20%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 39.13%; |
||||
top: 16%; |
||||
} |
||||
|
||||
.tea-money { |
||||
font-size:24%; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:500; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
right: 16.38%; |
||||
top: 9.58%; |
||||
} |
||||
|
||||
.commodity-new { |
||||
width: 5.46%; |
||||
height: 78.68%; |
||||
position: absolute; |
||||
right: 10.36%; |
||||
} |
||||
|
||||
.commodity-dztj { |
||||
width: 4.01%; |
||||
height: 62.29%; |
||||
position: absolute; |
||||
right: 11.48%; |
||||
} |
||||
|
||||
.coffee-view { |
||||
width: 42.58%; |
||||
height: 100%; |
||||
float: left; |
||||
} |
||||
|
||||
.coffee-title { |
||||
margin-left: 30.97%; |
||||
} |
||||
|
||||
.coffee-image { |
||||
width: 13.83%; |
||||
height: 89.92%; |
||||
margin-left: 3.75%; |
||||
} |
||||
|
||||
.coffee-name { |
||||
left: 0; |
||||
} |
||||
|
||||
.coffee-name-en { |
||||
left: 40.45%; |
||||
} |
||||
|
||||
.coffee-money { |
||||
right: 9.77%; |
||||
} |
||||
|
||||
.hot-view { |
||||
width: 115.33%; |
||||
height: 33.7%; |
||||
margin-left: -15.33%; |
||||
margin-top: -3.42%; |
||||
background: url(../../static/images/hua.png); |
||||
background-size: 100% 100%; |
||||
position: relative; |
||||
} |
||||
|
||||
.hot-title { |
||||
font-size:36%; |
||||
font-family:HannotateSC-W5; |
||||
font-weight:bold; |
||||
color:rgba(247,128,22,1); |
||||
position: absolute; |
||||
left: 26.33%; |
||||
top: 21.7%; |
||||
} |
||||
|
||||
.hot-list-view { |
||||
width: 100%; |
||||
height: 61.27%; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 38.73%; |
||||
} |
||||
|
||||
.hot-list { |
||||
width: 100%; |
||||
height: 28.25%; |
||||
position: relative; |
||||
} |
||||
|
||||
.hot-name { |
||||
font-size:18%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 30.37%; |
||||
} |
||||
|
||||
.hot-nameEn { |
||||
font-size:15%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 30.37%; |
||||
top: 44.44%; |
||||
} |
||||
|
||||
.hot-money { |
||||
font-size:15%; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:500; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
right: 13.03%; |
||||
} |
||||
|
||||
.qrimg { |
||||
opacity: 0; |
||||
width: 0; |
||||
height: 0; |
||||
} |
||||
|
||||
.tea-name-font { |
||||
float: left; |
||||
} |
||||
|
||||
@keyframes style1 { |
||||
from, 20%, 53%, 80%, to { |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
transform: translate3d(0,0.5,0.1); |
||||
} |
||||
40%, 43% { |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
transform: translate3d(0px, -80%, 0); |
||||
} |
||||
} |
||||
|
||||
.animation-font { |
||||
animation-duration: 0.32s; |
||||
animation-fill-mode: both; |
||||
animation-name: style1; |
||||
} |
||||
|
||||
|
||||
</style> |
||||
@ -0,0 +1,50 @@
|
||||
|
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 1211732 */ |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot'); |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff2') format('woff2'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.svg#iconfont') format('svg'); |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 33.33upx; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.iconnew:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icondztj:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.iconwallet:before { |
||||
content: "\e641"; |
||||
} |
||||
|
||||
.iconzfbpay:before { |
||||
content: "\e643"; |
||||
} |
||||
|
||||
.iconalipaylogo:before { |
||||
content: "\e648"; |
||||
} |
||||
|
||||
.iconwechatlogo:before { |
||||
content: "\e647"; |
||||
} |
||||
|
||||
.iconpayok:before { |
||||
content: "\e644"; |
||||
} |
||||
|
||||
.iconjian:before { |
||||
content: "\e663"; |
||||
} |
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 241 KiB |
@ -0,0 +1,76 @@
|
||||
/** |
||||
* 这里是uni-app内置的常用样式变量 |
||||
* |
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 |
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App |
||||
* |
||||
*/ |
||||
|
||||
/** |
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 |
||||
* |
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 |
||||
*/ |
||||
|
||||
/* 颜色变量 */ |
||||
|
||||
/* 行为相关颜色 */ |
||||
$uni-color-primary: #007aff; |
||||
$uni-color-success: #4cd964; |
||||
$uni-color-warning: #f0ad4e; |
||||
$uni-color-error: #dd524d; |
||||
|
||||
/* 文字基本颜色 */ |
||||
$uni-text-color:#333;//基本色 |
||||
$uni-text-color-inverse:#fff;//反色 |
||||
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 |
||||
$uni-text-color-placeholder: #808080; |
||||
$uni-text-color-disable:#c0c0c0; |
||||
|
||||
/* 背景颜色 */ |
||||
$uni-bg-color:#ffffff; |
||||
$uni-bg-color-grey:#f8f8f8; |
||||
$uni-bg-color-hover:#f1f1f1;//点击状态颜色 |
||||
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 |
||||
|
||||
/* 边框颜色 */ |
||||
$uni-border-color:#c8c7cc; |
||||
|
||||
/* 尺寸变量 */ |
||||
|
||||
/* 文字尺寸 */ |
||||
$uni-font-size-sm:24upx; |
||||
$uni-font-size-base:28upx; |
||||
$uni-font-size-lg:32upx; |
||||
|
||||
/* 图片尺寸 */ |
||||
$uni-img-size-sm:40upx; |
||||
$uni-img-size-base:52upx; |
||||
$uni-img-size-lg:80upx; |
||||
|
||||
/* Border Radius */ |
||||
$uni-border-radius-sm: 4upx; |
||||
$uni-border-radius-base: 6upx; |
||||
$uni-border-radius-lg: 12upx; |
||||
$uni-border-radius-circle: 50%; |
||||
|
||||
/* 水平间距 */ |
||||
$uni-spacing-row-sm: 10px; |
||||
$uni-spacing-row-base: 20upx; |
||||
$uni-spacing-row-lg: 30upx; |
||||
|
||||
/* 垂直间距 */ |
||||
$uni-spacing-col-sm: 8upx; |
||||
$uni-spacing-col-base: 16upx; |
||||
$uni-spacing-col-lg: 24upx; |
||||
|
||||
/* 透明度 */ |
||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 |
||||
|
||||
/* 文章场景相关 */ |
||||
$uni-color-title: #2C405A; // 文章标题颜色 |
||||
$uni-font-size-title:40upx; |
||||
$uni-color-subtitle: #555555; // 二级标题颜色 |
||||
$uni-font-size-subtitle:36upx; |
||||
$uni-color-paragraph: #3F536E; // 文章段落颜色 |
||||
$uni-font-size-paragraph:30upx; |
||||
@ -0,0 +1,4 @@
|
||||
|
||||
require('./common/runtime.js') |
||||
require('./common/vendor.js') |
||||
require('./common/main.js') |
||||
@ -0,0 +1,23 @@
|
||||
{ |
||||
"pages": [ |
||||
"pages/confirm-code/confirm-code", |
||||
"pages/store-commodity/store-commodity", |
||||
"pages/menu/menu" |
||||
], |
||||
"window": { |
||||
"navigationBarTextStyle": "black", |
||||
"navigationBarTitleText": "uni-app", |
||||
"navigationBarBackgroundColor": "#F8F8F8", |
||||
"backgroundColor": "#F8F8F8", |
||||
"navigationStyle": "custom" |
||||
}, |
||||
"nvueCompiler": "weex", |
||||
"renderer": "auto", |
||||
"splashscreen": { |
||||
"alwaysShowBeforeRender": true, |
||||
"autoclose": false |
||||
}, |
||||
"appname": "优客菜单", |
||||
"compilerVersion": "2.2.2", |
||||
"usingComponents": {} |
||||
} |
||||
@ -0,0 +1 @@
|
||||
@import './common/main.wxss'; |
||||
@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{"375e":function(n,o,t){"use strict";t.r(o);var u=t("cf8a"),e=t.n(u);for(var a in u)"default"!==a&&function(n){t.d(o,n,function(){return u[n]})}(a);o["default"]=e.a},"69aa":function(n,o,t){"use strict";var u=t("8132"),e=t.n(u);e.a},8132:function(n,o,t){},"9bd1":function(n,o,t){"use strict";t.r(o);var u=t("375e");for(var e in u)"default"!==e&&function(n){t.d(o,n,function(){return u[n]})}(e);t("69aa");var a,c,l=t("2877"),f=Object(l["a"])(u["default"],a,c,!1,null,null,null);o["default"]=f.exports},cf8a:function(n,o,t){"use strict";(function(n){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var t={onLaunch:function(){console.log(n("App Launch"," at App.vue:4"))},onShow:function(){console.log(n("App Show"," at App.vue:7"))},onHide:function(){console.log(n("App Hide"," at App.vue:10"))}};o.default=t}).call(this,t("0de9")["default"])}},[["74cf","common/runtime","common/vendor"]]]); |
||||
@ -0,0 +1,61 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*每个页面公共css */ |
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 1211732 */ |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot'); |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff2') format('woff2'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.svg#iconfont') format('svg'); |
||||
} |
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 33.33rpx; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
.iconnew:before { |
||||
content: "\E63D"; |
||||
} |
||||
.icondztj:before { |
||||
content: "\E63E"; |
||||
} |
||||
.iconwallet:before { |
||||
content: "\E641"; |
||||
} |
||||
.iconzfbpay:before { |
||||
content: "\E643"; |
||||
} |
||||
.iconalipaylogo:before { |
||||
content: "\E648"; |
||||
} |
||||
.iconwechatlogo:before { |
||||
content: "\E647"; |
||||
} |
||||
.iconpayok:before { |
||||
content: "\E644"; |
||||
} |
||||
.iconjian:before { |
||||
content: "\E663"; |
||||
} |
||||
page { |
||||
background-color: #F7F7F7; |
||||
} |
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
(function(e){function t(t){for(var n,o,a=t[0],c=t[1],l=t[2],s=0,d=[];s<a.length;s++)o=a[s],u[o]&&d.push(u[o][0]),u[o]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);f&&f(t);while(d.length)d.shift()();return i.push.apply(i,l||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,o=1;o<r.length;o++){var a=r[o];0!==u[a]&&(n=!1)}n&&(i.splice(t--,1),e=c(c.s=r[0]))}return e}var n={},o={"common/runtime":0},u={"common/runtime":0},i=[];function a(e){return c.p+""+e+".js"}function c(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,c),r.l=!0,r.exports}c.e=function(e){var t=[],r={"node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode":1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=new Promise(function(t,r){for(var n=({"node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode":"node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}[e]||e)+".wxss",u=c.p+n,i=document.getElementsByTagName("link"),a=0;a<i.length;a++){var l=i[a],s=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(s===n||s===u))return t()}var d=document.getElementsByTagName("style");for(a=0;a<d.length;a++){l=d[a],s=l.getAttribute("data-href");if(s===n||s===u)return t()}var f=document.createElement("link");f.rel="stylesheet",f.type="text/css",f.onload=t,f.onerror=function(t){var n=t&&t.target&&t.target.src||u,i=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");i.request=n,delete o[e],f.parentNode.removeChild(f),r(i)},f.href=u;var p=document.getElementsByTagName("head")[0];p.appendChild(f)}).then(function(){o[e]=0}));var n=u[e];if(0!==n)if(n)t.push(n[2]);else{var i=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=i);var l,s=document.createElement("script");s.charset="utf-8",s.timeout=120,c.nc&&s.setAttribute("nonce",c.nc),s.src=a(e),l=function(t){s.onerror=s.onload=null,clearTimeout(d);var r=u[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,i=new Error("Loading chunk "+e+" failed.\n("+n+": "+o+")");i.type=n,i.request=o,r[1](i)}u[e]=void 0}};var d=setTimeout(function(){l({type:"timeout",target:s})},12e4);s.onerror=s.onload=l,document.head.appendChild(s)}return Promise.all(t)},c.m=e,c.c=n,c.d=function(e,t,r){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(c.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)c.d(r,n,function(t){return e[t]}.bind(null,n));return r},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/",c.oe=function(e){throw console.error(e),e};var l=global["webpackJsonp"]=global["webpackJsonp"]||[],s=l.push.bind(l);l.push=t,l=l.slice();for(var d=0;d<l.length;d++)t(l[d]);var f=s;r()})([]); |
||||
@ -0,0 +1,126 @@
|
||||
{ |
||||
"@platforms": [ |
||||
"android", |
||||
"iPhone", |
||||
"iPad" |
||||
], |
||||
"id": "__UNI__A096421", |
||||
"name": "优客菜单", |
||||
"version": { |
||||
"name": "1.0.0", |
||||
"code": "100" |
||||
}, |
||||
"description": "", |
||||
"launch_path": "__uniappview.html", |
||||
"developer": { |
||||
"name": "", |
||||
"email": "", |
||||
"url": "" |
||||
}, |
||||
"permissions": { |
||||
"UniNView": { |
||||
"description": "UniNView原生渲染" |
||||
} |
||||
}, |
||||
"plus": { |
||||
"useragent": { |
||||
"value": "uni-app appservice", |
||||
"concatenate": true |
||||
}, |
||||
"splashscreen": { |
||||
"target": "id:1", |
||||
"autoclose": true, |
||||
"waiting": true, |
||||
"delay": 0 |
||||
}, |
||||
"popGesture": "close", |
||||
"launchwebview": { |
||||
"render": "always", |
||||
"id": "1", |
||||
"kernel": "WKWebview" |
||||
}, |
||||
"statusbar": { |
||||
"immersed": "supportedDevice", |
||||
"style": "dark", |
||||
"background": "#F8F8F8" |
||||
}, |
||||
"usingComponents": true, |
||||
"distribute": { |
||||
"icons": { |
||||
"ios": { |
||||
"appstore": "C:/Users/艺术生/Desktop/摄像头文档/微信图片_20190710100225.png", |
||||
"ipad": { |
||||
"app": "unpackage/res/icons/76x76.png", |
||||
"app@2x": "unpackage/res/icons/152x152.png", |
||||
"notification": "unpackage/res/icons/20x20.png", |
||||
"notification@2x": "unpackage/res/icons/40x40.png", |
||||
"proapp@2x": "unpackage/res/icons/167x167.png", |
||||
"settings": "unpackage/res/icons/29x29.png", |
||||
"settings@2x": "unpackage/res/icons/58x58.png", |
||||
"spotlight": "unpackage/res/icons/40x40.png", |
||||
"spotlight@2x": "unpackage/res/icons/80x80.png" |
||||
}, |
||||
"iphone": { |
||||
"app@2x": "unpackage/res/icons/120x120.png", |
||||
"app@3x": "unpackage/res/icons/180x180.png", |
||||
"notification@2x": "unpackage/res/icons/40x40.png", |
||||
"notification@3x": "unpackage/res/icons/60x60.png", |
||||
"settings@2x": "unpackage/res/icons/58x58.png", |
||||
"settings@3x": "unpackage/res/icons/87x87.png", |
||||
"spotlight@2x": "unpackage/res/icons/80x80.png", |
||||
"spotlight@3x": "unpackage/res/icons/120x120.png" |
||||
} |
||||
}, |
||||
"android": { |
||||
"hdpi": "unpackage/res/icons/72x72.png", |
||||
"ldpi": "unpackage/res/icons/48x48.png", |
||||
"mdpi": "unpackage/res/icons/48x48.png", |
||||
"xhdpi": "unpackage/res/icons/96x96.png", |
||||
"xxhdpi": "unpackage/res/icons/144x144.png", |
||||
"xxxhdpi": "unpackage/res/icons/192x192.png" |
||||
} |
||||
}, |
||||
"google": { |
||||
"permissions": [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||
] |
||||
}, |
||||
"apple": {}, |
||||
"plugins": { |
||||
"audio": { |
||||
"mp3": { |
||||
"description": "Android平台录音支持MP3格式文件" |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
"allowsInlineMediaPlayback": true, |
||||
"uni-app": { |
||||
"compilerVersion": "2.2.2", |
||||
"control": "v8", |
||||
"nvueCompiler": "weex", |
||||
"renderer": "auto" |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,10 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"],{"225f":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o,i=u(n("6eed"));function u(t){return t&&t.__esModule?t:{default:t}}var a={name:"tki-qrcode",props:{size:{type:Number,default:200},unit:{type:String,default:"upx"},show:{type:Boolean,default:!0},val:{type:String,default:""},background:{type:String,default:"#ffffff"},foreground:{type:String,default:"#000000"},pdground:{type:String,default:"#000000"},icon:{type:String,default:""},iconSize:{type:Number,default:40},lv:{type:Number,default:3},onval:{type:Boolean,default:!1},loadMake:{type:Boolean,default:!1},usingComponents:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},loadingText:{type:String,default:"二维码生成中"}},data:function(){return{result:""}},methods:{_makeCode:function(){var e=this;this._empty(this.val)?t.showToast({title:"二维码内容不能为空",icon:"none",duration:2e3}):o=new i.default({context:e,usingComponents:e.usingComponents,showLoading:e.showLoading,loadingText:e.loadingText,text:e.val,size:e.cpSize,background:e.background,foreground:e.foreground,pdground:e.pdground,correctLevel:e.lv,image:e.icon,imageSize:e.iconSize,cbResult:function(t){e._result(t)}})},_clearCode:function(){this._result(""),o.clear()},_saveCode:function(){var e=this;""!=this.result&&t.saveImageToPhotosAlbum({filePath:e.result,success:function(){t.showToast({title:"二维码保存成功",icon:"success",duration:2e3})}})},_result:function(t){this.result=t,this.$emit("result",t)},_empty:function(t){var e=typeof t,n=!1;return"number"==e&&""==String(t)?n=!0:"undefined"==e?n=!0:"object"==e?"{}"!=JSON.stringify(t)&&"[]"!=JSON.stringify(t)&&null!=t||(n=!0):"string"==e?""!=t&&"undefined"!=t&&"null"!=t&&"{}"!=t&&"[]"!=t||(n=!0):"function"==e&&(n=!1),n}},watch:{size:function(t,e){var n=this;t==e||this._empty(t)||(this.cSize=t,this._empty(this.val)||setTimeout(function(){n._makeCode()},100))},val:function(t,e){var n=this;this.onval&&(t==e||this._empty(t)||setTimeout(function(){n._makeCode()},0))}},computed:{cpSize:function(){return"upx"==this.unit?t.upx2px(this.size):this.size}},mounted:function(){var t=this;this.loadMake&&(this._empty(this.val)||setTimeout(function(){t._makeCode()},0))}};e.default=a}).call(this,n("6e42")["default"])},"6e82":function(t,e,n){"use strict";n.r(e);var o=n("c2e0"),i=n("b041");for(var u in i)"default"!==u&&function(t){n.d(e,t,function(){return i[t]})}(u);n("874a");var a=n("2877"),r=Object(a["a"])(i["default"],o["a"],o["b"],!1,null,null,null);e["default"]=r.exports},"85b7":function(t,e,n){},"874a":function(t,e,n){"use strict";var o=n("85b7"),i=n.n(o);i.a},b041:function(t,e,n){"use strict";n.r(e);var o=n("225f"),i=n.n(o);for(var u in o)"default"!==u&&function(t){n.d(e,t,function(){return o[t]})}(u);e["default"]=i.a},c2e0:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement;t._self._c},i=[];n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i})}}]); |
||||
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ |
||||
'node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode-create-component', |
||||
{ |
||||
'node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode-create-component':(function(module, exports, __webpack_require__){ |
||||
__webpack_require__('6e42')['createComponent'](__webpack_require__("6e82")) |
||||
}) |
||||
}, |
||||
[['node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode-create-component']] |
||||
]);
|
||||
@ -0,0 +1,4 @@
|
||||
{ |
||||
"usingComponents": {}, |
||||
"component": true |
||||
} |
||||
@ -0,0 +1 @@
|
||||
<view class="_qrCode"><canvas class="_qrCodeCanvas" style="{{'width:'+(cpSize+'px')+';'+('height:'+(cpSize+'px')+';')}}" id="_myQrCodeCanvas" canvas-id="_myQrCodeCanvas"></canvas><image hidden="{{!(show)}}" style="{{'width:'+(cpSize+'px')+';'+('height:'+(cpSize+'px')+';')}}" src="{{result}}"></image></view> |
||||
@ -0,0 +1,11 @@
|
||||
|
||||
._qrCode { |
||||
position: relative; |
||||
} |
||||
._qrCodeCanvas { |
||||
position: fixed; |
||||
top: -99999rpx; |
||||
left: -99999rpx; |
||||
z-index: -99999; |
||||
} |
||||
|
||||
@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/confirm-code/confirm-code"],{"0efd":function(e,t,n){"use strict";n.r(t);var o=n("456f"),r=n("6118");for(var c in r)"default"!==c&&function(e){n.d(t,e,function(){return r[e]})}(c);n("246d");var u=n("2877"),i=Object(u["a"])(r["default"],o["a"],o["b"],!1,null,null,null);t["default"]=i.exports},"246d":function(e,t,n){"use strict";var o=n("7a69"),r=n.n(o);r.a},"421a":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;n("71c0");var o=u(n("596e")),r=c(n("9bdb"));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};o.get||o.set?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,t}var i=function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode")]).then(n.bind(null,"6e82"))},a={components:{tkiQrcode:i},data:function(){return{val:"https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4",showCode:!1,socketMsgQueue:""}},onLoad:function(){this.checkLogin()},onShow:function(){},methods:{checkLogin:function(){var t=this;o.checkLogin().then(function(n){"success"==n.message?e.redirectTo({url:"/pages/store-commodity/store-commodity"}):(t.showCode=!0,t.getWebSocketRes())})},VXCode:function(t){this.showCode=!0,this.val=t,e.setStorageSync("id",t)},loginPage:function(t){e.setStorageSync("openId",t.openId),e.redirectTo({url:"/pages/menu/menu?id="+t.menuId})},getWebSocketRes:function(){var t=r.default.getWebSocket(this);e.setStorageSync("socket",t)}}};t.default=a}).call(this,n("6e42")["default"])},"456f":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement;e._self._c},r=[];n.d(t,"a",function(){return o}),n.d(t,"b",function(){return r})},6118:function(e,t,n){"use strict";n.r(t);var o=n("421a"),r=n.n(o);for(var c in o)"default"!==c&&function(e){n.d(t,e,function(){return o[e]})}(c);t["default"]=r.a},"7a69":function(e,t,n){}},[["dcd5","common/runtime","common/vendor"]]]); |
||||
@ -0,0 +1,5 @@
|
||||
{ |
||||
"usingComponents": { |
||||
"tki-qrcode": "/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode" |
||||
} |
||||
} |
||||
@ -0,0 +1 @@
|
||||
<block wx:if="{{showCode}}"><view><view class="code-view"><tki-qrcode class="vue-ref" vue-id="1" val="{{val}}" size="{{100}}" unit="upx" onval="{{true}}" loadMake="{{true}}" showLoading="{{false}}" usingComponents="{{true}}" data-ref="qrcode" bind:__l="__l"></tki-qrcode></view><text class="code-text">请使用微信扫码验证</text></view></block> |
||||
@ -0,0 +1,22 @@
|
||||
|
||||
page{ |
||||
background: #f5f5f5; |
||||
} |
||||
.code-view{ |
||||
position: absolute; |
||||
left: calc(50% - 50rpx); |
||||
top: calc(50% - 60rpx); |
||||
width: 100rpx; |
||||
height: 100rpx; |
||||
} |
||||
.code-text{ |
||||
position: absolute; |
||||
width: 100rpx; |
||||
text-align: center; |
||||
font-size:10.41rpx; |
||||
left: calc(50% - 50rpx); |
||||
top: calc(50% + 60rpx); |
||||
display: block; |
||||
} |
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/menu/menu"],{7889:function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement;e._self._c},l=[];i.d(t,"a",function(){return a}),i.d(t,"b",function(){return l})},"97a9":function(e,t,i){"use strict";i.r(t);var a=i("dfa8"),l=i.n(a);for(var o in a)"default"!==o&&function(e){i.d(t,e,function(){return a[e]})}(o);t["default"]=l.a},c7f2:function(e,t,i){},d628:function(e,t,i){"use strict";i.r(t);var a=i("7889"),l=i("97a9");for(var o in l)"default"!==o&&function(e){i.d(t,e,function(){return l[e]})}(o);i("f596");var n=i("2877"),r=Object(n["a"])(l["default"],a["a"],a["b"],!1,null,null,null);t["default"]=r.exports},dfa8:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i("596e"),l=o(i("a4ea"));function o(e){return e&&e.__esModule?e:{default:e}}var n=function(){return Promise.all([i.e("common/vendor"),i.e("node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode")]).then(i.bind(null,"6e82"))},r="https://fsb.biutag.com:9900/ukeer-pc",d=(document.body.clientWidth,{components:{tkiQrcode:n},data:function(){return{id:"6fdfec14-8a86-4ae5-9c3a-8a098fe08726",baseUrl:"https://fsb.biutag.com:9900/ukeer-pc",template:{templateId:"",name:"",imageBg:"",imageReal:"",realWidth:0,realHeight:0,scaleWidth:450,scaleHeight:600,scale:0,bl:""},ifShow:!0,items:[],val:"",size:100,unit:"upx",onval:!0,loadMake:!0,src:"",wxcode:void 0,codeObj:[]}},mounted:function(){},onLoad:function(e){this.id=e.id,this.bl=this.template.scaleWidth/750,this.getTemplate(),l.default.getWebSocket(this)},methods:{getTemplate:function(){var e=this,t={id:this.id},i=this;(0,a.getTemplate)(t).then(function(t){var a=t.data;i.template.templateId=a.templateId,i.template.name=a.templateName,i.template.imageReal=a.imageReal,i.template.imageBg=a.imageBg,i.template.realWidth=a.realWidth,i.template.realHeight=a.realHeight,i.template.scaleWidth=a.scaleWidth/i.bl,i.template.scaleHeight=a.scaleHeight/i.bl,i.template.scale=a.scale,i.imageBg=r+"/"+a.imageBg;for(var l=0;l<a.elementList.length;l++){var o=a.elementList[l],n={};n.x=o.elementX/i.bl,n.y=o.elementY/i.bl,n.width=o.elementWidth/i.bl,n.height=o.elementHeight/i.bl,n.fontBold="true"==o.fontWeight,n.orgFields=o.orgFields?o.orgFields.split(","):[],n.addrFields=o.addrFields?o.addrFields.split(","):[],n.fontFamily=o.fontFamily,n.fontSize=o.fontSize/i.bl,n.fontColor=o.fontColor?o.fontColor:"",n.align=o.align,n.wordSpace=o.wordSpace,n.qrcodeType=o.qrcodeType,n.qrcodeUrl=o.qrcodeUrl,o.imageUrl&&(n.imageUrl=o.imageUrl,i.qrImage=o.imageUrl),n.codeType=o.codeType,n.itemText=o.itemText,n.itemType=o.itemType,n["style"]=e.getItemStyle(l,n),e.items.push(n)}})},getItemStyle:function(e,t){var i={borderColor:e==this.currIndex?"#FF0000":"#CFCFCF",width:t.width+"upx",height:t.height+"upx"};if(("qrcode"==t.itemType&&t.qrcodeUrl||"image"==t.itemType&&t.imageUrl)&&(i.background="url("+(t.qrcodeUrl||t.imageUrl)+")",i.backgroundSize="100% 100%",i.backgroundRepeat="no-repeat"),"qrcode"==t.itemType&&t.qrcodeUrl){i.background="url("+t.qrcodeUrl+")";var a=t.itemText;i["itemText"]=t.itemText,i["itemTextBlack"]=a,i["imageUrl"]="url("+t.imageUrl+")",this.codeObj[this.codeObj.length]=i}return"code"!=t.itemType&&"org"!=t.itemType&&"address"!=t.itemType&&"text"!=t.itemType||!t.itemText||(i.color=t.fontColor,i.textAlign=t.align,i.fontFamily=t.fontFamily,i.fontWeight=t.fontBold?"bold":"",i.lineHeight=t.height+"upx",i.fontSize=t.fontSize+"upx",i.letterSpacing=t.wordSpace+"upx"),i},workspaceStyle:function(){var e=this,t=this.template;return t.imageBg?{backgroundRepeat:"no-repeat",width:t.scaleWidth/e.bl+"upx",height:t.scaleHeight+"upx",background:"url("+r+"/"+t.imageBg+")",backgroundSize:t.scaleWidth/e.bl+"upx "+t.scaleHeight/e.bl+"upx"}:{}},qrR:function(t){if(this.wxcode=t,""!=this.val)for(var i=0;i<this.codeObj.length;i++)this.codeObj[i].background="url("+this.wxcode+")",this.codeObj[i].itemText="扫码支付",console.log(e(this.codeObj[i]," at pages/menu/menu.vue:174"))},getWxCode:function(e){if(void 0!=e&&e!=this.val&&(this.val=e),void 0==e)for(var t=0;t<this.codeObj.length;t++)this.val="",this.codeObj[t].background=this.codeObj[t].imageUrl,this.codeObj[t].itemText=this.codeObj[t].itemTextBlack}}});t.default=d}).call(this,i("0de9")["default"])},f596:function(e,t,i){"use strict";var a=i("c7f2"),l=i.n(a);l.a}},[["ec00","common/runtime","common/vendor"]]]); |
||||
@ -0,0 +1,5 @@
|
||||
{ |
||||
"usingComponents": { |
||||
"tki-qrcode": "/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode" |
||||
} |
||||
} |
||||
@ -0,0 +1 @@
|
||||
<view class="menu-div"><block wx:if="{{template.imageBg}}"><view class="workspace" style="{{('width:'+template.scaleWidth+'upx;height:'+template.scaleHeight+'upx;background: url('+baseUrl+'/'+template.imageBg+');backgroundSize:'+template.scaleWidth+'upx '+template.scaleHeight+'upx;')}}"><block wx:for="{{items}}" wx:for-item="citem" wx:for-index="index" wx:key="index"><view style="{{('position: absolute;top:'+citem.y+'upx;left:'+citem.x+'upx;z-index:'+index+';width:'+citem.width+'upx;height:'+citem.height+'upx')}}"><view class="template-item" style="{{(citem.style)}}"><text style="{{(citem.itemType=='qrcode'?'background: #FFFFFF;position:absolute;width:100%;top:'+citem.height+'upx;text-align:'+citem.align+';font-size:'+citem.fontSize+'upx;letter-spacing:'+citem.wordSpace+'upx;font-family:'+citem.fontFamily:'')}}">{{citem.style.itemText}}</text></view></view></block><view class="qrimg"><block wx:if="{{ifShow}}"><tki-qrcode class="vue-ref" vue-id="1" val="{{val}}" size="{{size}}" unit="{{unit}}" onval="{{onval}}" loadMake="{{loadMake}}" usingComponents="{{true}}" data-ref="qrcode" data-event-opts="{{[['^result',[['qrR']]]]}}" bind:result="__e" bind:__l="__l"></tki-qrcode></block></view></view></block></view> |
||||
@ -0,0 +1,19 @@
|
||||
|
||||
.menu-div { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.workspace { |
||||
width: 100%; |
||||
position: relative; |
||||
backgroundRepeat: 'no-repeat'; |
||||
} |
||||
.template-item { |
||||
background-size: 100% 100% !important; |
||||
} |
||||
.qrimg { |
||||
opacity: 0; |
||||
width: 0; |
||||
height: 0; |
||||
} |
||||
|
||||
@ -0,0 +1 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/store-commodity/store-commodity"],{"1d13":function(n,e,o){},2788:function(n,e,o){"use strict";var t=o("1d13"),a=o.n(t);a.a},"357d":function(n,e,o){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(o("05a7")),a=r(o("a27f")),i=r(o("a4ea")),m=c(o("596e"));function c(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var t=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(n,o):{};t.get||t.set?Object.defineProperty(e,o,t):e[o]=n[o]}return e.default=n,e}function r(n){return n&&n.__esModule?n:{default:n}}var s=function(){return Promise.all([o.e("common/vendor"),o.e("node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode")]).then(o.bind(null,"6e82"))},u={components:{tkiQrcode:s},data:function(){return{storeId:"100001",menuHtml:"",bgLeft:t.default,bgRight:a.default,ifShow:!0,val:"https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4",size:100,unit:"upx",onval:!0,loadMake:!0,src:"",code:"",wxcode:"",wxtitle:"扫码付款",teaList:[{name:"正山小种(红茶)",nameEn:"Black tea",money:"¥20.00",showNew:"",animation:""},{name:"南迫冰岛普洱(生茶)",nameEn:"Puer tea",money:"¥29.99",showNew:!0,animation:""},{name:"大红袍",nameEn:"Wuyi oolong tea",money:"¥29.99",showNew:!0,animation:""},{name:"雨前龙井(绿茶)",nameEn:"Green tea",money:"¥25.99",showNew:"",animation:""},{name:"冻顶(乌龙茶)",nameEn:"Dongding oolong tea",money:"¥25.99",showNew:"",animation:""},{name:"茉莉花茶",nameEn:"Jasmine tea",money:"¥25.99",showNew:!0,animation:""},{name:"荔枝红茶",nameEn:"Lychee",money:"25.99",showNew:"",animation:""},{name:"玫瑰花红茶/冷萃",nameEn:"Rose black tea",money:"¥25.99/19.99",showNew:!1,animation:""},{name:"蜜桃乌龙茶/冷萃",nameEn:"Peach oolong tea",money:"¥25.99/19.99",showNew:"",animation:""},{name:"桂花乌龙茶",nameEn:"Osmanthus oolong tea",money:"¥25.99",showNew:"",animation:""},{name:"苹果乌龙茶",nameEn:"Apple oolong tea",money:"¥29.99",showNew:"",animation:""},{name:"鲜牛奶",nameEn:"Fresh Milk",money:"¥15.99",showNew:"",animation:""},{name:"巴旦木/混合坚果",nameEn:"Almond/Mixed nuts",money:"¥25.99",showNew:"",animation:""}],coffeeList:[{name:"猿子弹咖啡(冰/热)",nameEn:"Apesos coffee(lced/Hot)",money:"¥25.99",animation:""},{name:"热防弹咖啡",nameEn:"Hot bulletproof coffee",money:"¥25.99",animation:""},{name:"爱尔兰冰猿",nameEn:"lrish coffee",money:"¥49.99",animation:""},{name:"美式(冰/热)",nameEn:"A mericano(lced/Hot)",money:"¥19.99",animation:""},{name:"卡布奇诺(热)",nameEn:"Cappucino(Hot)",money:"¥29.99",animation:""},{name:"澳白(热)",nameEn:"Flat white(Hot)",money:"¥29.99",animation:""},{name:"浓缩Espresso",nameEn:"",money:"",animation:""},{name:"(Double)(Single)",nameEn:"",money:"¥15.99/19.99",animation:""},{name:"手冲咖啡",nameEn:"Pour-over coffee",money:"¥39.99",animation:""},{name:"拿铁(冰/热)",nameEn:"Latte(Lced/Hot)",money:"¥29.99",animation:""}],hotList:[{name:"正山小种(红茶)",nameEn:"Black tea",money:"20.00"},{name:"猿子弹咖啡(冰/热)",nameEn:"Apesos coffee(lced/Hot)",money:"25.99"},{name:"澳白(热)",nameEn:"Flat white(Hot)",money:"29.99"}]}},mounted:function(){this.getWxCode()},onLoad:function(){this.getWxCode(),i.default.getWebSocket(this)},onShow:function(){},methods:{loadMenu:function(){var e=this,o={storeId:this.storeId};m.showStoreMenu(o).then(function(o){0==o.code?e.menuHtml=o.data.commodityMenuHtml:n.showToast({title:"菜单获取失败",icon:"none"})})},qrR:function(n){this.wxcode=n},getWxCode:function(n){void 0==n?(this.val="https://u.wechat.com/MGCFEPwjKx0ZXPaED6LSwB4",this.wxtitle="扫码进群"):(this.val=n,this.wxtitle="扫码付款")},testAlertAn:function(){this.teaList[5].animation="animation-font"},VXCode:function(e){n.setStorageSync("id",e)}}};e.default=u}).call(this,o("6e42")["default"])},"8f39":function(n,e,o){"use strict";o.r(e);var t=o("357d"),a=o.n(t);for(var i in t)"default"!==i&&function(n){o.d(e,n,function(){return t[n]})}(i);e["default"]=a.a},"97a0":function(n,e,o){"use strict";var t=function(){var n=this,e=n.$createElement;n._self._c},a=[];o.d(e,"a",function(){return t}),o.d(e,"b",function(){return a})},db8a:function(n,e,o){"use strict";o.r(e);var t=o("97a0"),a=o("8f39");for(var i in a)"default"!==i&&function(n){o.d(e,n,function(){return a[n]})}(i);o("2788");var m=o("2877"),c=Object(m["a"])(a["default"],t["a"],t["b"],!1,null,null,null);e["default"]=c.exports}},[["0c0a","common/runtime","common/vendor"]]]); |
||||
@ -0,0 +1,5 @@
|
||||
{ |
||||
"usingComponents": { |
||||
"tki-qrcode": "/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode" |
||||
} |
||||
} |
||||
@ -0,0 +1 @@
|
||||
<view class="content"><view class="content-left" style="{{'background-image:'+('url('+bgLeft+')')+';'}}"><view class="content-left content-left-black"><view class="interval-view-one"></view><text class="content-left-discounts">充值<text class="content-push-money">777</text>,立享全场<text class="content-push-money">7</text>折</text><view class="interval-view-two"></view><text class="content-left-discounts">账户余额<text class="content-push-money">1010.10</text>元尊享</text><view class="interval-view-two"></view><text class="content-left-discounts">会议区/茶室</text><view class="interval-view-three content-left-discounts-1"><text class="content-left-discounts-2">{{''+wxtitle+''}}</text></view><view class="wx-code-view"><image class="wx-code" src="{{wxcode}}"></image><view class="qrimg"><block wx:if="{{ifShow}}"><tki-qrcode class="vue-ref" vue-id="1" val="{{val}}" size="{{size}}" unit="{{unit}}" onval="{{onval}}" loadMake="{{loadMake}}" usingComponents="{{true}}" data-ref="qrcode" data-event-opts="{{[['^result',[['qrR']]]]}}" bind:result="__e" bind:__l="__l"></tki-qrcode></block></view><text class="code-remark">{{wxtitle}}</text></view><view class="interval-view-four"></view><text class="content-left-discounts content-left-discounts-botton">添加回复<text class="content-push-money">【 进群 】</text>即可加入</text><view class="interval-view-two"></view><text class="content-left-discounts content-left-discounts-botton">桃子湖畔高颜值的面对面群</text></view></view><view class="content-right" style="{{'background-image:'+('url('+bgRight+')')+';'}}"><view class="content-right content-right-black"><view class="tea-view"><view class="tea-title-view"><image class="tea-image" src="../../static/images/cha.png"></image><text class="tea-title">茶(Tea)</text></view><block wx:for="{{teaList}}" wx:for-item="tea" wx:for-index="index" wx:key="index"><view class="tea-list"><text class="tea-name"><block wx:for="{{tea.name}}" wx:for-item="name" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',tea.animation]}}" style="{{('animation-delay: '+0.16*indexName+'s;')}}">{{''+name+''}}</text></block></text><text class="tea-name tea-name-en"><block wx:for="{{tea.nameEn}}" wx:for-item="nameEn" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',tea.animation]}}" style="{{('animation-delay: '+0.16*(tea.name.length+indexName)+'s;')}}">{{''+nameEn+''}}</text></block></text><text class="tea-money"><block wx:for="{{tea.money}}" wx:for-item="Imoney" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',tea.animation]}}" style="{{('animation-delay: '+0.16*(tea.name.length+tea.nameEn.length+indexName)+'s;')}}">{{''+Imoney+''}}</text></block></text><block wx:if="{{tea.showNew}}"><image class="commodity-new" src="../../static/images/new.svg"></image></block><block wx:if="{{tea.showNew===''?false:!tea.showNew}}"><image class="commodity-dztj" src="../../static/images/dztj.svg"></image></block></view></block></view><view class="coffee-view"><view class="tea-title-view"><text data-event-opts="{{[['tap',[['testAlertAn',['$event']]]]]}}" class="tea-title coffee-title" bindtap="__e">咖啡(coffee)</text><image class="tea-image coffee-image" src="../../static/images/kafei.png"></image></view><block wx:for="{{coffeeList}}" wx:for-item="coffee" wx:for-index="index" wx:key="index"><view class="tea-list"><text class="tea-name coffee-name"><block wx:for="{{coffee.name}}" wx:for-item="name" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',coffee.animation]}}" style="{{('animation-delay: '+0.16*indexName+'s;')}}">{{''+name+''}}</text></block></text><text class="tea-name tea-name-en coffee-name-en"><block wx:for="{{coffee.nameEn}}" wx:for-item="nameEn" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',coffee.animation]}}" style="{{('animation-delay: '+0.16*(coffee.name.length+indexName)+'s;')}}">{{''+nameEn+''}}</text></block></text><text class="tea-money coffee-money"><block wx:for="{{coffee.money}}" wx:for-item="Imoney" wx:for-index="indexName" wx:key="indexName"><text class="{{['tea-name-font',coffee.animation]}}" style="{{('animation-delay: '+0.16*(coffee.name.length+coffee.nameEn.length+indexName)+'s;')}}">{{''+Imoney+''}}</text></block></text></view></block></view></view></view></view> |
||||
@ -0,0 +1,291 @@
|
||||
|
||||
page { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.content { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.content-left { |
||||
width: 18.69%; |
||||
height: 100%; |
||||
/* background: url("~@/static/images/yuansuleft.jpg"); */ |
||||
background-size: 100% 100%; |
||||
float: left; |
||||
} |
||||
.content-right { |
||||
width: 81.31%; |
||||
height: 100%; |
||||
/* background: url("../../static/images/yuansuright.png"); */ |
||||
background-size: 100% 100%; |
||||
float: left; |
||||
} |
||||
.content-left-black { |
||||
width: 100%; |
||||
background:rgba(0,0,0,0.7); |
||||
} |
||||
.content-right-black { |
||||
width: 100%; |
||||
background:rgba(0,0,0,0.85); |
||||
} |
||||
.interval-view-one { |
||||
width: 100%; |
||||
height: 11%; |
||||
} |
||||
.content-left-discounts { |
||||
margin-left: 8.36%; |
||||
font-size: 28%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
color:rgba(255,255,255,1); |
||||
float: left; |
||||
} |
||||
.content-left-discounts-1 { |
||||
width: 100%; |
||||
font-size: 28%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
color:rgba(255,255,255,1); |
||||
text-align: center; |
||||
float: left; |
||||
margin-top: 20%; |
||||
} |
||||
.content-left-discounts-2 { |
||||
margin-top: 60%; |
||||
} |
||||
.content-push-money { |
||||
color: #E26910; |
||||
} |
||||
.interval-view-two { |
||||
width: 100%; |
||||
height: 1.61%; |
||||
float: left; |
||||
} |
||||
.interval-view-three { |
||||
width: 100%; |
||||
height: 4.51%; |
||||
float: left; |
||||
} |
||||
.wx-code-view { |
||||
width: 79.38%; |
||||
height: 26.38%; |
||||
margin-top: 8.51%; |
||||
margin: 0 auto; |
||||
clear: left; |
||||
background: #FFFFFF; |
||||
} |
||||
.wx-code { |
||||
width: 70.71%; |
||||
height: 70.71%; |
||||
margin-left: 15.08%; |
||||
margin-top: 9.82%; |
||||
} |
||||
.code-remark { |
||||
width: 100%; |
||||
font-size:24%; |
||||
font-family:PingFangSC-Regular; |
||||
color:rgba(3,3,3,1); |
||||
text-align: center; |
||||
margin-top: -2%; |
||||
line-height: 20.35%; |
||||
float: left; |
||||
} |
||||
.interval-view-four { |
||||
height: 4.5%; |
||||
width: 100%; |
||||
float: left; |
||||
} |
||||
.content-left-discounts-botton { |
||||
margin-left: 2.78%; |
||||
} |
||||
.tea-view { |
||||
width:57.42%; |
||||
height: 100%; |
||||
float: left; |
||||
} |
||||
.tea-title-view { |
||||
width: 100%; |
||||
height: 11.94%; |
||||
} |
||||
.tea-image { |
||||
width: 7.8%; |
||||
height: 87.59%; |
||||
margin-top: 0; |
||||
margin-left: 18.39%; |
||||
float: left; |
||||
} |
||||
.tea-title { |
||||
font-size:30%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
margin-left: 10.81%; |
||||
margin-top: 4.72%; |
||||
float: left; |
||||
} |
||||
.tea-list { |
||||
width: 100%; |
||||
height: 6.75%; |
||||
position: relative; |
||||
} |
||||
.tea-name { |
||||
font-size:30%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 7.8%; |
||||
} |
||||
.tea-name-en { |
||||
font-size: 20%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 39.13%; |
||||
top: 16%; |
||||
} |
||||
.tea-money { |
||||
font-size:24%; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:500; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
right: 16.38%; |
||||
top: 9.58%; |
||||
} |
||||
.commodity-new { |
||||
width: 5.46%; |
||||
height: 78.68%; |
||||
position: absolute; |
||||
right: 10.36%; |
||||
} |
||||
.commodity-dztj { |
||||
width: 4.01%; |
||||
height: 62.29%; |
||||
position: absolute; |
||||
right: 11.48%; |
||||
} |
||||
.coffee-view { |
||||
width: 42.58%; |
||||
height: 100%; |
||||
float: left; |
||||
} |
||||
.coffee-title { |
||||
margin-left: 30.97%; |
||||
} |
||||
.coffee-image { |
||||
width: 13.83%; |
||||
height: 89.92%; |
||||
margin-left: 3.75%; |
||||
} |
||||
.coffee-name { |
||||
left: 0; |
||||
} |
||||
.coffee-name-en { |
||||
left: 40.45%; |
||||
} |
||||
.coffee-money { |
||||
right: 9.77%; |
||||
} |
||||
.hot-view { |
||||
width: 115.33%; |
||||
height: 33.7%; |
||||
margin-left: -15.33%; |
||||
margin-top: -3.42%; |
||||
background: url(../../static/img/hua.96659191.png); |
||||
background-size: 100% 100%; |
||||
position: relative; |
||||
} |
||||
.hot-title { |
||||
font-size:36%; |
||||
font-family:HannotateSC-W5; |
||||
font-weight:bold; |
||||
color:rgba(247,128,22,1); |
||||
position: absolute; |
||||
left: 26.33%; |
||||
top: 21.7%; |
||||
} |
||||
.hot-list-view { |
||||
width: 100%; |
||||
height: 61.27%; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 38.73%; |
||||
} |
||||
.hot-list { |
||||
width: 100%; |
||||
height: 28.25%; |
||||
position: relative; |
||||
} |
||||
.hot-name { |
||||
font-size:18%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 30.37%; |
||||
} |
||||
.hot-nameEn { |
||||
font-size:15%; |
||||
font-family:FZLTZHK--GBK1-0; |
||||
font-weight:600; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
left: 30.37%; |
||||
top: 44.44%; |
||||
} |
||||
.hot-money { |
||||
font-size:15%; |
||||
font-family:PingFangSC-Medium; |
||||
font-weight:500; |
||||
color:rgba(255,255,255,1); |
||||
position: absolute; |
||||
right: 13.03%; |
||||
} |
||||
.qrimg { |
||||
opacity: 0; |
||||
width: 0; |
||||
height: 0; |
||||
} |
||||
.tea-name-font { |
||||
float: left; |
||||
} |
||||
@-webkit-keyframes style1 { |
||||
from, 20%, 53%, 80%, to { |
||||
-webkit-animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
-webkit-transform: translate3d(0,0.5,0.1); |
||||
transform: translate3d(0,0.5,0.1); |
||||
} |
||||
40%, 43% { |
||||
-webkit-animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
-webkit-transform: translate3d(0px, -80%, 0); |
||||
transform: translate3d(0px, -80%, 0); |
||||
} |
||||
} |
||||
@keyframes style1 { |
||||
from, 20%, 53%, 80%, to { |
||||
-webkit-animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
-webkit-transform: translate3d(0,0.5,0.1); |
||||
transform: translate3d(0,0.5,0.1); |
||||
} |
||||
40%, 43% { |
||||
-webkit-animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
animation-timing-function: cubic-bezier(0.5, 0.5, 1.000, 1.000); |
||||
-webkit-transform: translate3d(0px, -80%, 0); |
||||
transform: translate3d(0px, -80%, 0); |
||||
} |
||||
} |
||||
.animation-font { |
||||
-webkit-animation-duration: 0.32s; |
||||
animation-duration: 0.32s; |
||||
-webkit-animation-fill-mode: both; |
||||
animation-fill-mode: both; |
||||
-webkit-animation-name: style1; |
||||
animation-name: style1; |
||||
} |
||||
|
||||
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
|
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 1211732 */ |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot'); |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff2') format('woff2'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.svg#iconfont') format('svg'); |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 33.33upx; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.iconnew:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icondztj:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.iconwallet:before { |
||||
content: "\e641"; |
||||
} |
||||
|
||||
.iconzfbpay:before { |
||||
content: "\e643"; |
||||
} |
||||
|
||||
.iconalipaylogo:before { |
||||
content: "\e648"; |
||||
} |
||||
|
||||
.iconwechatlogo:before { |
||||
content: "\e647"; |
||||
} |
||||
|
||||
.iconpayok:before { |
||||
content: "\e644"; |
||||
} |
||||
|
||||
.iconjian:before { |
||||
content: "\e663"; |
||||
} |
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 241 KiB |
@ -0,0 +1,678 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="zh-CN"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<script> |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
</script> |
||||
<title></title> |
||||
<style> |
||||
html, |
||||
body { |
||||
margin: 0; |
||||
padding: 0; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
background: #ffffff; |
||||
} |
||||
|
||||
* { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
button, |
||||
input, |
||||
input[type=button], |
||||
input[type=reset], |
||||
input[type=search], |
||||
input[type=submit], |
||||
select { |
||||
outline: none; |
||||
-webkit-tap-highlight-color: transparent; |
||||
-webkit-appearance: none; |
||||
font-family: inherit; |
||||
border: none; |
||||
} |
||||
|
||||
.hide { |
||||
display: none; |
||||
} |
||||
|
||||
.search-wrap { |
||||
position: absolute; |
||||
left: 0; |
||||
right: 0; |
||||
top: 0; |
||||
padding: 8px 60px 8px 15px; |
||||
background-color: #fff; |
||||
border-bottom: 1px solid #d3d3d3; |
||||
z-index: 100; |
||||
} |
||||
|
||||
.search-wrap.init-status { |
||||
padding-right: 15px; |
||||
} |
||||
|
||||
.search-wrap .search-bar { |
||||
display: block; |
||||
height: 30px; |
||||
background-color: #ebebeb; |
||||
padding-left: 10px; |
||||
padding-right: 10px; |
||||
color: #b4b4b4; |
||||
font-size: 15px; |
||||
line-height: 31px; |
||||
border-radius: 5px; |
||||
overflow: hidden; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
} |
||||
|
||||
.search-wrap .cancel, |
||||
.search-wrap .submit { |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
width: 55px; |
||||
height: 46px; |
||||
line-height: 46px; |
||||
text-align: center; |
||||
font-size: 16px; |
||||
color: #0079ff; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.search-wrap .clear-input { |
||||
top: 11px; |
||||
right: 60px; |
||||
width: 34px; |
||||
height: 26px; |
||||
line-height: 26px; |
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEUAAACZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZlr8OySAAAAE3RSTlMANO/H574Jw5g/soF2LxKbQCgmvcJ4rgAAAKFJREFUOMu9k1sSgyAMRcNLwbfe/e+1HZLa0DKTP8+PztwTDRDoWa4lRSCm5erGZcTNWP7iIaMhD22+BfwQtqae89bQ39jRYVf9ocu3U+5/cp4D7yZeCwkrKo7Y8O8XVFYRZilkgx+VWYQEZagcSYQIZagcUQRAGZwLpmD+wmzSXKa5UdZWW4d10E1Gh2wPjD1y9tBqSlDlB/U4PxfnpEd5AeZAIGebfob2AAAAAElFTkSuQmCC) no-repeat center center; |
||||
background-color: #ededed; |
||||
background-size: 18px 18px; |
||||
position: absolute; |
||||
padding: 0; |
||||
border: 0; |
||||
font-size: 14px; |
||||
border-radius: 4px; |
||||
text-align: center; |
||||
z-index: 2; |
||||
} |
||||
|
||||
.search-wrap.init-status .cancel, |
||||
.search-wrap.init-status .clear-input, |
||||
.search-wrap.init-status .submit { |
||||
display: none; |
||||
} |
||||
|
||||
.search-wrap .search-bar .keyword { |
||||
display: block; |
||||
width: 100%; |
||||
padding-top: 6px; |
||||
padding-bottom: 6px; |
||||
border: 0; |
||||
font-size: 14px; |
||||
line-height: 18px; |
||||
background: 0 0; |
||||
} |
||||
|
||||
.search-wrap.init-status .search-bar .keyword { |
||||
text-align: left; |
||||
} |
||||
|
||||
.search-wrap .search-bar .keyword::-webkit-input-placeholder { |
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAgCAMAAACioYPHAAAAaVBMVEUAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICxWbJ4AAAAInRSTlMAv39AEB/f758wYFDQj3CvDPflh9qpJBYEyEc3sn1om1t4LqRQpwAABAhJREFUWMPtlumS0zAQhD26TzvXsiwsC/T7PySK5Fi+Q2Cpoij6R2w5lvSpPTNS86+Jc1kbLbfrb7WxXT4U44Y1jK/1tI3cmPnwzYTT6dK1chcQCLVB2ABk8GtdXW1IKLHWk9Ct452PuOlJ7gLexk1shGYLcGFPfbujLs0Aut+z6vMJuJw/2Q+8JeD4tg0YyizCE0gQGs+TvCjIRIZlEW43RAvAmJx8ENAfofwQBQScNwEJZQ4gdDI1kNXHJ6AoSyFQFoAFYGLYAzTspki29++I10NT9QVo9wEZ2r4h82XPh0cBAw3qRzkovH6cJiFg7wDy2vgtQPsTPc9Qh9mjJ7yswUXGFBgzloEvHYyR3USjD2XcNWn7lLJyBCi8UbgPeNDLmvB8XLMARKRBpDhDEl2npBqDBLpJ0aAAluftxQZARYDSPwH4DZcly1d8vRODnPtrw3LOw/xLO7Ba2fM9d9fXeLpcO7MYAN21dtSnMzPvzS1IzVrOfoJ6IAZngBHKiTFg7So86xSArgVNF0WYqu4IL2tV/wAcfhFQ0A3JRzEHtABULgFLwEVA9TdqNWM15CZgmzwKVAKyXIpxlKm04gU0Ako2kvExQvR5dX8SUBJc7NhVCv12MbzLCZ0ocahB/m6ZIboPGPBpyfEREBuAWrdbg0qNKkoY7wL4hO8rmzNOq3xOwyRyMR1UDL7TtRZ6pqFcalr/HoBva0X5jKflQ9kqACspx6ZHRsp4+TX3DoDPwOe94l35rigB2UimFe/loEfRIJzKeKUR4OaAYgwoQJtlpv5l8PJxYeBleFQVOjks1NfqUddiXQdow3nLskwA3ATQEauAjnQ1P4BPVSuxPOI8L9Np0qXEtBqXV1qYuoFUBUrqGNPaVsCogbYCCmgzmE803/QSex34y4TvuIzAZahQntohDHNIYi3ndrKj8v5oL/yVrnOi/zMbZJsdCTY5AL7KevoHcPpwF1AE7ZrY81Wx7sZgcyw6eUVXAEIrapJIxqYVIBdNx/NWFEvkmTrq2xFH458THT9rwIRKuASshAhzPkmA6Rm8wlDBg4py/cBCUZSYprSkkjkKmTOMj82WkHTUSLr45jkTbgPWmHPTk66GkQODYEMFkmOPx50kIPocyb+2hEVm0pOVfI4XJJ2efMrfQrgP6Agwk/3MKSg+MclWE6ssgpc9nlMwJdW6UcYZuOKqFtP9TcrDcGS9rBIKjTywT2ggmZ1X0dsCgyhmX1EQ9CIVIkYikZkLioQuF9XUMNyQvEDNFs+INFQOkiRTGFwAyjix2Cc6otHHMWZlbM+yPOclxYd9QYGXTrIsTza7hGFmH6BMqSKdq+bbGMo0ohqUUvkR8VtJ8fKBXvJly2Cx3882//UX6QfMclqph21gcgAAAABJRU5ErkJggg==); |
||||
background-repeat: no-repeat; |
||||
background-position: left center; |
||||
background-size: 80px 16px; |
||||
color: gray |
||||
} |
||||
|
||||
.search-wrap.init-status .search-bar .keyword::-webkit-input-placeholder { |
||||
background-position: center center; |
||||
} |
||||
|
||||
.suggestion-wrap { |
||||
position: absolute; |
||||
top: 46px; |
||||
bottom: 0; |
||||
z-index: 7; |
||||
width: 100%; |
||||
background: #f6f6f6; |
||||
overflow: scroll; |
||||
-webkit-overflow-scrolling: touch; |
||||
} |
||||
|
||||
.map-wrap { |
||||
height: 220px; |
||||
position: relative; |
||||
top: 46px; |
||||
width: 100%; |
||||
} |
||||
|
||||
.list-wrap { |
||||
width: 100%; |
||||
position: absolute; |
||||
background-color: #fff; |
||||
z-index: 1; |
||||
bottom: 0; |
||||
left: 0; |
||||
overflow: hidden; |
||||
border-top: 1px solid #d3d3d3; |
||||
overflow-y: scroll; |
||||
padding-bottom: 0; |
||||
padding-bottom: constant(safe-area-inset-bottom); |
||||
padding-bottom: env(safe-area-inset-bottom); |
||||
-webkit-overflow-scrolling: touch; |
||||
} |
||||
|
||||
.poi-list ul { |
||||
list-style: none; |
||||
width: 100%; |
||||
text-align: left; |
||||
padding: 0 0 65px; |
||||
} |
||||
|
||||
.suggestion-wrap li, |
||||
.active-pos, |
||||
.poi-list li { |
||||
position: relative; |
||||
display: block; |
||||
padding-left: 15px; |
||||
border: none; |
||||
height: 58px; |
||||
padding-top: 6px; |
||||
margin: 0; |
||||
} |
||||
|
||||
.poi-list li * { |
||||
pointer-events: none; |
||||
} |
||||
|
||||
.poi-list li p, |
||||
.active-pos div p { |
||||
padding-bottom: 10px; |
||||
border-bottom: 1px solid #d3d3d3; |
||||
} |
||||
|
||||
.poi-title { |
||||
font-size: 14px; |
||||
line-height: 27px; |
||||
color: #333; |
||||
font-weight: 400; |
||||
display: block; |
||||
width: 92%; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.poi-address { |
||||
font-size: 12px; |
||||
color: gray; |
||||
height: 20px; |
||||
line-height: 20px; |
||||
margin: 0; |
||||
width: 92%; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
overflow: hidden; |
||||
display: block; |
||||
} |
||||
|
||||
.poi-city, |
||||
.poi-latlng { |
||||
line-height: 22px; |
||||
display: none; |
||||
} |
||||
|
||||
.no-more-results, |
||||
.no-results { |
||||
color: gray; |
||||
padding: 20px 0; |
||||
line-height: 24px; |
||||
text-align: center; |
||||
} |
||||
|
||||
.no-more-results p, |
||||
.no-results p { |
||||
padding: 0; |
||||
margin: 0; |
||||
} |
||||
|
||||
.list-wrap i { |
||||
width: 16px; |
||||
height: 16px; |
||||
display: none; |
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAaVBMVEUAAAAAef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef8Aef84EEEWAAAAInRSTlMA+QQY6izG8NO6TphC3JReWSMoDLOfgXajf29lZEs7Hcep1l5DEAAAAPxJREFUOMuFU9cSgyAQBDSUgCVgSS/8/0cGc8E5FQdeOGaXud0rBB9mzdFYRtKnGDkVkktB+VgkYE27poCw6aheUxpxPqHn6SyaRe66NKsfpqyRll6+Njlfsp/jS1WkRFeXf/QUh6Stg3iCAHndMX6VPxltlaiMNdPXqp1iftviR+qHcN34ZJm6FO4/4XY0FOeuknhpp0jdCamHJA7GhjqQ2n2ctCpofPw8K+22OHm8I+HjvXIYj4SYYvSBwTAeU0SROjA6hnEQCTYjg2McbEKhZgbGoVC41HqJQ6lxs1iP8blZuN3WrdudG5jcyGWHNj/2+cXJr15+ebPr/wWbNBG/n/A0GgAAAABJRU5ErkJggg==) no-repeat right center; |
||||
background-size: 16px 16px; |
||||
position: absolute; |
||||
right: 15px; |
||||
top: 50%; |
||||
margin-top: -8px; |
||||
} |
||||
|
||||
.list-wrap i.active { |
||||
right: 30px; |
||||
display: inline-block; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<div class="search-wrap init-status"> |
||||
<div class="search-bar"> |
||||
<form name="poi-search" id="poiSearch" onsubmit="return false;"> |
||||
<input type="search" class="keyword" id="searchword" placeholder=" "> |
||||
<button type="reset" class="clear-input hide"></button> |
||||
<button type="submit" class="submit hide">搜索</button> |
||||
</form> |
||||
<a class="cancel">取消</a> |
||||
</div> |
||||
</div> |
||||
<div class="suggestion-wrap hide"> |
||||
<div class="poi-list"> |
||||
<ul> |
||||
|
||||
</ul> |
||||
</div> |
||||
<div class="no-results hide"> |
||||
<p>对不起,没有搜索到相关数据!</p> |
||||
</div> |
||||
<div class="no-more-results hide"> |
||||
<p>亲,没有更多了~</p> |
||||
</div> |
||||
</div> |
||||
<div id="map" class="map-wrap"></div> |
||||
<div class="list-wrap"> |
||||
<div class="active-pos"> |
||||
|
||||
</div> |
||||
<div class="poi-list"> |
||||
<ul> |
||||
|
||||
</ul> |
||||
<div class="no-results hide"> |
||||
<p>对不起,没有搜索到相关数据!</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
var loc; |
||||
var serviceWebview; |
||||
var back = function (cancel) { |
||||
if (cancel) { |
||||
plus.webview.postMessageToUniNView({ |
||||
type: 'chooseLocation', |
||||
args: { |
||||
errMsg: 'cancel' |
||||
} |
||||
}, '__uniapp__service'); |
||||
} |
||||
var webview = plus.webview.currentWebview() |
||||
if (webview.__uniapp_statusbar_style === 'dark') { |
||||
plus.navigator.setStatusBarStyle('dark') |
||||
} |
||||
webview.close('auto'); |
||||
}; |
||||
window.__chooseLocationConfirm__ = function () { |
||||
if (!loc) { |
||||
plus.nativeUI.alert('您尚未选择位置!'); |
||||
return; |
||||
} |
||||
plus.webview.postMessageToUniNView({ |
||||
type: 'chooseLocation', |
||||
args: loc |
||||
}, '__uniapp__service'); |
||||
back(); |
||||
} |
||||
var searchWrapElem = document.querySelector('.search-wrap'); |
||||
var searchWordElem = document.getElementById('searchword'); |
||||
var resetElem = document.querySelector('[type="reset"]'); |
||||
var cancelElem = document.querySelector('.cancel'); |
||||
|
||||
var suggestionWrapElem = document.querySelector('.suggestion-wrap'); |
||||
var mapElem = document.getElementById('map'); |
||||
var listWrapElem = document.querySelector('.list-wrap'); |
||||
|
||||
var suggestionPoiListElem = suggestionWrapElem.querySelector('.poi-list ul'); |
||||
var suggestionPoiNoResultsElem = suggestionWrapElem.querySelector('.no-results'); |
||||
var suggestionPoiNoMoreResultsElem = suggestionWrapElem.querySelector( |
||||
'.no-more-results'); |
||||
|
||||
var activePosElem = document.querySelector('.active-pos'); |
||||
var nearbyPoiListElem = listWrapElem.querySelector('.poi-list ul'); |
||||
var nearbyPoiNoResultsElem = listWrapElem.querySelector('.no-results'); |
||||
|
||||
listWrapElem.style.top = mapElem.offsetHeight + 47 + 'px'; |
||||
|
||||
|
||||
var debounce = function (func, wait, immediate) { |
||||
var timeout, result; |
||||
return function () { |
||||
var context = this, |
||||
args = arguments, |
||||
later, callNow; |
||||
later = function () { |
||||
timeout = null; |
||||
if (!immediate) { |
||||
result = func.apply(context, args); |
||||
} |
||||
}; |
||||
callNow = immediate && !timeout; |
||||
clearTimeout(timeout); |
||||
timeout = setTimeout(later, wait); |
||||
if (callNow) { |
||||
result = func.apply(context, args); |
||||
} |
||||
return result; |
||||
}; |
||||
}; |
||||
|
||||
var plusReady = function (callback) { |
||||
if (window.plus) { |
||||
callback() |
||||
} else { |
||||
document.addEventListener('plusready', callback) |
||||
} |
||||
} |
||||
var ZOOM = 13 |
||||
window.__chooseLocation__ = function (params) { |
||||
if (params && params.keyword) { |
||||
searchWordElem.value = params.keyword; |
||||
} |
||||
plusReady(function () { |
||||
serviceWebview = plus.webview.getWebviewById('__W2A_CONTEXT_') || |
||||
plus.webview |
||||
.getLaunchWebview(); |
||||
plus.key.addEventListener('backbutton', function () { |
||||
back(true); |
||||
}); |
||||
|
||||
var nativeMarker = false; |
||||
|
||||
var nativeMap = new plus.maps.Map('map', { |
||||
zoom: ZOOM |
||||
}); |
||||
|
||||
|
||||
var centerPoint = false |
||||
|
||||
var reverseGeocode = debounce(function (point) { |
||||
plus.maps.Map.reverseGeocode(point, {}, function (res) { |
||||
activePosElem.innerHTML = |
||||
'<div data-name="' + (res.address || '') + |
||||
'" data-address="' + (res.address || '') + |
||||
'" data-lat="' + res.coord.getLat() + |
||||
'" data-lng="' + res.coord.getLng() + |
||||
'"><h2 class="poi-title">地图位置</h2><p><span class="poi-address">' + |
||||
(res.address || |
||||
'') + |
||||
'</span><span class="poi-latlng">' + |
||||
res.coord |
||||
.getLat() + |
||||
',' + res.coord.getLng() + |
||||
'</span><i></i></p></div>'; |
||||
}, function (err) { |
||||
console.log(err); |
||||
}); |
||||
searchNearbyPoi.poiSearchNearBy(searchWordElem.value || '', point, 1000); |
||||
}, 10) |
||||
|
||||
|
||||
nativeMap.getUserLocation(function (state, point) { //获取当前用户坐标 |
||||
if (state === 0) { |
||||
nativeMarker = new plus.maps.Marker(point); |
||||
nativeMarker.setIcon('__uniappmarker@3x.png'); |
||||
nativeMap.addOverlay(nativeMarker); |
||||
//centerPoint = point; |
||||
nativeMap.showUserLocation(true); |
||||
if (plus.os.name !== 'Android') { |
||||
nativeMap.setCenter(point); |
||||
} |
||||
// reverseGeocode(centerPoint); |
||||
} else { |
||||
console.log('获取用户坐标失败'); |
||||
} |
||||
|
||||
}); |
||||
|
||||
|
||||
|
||||
nativeMap.onstatuschanged = function (evt) { //切换坐标中心 |
||||
// if (!centerPoint) { |
||||
// return; |
||||
// } |
||||
if (centerPoint && evt.center) { |
||||
if (centerPoint.latitude === evt.center.latitude && |
||||
centerPoint.longitude === evt.center.longitude) { |
||||
return; |
||||
} |
||||
} |
||||
centerPoint = evt.center |
||||
if (nativeMarker) { |
||||
nativeMarker.setPoint(centerPoint); |
||||
} |
||||
reverseGeocode(centerPoint); |
||||
}; |
||||
|
||||
var searchPoi = new plus.maps.Search(nativeMap); |
||||
var searchNearbyPoi = new plus.maps.Search(nativeMap); |
||||
|
||||
var showMap = function (centerPoint) { |
||||
nativeMap.show(); |
||||
if (centerPoint) { |
||||
if (nativeMarker) { |
||||
nativeMarker.setPoint(centerPoint); |
||||
} |
||||
nativeMap.setCenter(centerPoint); |
||||
// setTimeout(function() { |
||||
// nativeMap.setZoom(ZOOM); |
||||
// }, 150); |
||||
// reverseGeocode(centerPoint); |
||||
} |
||||
searchWordElem.value = ''; |
||||
cancelElem.className = 'cancel hide'; |
||||
searchWrapElem.className = 'search-wrap init-status'; |
||||
suggestionWrapElem.className = 'suggestion-wrap hide'; |
||||
resetSuggestionPoiList(); |
||||
} |
||||
|
||||
var resetSuggestionPoiList = function () { |
||||
suggestionPoiListElem.innerHTML = ''; |
||||
suggestionPoiNoResultsElem.className = 'no-results hide'; |
||||
suggestionPoiNoMoreResultsElem.className = |
||||
'no-more-results hide'; |
||||
} |
||||
|
||||
var showSuggestionPoiList = function () { |
||||
nativeMap.hide(); |
||||
resetSuggestionPoiList(); |
||||
} |
||||
|
||||
var showSuggestionPoiNoResults = function () { |
||||
suggestionPoiListElem.innerHTML = ''; |
||||
suggestionPoiNoResultsElem.className = 'no-results'; |
||||
suggestionPoiNoMoreResultsElem.className = |
||||
'no-more-results hide'; |
||||
} |
||||
|
||||
var renderPoiResults = function (poiList) { |
||||
var html = []; |
||||
for (var i = 0; i < poiList.length; i++) { |
||||
var poi = poiList[i]; |
||||
if (poi.point) { |
||||
html.push('<li data-name="' + (poi.name || '') + |
||||
'" data-address="' + (poi.address || '') + |
||||
'" data-lat="' + poi.point.getLat() + |
||||
'" data-lng="' + poi.point.getLng() + |
||||
'"><p><span class="poi-title">' + poi.name + |
||||
'</span><span class="poi-address">' + (poi.address || |
||||
'') + |
||||
'</span><span class="poi-latlng">' + poi.point |
||||
.getLat() + |
||||
',' + poi.point.getLng() + |
||||
'</span><span class="poi-city">' + poi.city + |
||||
'</span></p><i></i></li>'); |
||||
} |
||||
} |
||||
return html.join(''); |
||||
} |
||||
var showNearbyPoiNoResults = function () { |
||||
nearbyPoiListElem.innerHTML = ''; |
||||
nearbyPoiNoResultsElem.className = 'no-results'; |
||||
} |
||||
var showNearbyPoiResults = function (poiList) { |
||||
var html = renderPoiResults(poiList); |
||||
if (html) { |
||||
nearbyPoiListElem.innerHTML = html; |
||||
nearbyPoiNoResultsElem.className = 'no-results hide'; |
||||
} else { |
||||
showNearbyPoiNoResults(); |
||||
} |
||||
} |
||||
var showSuggestionPoiResults = function (poiList) { |
||||
var html = renderPoiResults(poiList); |
||||
if (html) { |
||||
suggestionPoiListElem.innerHTML = html; |
||||
suggestionPoiNoResultsElem.className = |
||||
'no-results hide'; |
||||
suggestionPoiNoMoreResultsElem.className = |
||||
'no-more-results'; |
||||
} else { |
||||
showSuggestionPoiNoResults(); |
||||
} |
||||
} |
||||
|
||||
searchPoi.onPoiSearchComplete = function (state, res) { |
||||
if (state === 0) { |
||||
if (res.poiList.length) { |
||||
showSuggestionPoiResults(res.poiList); |
||||
} else { |
||||
showSuggestionPoiNoResults(); |
||||
} |
||||
} else { |
||||
showSuggestionPoiNoResults(); |
||||
} |
||||
}; |
||||
|
||||
searchNearbyPoi.onPoiSearchComplete = function (state, res) { |
||||
if (state === 0) { |
||||
if (res.poiList.length) { |
||||
showNearbyPoiResults(res.poiList); |
||||
} else { |
||||
showNearbyPoiNoResults(); |
||||
} |
||||
} else { |
||||
showNearbyPoiNoResults(); |
||||
} |
||||
}; |
||||
|
||||
var getSuggestion = debounce(function (q) { |
||||
if (q.trim()) { |
||||
searchPoi.poiSearchNearBy(q, centerPoint, 50000) |
||||
} else { } |
||||
}, 10); |
||||
|
||||
suggestionPoiListElem.addEventListener('click', function (evt) { |
||||
var target = evt.target; |
||||
for (; target && target !== suggestionPoiListElem; target = |
||||
target.parentNode) { |
||||
if (target && target.tagName === 'LI') { |
||||
var laglng = target.querySelector('.poi-latlng') |
||||
.innerText |
||||
.split(','); |
||||
centerPoint = new plus.maps.Point(Number(laglng[1]), Number(laglng[ |
||||
0])); |
||||
showMap(centerPoint); |
||||
reverseGeocode(centerPoint); |
||||
break; |
||||
} |
||||
} |
||||
}); |
||||
|
||||
searchWordElem.addEventListener('click', function () { |
||||
searchWrapElem.className = 'search-wrap'; |
||||
suggestionWrapElem.className = 'suggestion-wrap'; |
||||
cancelElem.className = 'cancel'; |
||||
showSuggestionPoiList(); |
||||
}); |
||||
|
||||
var oldHasValue = false; |
||||
|
||||
var setInputState = function (hasValue) { |
||||
if (hasValue !== oldHasValue) { |
||||
if (hasValue) { |
||||
resetElem.className = 'clear-input' |
||||
} else { |
||||
resetElem.className = 'clear-input hide' |
||||
} |
||||
oldHasValue = hasValue; |
||||
} |
||||
} |
||||
|
||||
searchWordElem.addEventListener('input', function () { |
||||
var value = this.value.replace(/^\s+|\s+$/g, ''); |
||||
setInputState(!!value); |
||||
getSuggestion(value); |
||||
}); |
||||
|
||||
resetElem.addEventListener('click', function (e) { |
||||
setInputState(false); |
||||
setTimeout(function () { |
||||
searchWordElem.focus(); |
||||
}, 0); |
||||
}); |
||||
cancelElem.addEventListener('click', function () { |
||||
showMap(); |
||||
}); |
||||
|
||||
listWrapElem.addEventListener('click', function (e) { |
||||
var target = e.target; |
||||
for (; target && target !== listWrapElem; target = |
||||
target.parentNode) { |
||||
if (target.className === 'active-pos' || target.tagName === |
||||
'LI') { |
||||
var lastActiveElem = listWrapElem.querySelector( |
||||
'i.active'); |
||||
if (lastActiveElem) { |
||||
lastActiveElem.className = ''; |
||||
} |
||||
if (target.className === 'active-pos') { |
||||
target = target.children[0] |
||||
} |
||||
target.querySelector('i').className = 'active'; |
||||
loc = { |
||||
poiname: target.getAttribute('data-name'), |
||||
poiaddress: target.getAttribute( |
||||
'data-address'), |
||||
latlng: { |
||||
lat: target.getAttribute( |
||||
'data-lat'), |
||||
lng: target.getAttribute( |
||||
'data-lng'), |
||||
} |
||||
} |
||||
if (nativeMarker) { |
||||
nativeMarker.setPoint(new plus.maps.Point( |
||||
loc.latlng.lng, loc.latlng.lat)); |
||||
} |
||||
break; |
||||
} |
||||
} |
||||
}) |
||||
|
||||
|
||||
}); |
||||
}; |
||||
</script> |
||||
</body> |
||||
|
||||
</html> |
||||
|
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,284 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="zh-CN"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<script> |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
</script> |
||||
<title></title> |
||||
<style> |
||||
html, |
||||
body, |
||||
.container { |
||||
margin: 0; |
||||
padding: 0; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
background: #ffffff; |
||||
} |
||||
|
||||
#map { |
||||
position: absolute; |
||||
left: 0; |
||||
top: 0; |
||||
right: 0; |
||||
bottom: 80px; |
||||
bottom: calc(80px + constant(safe-area-inset-bottom)); |
||||
bottom: calc(80px + env(safe-area-inset-bottom)); |
||||
} |
||||
|
||||
#poi { |
||||
position: absolute; |
||||
left: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
bottom: constant(safe-area-inset-bottom); |
||||
bottom: env(safe-area-inset-bottom); |
||||
height: 80px; |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.poi-info { |
||||
width: 100%; |
||||
padding: 23px 16px 23px 18px; |
||||
box-sizing: border-box; |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.poi-name { |
||||
font-size: 17px; |
||||
line-height: 17px; |
||||
color: #111111; |
||||
display: block; |
||||
margin-right: 70px; |
||||
word-wrap: break-word; |
||||
} |
||||
|
||||
.poi-addr { |
||||
font-size: 13px; |
||||
line-height: 13px; |
||||
color: #666666; |
||||
display: block; |
||||
margin-top: 4px; |
||||
margin-right: 70px; |
||||
word-wrap: break-word; |
||||
} |
||||
|
||||
.poi-nav { |
||||
display: block; |
||||
position: absolute; |
||||
top: 10px; |
||||
right: 16px; |
||||
width: 60px; |
||||
height: 60px; |
||||
border-radius: 60px; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.poi-nav i, |
||||
.poi-nav span { |
||||
position: absolute; |
||||
top: 0; |
||||
width: 100%; |
||||
height: 100%; |
||||
display: inline-block; |
||||
border-radius: 60px; |
||||
} |
||||
|
||||
.poi-nav i { |
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAMAAAAOusbgAAACnVBMVEUAAAA9avA+avA9avA/bPE8afA+avM9afA9avA9au9Ac/I+bPQ9avA8a/E8au8+avY9avA9avBAgP88avA9au9AbfFAgP89avA9avBJbf89au88afA8ae88afA8ae9AbO88afA/avE9ae88avBHcfFCcfY+a/H///89afE8afA8avA9afA8afA9a/E9afA9avA8avA8avA9ae////88ae8/a+/+/v77/P5Cbu9jh/I9au9Te/CIo/XY4fuasfbH1PpJc/Dl6/xHce9Cbe9Eb+9FcO/3+f5SevC0xfjh6PygtvdLdPD4+f7e5fytwPj9/f7y9f1agPG6yvlsjvNIcvC8y/lXfvFNdvBZf/HR3PtBbe+DoPTT3fvg5/xWffGyxPh/nPTo7f32+P65yfnBz/n6+/6xw/i+zfmwwvj5+v6Np/WetPdPd/BMdfBOd/BdgvGkufdGce9ghfKnu/deg/F4l/NqjPKAnfS3x/lAbO+KpfVPePBmifKqvviZsPait/fS3PtUe/F6mfT8/f7s8P2Xr/bX4PuWrvbI1fqdtPfq7/3t8f3E0vqCn/RRefCzxPjK1vpwkfPP2vtVfPHR2/tDbu+BnvTr8P3G0/qLpvXW3/uOqPXL1/rf5vyht/eDn/Rzk/OPqfWQqfXZ4vuGovX19/67y/nm7Pymuvc+au9hhfKluvfU3vt3lvO3yPlpjPJykvN2lfNQePB7mfSsv/ju8v18mvTO2fvv8/22x/nr7/2cs/aMpvXn7P3D0fp+nPR5mPTE0frj6fyftfdcgfFfhPHN2Prx9P1ihvJ2lvO/zvm9zPl0lPOHo/VsjvKovPeQqvX09v6TrPZ1lfOUrfZnivKVrfbM2PrAzvmuwfi1xvjC0Pri6fzz9v59m/T8d63OAAAAM3RSTlMA7GNUSf4p38bFFC3nN7Id75oI/eI4BIv7B9Kl9fnCQLs1ossSG2sBS/p7rJlYuLmYrcSkuUTkAAAGJElEQVR4XsWbVXvbShBAJbumJE0abp0mbdI23KS9M4YgM0ORmZmZmZkZLjMzMzPDb7m2NvJnx8p6pVjd86J18nA+raSFmVlBNXGRxtyMApvdIqamiha7rSAj1xgZJ+iLOTPPEo8KxFvyMs06SSMMKVFIJSrFEBFu6zBjdA4ykBNtHBZGbfq4IcjMkHHpYdKOGIkqGTkiDNpBNtSAbdAAtYNHoUZGDRa0MzrWhJoxxY7WqM0yiDggREOWFm9MGg6YtBj13mwRw4CYrVKblGzCsGBKTlLjHWPFsGEdw+41J2AYSWCePRJFDCtiIuNYNRzDzHCmcWzsUAw7Q8cy3C/xhtsc8p4T1fbz7TUXmXo7xHM2i6iSb2Hus8iAaKZ+vwmoXgzwYQnLV0X5npOsqEkM9QcdGBJr/2NYMmoUA9zswZAk9zsvmLSJCc+txBCYspW9MSIORAyd7xQjHVFxlsxKQ+1iwrUipJOmtDIw4IDF0PFKNVIxKKyvWDu68vbEQ2+5OnxAAAc2Iw0xeB0Wi0zsnb8f6NyYghRig9axJmSguHkhhGRh8zTKm9131cu0fq6uAAY6tyGFUX3mJGTAXQYMvLkSqQTOUzZk4GsGbdsmDMEjAfsyZGAbEFrbz253FMuUgh/zDjOM2f47Opb9YO1xIqjY3u93vKABGRgp+EhHBnYRQWMx9iN+/EVkI90nzkcG2iTBMw5UFi+85UZG8mXvMJb9/iQi2IHK4s+6kJkhcrTCyD4mlyn//fglVINRIEQjA29L4t1K4o72CaiKaOKNyEEGlkjibQriQ0WokpwIFfNhtyQOnnteXkaZ/umzY4pWsXZSJHHUwxdHeb1mfPhiNHvEmTzEmR7xeB7iPI/YwkNsEYS4eB7i+DghEnmIMVIw8hEbhVw+4lwhg484QyjkIy4UrHzEVsHOR2wXLHzEFkHkIxaFVD7iVG5i5q4u2ujlpfB1tQW5YBHsyAW7YEMu2IQC5EKBkIFcyBBykQu5ghG5YGRZ+qzasmUV+uFYhzJfrrmKmohkWexNAfAPmk17b+kHcns9fIQ+znf2ZSVlsSdY1IonnIP9pUjY4f+vWdCXyZTlrZBHCeQRugC6epuSYOt8gIO4eo6Hza2waI6XvUTcs8FDBVR4L99QxHnULcwmCOIplGiEN1YsB3+mS2Ji6oZulH9StjBmDeInZ3+K12fKuODyzI3E9HyXhytwxXt5gSI2U7epdUWEfQD7eptuDKbLCatVPuMosjFnerkUOLq8mAQp2lAWz3vUgwtc3ku9JKZszA0qxa894WEZ4kaAI5WILa1QTsTsz9ggB19UiWeDh6mIeM8F7xZhObhKVIpzIqjhpi0ze6kCqJLbpxHn7Nx5RhJjz6uwdNkBaEefuPyehzIo814+7lccTQ+wvQ4KnJEU04kYG8oAoH6V2gHESA8p/lwq0Q7QXOrjToAY3XsA7tcgYfJjhLkwt7dVTQ8p0oOoe4jk7NNICBAf7gCAG7XoQ37GNMYxhY3fJ4HTdU54ECSumQ8w9SjADHJnjl4mwkS5SQsb0wPllcdgsdRYBPWfBIpr71YBLK7BcoD7LYhYAsGUUALl9NTAYmidJDUuNkGb21+863MAkPq/GeDmCnbxCJZkyF3w9fAXLliChOLZ0LT1N3B+tU6elafWITom9XICTshNhb62saR/TjrhNBIcpxrB+R1pLgCAc5O/X40yP9Sxv1yDQie8HGuc8OPVn3YvWnChqRO8NEk5tFuwtLwKqn75taFyba17Wk1ddcupLqy8RyADiMxa5YQXPcW3AvyY9/i1iv2wHBF7OuABVl6AAI7hFFDifFCKjyWpeeT3PxrXl18/eaeoQXqv/oS/EHHD5QrvlHzp73/+dYJMN5bMUGI7JanJnsZt+Y8MjbNQZqu7du0ELzXIhDiakrjWEwMlVa8naVmU4gQdEWMo5Rg6YsqmFKDoSTKt5EZHrEnUIiPdSBjDUFalA6KZoZBMB4Yn8iqd41UsyKs8kldBKK8SWF5Fv7zKnHkVdvMvZedfvM//uAL/Axr8j6TwP4RDSM9Xc+woP53TQStOR8v0wZw5XvfDdPTjg4VW+figtVDb8cH/AZ+Eg+9jqX0NAAAAAElFTkSuQmCC) no-repeat; |
||||
background-size: 100%; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<div id="container" class="container"> |
||||
<div id="map"></div> |
||||
<div id="poi"> |
||||
<div class="poi-info"> |
||||
<span class="poi-name"></span> |
||||
<span class="poi-addr"></span> |
||||
<div class="poi-nav"> |
||||
<i></i> |
||||
<span></span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
var loc; |
||||
var serviceWebview; |
||||
var back = function() { |
||||
var webview = plus.webview.currentWebview() |
||||
if (webview.__uniapp_statusbar_style === 'light') { |
||||
plus.navigator.setStatusBarStyle('light') |
||||
} |
||||
webview.close('auto'); |
||||
}; |
||||
|
||||
var isIos = !!navigator.userAgent.match(/iPhone|iPad|iPod/i); |
||||
|
||||
document.addEventListener('plusready', function() { |
||||
serviceWebview = plus.webview.getWebviewById('__W2A_CONTEXT_') || plus.webview.getLaunchWebview(); |
||||
plus.key.addEventListener('backbutton', back); |
||||
|
||||
|
||||
}) |
||||
|
||||
/** |
||||
* 调用系统第三方程序进行导航 |
||||
*/ |
||||
function openSysMap(lat, lng, title) { |
||||
/** |
||||
* 网页版地图源 |
||||
*/ |
||||
var mapsSourceWeb = [ |
||||
{ |
||||
title: '腾讯地图网页版', |
||||
getUrl: function() { |
||||
var url |
||||
url = 'https://apis.map.qq.com/uri/v1/routeplan?type=drive' + '&to=' + |
||||
encodeURIComponent(title) + '&tocoord=' + encodeURIComponent(lat + ',' + lng) + |
||||
'&referer=APP' |
||||
return url |
||||
} |
||||
} |
||||
] |
||||
/** |
||||
* APP版地图源 |
||||
*/ |
||||
var mapsSource = [ |
||||
{ |
||||
title: '高德地图', |
||||
pname: 'com.autonavi.minimap', |
||||
action: !isIos ? 'amapuri://' : 'iosamap://', |
||||
getUrl: function() { |
||||
var url |
||||
if (!isIos) { |
||||
url = 'amapuri://route/plan/' |
||||
} else { |
||||
url = 'iosamap://path' |
||||
} |
||||
url += '?sourceApplication=APP&dname=' + encodeURIComponent(title) + '&dlat=' + lat + |
||||
'&dlon=' + lng + '&dev=0' |
||||
return url |
||||
} |
||||
}, |
||||
{ |
||||
title: '百度地图', |
||||
pname: 'com.baidu.BaiduMap', |
||||
action: 'baidumap://', |
||||
getUrl: function() { |
||||
var url = 'baidumap://map/direction?destination=' + encodeURIComponent('latlng:' + lat + |
||||
',' + lng + '|name:' + title) + '&mode=driving&src=APP&coord_type=gcj02' |
||||
return url |
||||
} |
||||
}, |
||||
{ |
||||
title: '腾讯地图', |
||||
pname: 'com.tencent.map', |
||||
action: 'qqmap://', |
||||
getUrl: function() { |
||||
var url |
||||
url = 'qqmap://map/routeplan?type=drive' + (isIos ? ('&from=' + encodeURIComponent( |
||||
'我的位置')) : '') + '&to=' + encodeURIComponent(title) + '&tocoord=' + |
||||
encodeURIComponent(lat + ',' + lng) + '&referer=APP' |
||||
return url |
||||
} |
||||
} |
||||
] |
||||
var maps = [] |
||||
mapsSource.forEach(function(mapsSource) { |
||||
var installed = plus.runtime.isApplicationExist({ |
||||
pname: mapsSource.pname, |
||||
action: mapsSource.action, |
||||
}) |
||||
if (installed) { |
||||
maps.push(mapsSource) |
||||
} |
||||
}) |
||||
if (isIos) { |
||||
maps.unshift({ |
||||
title: 'Apple 地图', |
||||
getUrl: function() { |
||||
var url |
||||
url = 'https://maps.apple.com/?daddr=' + encodeURIComponent(title) + '&sll=' + |
||||
encodeURIComponent(lat + ',' + lng) |
||||
return url |
||||
} |
||||
}) |
||||
} |
||||
if (maps.length === 0) { |
||||
maps = maps.concat(mapsSourceWeb) |
||||
} |
||||
plus.nativeUI.actionSheet({ |
||||
title: '导航方式', |
||||
cancel: '取消', |
||||
buttons: maps, |
||||
}, function(res) { |
||||
var index = res.index |
||||
var map |
||||
if (index > 0) { |
||||
map = maps[index - 1] |
||||
plus.runtime.openURL(map.getUrl(), function() { }, map.pname) |
||||
} |
||||
}) |
||||
} |
||||
|
||||
var ZOOM = 13 |
||||
window.__openLocation__ = function(params) { |
||||
var mapElem = document.getElementById('map'); |
||||
var poiNameElem = document.querySelector('.poi-name'); |
||||
var poiAddrElem = document.querySelector('.poi-addr'); |
||||
var poiNavElem = document.querySelector('.poi-nav'); |
||||
var latitude = params.latitude; |
||||
var longitude = params.longitude; |
||||
var scale = params.scale; |
||||
var name = params.name; |
||||
var address = params.address; |
||||
var point = new plus.maps.Point(longitude, latitude); |
||||
var map = plus.maps.create('map', { |
||||
center: point, |
||||
zoom: scale || ZOOM, |
||||
top: 0, |
||||
left: 0, |
||||
width: mapElem.offsetWidth, |
||||
height: mapElem.offsetHeight |
||||
|
||||
}); |
||||
var marker = new plus.maps.Marker(point); |
||||
marker.setIcon('__uniappmarker@3x.png'); |
||||
if (name) { |
||||
poiNameElem.innerText = name; |
||||
// marker.setLabel(name); |
||||
} |
||||
if (address) { |
||||
poiAddrElem.innerText = address; |
||||
// var bubble = new plus.maps.Bubble(address); |
||||
// marker.setBubble(bubble); |
||||
} |
||||
map.addOverlay(marker); |
||||
plus.webview.currentWebview().append(map); |
||||
var userPoint = false |
||||
map.getUserLocation(function(state, point) { |
||||
if (state) { |
||||
plus.nativeUI.toast('定位失败!'); |
||||
} else { |
||||
userPoint = point; |
||||
} |
||||
}) |
||||
|
||||
poiNavElem.addEventListener('click', function() { |
||||
openSysMap(latitude, longitude, name) |
||||
}); |
||||
} |
||||
</script> |
||||
</body> |
||||
|
||||
</html> |
||||
@ -0,0 +1,146 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="zh-CN"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<script> |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||
CSS.supports( |
||||
'top: constant(a)')) |
||||
document.write( |
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
</script> |
||||
<title>扫码</title> |
||||
<style> |
||||
html, |
||||
body, |
||||
.container { |
||||
margin: 0; |
||||
padding: 0; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
background: #000000; |
||||
} |
||||
</style> |
||||
</head> |
||||
|
||||
<body> |
||||
<div id="scan" class="container"> |
||||
</div> |
||||
<script> |
||||
var scan; |
||||
var lightImg; |
||||
var lightView; |
||||
var back = function(cancel) { |
||||
if (cancel) { |
||||
plus.webview.postMessageToUniNView({ |
||||
type: 'scanCode', |
||||
args: { |
||||
errMsg: 'cancel' |
||||
} |
||||
}, '__uniapp__service'); |
||||
} |
||||
lightImg && lightImg.clear(); |
||||
lightView && lightView.clear(); |
||||
scan && scan.close(); |
||||
var webview = plus.webview.currentWebview(); |
||||
if (webview.__uniapp_dark) { |
||||
plus.navigator.setStatusBarStyle('dark'); |
||||
} |
||||
webview.close('auto'); |
||||
} |
||||
/** |
||||
* 绘制照亮开关 |
||||
*/ |
||||
function drawLight() { |
||||
var offImg = |
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABjklEQVRoQ+1ZbVHEQAx9TwE4ABTcOQAknANQAKcAUAAOAAXgAHAACsDCKQiTmbYDzJZtNt2bFrJ/m6+Xl2yyU2LmhzOPH/8PgIjcADirxNyapNoffMwMiMgzgMPBHmyCLySPLCoBwJKtAbJbYaBmD1yRvBwAtBMxl5DF+DZkiwCIyBLAzsgBbki+Wm2WAlCaL6zOMvKnJO+sNksB7ALQbO1ZHfbIv5FUVs2nCIB6EZETALdmj2mFY5I6X8ynGEADQllYmL1+VzBfnV/VvQB0aj45ARyQ/Ci14QLQsOBZLe5JaikWnzEA7AN4L4hgA2Dpyb76dANwsOCq/TZhASAYKGie0a7R1lDPI0ebtF0NUi+4yfdAtxr3PEMnD6BbD0QkNfACQO05EAwMuaBqDrIVycdmTpwDuP4R0OR7QFftVRP0g+49cwOQq4DJMxAAchmofY3m/EcJBQOZbTRKKJeBKKEoIePvpFRJ1VzmciUccyCa+C81cerBkuuB7sGTE/zt+yhN7AnAqxsAvBn06n8CkyPwMZKwm+UAAAAASUVORK5CYII='; |
||||
var onImg = |
||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAB4klEQVRoQ+1ZQU7CUBCdaWVBLFETqUtxB7iQG4hH4AZ4AvUE4gnkBuoJ9AbiDXAhZadby4IQICaS9psqJBVLy5/fkhKHbefPzPvzZv6bgLDmP1zz/OH/ARjZpSYAniVSORQXRt5qyviWrsDQLrUQ8FgmyLK2AsRTzrSqy9p7dgxA5raibFdSgSR7QAi4yu11GlFA/d+lKSTjfBW2JAAj+7Cio7MVZ4KO0AeG+dKW9UkCMHwvNxDhUjZYuL17apjdW1mfJACiX9gef2bbgLgvG3CB/bNhdioUXyQAXqCRXawDaDeUoPNnBLonuXy3RfFFBvADouxx9ogSeHaGMjpjm0LDXrGKQntUAaBn3IPsTveN6kOpAl5QNWkh7gzTqlOTJ0mJ+WAf/WLBmWivskkIEIONjKio3H4sAKhVUOX+7MKUKcQAZLk3Z88VWEQhr0kRYCoN/m5wqe8BvzQOkuDpB+CTB0EPHgOYNnNiTewXaFyBkFGbWAVQE7XNXevhW7X2Sucg8NqfR+p7AADaesateUk7E+0eAH4tLOsAIPSNZQBJT6EoicMV4Ar4OEJZK5lCTCGmkPy/MUGjOTEtxO9A1A1wE3MTp6iJgxaWKAr7F54o27DvsUwhlQRUzzIA1RtUPf8FRKRYQOI+9hQAAAAASUVORK5CYII='; |
||||
var onText = '轻触照亮'; |
||||
var offText = '轻触关闭'; |
||||
var on = false; |
||||
var viewWidth = 48; |
||||
var fontSize = 12; |
||||
var imgWidth = 30; |
||||
|
||||
function changeType() { |
||||
lightView.reset(); |
||||
lightImg.loadBase64Data(on ? onImg : offImg, function() { |
||||
lightView.drawBitmap(lightImg, {}, { |
||||
top: 0, |
||||
left: (viewWidth - imgWidth) / 2 + 'px', |
||||
width: imgWidth + 'px', |
||||
height: imgWidth + 'px' |
||||
}); |
||||
}); |
||||
lightView.drawText(on ? offText : onText, { |
||||
top: imgWidth + 'px', |
||||
left: '0px', |
||||
width: '100%', |
||||
height: fontSize + 'px' |
||||
}, { |
||||
color: '#ffffff', |
||||
size: fontSize + 'px' |
||||
}); |
||||
scan.setFlash(on); |
||||
on = !on; |
||||
} |
||||
lightImg = new plus.nativeObj.Bitmap('lightImg'); |
||||
lightView = new plus.nativeObj.View('lightView', { |
||||
width: viewWidth + 'px', |
||||
height: viewWidth + 'px', |
||||
top: window.innerHeight / 2 + 50 + 'px', |
||||
left: (window.innerWidth - viewWidth) / 2 + 'px', |
||||
position: 'static' |
||||
}); |
||||
lightView.addEventListener('click', function() { |
||||
changeType(); |
||||
}); |
||||
plus.webview.currentWebview().append(lightView); |
||||
changeType(); |
||||
} |
||||
document.addEventListener('plusready', function() { |
||||
var serviceWebview = plus.webview.getWebviewById('__W2A_CONTEXT_') || plus.webview.getLaunchWebview(); |
||||
plus.key.addEventListener('backbutton', function() { |
||||
back(true); |
||||
}); |
||||
setTimeout(function() { |
||||
var webview = plus.webview.currentWebview(); |
||||
scan = new plus.barcode.Barcode('scan', webview.__uniapp_scan_type, { |
||||
frameColor: '#118CE9', |
||||
scanbarColor: '#118CE9' |
||||
}); |
||||
scan.onmarked = function(type, code, file) { |
||||
var res = { |
||||
type: type, |
||||
code: code |
||||
}; |
||||
back() |
||||
plus.webview.postMessageToUniNView({ |
||||
type: 'scanCode', |
||||
args: res |
||||
}, '__uniapp__service'); |
||||
}; |
||||
scan.onerror = function(error) { |
||||
back() |
||||
plus.webview.postMessageToUniNView({ |
||||
type: 'scanCode', |
||||
args: { |
||||
errMsg: error.message + ',错误码:' + error.code |
||||
} |
||||
}, '__uniapp__service'); |
||||
}; |
||||
|
||||
scan.start(); |
||||
drawLight(); |
||||
}, 500) |
||||
}) |
||||
</script> |
||||
</body> |
||||
|
||||
</html> |
||||
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="zh-CN"> |
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<title>TabBar</title> |
||||
|
||||
<script> |
||||
document.addEventListener('plusready', function() { |
||||
window.UniLaunchWebviewReady = function(isWebviewReady){ |
||||
plus.webview.postMessageToUniNView({type: 'UniWebviewReady-' + plus.webview.currentWebview().id}, '__uniapp__service'); |
||||
} |
||||
UniLaunchWebviewReady(true); |
||||
}) |
||||
</script> |
||||
</head> |
||||
<body> |
||||
</body> |
||||
|
||||
</html> |
||||
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="zh-CN"> |
||||
|
||||
<head> |
||||
<meta charset="UTF-8" /> |
||||
<script> |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||
CSS.supports('top: constant(a)')) |
||||
document.write( |
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||
</script> |
||||
<title>View</title> |
||||
<style> |
||||
* { |
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); |
||||
-webkit-tap-highlight-color: transparent; |
||||
} |
||||
|
||||
input[type="search"i]::-webkit-search-cancel-button { |
||||
display: none; |
||||
} |
||||
</style> |
||||
<script> |
||||
var __wxConfig = {"debug":false,"appname":"优客菜单","entryPagePath":"pages/confirm-code/confirm-code.html","page":{"pages/confirm-code/confirm-code.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}},"pages/store-commodity/store-commodity.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}},"pages/menu/menu.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}}},"global":{"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","navigationStyle":"custom"}},"tabBar":{"color":"","selectedColor":"","backgroundColor":"","borderStyle":"black","list":[],"position":"bottom"},"networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"platform":"devtools","pages":["pages/confirm-code/confirm-code","pages/store-commodity/store-commodity","pages/menu/menu"],"nvueCompiler":"weex","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"compilerVersion":"2.2.2","usingComponents":{}} |
||||
</script> |
||||
<script> |
||||
var __id__ = ''; |
||||
window.__dispatchGenerateFunc__ = function(page) { |
||||
__id__ = page; |
||||
document.title = page; |
||||
// window.history.pushState('', '', page); |
||||
var wxss = page.replace('.html', '.wxss') |
||||
if ( |
||||
typeof __wxAppCode__ !== 'undefined' && |
||||
__wxAppCode__.hasOwnProperty(wxss) |
||||
) { |
||||
var setCssToHead = __wxAppCode__[wxss] |
||||
typeof setCssToHead === 'function' && setCssToHead() |
||||
document.dispatchEvent(new CustomEvent("generateFuncReady", { |
||||
detail: { |
||||
generateFunc: $gwx(page.replace('.html', '.wxml')) |
||||
} |
||||
})); |
||||
} else { |
||||
plus.webview.currentWebview().setJsFile('_www/' + page.replace('.html', '.js')); |
||||
} |
||||
}; |
||||
</script> |
||||
<script src="__uniappes6.js"></script> |
||||
<script src="uniapp://ready"></script> |
||||
</head> |
||||
|
||||
<body> |
||||
<div></div> |
||||
</body> |
||||
|
||||
</html> |
||||
@ -0,0 +1 @@
|
||||
"use weex:vue";var __wxConfig = {"debug":false,"appname":"优客菜单","entryPagePath":"pages/confirm-code/confirm-code.html","page":{"pages/confirm-code/confirm-code.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}},"pages/store-commodity/store-commodity.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}},"pages/menu/menu.html":{"window":{"usingComponents":{"tki-qrcode":"/node-modules/tki-qrcode/components/tki-qrcode/tki-qrcode"}}}},"global":{"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","navigationStyle":"custom"}},"tabBar":{"color":"","selectedColor":"","backgroundColor":"","borderStyle":"black","list":[],"position":"bottom"},"networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"platform":"devtools","pages":["pages/confirm-code/confirm-code","pages/store-commodity/store-commodity","pages/menu/menu"],"nvueCompiler":"weex","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"compilerVersion":"2.2.2","usingComponents":{}}; |
||||
@ -0,0 +1,126 @@
|
||||
{ |
||||
"@platforms": [ |
||||
"android", |
||||
"iPhone", |
||||
"iPad" |
||||
], |
||||
"id": "__UNI__A096421", |
||||
"name": "优客菜单", |
||||
"version": { |
||||
"name": "1.0.0", |
||||
"code": "100" |
||||
}, |
||||
"description": "", |
||||
"launch_path": "__uniappview.html", |
||||
"developer": { |
||||
"name": "", |
||||
"email": "", |
||||
"url": "" |
||||
}, |
||||
"permissions": { |
||||
"UniNView": { |
||||
"description": "UniNView原生渲染" |
||||
} |
||||
}, |
||||
"plus": { |
||||
"useragent": { |
||||
"value": "uni-app appservice", |
||||
"concatenate": true |
||||
}, |
||||
"splashscreen": { |
||||
"target": "id:1", |
||||
"autoclose": true, |
||||
"waiting": true, |
||||
"delay": 0 |
||||
}, |
||||
"popGesture": "close", |
||||
"launchwebview": { |
||||
"render": "always", |
||||
"id": "1", |
||||
"kernel": "WKWebview" |
||||
}, |
||||
"statusbar": { |
||||
"immersed": "supportedDevice", |
||||
"style": "dark", |
||||
"background": "#F8F8F8" |
||||
}, |
||||
"usingComponents": true, |
||||
"distribute": { |
||||
"icons": { |
||||
"ios": { |
||||
"appstore": "C:/Users/艺术生/Desktop/摄像头文档/微信图片_20190710100225.png", |
||||
"ipad": { |
||||
"app": "unpackage/res/icons/76x76.png", |
||||
"app@2x": "unpackage/res/icons/152x152.png", |
||||
"notification": "unpackage/res/icons/20x20.png", |
||||
"notification@2x": "unpackage/res/icons/40x40.png", |
||||
"proapp@2x": "unpackage/res/icons/167x167.png", |
||||
"settings": "unpackage/res/icons/29x29.png", |
||||
"settings@2x": "unpackage/res/icons/58x58.png", |
||||
"spotlight": "unpackage/res/icons/40x40.png", |
||||
"spotlight@2x": "unpackage/res/icons/80x80.png" |
||||
}, |
||||
"iphone": { |
||||
"app@2x": "unpackage/res/icons/120x120.png", |
||||
"app@3x": "unpackage/res/icons/180x180.png", |
||||
"notification@2x": "unpackage/res/icons/40x40.png", |
||||
"notification@3x": "unpackage/res/icons/60x60.png", |
||||
"settings@2x": "unpackage/res/icons/58x58.png", |
||||
"settings@3x": "unpackage/res/icons/87x87.png", |
||||
"spotlight@2x": "unpackage/res/icons/80x80.png", |
||||
"spotlight@3x": "unpackage/res/icons/120x120.png" |
||||
} |
||||
}, |
||||
"android": { |
||||
"hdpi": "unpackage/res/icons/72x72.png", |
||||
"ldpi": "unpackage/res/icons/48x48.png", |
||||
"mdpi": "unpackage/res/icons/48x48.png", |
||||
"xhdpi": "unpackage/res/icons/96x96.png", |
||||
"xxhdpi": "unpackage/res/icons/144x144.png", |
||||
"xxxhdpi": "unpackage/res/icons/192x192.png" |
||||
} |
||||
}, |
||||
"google": { |
||||
"permissions": [ |
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", |
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", |
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", |
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", |
||||
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", |
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||
] |
||||
}, |
||||
"apple": {}, |
||||
"plugins": { |
||||
"audio": { |
||||
"mp3": { |
||||
"description": "Android平台录音支持MP3格式文件" |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
"allowsInlineMediaPlayback": true, |
||||
"uni-app": { |
||||
"compilerVersion": "2.2.2", |
||||
"control": "v8", |
||||
"nvueCompiler": "weex", |
||||
"renderer": "auto" |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,2 @@
|
||||
setCssToHead(["body{ background: #f5f5f5; }\n.",[1],"code-view{ position: absolute; left: calc(50% - ",[0,50],"); top: calc(50% - ",[0,60],"); width: ",[0,100],"; height: ",[0,100],"; }\n.",[1],"code-text{ position: absolute; width: ",[0,100],"; text-align: center; font-size:",[0,10.41],"; left: calc(50% - ",[0,50],"); top: calc(50% + ",[0,60],"); display: block; }\n",],undefined,{path:"./pages/confirm-code/confirm-code.wxss"})(); |
||||
document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/confirm-code/confirm-code.wxml') } })); |
||||
@ -0,0 +1,2 @@
|
||||
setCssToHead([".",[1],"menu-div { width: 100%; height: 100%; }\n.",[1],"workspace { width: 100%; position: relative; backgroundRepeat: \x27no-repeat\x27; }\n.",[1],"template-item { background-size: 100% 100% !important; }\n.",[1],"qrimg { opacity: 0; width: 0; height: 0; }\n",],undefined,{path:"./pages/menu/menu.wxss"})(); |
||||
document.dispatchEvent(new CustomEvent("generateFuncReady", { detail: { generateFunc: $gwx('./pages/menu/menu.wxml') } })); |
||||
@ -0,0 +1,50 @@
|
||||
|
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 1211732 */ |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot'); |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff2') format('woff2'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.svg#iconfont') format('svg'); |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 33.33upx; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.iconnew:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icondztj:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.iconwallet:before { |
||||
content: "\e641"; |
||||
} |
||||
|
||||
.iconzfbpay:before { |
||||
content: "\e643"; |
||||
} |
||||
|
||||
.iconalipaylogo:before { |
||||
content: "\e648"; |
||||
} |
||||
|
||||
.iconwechatlogo:before { |
||||
content: "\e647"; |
||||
} |
||||
|
||||
.iconpayok:before { |
||||
content: "\e644"; |
||||
} |
||||
|
||||
.iconjian:before { |
||||
content: "\e663"; |
||||
} |
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 188 KiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 241 KiB |
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>优客菜单</title><script>document.addEventListener('DOMContentLoaded', function() { |
||||
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px' |
||||
}) |
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) |
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/ukeerStore/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/ukeerStore/static/js/chunk-vendors.c950ef6c.js></script><script src=/ukeerStore/static/js/index.4c5022bd.js></script></body></html> |
||||
@ -0,0 +1,50 @@
|
||||
|
||||
@font-face { |
||||
font-family: 'iconfont'; /* project id 1211732 */ |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot'); |
||||
src: url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.eot?#iefix') format('embedded-opentype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff2') format('woff2'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.woff') format('woff'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.ttf') format('truetype'), |
||||
url('//at.alicdn.com/t/font_1211732_2c0v1cntckq.svg#iconfont') format('svg'); |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 33.33upx; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.iconnew:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icondztj:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.iconwallet:before { |
||||
content: "\e641"; |
||||
} |
||||
|
||||
.iconzfbpay:before { |
||||
content: "\e643"; |
||||
} |
||||
|
||||
.iconalipaylogo:before { |
||||
content: "\e648"; |
||||
} |
||||
|
||||
.iconwechatlogo:before { |
||||
content: "\e647"; |
||||
} |
||||
|
||||
.iconpayok:before { |
||||
content: "\e644"; |
||||
} |
||||
|
||||
.iconjian:before { |
||||
content: "\e663"; |
||||
} |
||||
|
After Width: | Height: | Size: 9.2 KiB |