Compare commits
368 Commits
master
...
gaohao2.0.
| Author | SHA1 | Date |
|---|---|---|
|
|
e17d5ffcaa | |
|
|
18aecb9f6c | |
|
|
740a3201e4 | |
|
|
28950f0ad1 | |
|
|
ecb615e9c8 | |
|
|
09aee024e0 | |
|
|
20350ea247 | |
|
|
88478b2768 | |
|
|
151562d5e6 | |
|
|
76a80729c8 | |
|
|
f7a2f588ef | |
|
|
8c5e03d6c4 | |
|
|
d2dbfd5163 | |
|
|
69151ca3f4 | |
|
|
fb4f8820a4 | |
|
|
89943e7f10 | |
|
|
04f0fef615 | |
|
|
c679b60cb7 | |
|
|
2808dec925 | |
|
|
4cf6352494 | |
|
|
2caee2bd1a | |
|
|
7167c2604f | |
|
|
7b81e2ffb0 | |
|
|
bca2b6a3f7 | |
|
|
bec723cd69 | |
|
|
b2abe69e37 | |
|
|
a868117cda | |
|
|
d8e504d151 | |
|
|
d6ca0aead6 | |
|
|
ae8fe05146 | |
|
|
55ae63e94b | |
|
|
0131e97d21 | |
|
|
6b5b05d33c | |
|
|
aef7874901 | |
|
|
3ad4d7af68 | |
|
|
3288d1ed9b | |
|
|
19b6e2fa09 | |
|
|
e2881ebd7b | |
|
|
a3e1d951e6 | |
|
|
587fa3a620 | |
|
|
a821223a3b | |
|
|
a77a7ab716 | |
|
|
1e420a9c2a | |
|
|
82cea7c341 | |
|
|
1de598f1b1 | |
|
|
5f03e44701 | |
|
|
861e97b775 | |
|
|
b3cb29691a | |
|
|
5d83068d61 | |
|
|
84a545d393 | |
|
|
2dbcdf4300 | |
|
|
c2ff506543 | |
|
|
244e7bc736 | |
|
|
4f73a08b86 | |
|
|
22b9726de6 | |
|
|
d75da8ac9f | |
|
|
5550649e8a | |
|
|
907321d3d3 | |
|
|
192b9ab9de | |
|
|
f52d1545a3 | |
|
|
05c7b85a75 | |
|
|
728774fa66 | |
|
|
fddaea0e7b | |
|
|
f304488dbd | |
|
|
c83aa0b4c4 | |
|
|
d729f61fdf | |
|
|
c1941cbddd | |
|
|
bf5460c304 | |
|
|
8ca9a73775 | |
|
|
c00e084a09 | |
|
|
61cbc5c846 | |
|
|
dfa5c79ec8 | |
|
|
b67f1381ca | |
|
|
da8ff7d4d6 | |
|
|
d82bd93033 | |
|
|
f6139760a4 | |
|
|
f7cea2ceb7 | |
|
|
3d60193596 | |
|
|
9b012d397d | |
|
|
bfc63507f7 | |
|
|
69b23acc73 | |
|
|
3b3a08d460 | |
|
|
83aeb25652 | |
|
|
30998ddfda | |
|
|
63506487a7 | |
|
|
0fcb19cbdc | |
|
|
1133bda264 | |
|
|
b9cf0152c3 | |
|
|
085abd62e5 | |
|
|
d3061e5da1 | |
|
|
6afe7b0d6e | |
|
|
f2cf4aace2 | |
|
|
a6c73df5e7 | |
|
|
bfc5ee00be | |
|
|
8e0afe82a6 | |
|
|
257e12c7ed | |
|
|
8cb92dc6f5 | |
|
|
d09396adc9 | |
|
|
24a98d1e77 | |
|
|
f5c9ae2f63 | |
|
|
360b0c1ade | |
|
|
486206e8d3 | |
|
|
29eb4b2bb2 | |
|
|
62cbad9029 | |
|
|
fc9da59f26 | |
|
|
7238a87ecc | |
|
|
485797e844 | |
|
|
75d3cab654 | |
|
|
3c7bbe82d2 | |
|
|
5dc0993f04 | |
|
|
bb805f6f93 | |
|
|
b6f3c1ed96 | |
|
|
2a3f125bce | |
|
|
ef7ef4baaa | |
|
|
7b7b8ddac3 | |
|
|
aeae9c2e39 | |
|
|
35d4304410 | |
|
|
93c3e70e98 | |
|
|
5fb9871900 | |
|
|
1dd800b854 | |
|
|
f2666346c8 | |
|
|
ab6a6d852c | |
|
|
2b2d6d278c | |
|
|
703f53c8ac | |
|
|
529a43903c | |
|
|
c62ee92b86 | |
|
|
29af36c446 | |
|
|
035c63ce2b | |
|
|
b9328d0a1c | |
|
|
5d99a4c373 | |
|
|
87a544a526 | |
|
|
b1937c2c84 | |
|
|
520d791326 | |
|
|
f442a5a85c | |
|
|
0e3e975627 | |
|
|
3e49f319c2 | |
|
|
8e3ac4dca0 | |
|
|
2b66e1d7f8 | |
|
|
9605bb5499 | |
|
|
e1e501e150 | |
|
|
8dd53c530a | |
|
|
9326d10d51 | |
|
|
24bfe3763e | |
|
|
57958f9db4 | |
|
|
9ccd13a19c | |
|
|
c23ef86147 | |
|
|
4ab448e3c7 | |
|
|
a6cf6c70f3 | |
|
|
807d1970e6 | |
|
|
40a6a88305 | |
|
|
d4001e5f37 | |
|
|
cc5d5daf96 | |
|
|
92e79a74f4 | |
|
|
5b63e01215 | |
|
|
a5eb227aca | |
|
|
2d3ea3ea5e | |
|
|
ece7a35afd | |
|
|
f6ac523cd0 | |
|
|
62f0e6f25b | |
|
|
82b3a74435 | |
|
|
fde34fa151 | |
|
|
6ad7581fc7 | |
|
|
4d09e97c2e | |
|
|
9ee4ff1f30 | |
|
|
16fa1dae73 | |
|
|
f43b15a712 | |
|
|
85bba7828c | |
|
|
638ffcb824 | |
|
|
a71399f675 | |
|
|
e63122b160 | |
|
|
ca46106afb | |
|
|
2d49fbe45d | |
|
|
8655d7ed2f | |
|
|
b1191261f2 | |
|
|
b6f84338dc | |
|
|
37f0e88add | |
|
|
81f122c9fc | |
|
|
2f182c9b39 | |
|
|
87f006d66e | |
|
|
f47418ab32 | |
|
|
194497eed2 | |
|
|
7a3f337eb8 | |
|
|
c17b6302a4 | |
|
|
a0baa5b59a | |
|
|
0de026c34a | |
|
|
35e73b5106 | |
|
|
2a3c5eabba | |
|
|
679f919106 | |
|
|
6493a1bf0f | |
|
|
dc2df55efe | |
|
|
77c52b3625 | |
|
|
485f0ab001 | |
|
|
963e9feb1b | |
|
|
05c96ca98c | |
|
|
54de16a6c7 | |
|
|
0d0d0d26ae | |
|
|
0faa782b00 | |
|
|
bb2f0ea36e | |
|
|
913144f665 | |
|
|
c79a74d43f | |
|
|
2ea874c692 | |
|
|
a011e72584 | |
|
|
46e91a1e89 | |
|
|
07c7562628 | |
|
|
380a6312f8 | |
|
|
a40cfd9c5f | |
|
|
0359bc4947 | |
|
|
ff7dbe9a0c | |
|
|
736ff85457 | |
|
|
49e5ed4b5c | |
|
|
73af4a9a3c | |
|
|
802cc2d721 | |
|
|
aaf23343ac | |
|
|
cba4e6065e | |
|
|
139e4039a5 | |
|
|
aef0f1060d | |
|
|
a5e07a4f62 | |
|
|
cee5af2671 | |
|
|
46dfcc394a | |
|
|
6cf34acfc2 | |
|
|
4465ddf666 | |
|
|
9a6d9d1598 | |
|
|
84b5632d23 | |
|
|
3abfa4658a | |
|
|
b03afdb4e3 | |
|
|
0084a4e91c | |
|
|
ed28c771cb | |
|
|
4582bcac2f | |
|
|
db249cd6c7 | |
|
|
565e22f186 | |
|
|
1962b16d7b | |
|
|
badc547797 | |
|
|
647aa0b717 | |
|
|
06a9c4f2de | |
|
|
02cbc93a14 | |
|
|
5a16a5199e | |
|
|
c8633827cc | |
|
|
4ab5b59d7f | |
|
|
554217180e | |
|
|
1e9797f09a | |
|
|
5ea2ab4aa9 | |
|
|
8f0114bb00 | |
|
|
ba106d1f96 | |
|
|
bdd5a6a325 | |
|
|
a54580549a | |
|
|
636a8e2915 | |
|
|
d09082e6ea | |
|
|
cb577d265e | |
|
|
e2c096e65a | |
|
|
3d2fce5745 | |
|
|
697f207683 | |
|
|
def9db0884 | |
|
|
a3dfe46cbd | |
|
|
65be66ba91 | |
|
|
9804c20671 | |
|
|
b880b65e9e | |
|
|
83f2e1f9b8 | |
|
|
1799fc158c | |
|
|
a5e2a9cd6c | |
|
|
7fcdcfcb1e | |
|
|
adbc75f4e0 | |
|
|
9ac0246e02 | |
|
|
2f7fac1888 | |
|
|
1efdcca59c | |
|
|
6402da83aa | |
|
|
a4d0bc8177 | |
|
|
a627b9b6ab | |
|
|
63d85521eb | |
|
|
05d31a6012 | |
|
|
d140ef4f41 | |
|
|
d5cf194fd1 | |
|
|
d3dc53783e | |
|
|
59e21b5ed0 | |
|
|
8abd538d88 | |
|
|
5ce56b7030 | |
|
|
28d7354913 | |
|
|
086f203d70 | |
|
|
7cf201581e | |
|
|
57fbc3e5ae | |
|
|
81b9131f9e | |
|
|
9c636e6948 | |
|
|
1e279517e0 | |
|
|
089745dfa6 | |
|
|
cb7d853707 | |
|
|
66e15baaee | |
|
|
b2e8d69c61 | |
|
|
f49aa283f9 | |
|
|
407a5c7e52 | |
|
|
219dce9b2f | |
|
|
c6c2680993 | |
|
|
eb99040703 | |
|
|
85e2c074f7 | |
|
|
b3e25d7459 | |
|
|
26b8b4f2af | |
|
|
36ef5bd613 | |
|
|
cf04b0ce1b | |
|
|
4e8ecd339c | |
|
|
018f908806 | |
|
|
d3dccd5da9 | |
|
|
e8ad1ccc8d | |
|
|
e0781543b4 | |
|
|
face0eeafb | |
|
|
91d22d5e7d | |
|
|
fa09c5b303 | |
|
|
72be3befa7 | |
|
|
d67ab4d9b6 | |
|
|
2ea1f162b0 | |
|
|
af720a1bab | |
|
|
48b569f49d | |
|
|
2e3061a967 | |
|
|
7cea9eb628 | |
|
|
dd5adf82b8 | |
|
|
fde8599a15 | |
|
|
ac11e4fcc0 | |
|
|
8386120c87 | |
|
|
d0cf4a5cc6 | |
|
|
83413a2776 | |
|
|
925e2027e2 | |
|
|
75ac4e967c | |
|
|
07a6425ec4 | |
|
|
ea60344f02 | |
|
|
6ee3d6a8c9 | |
|
|
8641ac116c | |
|
|
3ecf72ebf2 | |
|
|
64b5293d7f | |
|
|
d16da9cdba | |
|
|
bf3df88987 | |
|
|
855e165bff | |
|
|
afedc67e9e | |
|
|
c234c61dfc | |
|
|
ca6380a9c0 | |
|
|
9c25679656 | |
|
|
618daced35 | |
|
|
8b3dd745ac | |
|
|
297f2ebe60 | |
|
|
1ef9645144 | |
|
|
da87e38df0 | |
|
|
740c83bb4a | |
|
|
1d00f35bc9 | |
|
|
7c1a4edbaf | |
|
|
ba18953745 | |
|
|
6ff09f5961 | |
|
|
4d5c78932e | |
|
|
b1e0dfb352 | |
|
|
7dc98c0cc7 | |
|
|
09661b8b0b | |
|
|
5e78e9b69f | |
|
|
678c8fa053 | |
|
|
75610b685f | |
|
|
a647b6123e | |
|
|
be2d4e1d39 | |
|
|
e11d6ffd76 | |
|
|
e1498a50f6 | |
|
|
9ab09c375f | |
|
|
a9832d38af | |
|
|
3b85017f91 | |
|
|
25acfbeb91 | |
|
|
4bc97b35fd | |
|
|
007d9e4336 | |
|
|
b15cf00d76 | |
|
|
f79cc209fb | |
|
|
bfa7670c2c | |
|
|
091552233c | |
|
|
289b808bf6 | |
|
|
d844832aad | |
|
|
2b723694fa | |
|
|
653da2ad81 | |
|
|
a9b9da0bbf |
|
|
@ -1 +1,5 @@
|
|||
/unpackage
|
||||
# 忽略提交文件
|
||||
/unpackage
|
||||
node_modules/
|
||||
.vscode/
|
||||
.hbuilderx/
|
||||
|
|
@ -1,16 +1,27 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
91
App.vue
91
App.vue
|
|
@ -1,15 +1,94 @@
|
|||
<template>
|
||||
</template>
|
||||
<script>
|
||||
import useStorage from '@/utils/useStroage.js';
|
||||
import Api from '@/common/js/api.js'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// console.log('App Launch');
|
||||
useStorage.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
globalData: {
|
||||
systemInfo: null,
|
||||
tableCode: null,
|
||||
shopId: null,
|
||||
queueId: null,
|
||||
},
|
||||
onLaunch: function(options) {
|
||||
if ( options.query&&options.query.qrCode ) {
|
||||
if (this.getQueryString(options.query.qrCode, 'code')) {
|
||||
this.globalData.tableCode = this.getQueryString(options.query.qrCode, 'code')
|
||||
}
|
||||
if (this.getQueryString(options.query.qrCode, 'shopId')) {
|
||||
this.globalData.shopId = this.getQueryString(options.query.qrCode, 'shopId')
|
||||
}
|
||||
if (this.getQueryString(options.query.qrCode, 'queueId')) {
|
||||
this.globalData.queueId = this.getQueryString(options.query.qrCode, 'queueId')
|
||||
}
|
||||
}
|
||||
if ( uni.getStorageSync("NAME") && !uni.getStorageSync("NAME").data) {
|
||||
uni.cache.clear();
|
||||
}
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
// #endif
|
||||
uni.cache.set('NAME', '零点八零');
|
||||
if (!uni.cache.get('token')) {
|
||||
this.$store.dispatch("loginEvent")
|
||||
}
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
onShow: function() {
|
||||
// console.log('App Show');
|
||||
// 获取导航栏信息
|
||||
wx.getSystemInfo({
|
||||
success: res => {
|
||||
this.globalData.systemInfo = res;
|
||||
}
|
||||
})
|
||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||
// #ifdef MP-WEIXIN
|
||||
// 当向小程序后台请求完新版本信息,会进行回调。res: {hasUpdate: true, version: 1.0.0}
|
||||
const updateManager = uni.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
if (res.hasUpdate) { // 有更新
|
||||
uni.showLoading({
|
||||
title: '更新中...'
|
||||
}); // 开始下载前,显示Loading
|
||||
}
|
||||
});
|
||||
// 当新版本下载完成,会进行回调
|
||||
updateManager.onUpdateReady(function() {
|
||||
uni.hideLoading(); // 关闭 Loading
|
||||
uni.showModal({ // 弹确认框(强制更新)
|
||||
title: '更新提示',
|
||||
content: '更新完毕,是否重启?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
updateManager.applyUpdate(); // 强制小程序重启并使用新版本。
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
// 当新版本下载失败,会进行回调
|
||||
updateManager.onUpdateFailed(function() {
|
||||
uni.hideLoading(); // 关闭 Loading
|
||||
uni.showToast({
|
||||
title: '更新失败,稍后再试...',
|
||||
icon: "error"
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
|
||||
},
|
||||
onHide: function() {
|
||||
// console.log('App Hide');
|
||||
},
|
||||
methods: {
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -70,7 +149,7 @@
|
|||
}
|
||||
|
||||
page {
|
||||
background-color: #f2f2f2;
|
||||
background-color: #F6F6F6!important;
|
||||
}
|
||||
|
||||
text {
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
var crypto = require('crypto')
|
||||
|
||||
function WXBizDataCrypt(appId, sessionKey) {
|
||||
this.appId = appId
|
||||
this.sessionKey = sessionKey
|
||||
}
|
||||
|
||||
WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) {
|
||||
// base64 decode
|
||||
var sessionKey = new Buffer(this.sessionKey, 'base64')
|
||||
encryptedData = new Buffer(encryptedData, 'base64')
|
||||
iv = new Buffer(iv, 'base64')
|
||||
|
||||
try {
|
||||
// 解密
|
||||
var decipher = crypto.createDecipheriv('aes-128-cbc', sessionKey, iv)
|
||||
// 设置自动 padding 为 true,删除填充补位
|
||||
decipher.setAutoPadding(true)
|
||||
var decoded = decipher.update(encryptedData, 'binary', 'utf8')
|
||||
decoded += decipher.final('utf8')
|
||||
|
||||
decoded = JSON.parse(decoded)
|
||||
|
||||
} catch (err) {
|
||||
throw new Error('Illegal Buffer')
|
||||
}
|
||||
|
||||
if (decoded.watermark.appid !== this.appId) {
|
||||
throw new Error('Illegal Buffer')
|
||||
}
|
||||
|
||||
return decoded
|
||||
}
|
||||
|
||||
module.exports = WXBizDataCrypt
|
||||
395
common/js/api.js
395
common/js/api.js
|
|
@ -1,50 +1,397 @@
|
|||
export default {
|
||||
userwxlogin(data) { //登录
|
||||
return uni.api.post("/login/wx/custom/login", data);
|
||||
return uni.api.post("/login/auth/custom/login", data);
|
||||
},
|
||||
productqueryProduct(data) { //获取商品信息
|
||||
return uni.api.post("/product/queryProduct", data);
|
||||
loginwxuserInfo(data) { //获取用户详情
|
||||
return uni.api.get("/login/userInfo", data,false);
|
||||
},
|
||||
cartadd(data) { //添加到购物车
|
||||
return uni.api.post("/cart/add", data);
|
||||
userwxlogins(data) { // 获取手机号
|
||||
console.log(data)
|
||||
return uni.api.post("/login/getPhoneNumber", data);
|
||||
},
|
||||
cartcartList(data) { //购物车
|
||||
return uni.api.get("/cart/cartList", data);
|
||||
getShopExtend(data) { //获取图片 通过shopId和autokey
|
||||
return uni.api.post("/common/shopExtend", data,false);
|
||||
},
|
||||
// 获取弹窗广告列表
|
||||
getPopUpAd(data) {
|
||||
return uni.api.get("/tbShopAd/list", data,false);
|
||||
},
|
||||
logincreateCardNo(data) { //获取会员码
|
||||
return uni.api.get("/login/createCardNo", data);
|
||||
},
|
||||
cartupdateNumber(data) { //购物车更改数量
|
||||
return uni.api.get("/cart/updateNumber", data);
|
||||
productqueryShop(data) { //通过桌码获取店铺信息
|
||||
return uni.api.get("/product/queryShop", data);
|
||||
},
|
||||
ordercreatOrder(data) { //下单
|
||||
return uni.api.post("/order/creatOrder", data);
|
||||
productChoseCount(data) { //就餐人数选择
|
||||
return uni.api.post("/product/choseCount", data,false);
|
||||
},
|
||||
cartclear(data) { //清空购物车
|
||||
return uni.api.get("/cart/clear", data);
|
||||
productqueryProduct(data) { //获取商品信息
|
||||
return uni.api.post("/product/queryProduct", data, false);
|
||||
},
|
||||
payorderPay(data) { //订单支付
|
||||
productquerySpec(data) { //获取已上架商品规格
|
||||
return uni.api.post("/product/querySpec", data, false);
|
||||
},
|
||||
cartAdd(data) { //添加到购物车
|
||||
return uni.api.post("/product/addCart", data);
|
||||
},
|
||||
cleanCart(data) { //清空购物车
|
||||
return uni.api.post("/product/cleanCart", data);
|
||||
},
|
||||
// 下单详情
|
||||
getproductorderConfirm(data) {
|
||||
return uni.api.get("/product/orderConfirm", data);
|
||||
},
|
||||
// 下单详情
|
||||
getproductorderConfirm(data) {
|
||||
return uni.api.get("/product/orderConfirm", data);
|
||||
},
|
||||
|
||||
choseEatModel(data) { //就餐模式选择
|
||||
return uni.api.post("/product/choseEatModel", data, false);
|
||||
},
|
||||
|
||||
// 支付
|
||||
payOrderPay(data) {
|
||||
return uni.api.post("/pay/groupOrderPay", data);
|
||||
},
|
||||
// 会员支付
|
||||
accountPay(data) {
|
||||
return uni.api.get("/pay/accountPay", data);
|
||||
},
|
||||
orderPay(data) { //订单支付
|
||||
return uni.api.post("/pay/orderPay", data);
|
||||
},
|
||||
orderorderList(data) { //订单列表
|
||||
return uni.api.get("/order/orderList", data);
|
||||
cancelOrderPay(data) { //订单支付
|
||||
return uni.api.post("/notify/cancel", data);
|
||||
},
|
||||
orderorderInfo(data) { //订单回显
|
||||
return uni.api.get("/order/orderInfo", data);
|
||||
},
|
||||
loginwxuserInfo(data) { //微信用户详情
|
||||
return uni.api.get("/login/wx/userInfo", data);
|
||||
|
||||
paymodfiyOrderInfo(data) { //查询订单支付状态
|
||||
return uni.api.post("/pay/modfiyOrderInfo", data);
|
||||
},
|
||||
paymemeberIn(data) { //充值
|
||||
return uni.api.post("/pay/memeberIn", data);
|
||||
},
|
||||
paymodfiyOrderInfo(data) { //查询订单支付状态
|
||||
return uni.api.post("/pay/modfiyOrderInfo", data);
|
||||
|
||||
|
||||
orderorderList(data) { //订单列表
|
||||
return uni.api.get("/order/orderList", data);
|
||||
},
|
||||
orderorderInfo(data) { //订单回显
|
||||
return uni.api.get("/order/orderInfo", data ,false);
|
||||
},
|
||||
removeOrder(data) { //删除订单
|
||||
return uni.api.post("/order/rmOrder", data);
|
||||
},
|
||||
creatOrder(data) { //创建订单
|
||||
return uni.api.post("/order/creatOrder", data);
|
||||
},
|
||||
useCoupon(data) { //订单选择优惠券
|
||||
return uni.api.post("/order/useCoupon", data);
|
||||
},
|
||||
|
||||
|
||||
// 团购订单列表
|
||||
groupOrderInfo(data) { //订单列表
|
||||
return uni.api.get("/groupOrderInfo/list", data);
|
||||
},
|
||||
|
||||
groupOrderInfoDetail(data) { //订单回显
|
||||
return uni.api.get("/groupOrderInfo/get", data);
|
||||
},
|
||||
// 下单
|
||||
creatGroupOrder(data) {
|
||||
return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 获取店铺会员信息
|
||||
shopUserInfo(data) {
|
||||
return uni.api.get("/user/shopUserInfo", data,false);
|
||||
},
|
||||
// 注册会员
|
||||
openMember(data) {
|
||||
return uni.api.post("/user/openMember", data);
|
||||
},
|
||||
// 会员填充手机号
|
||||
upVipPhont(data) {
|
||||
return uni.api.post("/user/upVipPhont", data);
|
||||
},
|
||||
|
||||
|
||||
// 优惠券数量
|
||||
userCoupon(data) {
|
||||
return uni.api.get("/user/userCoupon", data);
|
||||
},
|
||||
// 优惠加倍
|
||||
yhqDouble(data) { //查询订单支付状态
|
||||
return uni.api.post("/order/yhqDouble", data);
|
||||
},
|
||||
// 优惠卷详情
|
||||
getYhqDouble(data) { //通过选中的商品规格查询价格
|
||||
return uni.api.get("/order/getYhqDouble", data);
|
||||
},
|
||||
productqueryProductSku(data) { //通过选中的商品规格查询价格
|
||||
return uni.api.get("/product/queryProductSku", data);
|
||||
return uni.api.get("/product/queryProductSku", data, false);
|
||||
},
|
||||
logingetPhoneNumber(data) { //小程序获取手机号
|
||||
return uni.api.post("/login/getPhoneNumber", data);
|
||||
},
|
||||
cashierServiceloginregister(data) { //用户注册
|
||||
return uni.api.post("/cashierService/login/register", data);
|
||||
},
|
||||
cashierServiceloginregister(data) { //APP登录
|
||||
return uni.api.post("/login/app/login", data);
|
||||
},
|
||||
phoneValidateCode(data) { //验证码
|
||||
return uni.api.get("/phoneValidateCode", data);
|
||||
},
|
||||
homehomePageUp(data) { //首页上半部分
|
||||
return uni.api.post("/home/homePageUp", data);
|
||||
},
|
||||
home(data) { //首页上半部分
|
||||
return uni.api.post("/home", data, false);
|
||||
},
|
||||
locationdistrict(data) { //获取行政区域(区,街道)
|
||||
return uni.api.get("/location/district", data);
|
||||
},
|
||||
queryMemberAccount(data) { //获取余额明细
|
||||
return uni.api.get("/pay/queryMemberAccount", data);
|
||||
},
|
||||
queryMemberPointsLog(data) { //获取余额明细
|
||||
return uni.api.get("/api/points/member-points-log/page", data);
|
||||
},
|
||||
ordermineCoupons(data) { //我的优惠券
|
||||
return uni.api.get("/order/mineCoupons", data, false);
|
||||
},
|
||||
getUserConpons(data) { //我的优惠券
|
||||
return uni.api.post("/userConpons/find", data);
|
||||
},
|
||||
conponList(data) { //获取优惠券
|
||||
return uni.api.post("/coupon/find", data);
|
||||
},
|
||||
ordergetYhqPara(data) { //获取优惠券参数列表
|
||||
return uni.api.get("/order/getYhqPara", data);
|
||||
},
|
||||
orderfindCoupons(data) { //系统优惠券
|
||||
return uni.api.get("/order/findCoupons", data);
|
||||
},
|
||||
tbPlatformDict(data) { //获取菜单
|
||||
return uni.api.get("/tbPlatformDict", data);
|
||||
},
|
||||
distirictsubShopList(data) { //预约到店(店铺列表)
|
||||
return uni.api.get("/distirict/subShopList", data);
|
||||
},
|
||||
distiricttopCommon(data) { //获取top部分(店铺列表)
|
||||
return uni.api.get("/distirict/topCommon", data);
|
||||
},
|
||||
orderfindWiningUser(data) { //获取免单订单
|
||||
return uni.api.get("/order/findWiningUser", data);
|
||||
},
|
||||
// 获取自己的免单订单
|
||||
ordermineWinner(data) {
|
||||
return uni.api.get("/order/mineWinner", data);
|
||||
},
|
||||
indexlist(data) { //商品列表(今日上新/热榜/咖啡饮品)
|
||||
return uni.api.get("/distirict/productCate", data, false);
|
||||
},
|
||||
productproductInfo(data) { //商品详情
|
||||
return uni.api.get("/product/productInfo", data);
|
||||
},
|
||||
distirictcomShopList(data) { //通用门店列表
|
||||
return uni.api.get("/distirict/comShopList", data);
|
||||
},
|
||||
loginOut(data) { //退出登录
|
||||
return uni.api.post("/login/loginOut", data);
|
||||
},
|
||||
productqueryShopIdByTableCode(data) { //通过桌码获取shopId
|
||||
return uni.api.get("/product/queryShopIdByTableCode", data);
|
||||
},
|
||||
geocodelocation(data) { //根据经纬度获取信息
|
||||
return uni.api.get("/location/geocode", data, false);
|
||||
},
|
||||
// 修改头像和昵称
|
||||
upUserInfo(data) {
|
||||
return uni.api.post("/login/upUserInfo", data);
|
||||
},
|
||||
loginresetPwd(data) { // 重置资金密码
|
||||
return uni.api.post("/login/resetPwd", data);
|
||||
},
|
||||
paygetActive(data) { // 获取充值活动
|
||||
return uni.api.get("/pay/getActive", data);
|
||||
},
|
||||
paygetShopByMember(data) { // 获取会员店铺信息
|
||||
return uni.api.get("/pay/getShopByMember", data, false);
|
||||
},
|
||||
loginmpdifyPwd(data) { // 修改资金密码
|
||||
return uni.api.get("/login/mpdifyPwd", data);
|
||||
},
|
||||
cashierServicesong(data) { // 获取所有歌曲,支持搜索及分页
|
||||
return uni.api.get("/song", data, false);
|
||||
},
|
||||
cashierServicerecord(data) { // 点歌记录
|
||||
return uni.api.get("/song/record", data);
|
||||
},
|
||||
cashierServicesongpost(data) { // 点歌
|
||||
return uni.api.post("/song", data);
|
||||
},
|
||||
businessopenId(data) { // 获取openId
|
||||
return uni.api.get("/login/wx/business/openId", data);
|
||||
},
|
||||
songsinging(data) { // 获取正在演唱的歌曲
|
||||
return uni.api.get("/song/singing", data, false);
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取排号信息
|
||||
* @param {Object} param
|
||||
*/
|
||||
getQueueUpList(param) {
|
||||
return uni.api.get("/callTable/queue", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取桌型列表
|
||||
* @param {Object} param
|
||||
*/
|
||||
getQueueUpTablList(param) {
|
||||
return uni.api.get("/callTable", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取排号状态
|
||||
* @param {Object} param
|
||||
*/
|
||||
getQueueUpState(param) {
|
||||
return uni.api.get("/callTable/state", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取订阅
|
||||
* @param {Object} data
|
||||
*/
|
||||
setSubMsg(data) {
|
||||
return uni.api.post("/callTable/subMsg", data,false);
|
||||
},
|
||||
|
||||
/**
|
||||
* 取号
|
||||
* @param {Object} data
|
||||
*/
|
||||
getTakeNumber(data) {
|
||||
return uni.api.post("/callTable/takeNumber", data, false);
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消排号
|
||||
* @param {Object} data
|
||||
*/
|
||||
cancelTakeNumber(data) {
|
||||
return uni.api.post("/callTable/cancel", data, false);
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 积分-基本设置-获取店铺设置
|
||||
* @param {Object} param
|
||||
*/
|
||||
shopSettingInfo(shopId) {
|
||||
return uni.api.get(`/api/points/basic-setting/${shopId}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 积分-兑换商品列表
|
||||
* @param {Object} param
|
||||
*/
|
||||
pointsGoodsList(param) {
|
||||
return uni.api.get("/api/points/goods-setting/page", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 积分-生成订单
|
||||
* @param {Object} data
|
||||
*/
|
||||
pointsCreateOrder(data) {
|
||||
return uni.api.post("/api/points/exchange-record/create", data);
|
||||
},
|
||||
/**
|
||||
* 积分-支付订单
|
||||
* @param {Object} data
|
||||
*/
|
||||
pointsPayOrder(data) {
|
||||
return uni.api.post("/api/points/exchange-record/pay", data);
|
||||
},
|
||||
/**
|
||||
* 积分-取消订单
|
||||
* @param {Object} data
|
||||
*/
|
||||
pointsCancelOrder(data) {
|
||||
return uni.api.post("/api/points/exchange-record/cancel", data);
|
||||
},
|
||||
/**
|
||||
* 积分-001-会员积分账户信息
|
||||
* @param {Object} param
|
||||
*/
|
||||
memberPointsInfo(memberId) {
|
||||
return uni.api.get(`/api/points/member-points/${memberId}`, );
|
||||
},
|
||||
|
||||
/**
|
||||
* 积分-明细列表
|
||||
* @param {Object} param
|
||||
*/
|
||||
memberPointsLogList(param) {
|
||||
return uni.api.get("/api/points/member-points-log/page", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 积分-兑换记录-列表
|
||||
* @param {Object} param
|
||||
*/
|
||||
exchangeRecordList(param) {
|
||||
return uni.api.get("/api/points/exchange-record/page", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 积分-获取订单可用积分及抵扣金额
|
||||
* @param {Object} param
|
||||
*/
|
||||
calcUsablePoints(param) {
|
||||
return uni.api.get("/api/points/member-points/calc-usable-points", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享-获取邀请页数据
|
||||
* @param {Object} param
|
||||
*/
|
||||
getByShopId(param) {
|
||||
return uni.api.get("/tbShopShare/getByShopId", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享-邀请记录
|
||||
* @param {Object} param
|
||||
*/
|
||||
shareRecord(param) {
|
||||
return uni.api.get("/tbShopShare/record", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享-被邀请人进入页面时使用
|
||||
* @param {Object} param
|
||||
*/
|
||||
shareHeOpen(param) {
|
||||
return uni.api.post("/tbShopShare/open", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享-被邀请人领取优惠券时使用
|
||||
* @param {Object} param
|
||||
*/
|
||||
shareReceive(param) {
|
||||
return uni.api.post("/tbShopShare/receive", param);
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
export default {
|
||||
|
||||
/**
|
||||
* 获取排号信息
|
||||
* @param {Object} param
|
||||
*/
|
||||
getQueueUpList(param) {
|
||||
return uni.api.get("/callTable/queue", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取桌型列表
|
||||
* @param {Object} param
|
||||
*/
|
||||
getQueueUpTablList(param) {
|
||||
return uni.api.get("/callTable", param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 取号
|
||||
* @param {Object} data
|
||||
*/
|
||||
getTakeNumber(data) {
|
||||
return uni.api.post("/callTable/takeNumber", data, false);
|
||||
},
|
||||
|
||||
/**
|
||||
* 取消排号
|
||||
* @param {Object} data
|
||||
*/
|
||||
cancelTakeNumber(data) {
|
||||
return uni.api.post("/callTable", data, false);
|
||||
},
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,74 +0,0 @@
|
|||
const env = {
|
||||
aliyunServerURL: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com',
|
||||
accessid: 'LTAI5tMLHwnM1zYYAFuRa1fK',
|
||||
AccessKeySecret: 'jS1h2STq1vcODczDNFQkjcU6ODyYAj',
|
||||
timeout: 100000
|
||||
}
|
||||
|
||||
const Base64 = require('./Base64.js');
|
||||
|
||||
require('./hmac.js');
|
||||
require('./sha1.js');
|
||||
const Crypto = require('./crypto.js');
|
||||
|
||||
|
||||
const uploadFile = function(filePath, key = new Date().getTime()) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// const aliyunFileKey = `${new Date().getTime()}_${userId}`;
|
||||
const aliyunServerURL = env.aliyunServerURL;
|
||||
const accessid = env.accessid;
|
||||
const policyBase64 = getPolicyBase64();
|
||||
const signature = getSignature(policyBase64);
|
||||
|
||||
wx.uploadFile({
|
||||
url: aliyunServerURL, //仅为示例,非真实的接口地址
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
formData: {
|
||||
'key': 'headportrait/' + key,
|
||||
'OSSAccessKeyId': accessid,
|
||||
'policy': policyBase64,
|
||||
'Signature': signature,
|
||||
'success_action_status': '200',
|
||||
},
|
||||
success: function(res) {
|
||||
if (res.statusCode != 200) {
|
||||
reject('上传错误:' + JSON.stringify(res))
|
||||
return;
|
||||
}
|
||||
resolve(`https://czh5.sxczgkj.cn/headportrait/${key}`)
|
||||
},
|
||||
fail: function(err) {
|
||||
reject('上传错误:' + JSON.stringify(err))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getPolicyBase64 = function() {
|
||||
let date = new Date();
|
||||
date.setHours(date.getHours() + env.timeout);
|
||||
let srcT = date.toISOString();
|
||||
const policyText = {
|
||||
"expiration": srcT, //设置该Policy的失效时间,超过这个失效时间之后,就没有办法通过这个policy上传文件了 指定了Post请求必须发生在2020年01月01日12点之前("2020-01-01T12:00:00.000Z")。
|
||||
"conditions": [
|
||||
["content-length-range", 0, 20 * 1024 * 1024] // 设置上传文件的大小限制,1048576000=1000mb
|
||||
]
|
||||
};
|
||||
|
||||
const policyBase64 = Base64.encode(JSON.stringify(policyText));
|
||||
return policyBase64;
|
||||
}
|
||||
|
||||
const getSignature = function(policyBase64) {
|
||||
const accesskey = env.AccessKeySecret;
|
||||
|
||||
const bytes = Crypto.HMAC(Crypto.SHA1, policyBase64, accesskey, {
|
||||
asBytes: true
|
||||
});
|
||||
const signature = Crypto.util.bytesToBase64(bytes);
|
||||
|
||||
return signature;
|
||||
}
|
||||
|
||||
module.exports = uploadFile;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
export default {
|
||||
userwxlogin(data) { //登录
|
||||
return uni.api.post("/login/wx/custom/login", data, type = 2);
|
||||
},
|
||||
}
|
||||
|
|
@ -1,148 +1,231 @@
|
|||
class webSocketUtils {
|
||||
constructor(url, time, params) {
|
||||
this.socketTask = null;
|
||||
this.is_open_socket = false; //避免重复连接
|
||||
this.url = url;
|
||||
this.params = params ? params : null;////是否初始化请求
|
||||
this.connectNum = 1; // 重连次数
|
||||
//这个参数是防止重连失败之后onClose方法会重复执行reconnect方法,导致重连定时器出问题
|
||||
//连接并打开之后可重连,且只执行重连方法一次
|
||||
this.canReconnect = false; // 是否可以重连
|
||||
//心跳检测
|
||||
this.timeout = time ? time : 5000; //多少秒执行检测
|
||||
this.heartbeatInterval = null; //检测服务器端是否还活着
|
||||
this.reconnectTimeOut = null; //重连之后多久再次重连
|
||||
try {
|
||||
return this.connectSocketInit({
|
||||
data: this.params,
|
||||
type: 'connectSocketInit',
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('catch');
|
||||
this.reconnect();
|
||||
}
|
||||
}
|
||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||
connectSocketInit (data) {
|
||||
console.log(data,"初始化")
|
||||
this.data = data;
|
||||
// console.log('this.url==', this.url);
|
||||
// console.log('this.params==', this.params);
|
||||
this.socketTask = uni.connectSocket({
|
||||
url: this.url,
|
||||
success: () => {
|
||||
console.log('正准备建立websocket中...');
|
||||
uni.hideLoading();
|
||||
// 返回实例
|
||||
return this.socketTask;
|
||||
},
|
||||
});
|
||||
this.socketTask.onOpen((res) => {
|
||||
this.connectNum = 1;
|
||||
console.log('WebSocket连接正常!');
|
||||
if(this.params){//是否初始化请求
|
||||
this.send(this.params);
|
||||
}
|
||||
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
clearInterval(this.heartbeatInterval);
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = true;
|
||||
this.start();
|
||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||
this.socketTask.onMessage((e) => {
|
||||
// 字符串转json
|
||||
let res = JSON.parse(e.data);
|
||||
uni.$emit('message', res)
|
||||
// 普通socket信息处理 TODO
|
||||
|
||||
});
|
||||
});
|
||||
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||
uni.onSocketError((res) => {
|
||||
console.log('网络断开,请检查!');
|
||||
this.socketTask = null;
|
||||
this.is_open_socket = false;
|
||||
this.canReconnect = true;
|
||||
clearInterval(this.heartbeatInterval);
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
if (this.connectNum <= 10) {
|
||||
uni.showToast({
|
||||
title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
||||
icon: 'none',
|
||||
});
|
||||
this.reconnect();
|
||||
this.connectNum += 1;
|
||||
} else {
|
||||
// uni.$emit('connectError');
|
||||
uni.showToast({
|
||||
title: `网络连接失败,请检查网络!`,
|
||||
icon: 'none',
|
||||
});
|
||||
this.connectNum = 1;
|
||||
this.canReconnect = false;
|
||||
}
|
||||
});
|
||||
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||
this.socketTask.onClose(() => {
|
||||
this.socketTask = null;
|
||||
clearInterval(this.heartbeatInterval);
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
|
||||
this.is_open_socket = false;
|
||||
if (this.canReconnect) {
|
||||
this.reconnect();
|
||||
this.canReconnect = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 主动关闭socket连接
|
||||
Close () {
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = false;
|
||||
if(this.socketTask){
|
||||
this.socketTask.close({
|
||||
success(res) {
|
||||
console.log('手动关闭成功');
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
//发送消息
|
||||
send(data) {
|
||||
console.log("发送消息---------->", data);
|
||||
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||
if (this.socketTask) {
|
||||
this.socketTask.send({
|
||||
data: JSON.stringify(data),
|
||||
async success() {
|
||||
console.log("消息发送成功");
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
//开启心跳检测
|
||||
start(data) {
|
||||
console.log('开启心跳检测',data)
|
||||
// this.heartbeatInterval = setInterval(() => {
|
||||
// this.send({
|
||||
// data: '心跳检测',
|
||||
// type: 'jc',
|
||||
// });
|
||||
// }, this.timeout);
|
||||
}
|
||||
//重新连接
|
||||
reconnect() {
|
||||
//停止发送心跳
|
||||
clearInterval(this.heartbeatInterval);
|
||||
//如果不是人为关闭的话,进行重连
|
||||
if (!this.is_open_socket) {
|
||||
console.log('进行重连');
|
||||
// this.canReconnect = true;
|
||||
this.reconnectTimeOut = setInterval(() => {
|
||||
this.connectSocketInit(this.data);
|
||||
}, this.timeout);
|
||||
}
|
||||
}
|
||||
constructor(url, time, params) {
|
||||
this.socketTask = null;
|
||||
this.is_open_socket = false; //避免重复连接
|
||||
this.url = url;
|
||||
this.params = params ? params : null; ////是否初始化请求
|
||||
this.connectNum = 1; // 重连次数
|
||||
//这个参数是防止重连失败之后onClose方法会重复执行reconnect方法,导致重连定时器出问题
|
||||
//连接并打开之后可重连,且只执行重连方法一次
|
||||
this.canReconnect = false; // 是否可以重连
|
||||
//心跳检测
|
||||
this.timeout = time ? time : 5000; //多少秒执行检测
|
||||
this.heartbeatInterval = null; //检测服务器端是否还活着
|
||||
this.reconnectTimeOut = null; //重连之后多久再次重连
|
||||
try {
|
||||
|
||||
return this.connectSocketInit({
|
||||
data: this.params,
|
||||
type: 'connectSocketInit',
|
||||
});
|
||||
} catch (e) {
|
||||
// console.log('catch');
|
||||
this.reconnect();
|
||||
}
|
||||
}
|
||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||
connectSocketInit(data) {
|
||||
let _this = this;
|
||||
this.data = data;
|
||||
// #ifdef MP-WEIXIN
|
||||
this.socketTask = uni.connectSocket({
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.connectSocket({
|
||||
// #endif
|
||||
url: this.url,
|
||||
success: (res) => {
|
||||
console.log('创建websocketc成功...');
|
||||
// uni.hideLoading();
|
||||
// 返回实例
|
||||
return this.socketTask;
|
||||
},
|
||||
fail: (res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.socketTask.onOpen((res) => {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.onSocketOpen((res) => {
|
||||
// #endif
|
||||
uni.hideLoading()
|
||||
this.connectNum = 1;
|
||||
console.log('WebSocket连接正常!==',res);
|
||||
if (this.params) { //是否初始化请求
|
||||
this.send(this.params);
|
||||
}
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
clearInterval(this.heartbeatInterval);
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = true;
|
||||
this.start();
|
||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||
// #ifdef MP-WEIXIN
|
||||
this.socketTask.onMessage((e) => {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.onSocketMessage((e)=>{
|
||||
// #endif
|
||||
// 字符串转json
|
||||
let res = JSON.parse(e.data);
|
||||
uni.$emit('message', res)
|
||||
// 普通socket信息处理 TODO
|
||||
});
|
||||
});
|
||||
|
||||
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.onSocketError((res) => {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.onSocketError((res) => {
|
||||
// #endif
|
||||
console.log('网络断开,请检查!');
|
||||
this.socketTask = null;
|
||||
this.is_open_socket = false;
|
||||
// this.Close()
|
||||
this.canReconnect = true;
|
||||
clearInterval(this.heartbeatInterval);
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
try {
|
||||
if (this.connectNum <= 10) {
|
||||
// uni.showLoading({
|
||||
// title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
||||
// mask: true
|
||||
// })
|
||||
uni.$emit('message', 1) //进行重连
|
||||
uni.showToast({
|
||||
title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
||||
icon: 'none',
|
||||
});
|
||||
this.reconnect();
|
||||
this.connectNum += 1;
|
||||
} else {
|
||||
// uni.$emit('connectError');
|
||||
uni.showToast({
|
||||
title: `网络连接失败,请检查网络!`,
|
||||
icon: 'none',
|
||||
});
|
||||
this.connectNum = 1;
|
||||
this.canReconnect = false;
|
||||
this.Close()
|
||||
setTimeout(res => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, 1000)
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
});
|
||||
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||
// #ifdef MP-WEIXIN
|
||||
this.socketTask.onClose(() => {
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.onSocketClose((res) => {
|
||||
// #endif
|
||||
console.log("socket关闭了")
|
||||
this.socketTask = null;
|
||||
clearInterval(this.heartbeatInterval);
|
||||
clearInterval(this.reconnectTimeOut);
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败
|
||||
my.offSocketMessage();
|
||||
my.offSocketError();
|
||||
my.offSocketOpen();
|
||||
my.offSocketClose();
|
||||
// #endif
|
||||
this.is_open_socket = false;
|
||||
if (this.canReconnect) {
|
||||
this.reconnect();
|
||||
this.canReconnect = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 主动关闭socket连接
|
||||
Close() {
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = false;
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (this.socketTask) {
|
||||
this.socketTask.close({
|
||||
success(res) {
|
||||
console.log('手动关闭成功');
|
||||
},
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.closeSocket({
|
||||
success(res) {
|
||||
console.log('手动关闭成功');
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序的ws连接问题,关闭连接时需关闭对于接受,防止关闭失败
|
||||
my.offSocketMessage();
|
||||
my.offSocketError();
|
||||
my.offSocketOpen();
|
||||
my.offSocketClose();
|
||||
// #endif
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('手动关闭失败==',res);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
//发送消息
|
||||
send(data) {
|
||||
// console.log("发送消息---------->", data);
|
||||
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (this.socketTask) {
|
||||
this.socketTask.send({
|
||||
data: JSON.stringify(data),
|
||||
async success() {
|
||||
// console.log("消息发送成功");
|
||||
},
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
my.sendSocketMessage({
|
||||
data: JSON.stringify(data),
|
||||
success(res) {
|
||||
// console.log("消息发送成功");
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
//开启心跳检测
|
||||
start(data) {
|
||||
// console.log('开启心跳检测', data)
|
||||
this.heartbeatInterval = setInterval(() => {
|
||||
this.send({
|
||||
data: '心跳检测',
|
||||
type: 'heartbeat',
|
||||
});
|
||||
}, this.timeout);
|
||||
}
|
||||
//重新连接
|
||||
reconnect() {
|
||||
//停止发送心跳
|
||||
clearInterval(this.heartbeatInterval);
|
||||
//如果不是人为关闭的话,进行重连
|
||||
if (!this.is_open_socket) {
|
||||
console.log('进行重连');
|
||||
this.canReconnect = true;
|
||||
this.reconnectTimeOut = setInterval(() => {
|
||||
this.connectSocketInit(this.data);
|
||||
}, this.timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = webSocketUtils;
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="swiperPanel" @touchstart="startMove" @touchend="endMove">
|
||||
<view class="swiperItem" v-for="(item, index) in swiperList" :key="index"
|
||||
:style="{transform: itemStyle[index].transform, zIndex: itemStyle[index].zIndex, opacity: itemStyle[index].opacity}">
|
||||
<view class="children">
|
||||
<image class="pic" :src="item.logo"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <swiper class="swiperItem" circular v-for="(item, index) in swiperList" :key="index"
|
||||
:style="{transform: itemStyle[index].transform, zIndex: itemStyle[index].zIndex, opacity: itemStyle[index].opacity}">
|
||||
<swiper-item class="children">
|
||||
<image class="pic" :src="item.logo"></image>
|
||||
</swiper-item>
|
||||
</swiper> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
swiperList: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
timersetnteritem: {
|
||||
type: String,
|
||||
default: '0'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timersetInterval: null,
|
||||
slideNote: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
screenWidth: 0,
|
||||
itemStyle: [
|
||||
{
|
||||
transform:''
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
timersetnteritem(newVal,oldVal) {
|
||||
if (newVal == 1) {
|
||||
clearTimeout(this.timersetInterval);
|
||||
this.timersetInterval = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var macInfo = uni.getSystemInfoSync();
|
||||
this.screenWidth = macInfo.screenWidth;
|
||||
// 计算swiper样式
|
||||
this.swiperList.forEach((item, index) => {
|
||||
this.itemStyle.push(this.getStyle(index))
|
||||
})
|
||||
// this.timersetInterval = setInterval(() => {
|
||||
// this.endMove()
|
||||
// }, 2000);
|
||||
},
|
||||
methods: {
|
||||
getStyle(e) {
|
||||
if (e > this.swiperList.length / 2) {
|
||||
var right = this.swiperList.length - e
|
||||
return {
|
||||
transform: 'scale(' + (1) + ') translate(-' + (right * 20) + '%,0px)',
|
||||
zIndex: 9999 - right,
|
||||
opacity: 1
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
transform: 'scale(' + (1) + ') translate(' + (e * 20) + '%,0px)',
|
||||
zIndex: 9999 - e,
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
// if (e > this.swiperList.length / 2) {
|
||||
// var right = this.swiperList.length - e
|
||||
// return {
|
||||
// transform: 'scale(' + (1 - right / 10) + ') translate(-' + (right * 9) + '%,0px)',
|
||||
// zIndex: 9999 - right,
|
||||
// opacity: 0.8 / right
|
||||
// }
|
||||
// } else {
|
||||
// return {
|
||||
// transform: 'scale(' + (1 - e / 10) + ') translate(' + (e * 9) + '%,0px)',
|
||||
// zIndex: 9999 - e,
|
||||
// opacity: 0.8 / e
|
||||
// }
|
||||
// }
|
||||
},
|
||||
startMove(e) {
|
||||
this.slideNote.x = e.changedTouches[0] ? e.changedTouches[0].pageX : 0;
|
||||
this.slideNote.y = e.changedTouches[0] ? e.changedTouches[0].pageY : 0;
|
||||
},
|
||||
endMove(e) {
|
||||
var newList = JSON.parse(JSON.stringify(this.itemStyle))
|
||||
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
|
||||
// 向左滑动
|
||||
var last = [newList.pop()]
|
||||
newList = last.concat(newList)
|
||||
// } else {
|
||||
// 向右滑动
|
||||
// newList.push(newList[0])
|
||||
// newList.splice(0, 1)
|
||||
// }
|
||||
this.itemStyle = newList
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.swiperPanel {
|
||||
height: 28rpx;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.swiperItem {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: all .5s;
|
||||
|
||||
/* 定义一个动画关键帧 */
|
||||
|
||||
|
||||
.children {
|
||||
height: 100%;
|
||||
width: 25%;
|
||||
// margin: 2rpx auto;
|
||||
|
||||
|
||||
/* 应用动画,设置动画时长、循环次数和速度曲线 */
|
||||
.pic {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 50%;
|
||||
// box-shadow: 0 0 10px #333;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<u-image :src="src" :radius="radius" :width="width" :height="height" :fade="false"></u-image>
|
||||
<u-image :src="src" :radius="radius" :width="width" :height="height" :fade="false" :lazy-load="true" slot="loading"></u-image>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,192 @@
|
|||
<template>
|
||||
<view class="uni-countdown">
|
||||
<text v-if="showDay" class="uni-countdown__number">{{ d }}</text>
|
||||
<text v-if="showDay" class="uni-countdown__splitor">天</text>
|
||||
<text class="uni-countdown__number">{{ h }}</text>
|
||||
<text class="uni-countdown__splitor">{{ showColon ? ':' : '时' }}</text>
|
||||
<text class="uni-countdown__number">{{ i }}</text>
|
||||
<text class="uni-countdown__splitor">{{ showColon ? ':' : '分' }}</text>
|
||||
<text class="uni-countdown__number">{{ s }}</text>
|
||||
<text v-if="!showColon" class="uni-countdown__splitor">秒</text>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/**
|
||||
* Countdown 倒计时
|
||||
* @description 倒计时组件
|
||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=25
|
||||
* @property {String} backgroundColor 背景色
|
||||
* @property {String} color 文字颜色
|
||||
* @property {Number} day 天数
|
||||
* @property {Number} hour 小时
|
||||
* @property {Number} minute 分钟
|
||||
* @property {Number} second 秒
|
||||
* @property {Boolean} showDay = [true|false] 是否显示天数
|
||||
* @property {Boolean} showColon = [true|false] 是否以冒号为分隔符
|
||||
* @property {String} splitorColor 分割符号颜色
|
||||
* @event {Function} timeup 倒计时时间到触发事件
|
||||
* @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
||||
*/
|
||||
export default {
|
||||
name: 'UniCountdown',
|
||||
props: {
|
||||
showDay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showColon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: '#FFFFFF'
|
||||
},
|
||||
borderColor: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
splitorColor: {
|
||||
type: String,
|
||||
default: '#000000'
|
||||
},
|
||||
indexs: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
day: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
hour: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
minute: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
second: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timer: null,
|
||||
syncFlag: false,
|
||||
d: '00',
|
||||
h: '00',
|
||||
i: '00',
|
||||
s: '00',
|
||||
leftTime: 0,
|
||||
seconds: 0
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
day(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
hour(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
minute(val) {
|
||||
this.changeFlag()
|
||||
},
|
||||
second(val) {
|
||||
this.changeFlag()
|
||||
}
|
||||
},
|
||||
created: function(e) {
|
||||
this.startData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
toSeconds(day, hours, minutes, seconds) {
|
||||
return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
|
||||
},
|
||||
timeUp() {
|
||||
console.log(1)
|
||||
clearInterval(this.timer)
|
||||
this.$emit('timeup',this.indexs)
|
||||
},
|
||||
countDown() {
|
||||
let seconds = this.seconds
|
||||
let [day, hour, minute, second] = [0, 0, 0, 0]
|
||||
if (seconds > 0) {
|
||||
day = Math.floor(seconds / (60 * 60 * 24))
|
||||
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
|
||||
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
|
||||
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
|
||||
} else {
|
||||
this.timeUp()
|
||||
}
|
||||
if (day < 10) {
|
||||
day = '0' + day
|
||||
}
|
||||
if (hour < 10) {
|
||||
hour = '0' + hour
|
||||
}
|
||||
if (minute < 10) {
|
||||
minute = '0' + minute
|
||||
}
|
||||
if (second < 10) {
|
||||
second = '0' + second
|
||||
}
|
||||
this.d = day
|
||||
this.h = hour
|
||||
this.i = minute
|
||||
this.s = second
|
||||
},
|
||||
startData() {
|
||||
this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
|
||||
if (this.seconds <= 0) {
|
||||
return
|
||||
}
|
||||
this.countDown()
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--
|
||||
if (this.seconds < 0) {
|
||||
this.timeUp()
|
||||
return
|
||||
}
|
||||
this.countDown()
|
||||
}, 1000)
|
||||
},
|
||||
changeFlag() {
|
||||
console.log(this.syncFlag,111111)
|
||||
if (!this.syncFlag) {
|
||||
this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
|
||||
this.startData();
|
||||
this.syncFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.uni-countdown {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.uni-countdown__splitor {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.uni-countdown__number {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
<template>
|
||||
<view class='keyboard' @click.stop='_handleKeyPress'>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='7'>7</view>
|
||||
<view class='key-cell cell_b' data-num='8'>8</view>
|
||||
<view class='key-cell cell_b' data-num='9'>9</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='4'>4</view>
|
||||
<view class='key-cell cell_b' data-num='5'>5</view>
|
||||
<view class='key-cell cell_b' data-num='6'>6</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='1'>1</view>
|
||||
<view class='key-cell cell_b' data-num='2'>2</view>
|
||||
<view class='key-cell cell_b' data-num='3'>3</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class="key-zero-and-point">
|
||||
<view class="a cell_b zero" data-num='0'>0</view>
|
||||
<view class="a cell_b point" data-num='.'>.</view>
|
||||
</view>
|
||||
|
||||
<view @touchstart="touchstart" @touchend="touchend" data-num='D' class="key-confirm2">
|
||||
<text data-num='D'>C</text>
|
||||
</view>
|
||||
|
||||
<view class='key-confirm' :style="{'background':btnColor}" data-num='S'>
|
||||
<view data-num='S' class="">
|
||||
<view data-num='S' class="title">{{title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
name:"keyBoard",
|
||||
props:{
|
||||
title:{
|
||||
default:'确认',
|
||||
type:String
|
||||
},
|
||||
btnColor:{
|
||||
default:'green',
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
money:'',
|
||||
Cdel:'',
|
||||
Time:''
|
||||
}
|
||||
},
|
||||
|
||||
watch:{
|
||||
money(val){
|
||||
this.$emit('update:money',val);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
touchstart(){
|
||||
this.Time=setInterval(()=>{
|
||||
console.log(this.money);
|
||||
if(this.money==''){
|
||||
clearInterval();
|
||||
}
|
||||
this.money = this.money.substring(0,this.money.length - 1);
|
||||
},200)
|
||||
},
|
||||
touchend(){
|
||||
clearInterval(this.Time);
|
||||
},
|
||||
//处理按键
|
||||
_handleKeyPress(e) {
|
||||
console.log('点击传e',e.target.dataset.num);
|
||||
let num = e.target.dataset.num;
|
||||
//不同按键处理逻辑
|
||||
// -1 代表无效按键,直接返回
|
||||
if (num == -1) return false;
|
||||
switch (String(num)) {
|
||||
//小数点
|
||||
case '.':
|
||||
this._handleDecimalPoint();
|
||||
break;
|
||||
//删除键
|
||||
case 'D':
|
||||
this._handleDeleteKey();
|
||||
break;
|
||||
//清空键
|
||||
case 'C':
|
||||
this._handleClearKey();
|
||||
break;
|
||||
//确认键
|
||||
case 'S':
|
||||
this._handleConfirmKey();
|
||||
break;
|
||||
default:
|
||||
this._handleNumberKey(num);
|
||||
break;
|
||||
}
|
||||
},
|
||||
//处理小数点函数
|
||||
_handleDecimalPoint() {
|
||||
//如果包含小数点,直接返回
|
||||
if (this.money.indexOf('.') > -1) return false;
|
||||
//如果小数点是第一位,补0
|
||||
if (!this.money.length)
|
||||
this.money = '0.';
|
||||
//如果不是,添加一个小数点
|
||||
else
|
||||
this.money = this.money + '.';
|
||||
},
|
||||
//处理删除键
|
||||
_handleDeleteKey() {
|
||||
let S = this.money;
|
||||
//如果没有输入,直接返回
|
||||
if (!S.length) return false;
|
||||
//否则删除最后一个
|
||||
this.money = S.substring(0, S.length - 1);
|
||||
},
|
||||
|
||||
//处理清空键
|
||||
_handleClearKey() {
|
||||
this.money = '';
|
||||
},
|
||||
|
||||
//处理数字
|
||||
_handleNumberKey(num) {
|
||||
if(this.money.length==10){
|
||||
return
|
||||
}
|
||||
let S = this.money;
|
||||
//如果有小数点且小数点位数不小于2
|
||||
if ( S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
||||
this.money = S + num;
|
||||
//没有小数点
|
||||
if (!(S.indexOf('.') > -1)) {
|
||||
//如果第一位是0,只能输入小数点
|
||||
if (num == 0 && S.length == 0)
|
||||
this.money = '0.';
|
||||
else {
|
||||
if (S.length && Number(S.charAt(0)) === 0) return;
|
||||
this.money = S + num;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//提交
|
||||
_handleConfirmKey() {
|
||||
let S = this.money;
|
||||
//未输入
|
||||
if (!S.length||S==0){
|
||||
uni.showToast({
|
||||
title: '请输入正确的数值',
|
||||
icon:'none',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//将 8. 这种转换成 8.00
|
||||
if (S.indexOf('.') > -1 && S.indexOf('.') == (S.length - 1))
|
||||
S = Number(S.substring(0, S.length - 1)).toFixed(2);
|
||||
//保留两位
|
||||
S = Number(S).toFixed(2);
|
||||
this.$emit('confirmEvent',S); //提交参数
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.cell_b{
|
||||
border-right: 1px solid #d5d5d6;
|
||||
border-bottom: 1px solid #d5d5d6;
|
||||
}
|
||||
|
||||
.key-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
flex: 1;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 40vh;
|
||||
width: 100%;
|
||||
|
||||
background: #FFFFFF;
|
||||
}
|
||||
.keyboard .key-row {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
height: 10vh;
|
||||
line-height: 10vh;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.keyboard .key-cell {
|
||||
flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-size: 60upx;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
height: 30vh;
|
||||
width: 25%;
|
||||
line-height: 30vh;
|
||||
color: #FFFFFF;
|
||||
z-index: 5;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm2 {
|
||||
position: absolute;
|
||||
height: 10vh;
|
||||
width: 25%;
|
||||
line-height: 10vh;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.key-zero-and-point{
|
||||
display: flex;height: 10vh;justify-content: center;align-items: center;width:75%;font-size: 60upx;
|
||||
.zero{
|
||||
display: flex;justify-content: center;align-items: center;width: 66.66%;font-size: 60upx;text-align: center;height: 100%;
|
||||
}
|
||||
.point{
|
||||
display: flex;justify-content: center;align-items: center;width: 33.33%;font-size: 60upx;text-align: center;height: 100%;
|
||||
}
|
||||
}
|
||||
.key-cell:active{
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
.a:active,.key-confirm2:active{
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,312 @@
|
|||
<template>
|
||||
<view class='keyboard' :style="{position: pos}" @click.stop='_handleKeyPress'>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='1'>1</view>
|
||||
<view class='key-cell cell_b' data-num='2'>2</view>
|
||||
<view class='key-cell cell_b' data-num='3'>3</view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='4'>4</view>
|
||||
<view class='key-cell cell_b' data-num='5'>5</view>
|
||||
<view class='key-cell cell_b' data-num='6'>6</view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='7'>7</view>
|
||||
<view class='key-cell cell_b' data-num='8'>8</view>
|
||||
<view class='key-cell cell_b' data-num='9'>9</view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='.'></view>
|
||||
<view class='key-cell cell_b' data-num='0'>0</view>
|
||||
<view class='key-cell cell_b' data-num='D' style="background: #F9F9F9;" @touchstart="touchstart"
|
||||
@touchend="touchend">
|
||||
<image data-num='D' style="width: 47.49rpx; height: 25.59rpx;"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/x.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="key-zero-and-point">
|
||||
<view class="a cell_b zero" data-num='0'>0</view>
|
||||
<view class="a cell_b point" data-num='.'>.</view>
|
||||
</view> -->
|
||||
<!-- <view class='key-confirm' :style="{'background':btnColor}" data-num='S'>
|
||||
<view data-num='S' class="">
|
||||
<view data-num='S' class="title">{{title}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "keyBoard",
|
||||
props: {
|
||||
title: {
|
||||
default: '确认',
|
||||
type: String
|
||||
},
|
||||
btnColor: {
|
||||
default: 'green',
|
||||
},
|
||||
pos: {
|
||||
default: 'fixed',
|
||||
type: String
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
money: '',
|
||||
Cdel: '',
|
||||
Time: ''
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
money(val) {
|
||||
this.$emit('update:money', val);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
touchstart() {
|
||||
this.Time = setInterval(() => {
|
||||
if (this.money == '') {
|
||||
clearInterval();
|
||||
}
|
||||
this.money = this.money.substring(0, this.money.length - 1);
|
||||
}, 200)
|
||||
},
|
||||
touchend() {
|
||||
clearInterval(this.Time);
|
||||
},
|
||||
//处理按键
|
||||
_handleKeyPress(e) {
|
||||
// console.log('点击传e', e.target.dataset.num);
|
||||
// #ifdef MP-WEIXIN
|
||||
let num = e.target.dataset.num;
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
let num = e.target.targetDataset.num;
|
||||
// #endif
|
||||
//不同按键处理逻辑
|
||||
// -1 代表无效按键,直接返回
|
||||
if (num == -1) return false;
|
||||
|
||||
switch (String(num)) {
|
||||
//小数点
|
||||
case '.':
|
||||
// uni.showToast({
|
||||
// title: '不可以设置.!',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// this._handleDecimalPoint();
|
||||
break;
|
||||
//删除键
|
||||
case 'D':
|
||||
this._handleDeleteKey();
|
||||
break;
|
||||
//清空键
|
||||
case 'C':
|
||||
this._handleClearKey();
|
||||
break;
|
||||
//确认键
|
||||
case 'S':
|
||||
this._handleConfirmKey();
|
||||
break;
|
||||
default:
|
||||
this._handleNumberKey(num);
|
||||
break;
|
||||
}
|
||||
},
|
||||
//处理小数点函数
|
||||
_handleDecimalPoint() {
|
||||
//如果包含小数点,直接返回
|
||||
if (this.money.indexOf('.') > -1) return false;
|
||||
//如果小数点是第一位,补0
|
||||
if (!this.money.length)
|
||||
this.money = '0.';
|
||||
//如果不是,添加一个小数点
|
||||
else
|
||||
this.money = this.money + '.';
|
||||
},
|
||||
//处理删除键
|
||||
_handleDeleteKey() {
|
||||
let S = this.money;
|
||||
//如果没有输入,直接返回
|
||||
if (!S.length) return false;
|
||||
//否则删除最后一个
|
||||
this.money = S.substring(0, S.length - 1);
|
||||
},
|
||||
|
||||
//处理清空键
|
||||
_handleClearKey() {
|
||||
this.money = '';
|
||||
},
|
||||
|
||||
//处理数字
|
||||
_handleNumberKey(num) {
|
||||
let S = this.money;
|
||||
//如果有小数点且小数点位数不小于2
|
||||
// if (S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
||||
this.money = S + num;
|
||||
//没有小数点
|
||||
// if (!(S.indexOf('.') > -1)) {
|
||||
// //如果第一位是0,只能输入小数点
|
||||
// if (num == 0 && S.length == 0)
|
||||
// this.money = '0';
|
||||
// else {
|
||||
// if (S.length && Number(S.charAt(0)) === 0) return;
|
||||
// this.money = S + num;
|
||||
// }
|
||||
// }
|
||||
console.log(num)
|
||||
if (this.money.length == 6) {
|
||||
this.$emit('confirmEvent', this.money); //提交参数
|
||||
return
|
||||
}
|
||||
},
|
||||
|
||||
//提交
|
||||
_handleConfirmKey() {
|
||||
let S = this.money;
|
||||
//未输入
|
||||
if (!S.length || S == 0) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的数值',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//将 8. 这种转换成 8.00
|
||||
if (S.indexOf('.') > -1 && S.indexOf('.') == (S.length - 1))
|
||||
S = Number(S.substring(0, S.length - 1)).toFixed(2);
|
||||
//保留两位
|
||||
S = Number(S).toFixed(2);
|
||||
this.$emit('confirmEvent', S); //提交参数
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cell_b {
|
||||
border-right: 1px solid #DBDBDB;
|
||||
border-bottom: 1px solid #DBDBDB;
|
||||
}
|
||||
|
||||
.key-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
flex: 1;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 32vh;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
border-top: 1rpx solid #DBDBDB;
|
||||
padding-bottom: calc(24rpx + constant(safe-area-inset-bottom));
|
||||
padding-bottom: calc(24rpx + env(safe-area-inset-bottom));
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.keyboard .key-row {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
height: 8vh;
|
||||
line-height: 8vh;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.keyboard .key-cell {
|
||||
flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 400;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
height: 30vh;
|
||||
width: 25%;
|
||||
line-height: 30vh;
|
||||
color: #FFFFFF;
|
||||
z-index: 5;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm2 {
|
||||
position: absolute;
|
||||
height: 8vh;
|
||||
width: 25%;
|
||||
line-height: 8vh;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.key-zero-and-point {
|
||||
display: flex;
|
||||
height: 8vh;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 75%;
|
||||
font-size: 60upx;
|
||||
|
||||
.zero {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 66.66%;
|
||||
font-size: 60upx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 33.33%;
|
||||
font-size: 60upx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.key-cell:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
|
||||
.a:active,
|
||||
.key-confirm2:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
<template>
|
||||
<view class="l-barrage">
|
||||
<block v-for="(item,index) in items" :key="index">
|
||||
<!-- #ifdef H5 -->
|
||||
<text v-if="item.display" class="aon" :style="{top: `${item.top}%`,color: item.color}">
|
||||
{{item.text}}
|
||||
</text>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifndef H5 -->
|
||||
<!-- <text v-if="item.display" class="aon"
|
||||
:style="{top: `${item.top}%`,color: item.color,
|
||||
animation: `mymove ${Number(item.time)}s linear forwards`
|
||||
}"
|
||||
>
|
||||
{{item.text}}
|
||||
</text> -->
|
||||
<view v-if="item.display" class="aon"
|
||||
style=" display: flex;justify-content: center;align-items: center; background-color: #000; padding:10rpx; border-radius: 10rpx;"
|
||||
:style="{top: `${item.top}%`,
|
||||
animation: `mymove ${Number(item.time)}s linear forwards`
|
||||
}">
|
||||
<image style="width: 50rpx; height: 50rpx;border-radius: 50%;" :src="avatar"
|
||||
mode="aspectFill"></image>
|
||||
<text style="color: #fff;">
|
||||
{{item.text}}
|
||||
</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let cycle;
|
||||
|
||||
// 弹幕字体颜色
|
||||
function getRandomColor() {
|
||||
let rgb = []
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
let color = Math.floor(Math.random() * 256).toString(16)
|
||||
color = color.length == 1 ? '0' + color : color
|
||||
rgb.push(color)
|
||||
}
|
||||
return '#' + rgb.join('')
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'l-barrage',
|
||||
props: {
|
||||
minTime: {
|
||||
type: Number,
|
||||
default: 4
|
||||
},
|
||||
maxTime: {
|
||||
type: Number,
|
||||
default: 9
|
||||
},
|
||||
minTop: {
|
||||
type: Number,
|
||||
default: 8
|
||||
},
|
||||
maxTop: {
|
||||
type: Number,
|
||||
default: 16
|
||||
},
|
||||
avatar:{
|
||||
type:String,
|
||||
default:'@/static/1.gif'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
items: [],
|
||||
userInfo: uni.cache.get('userInfo'), //个人信息
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add(text = '', time = Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this
|
||||
.minTime))) {
|
||||
this.items.push({
|
||||
text,
|
||||
time,
|
||||
top: Math.ceil(Math.random() * (this.maxTop - this.minTop + 1) + this.minTop),
|
||||
color: getRandomColor(),
|
||||
display: 1,
|
||||
});
|
||||
},
|
||||
start(items = []) {
|
||||
this.items = [];
|
||||
cycle && (clearInterval(cycle));
|
||||
let i = 0,
|
||||
len = items.length;
|
||||
|
||||
cycle = setInterval(() => {
|
||||
let time = 5;
|
||||
// #ifndef H5
|
||||
time = Math.ceil(Math.floor(Math.random() * (this.maxTime - this.minTime + 1) + this.minTime));
|
||||
// #endif
|
||||
|
||||
if (i < len) {
|
||||
this.add(items[i], time);
|
||||
i++;
|
||||
} else {
|
||||
clearInterval(cycle);
|
||||
setTimeout(() => {
|
||||
this.$emit("end", {});
|
||||
}, time * 1000)
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.aon {
|
||||
position: fixed;
|
||||
white-space: nowrap;
|
||||
|
||||
animation: mymove 5s linear forwards;
|
||||
animation-timing-function: linear;
|
||||
-webkit-animation-timing-function: linear;
|
||||
animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
.l-barrage {
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
@keyframes mymove {
|
||||
from {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
to {
|
||||
left: -200%;
|
||||
}
|
||||
}
|
||||
|
||||
@-moz-keyframes mymove
|
||||
|
||||
/* Firefox */
|
||||
{
|
||||
from {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
to {
|
||||
left: -200%;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes mymove
|
||||
|
||||
/* Safari and Chrome */
|
||||
{
|
||||
from {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
to {
|
||||
left: -200%;
|
||||
}
|
||||
}
|
||||
|
||||
@-o-keyframes mymove
|
||||
|
||||
/* Opera */
|
||||
{
|
||||
from {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
to {
|
||||
left: -200%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contentone flex-center">
|
||||
<image class="contentoneimage" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/ewm.png" mode="aspectFill"></image>
|
||||
<text class="contentonetext">精选推荐</text>
|
||||
</view>
|
||||
<view class="contenttow flex-between">
|
||||
<view class="contenttowitem" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
|
||||
<image class="contenttowitemimage" :src="item.image" mode="aspectFill"></image>
|
||||
<view class="contenttowitemtiter">
|
||||
{{item.shopName}}|{{item.productName}}
|
||||
</view>
|
||||
<view class="contenttowitemone flex-between">
|
||||
<view class="contenttowitemone_dingwei flex-start">
|
||||
<image class="contenttowitemone_dingweiimage"
|
||||
:src="item.image" mode="aspectFill"></image>
|
||||
<view class="contenttowitemone_dingweinumer">
|
||||
{{item.distances}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttowitemone_text">
|
||||
已售{{item.realSalesNumber}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttowitemtow flex-start">
|
||||
<view class="contenttowitemtow_one">
|
||||
券后¥{{item.salePrice}}
|
||||
</view>
|
||||
<view class="contenttowitemtow_tow">
|
||||
{{item.discount}}折
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
list: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
opacity: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
titleshow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clickproduct(item) {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
id:item.id
|
||||
})
|
||||
},
|
||||
clicknavigateBack() {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0 32rpx;
|
||||
|
||||
.contentone {
|
||||
.contentoneimage {
|
||||
width: 32.12rpx;
|
||||
height: 36.13rpx;
|
||||
}
|
||||
|
||||
.contentonetext {
|
||||
margin-left: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttow {
|
||||
width: 100%;
|
||||
|
||||
.contenttowitem {
|
||||
margin-top: 32rpx;
|
||||
width: 316rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
.contenttowitemimage {
|
||||
width: 100%;
|
||||
height: 220rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
}
|
||||
|
||||
.contenttowitemtiter {
|
||||
padding: 0 20rpx;
|
||||
margin-top: 8rpx;
|
||||
width: 100%;
|
||||
height: 72rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.contenttowitemone {
|
||||
padding: 0 20rpx;
|
||||
.contenttowitemone_dingwei {
|
||||
margin-top: 6rpx;
|
||||
.contenttowitemone_dingweiimage {
|
||||
width: 17.9rpx;
|
||||
height: 21.65rpx;
|
||||
}
|
||||
|
||||
.contenttowitemone_dingweinumer {
|
||||
margin-left: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemone_text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemtow {
|
||||
padding: 0 20rpx 8rpx 20rpx;
|
||||
|
||||
.contenttowitemtow_one {
|
||||
margin-top: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
|
||||
.contenttowitemtow_tow {
|
||||
margin-top: 6rpx;
|
||||
margin-left: 6rpx;
|
||||
padding: 2rpx 14rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #FF4C11;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 导航栏 -->
|
||||
<view class="navbar" :class="{active:opacity}">
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow 1 flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow 2 flex-between">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow 3 flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.heightBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view class="navbar_tow 4 flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','marginTop':HeighT.statusBar+'px','padding-right':menuButtonInfo.width+50 + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- 标题搜索框 -->
|
||||
<view class="flex-between">
|
||||
<view class="navbar_tow_one flex-start">
|
||||
<u-icon style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||
size="16"></u-icon>
|
||||
</view>
|
||||
<view class="navbar_tow_tow flex-start">
|
||||
<input type="text" class="navbar_tow_towinput" v-model="keyword" placeholder="请输入关键字" />
|
||||
<view class="navbar_tow_towview">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||
console.log("menuButtonInfo==",menuButtonInfo)
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
opacity: false,
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacity = false
|
||||
} else {
|
||||
this.opacity = true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
console.log("navHeighT==",this.$store.getters.is_BarHeight)
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(1)
|
||||
console.log(uni.getMenuButtonBoundingClientRect())
|
||||
},
|
||||
methods: {}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
|
||||
.active {
|
||||
background: rgba(249, 249, 249, 1);
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
// #ifdef APP-PLUS
|
||||
height: calc(var(--status-bar-height) / 2);
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
height: var(--status-bar-height);
|
||||
// #endif
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
.statusbarmargin {
|
||||
margin-top: var(--status-bar-height);
|
||||
}
|
||||
|
||||
// #endif
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
|
||||
.navbar_tow {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
font-size: 36rpx;
|
||||
|
||||
.flex-between {
|
||||
// #ifdef APP-PLUS || H5
|
||||
margin: 28rpx;
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
margin-left: 28rpx;
|
||||
// #endif
|
||||
width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
|
||||
.navbar_tow_one {
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar_tow_tow {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.navbar_tow_towview {
|
||||
position: absolute;
|
||||
right: 4rpx;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
text-align: center;
|
||||
background: #FEE06A;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
width: 116rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
border-radius: 34rpx 34rpx 34rpx 34rpx;
|
||||
}
|
||||
|
||||
.navbar_tow_towinput {
|
||||
height: 64rpx;
|
||||
padding-left: 32rpx;
|
||||
padding-right: 116rpx;
|
||||
flex: auto;
|
||||
background: #FFFFFF;
|
||||
border-radius: 34rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
<template>
|
||||
<view class="navbarcontent">
|
||||
<!-- 导航栏 -->
|
||||
<view class="navbar" :class="{active:opacity}">
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="status-bar"></view>
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="navbar_tow flex-between" :style="{'marginTop':HeighT.heightBar /2+'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':HeighT.customBar + ( (HeighT.heightBar - systemInfo.statusBarHeight)*2 )+'px','marginTop': ( HeighT.heightBar - (HeighT.heightBar - systemInfo.statusBarHeight))+'px','padding-right':HeighT.custwidth + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view class="navbar_tow flex-between"
|
||||
:style="{'height':systemInfo.titleBarHeight+'px','marginTop':systemInfo.statusBarHeight+'px','padding-right':menuButtonInfo.width+50 + 'px'}">
|
||||
<!-- #endif -->
|
||||
<!-- 标题搜索框 -->
|
||||
<view class="flex-between" v-if="opacity&&inputshow">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view class="navbar_tow_one flex-start" v-if="iconshow" @click="clicknavigateBack">
|
||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view class="navbar_tow_tow " @click="inputFocus" style="position: relative;padding-left: 60rpx;">
|
||||
<!-- #endif -->
|
||||
<u--input
|
||||
placeholder="请输入内容"
|
||||
class="custom-input"
|
||||
border="surround"
|
||||
:focus="focus"
|
||||
@confirm="confirmSearch"
|
||||
v-model="searchVal"
|
||||
:readonly="readonly"
|
||||
prefixIcon="search"
|
||||
prefixIconStyle="font-size: 18px;color: #909399"
|
||||
placeholderStyle="font-size: 14px;color: #999"
|
||||
fontSize="14px"
|
||||
:customStyle="{padding: '3rpx 10rpx ',width: '400rpx',borderRadius: '30rpx',backgroundColor: '#eee'}"
|
||||
|
||||
>
|
||||
</u--input>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 正常导航栏 -->
|
||||
<view class="flex-between" @click="clicknavigateBack" v-else>
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<view class="navbar_tow_one flex-start" v-if="iconshow">
|
||||
<u-icon name="arrow-left" :color="iconcolor" size="40"></u-icon>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
|
||||
<view class="navbar_tow_tow" v-if="opacity || titleshow" :style="{color: namecolor}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
||||
:style="{'padding-left':HeighT.custwidth-14 + 'px',color: namecolor}">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<view class="navbar_tow_tow" v-if="opacity || titleshow"
|
||||
:style="{'padding-left': 60 + 'rpx','textAlign': 'left',color: namecolor}">
|
||||
<!-- #endif -->
|
||||
{{title}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="heightshow" :style="{height:Topdistance +'px'}">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Topdistance: '',
|
||||
searchVal: "",
|
||||
systemInfo: '',
|
||||
// keyword
|
||||
};
|
||||
},
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
namecolor: {
|
||||
type: String,
|
||||
default: '#333333'
|
||||
},
|
||||
search: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
opacity: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
titleshow: { //标题是否显示
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
heightshow: { //是否要占位高度
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
iconshow: { //返回键是否显示
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
iconcolor: { //返回键颜色
|
||||
type: String,
|
||||
default: '#000'
|
||||
},
|
||||
navigateBacknavtitle: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
inputshow:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
focus:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
menuButtonInfo() { //手机类型的尺寸
|
||||
return uni.getMenuButtonBoundingClientRect()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.GetTop()
|
||||
wx.getSystemInfo({
|
||||
success: res => {
|
||||
this.systemInfo = res;
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
// 当组件挂载完成后获取距离
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
GetTop() {
|
||||
this.$u.getRect('.navbar').then(res => {
|
||||
this.Topdistance = res.height //滚动距离
|
||||
this.$emit('Topdistance', res.height)
|
||||
})
|
||||
},
|
||||
clicknavigateBack() {
|
||||
if (this.navigateBacknavtitle) {
|
||||
this.$emit('navigateBacknav')
|
||||
} else {
|
||||
uni.navigateBack()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 搜索点击处理
|
||||
*/
|
||||
inputFocus() {
|
||||
console.log(123)
|
||||
this.$emit('searchStatus', 'searchClick')
|
||||
},
|
||||
confirmSearch () {
|
||||
this.$emit('searchVal', this.searchVal)
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.navbarcontent {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
|
||||
.active {
|
||||
background: rgba(249, 249, 249, 1);
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
// #ifdef APP-PLUS
|
||||
height: calc(var(--status-bar-height) / 2);
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
height: var(--status-bar-height);
|
||||
// #endif
|
||||
}
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
.statusbarmargin {
|
||||
margin-top: var(--status-bar-height);
|
||||
}
|
||||
|
||||
// #endif
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
|
||||
.navbar_tow {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
font-size: 36rpx;
|
||||
|
||||
.flex-between {
|
||||
// #ifdef APP-PLUS || H5
|
||||
margin: 28rpx;
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
margin-left: 28rpx;
|
||||
// #endif
|
||||
width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
|
||||
.navbar_tow_one {
|
||||
height: 100%;
|
||||
line-height: 100%;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar_tow_tow {
|
||||
width: 200rpx;
|
||||
text-align: center;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
.u--input {
|
||||
width: 200rpx;
|
||||
input{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<view>
|
||||
<view class="pay-title">
|
||||
<text>请输入6位支付密码</text>
|
||||
</view>
|
||||
<view class="pay-password" @click="onPayUp">
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 1">●</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 2">●</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 3">●</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 4">●</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 5">●</text>
|
||||
</view>
|
||||
<view class="list">
|
||||
<text v-if="passwordArr.length >= 6">●</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="hint" @click="gopaypassword">
|
||||
<text>忘记支付密码?</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- ref:唯一ref passwrdType:密码样式pay keyInfo:密码输入返回事件 -->
|
||||
<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"></cc-defineKeyboard>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// AffirmStatus: 1,
|
||||
passwordArr: [],
|
||||
oldPasswordArr: [],
|
||||
newPasswordArr: [],
|
||||
afPasswordArr: [],
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 忘记支付密码
|
||||
gopaypassword() {
|
||||
uni.pro.navigateTo('/pages/user/repairpassword')
|
||||
},
|
||||
/**
|
||||
* 唤起键盘
|
||||
*/
|
||||
onPayUp() {
|
||||
this.$refs.CodeKeyboard.show();
|
||||
},
|
||||
/**
|
||||
* 支付键盘回调
|
||||
* @param {Object} val
|
||||
*/
|
||||
KeyInfo(val) {
|
||||
console.log(val)
|
||||
if (val.index&&val.index >= 6) {
|
||||
return;
|
||||
}
|
||||
// 判断是否输入的是删除键
|
||||
if (val.keyCode === 8) {
|
||||
// 删除最后一位
|
||||
this.passwordArr.splice(val.index + 1, 1)
|
||||
}
|
||||
// 判断是否输入的是.
|
||||
else if (val.keyCode == 190) {
|
||||
// 输入.无效
|
||||
} else {
|
||||
this.passwordArr.push(val.key);
|
||||
}
|
||||
|
||||
// uni.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: '输入密码是 = ' + JSON.stringify(this.passwordArr)
|
||||
// })
|
||||
|
||||
// 判断是否等于6
|
||||
if (this.passwordArr.length === 6) {
|
||||
// this.AffirmStatus = this.AffirmStatus + 1;
|
||||
let str = ''
|
||||
this.passwordArr.forEach(res => {
|
||||
str += res
|
||||
})
|
||||
this.$emit('accountPayevent', str)
|
||||
this.passwordArr = [];
|
||||
}
|
||||
// 判断到哪一步了
|
||||
// if (this.AffirmStatus === 1) {
|
||||
// this.oldPasswordArr = this.passwordArr;
|
||||
// } else if (this.AffirmStatus === 2) {
|
||||
// this.newPasswordArr = this.passwordArr;
|
||||
// } else if (this.AffirmStatus === 3) {
|
||||
// this.afPasswordArr = this.passwordArr;
|
||||
// } else if (this.AffirmStatus === 4) {
|
||||
// console.log(this.oldPasswordArr.join(''));
|
||||
// console.log(this.newPasswordArr.join(''));
|
||||
// console.log(this.afPasswordArr.join(''));
|
||||
// uni.showToast({
|
||||
// title: '修改成功',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack();
|
||||
// }, 2000)
|
||||
// }
|
||||
this.$forceUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
$base: #555; // 基础颜色
|
||||
|
||||
.page {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #FFFFFF;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.pay-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: #555555;
|
||||
}
|
||||
}
|
||||
|
||||
.pay-password {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 90%;
|
||||
height: 80rpx;
|
||||
margin: 20rpx auto;
|
||||
border: 2rpx solid $base;
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16.666%;
|
||||
height: 100%;
|
||||
border-right: 2rpx solid #EEEEEE;
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list:nth-child(6) {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
.hint {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
color: $base;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view style="margin-bottom: 128rpx;">
|
||||
<view class="contenttext flex-center">
|
||||
<text>¥</text>
|
||||
<text>{{payAmount}}</text>
|
||||
</view>
|
||||
<view class="contentbox flex-between">
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 1">●</text>
|
||||
</view>
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 2">●</text>
|
||||
</view>
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 3">●</text>
|
||||
</view>
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 4">●</text>
|
||||
</view>
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 5">●</text>
|
||||
</view>
|
||||
<view class="contentboxitem flex-colum">
|
||||
<text v-if="consumeFee.length >= 6">●</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<cwx-keyboard ref="keyboard" :pos="'inherit'" @confirmEvent="confirmEvent"
|
||||
:money.sync="consumeFee"></cwx-keyboard>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import cwxKeyboard from '@/components/cwx-keyboard/cwx-keyboard';
|
||||
export default {
|
||||
components: {
|
||||
cwxKeyboard
|
||||
},
|
||||
props: {
|
||||
payAmount: {
|
||||
default: 0,
|
||||
type: Number
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPwd: uni.cache.get('userInfo').isPwd,
|
||||
consumeFee: '', //第一遍
|
||||
money: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
console.log(uni.cache.get('userInfo').isPwd)
|
||||
|
||||
},
|
||||
watch: {
|
||||
consumeFee(newVal, oldVal) {
|
||||
console.log(this.consumeFee)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
confirmEvent(val) {
|
||||
|
||||
// uni.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: '输入密码是 = ' + JSON.stringify(this.passwordArr)
|
||||
// })
|
||||
|
||||
// 判断是否等于6
|
||||
if (val.length === 6) {
|
||||
this.$emit('accountPayevent', val)
|
||||
this.money = "";
|
||||
}
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
height: 100%;
|
||||
background: #FFFFFF;
|
||||
|
||||
.contenttext {
|
||||
padding: 48rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
text:nth-child(1){
|
||||
font-weight: bold;
|
||||
font-size: 48rpx;
|
||||
color: #333333;
|
||||
}
|
||||
text:nth-child(2){
|
||||
font-weight: bold;
|
||||
font-size: 60rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
margin-top: 48rpx;
|
||||
padding: 0 56rpx;
|
||||
|
||||
.contentboxitem {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<template>
|
||||
<picker mode="multiSelector"
|
||||
:value="multiIndex"
|
||||
:range="multiArray"
|
||||
@change="handleValueChange"
|
||||
@columnchange="handleColumnChange">
|
||||
<slot></slot>
|
||||
</picker>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const CHINA_REGIONS = require('./regions.json')
|
||||
export default {
|
||||
props:{
|
||||
defaultRegions:{
|
||||
type:Array,
|
||||
default(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
defaultRegionCode:{
|
||||
type:String
|
||||
},
|
||||
defaultRegion:[String,Array]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cityArr:CHINA_REGIONS[0].childs,
|
||||
districtArr:CHINA_REGIONS[0].childs[0].childs,
|
||||
multiIndex: [0, 0, 0],
|
||||
isInitMultiArray:true,
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
defaultRegion:{
|
||||
handler(region,oldRegion){
|
||||
if(Array.isArray(region)){
|
||||
// 避免传的是字面量的时候重复触发
|
||||
oldRegion = oldRegion || []
|
||||
if(region.join('')!==oldRegion.join('')){
|
||||
this.handleDefaultRegion(region)
|
||||
}
|
||||
}else if(region&®ion.length == 6){
|
||||
this.handleDefaultRegion(region)
|
||||
}else{
|
||||
console.warn('defaultRegion非有效格式')
|
||||
}
|
||||
},
|
||||
immediate:true,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
multiArray(){
|
||||
return this.pickedArr.map(arr=>arr.map(item=>item.name))
|
||||
},
|
||||
pickedArr(){
|
||||
// 进行初始化
|
||||
if(this.isInitMultiArray){
|
||||
return [
|
||||
CHINA_REGIONS,
|
||||
CHINA_REGIONS[0].childs,
|
||||
CHINA_REGIONS[0].childs[0].childs
|
||||
]
|
||||
}
|
||||
return [CHINA_REGIONS,this.cityArr,this.districtArr];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleColumnChange(e){
|
||||
// console.log(e);
|
||||
this.isInitMultiArray = false;
|
||||
const that = this;
|
||||
let col = e.detail.column;
|
||||
let row = e.detail.value;
|
||||
that.multiIndex[col] = row;
|
||||
try{
|
||||
switch(col){
|
||||
case 0:
|
||||
if(CHINA_REGIONS[that.multiIndex[0]].childs.length==0){
|
||||
that.cityArr = that.districtArr = [CHINA_REGIONS[that.multiIndex[0]]]
|
||||
break;
|
||||
}
|
||||
that.cityArr = CHINA_REGIONS[that.multiIndex[0]].childs
|
||||
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
|
||||
break;
|
||||
case 1:
|
||||
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[that.multiIndex[1]].childs
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}catch(e){
|
||||
// console.log(e);
|
||||
that.districtArr = CHINA_REGIONS[that.multiIndex[0]].childs[0].childs
|
||||
}
|
||||
|
||||
},
|
||||
handleValueChange(e){
|
||||
// 结构赋值
|
||||
let [index0,index1,index2] = e.detail.value;
|
||||
let [arr0,arr1,arr2] = this.pickedArr;
|
||||
let address = [arr0[index0],arr1[index1],arr2[index2]];
|
||||
// console.log(address);
|
||||
this.$emit('getRegion',address)
|
||||
},
|
||||
handleDefaultRegion(region){
|
||||
const isCode = !Array.isArray(region)
|
||||
this.isInitMultiArray = false;
|
||||
let children = CHINA_REGIONS
|
||||
for(let i=0;i<3;i++){
|
||||
for(let j=0;j<children.length;j++){
|
||||
let condition = isCode?children[j].code==region.slice(0,(i+1)*2):children[j].name.includes(region[i]);
|
||||
if(condition){
|
||||
// 匹配成功进行赋值
|
||||
// console.log(i,j,children.length-1);
|
||||
children = children[j].childs;
|
||||
if(i==0){
|
||||
this.cityArr = children
|
||||
}else if(i==1){
|
||||
this.districtArr = children
|
||||
}
|
||||
this.$set(this.multiIndex,i,j)
|
||||
// console.log(this.multiIndex);
|
||||
break;
|
||||
}else{
|
||||
// 首次匹配失败就用默认的初始化
|
||||
// console.log(i,j,children.length-1);
|
||||
if(i==0 && j==(children.length-1)){
|
||||
this.isInitMultiArray = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,255 @@
|
|||
<template>
|
||||
<view class="viewswiper" v-if="viewswiperShow">
|
||||
<view class="swiperBox">
|
||||
<u-swiper
|
||||
:list="popupadList"
|
||||
previousMargin="30"
|
||||
nextMargin="30"
|
||||
circular
|
||||
:autoplay="true"
|
||||
:indicator="false"
|
||||
keyName="imgUrl"
|
||||
radius='10'
|
||||
@change="e => current = e.current"
|
||||
@click="swiperClick"
|
||||
bgColor="transparent" height="920"
|
||||
>
|
||||
<!-- <view slot="indicator" class="indicator"> -->
|
||||
<!-- <view class="indicator__dot" v-for="(item, index) in carousel" :key="index"
|
||||
:class="[index === current && 'indicator__dot--active']"
|
||||
:style="[index === current && {'width':16+'px'}]">
|
||||
</view> -->
|
||||
<!-- </view> -->
|
||||
|
||||
</u-swiper>
|
||||
</view>
|
||||
|
||||
<u-icon name="close-circle" color="#fff" size="70" @click="closeClick"></u-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from "dayjs";
|
||||
// import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
popupadList: [],
|
||||
viewswiperShow: false,
|
||||
time: false,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
showPosition: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
forceUpdate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
forceUpdate(val,oldval) {
|
||||
// 在 forceUpdate 改变时执行更新操作
|
||||
let time = uni.cache.get('popUpTime') ? new Date().getTime() - uni.cache.get('popUpTime') : 1000;
|
||||
if ( time >= 1000 ) {
|
||||
uni.cache.set('popUpTime', new Date().getTime())
|
||||
this.getPopUpAd(); // 重新加载数据
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
// }
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 轮播图点击
|
||||
*/
|
||||
swiperClick (e) {
|
||||
let item = this.popupadList[e];
|
||||
if ( item.linkPath ) {
|
||||
uni.pro.navigateTo(item.linkPath, {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
is_type: "me",
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭广告
|
||||
*/
|
||||
closeClick () {
|
||||
this.viewswiperShow = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取弹窗广告
|
||||
*/
|
||||
async getPopUpAd () {
|
||||
let res = await this.api.getPopUpAd({
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.popupadList = [];
|
||||
// console.log(this.showPosition)
|
||||
// console.log(this.showPosition)
|
||||
// console.log(!uni.cache.get('popUpData'))
|
||||
if (!uni.cache.get('popUpData')) {
|
||||
res.data.forEach((item,index)=>{
|
||||
if ( item.showPosition == this.showPosition) {
|
||||
item["popUpTime"] = dayjs().format('YYYY-MM-DD');
|
||||
this.popupadList.push(item);
|
||||
}
|
||||
})
|
||||
uni.cache.set('popUpData', this.popupadList)
|
||||
} else {
|
||||
let popUpData = uni.cache.get('popUpData');
|
||||
res.data.forEach((item1,index1)=>{
|
||||
if ( popUpData.filter(obj => obj.id == item1.id).length > 0 ) {
|
||||
let obj = popUpData.filter(obj => obj.id == item1.id)[0];
|
||||
// console.log(this.showPosition)
|
||||
// console.log(item1.updateTime, obj.updateTime)
|
||||
// console.log(item1.showPosition == this.showPosition,this.isFrequency(item1.frequency,item1.popUpTime),item1.updateTime != obj.updateTime)
|
||||
if ( (item1.showPosition == this.showPosition && this.isFrequency(item1.frequency,item1.popUpTime)) || ( item1.showPosition == this.showPosition && item1.updateTime != obj.updateTime) ) {
|
||||
item1["popUpTime"] = dayjs().format('YYYY-MM-DD');
|
||||
this.popupadList.push(item1)
|
||||
}
|
||||
popUpData.forEach((item,index)=>{
|
||||
if ( item.id == item1.id && JSON.stringify(item1) != JSON.stringify(item) ) {
|
||||
popUpData[index]= item1;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if ( item1.showPosition == this.showPosition) {
|
||||
item1["popUpTime"] = dayjs().format('YYYY-MM-DD');
|
||||
this.popupadList.push(item1);
|
||||
popUpData.push(item1);
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
// console.log(popUpData)
|
||||
uni.cache.set('popUpData', popUpData)
|
||||
// console.log(this.popupadList)
|
||||
// updateTime
|
||||
|
||||
}
|
||||
this.viewswiperShow = false;
|
||||
if ( this.popupadList.length > 0 ) {
|
||||
this.viewswiperShow = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
isFrequency (frequency,popUpTime) {
|
||||
switch (frequency) {
|
||||
case "only_one": //仅首次展示
|
||||
return false;
|
||||
break;
|
||||
case 'every_show': //每次打开都展示
|
||||
return true;
|
||||
break;
|
||||
case 'every_day': //每天展示一次
|
||||
// return this.isTime("2024-08-22",1);
|
||||
return this.isTime(frequency,1);
|
||||
break;
|
||||
case 'three_day': //3天展示一次
|
||||
// return this.isTime("2024-08-20",1);
|
||||
return this.isTime(frequency,3);
|
||||
break;
|
||||
case 'seven_day': //7天展示一次
|
||||
// return this.isTime("2024-08-16",1);
|
||||
return this.isTime(frequency,7);
|
||||
break;
|
||||
case 'thirty_day': //30天展示一次
|
||||
// return this.isTime("2024-07-24",1);
|
||||
return this.isTime(frequency,30);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
isTime (popUpTime,num) {
|
||||
// 获取当前日期
|
||||
let date1 = dayjs();
|
||||
let date2 = dayjs(popUpTime).format('YYYY-MM-DD');
|
||||
// console.log(date1.diff(date2, "day"))
|
||||
if ( date1.diff(date2, "day") >= num ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.viewswiper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.swiperBox{
|
||||
width: 85%;
|
||||
margin-top: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
.swiper__wrapper__item__wrapper__image{
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.indicator {
|
||||
margin-bottom: 46rpx;
|
||||
@include flex(row);
|
||||
justify-content: center;
|
||||
|
||||
&__dot {
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
border-radius: 100px;
|
||||
background-color: rgba(255, 255, 255, 0.35);
|
||||
margin: 0 5px;
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&--active {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
.indicator_img{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.indicator-num {
|
||||
padding: 2px 0;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
border-radius: 100px;
|
||||
width: 35px;
|
||||
@include flex;
|
||||
justify-content: center;
|
||||
|
||||
&__text {
|
||||
color: #FFFFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
<template>
|
||||
<view class="nav">
|
||||
<view class="nav-left">
|
||||
<scroll-view scroll-y>
|
||||
<view class="nav-left-item" v-for="(item, index) in categoryList"
|
||||
@click="categoryClickMain(item, index)" :key="index"
|
||||
:style="index == categoryActive ? 'color:' + activeTextColor + ';background-color:' + activeBackgroundColor : ''">
|
||||
{{ item[label] }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="nav-right" v-if="!subCategoryList.length == 0">
|
||||
<scroll-view scroll-y :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="loadMore"
|
||||
scroll-with-animation>
|
||||
<view class="nav-right-item" v-for="(item, index2) in subCategoryList" :key="index2"
|
||||
@click="categoryClickSub(item)">
|
||||
<view>{{ item[label] }}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'category',
|
||||
data() {
|
||||
return {
|
||||
h: null,
|
||||
namelang: '',
|
||||
keyword: '请输入相关行业',
|
||||
height: 0,
|
||||
scrollTop: 0,
|
||||
scrollHeight: 0,
|
||||
categoryActive: 0,
|
||||
activeStyle: {
|
||||
color: this.activeTextColor,
|
||||
backgroundColor: this.activeBackgroundColor
|
||||
}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
//主分类激活索引
|
||||
merchant: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
defaultActive: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
//主分类List
|
||||
categoryList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
//侧边分类List
|
||||
subCategoryList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
activeTextColor: {
|
||||
type: String,
|
||||
default: '#FF981E'
|
||||
},
|
||||
activeBackgroundColor: {
|
||||
type: String,
|
||||
default: 'rgba(0,0,0,0)'
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: 'name'
|
||||
},
|
||||
imgSrc: {
|
||||
type: String,
|
||||
default: 'logo'
|
||||
},
|
||||
//主分类点击事件
|
||||
categoryMainClick: {},
|
||||
//子分类点击事件
|
||||
categorySubClick: {}
|
||||
},
|
||||
methods: {
|
||||
async computed_h() {
|
||||
//获取div宽度
|
||||
let content_Icon = await uni.utils.info_distance('Box_top');
|
||||
let content_top_box = await uni.utils.info_distance('Box_text');
|
||||
let system_info = await uni.getSystemInfo();
|
||||
var h_ = system_info.windowHeight + 'px';
|
||||
this.h = {
|
||||
height: h_
|
||||
};
|
||||
},
|
||||
scroll(e) {
|
||||
this.scrollHeight = e.detail.scrollHeight;
|
||||
},
|
||||
categoryClickMain(category, index) {
|
||||
this.namelang = category.name
|
||||
this.$emit('categoryMainClick', {
|
||||
'category': category,
|
||||
'index': index
|
||||
});
|
||||
this.categoryActive = index;
|
||||
this.scrollTop = -this.scrollHeight * index;
|
||||
},
|
||||
loadMore(e) {
|
||||
console.log(e)
|
||||
this.$emit('loadMores');
|
||||
},
|
||||
categoryClickSub(category) {
|
||||
this.$emit('categorySubClick', category);
|
||||
},
|
||||
searchkeyword() {
|
||||
this.$emit('searchkeyword', this.keyword)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.categoryActive = this.defaultActive;
|
||||
this.computed_h();
|
||||
// uni.getSystemInfo({
|
||||
// success: res => {
|
||||
// console.log(res);
|
||||
// this.height = res.windowHeight;
|
||||
// }
|
||||
// });
|
||||
},
|
||||
watch: {
|
||||
subCategoryList(newValue, oldValue) {}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.Box_top {
|
||||
padding: 32rpx 28rpx;
|
||||
}
|
||||
|
||||
.Box_text {
|
||||
background: #f1f0f5;
|
||||
padding: 10rpx 28rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.Box_texttext {
|
||||
margin-left: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
max-height: 600rpx;
|
||||
width: 30%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.nav-left-item {
|
||||
padding: 10rpx 0;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
width: 70%;
|
||||
max-height: 600rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.nav-right-item {
|
||||
width: 100%;
|
||||
border-left: solid 1px #e0e0e0;
|
||||
/* height: 100px; */
|
||||
text-align: left;
|
||||
padding: 24rpx 32rpx;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.nav-right-item image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: #f24544;
|
||||
}
|
||||
|
||||
.padding {
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
top: 0;
|
||||
position: fixed;
|
||||
background-color: #f24544;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<template xlang="wxml" minapp="mpvue">
|
||||
<view class="tki-barcode">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<canvas class="tki-barcode-canvas" :canvas-id="cid"
|
||||
<canvas class="tki-barcode-canvas 1" :canvas-id="cid"
|
||||
:style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<canvas :id="cid" :width="canvasWidth" :height="canvasHeight" class="tki-barcode-canvas" />
|
||||
<canvas :id="cid" :width="canvasWidth" :height="canvasHeight" class="tki-barcode-canvas 2" />
|
||||
<!-- #endif -->
|
||||
<image v-show="show" :src="result" :style="{width:canvasWidth+'px',height:canvasHeight+'px'}" />
|
||||
</view>
|
||||
|
|
@ -167,6 +167,7 @@
|
|||
watch: {
|
||||
val(n, o) {
|
||||
if (this.onval) {
|
||||
console.log(!this._empty(n))
|
||||
if (n != o && !this._empty(n)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,219 @@
|
|||
<template xlang="wxml" minapp="mpvue">
|
||||
<view class="tki-qrcode">
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<canvas class="tki-qrcode-canvas" :canvas-id="cid" :style="{width:cpSize+'px',height:cpSize+'px'}" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<canvas :id="cid" :width="cpSize" :height="cpSize" class="tki-qrcode-canvas" />
|
||||
<!-- #endif -->
|
||||
<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: {
|
||||
cid: {
|
||||
type: String,
|
||||
default: 'tki-qrcode-canvas'
|
||||
},
|
||||
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: {
|
||||
setval(n) {
|
||||
console.log("setval==",n)
|
||||
this.val = n
|
||||
if (!this._empty(n)) {
|
||||
setTimeout(() => {
|
||||
this._makeCode()
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
_makeCode() {
|
||||
let that = this
|
||||
if (!this._empty(this.val)) {
|
||||
qrcode = new QRCode({
|
||||
context: that, // 上下文环境
|
||||
canvasId:that.cid, // canvas-id
|
||||
usingComponents: that.usingComponents, // 是否是自定义组件
|
||||
showLoading: that.showLoading, // 是否显示loading
|
||||
loadingText: that.loadingText, // loading文字
|
||||
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>
|
||||
.tki-qrcode {
|
||||
position: relative;
|
||||
}
|
||||
.tki-qrcode-canvas {
|
||||
position: fixed;
|
||||
top: -99999upx;
|
||||
left: -99999upx;
|
||||
z-index: -99999;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class="scroll_box">
|
||||
<swiper class="swiper" circular="true" vertical="true" display-multiple-items="4" :autoplay="autoplay"
|
||||
:interval="interval" :duration="duration">
|
||||
<swiper-item v-for="(item,index) in list" :key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="line1">{{item.nickName}}</view>
|
||||
<view class="line2">
|
||||
<text>抽到</text>
|
||||
<text class="line2-amount">{{item.value}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
props: {
|
||||
autoplay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
interval: {
|
||||
type: Number,
|
||||
default: 1000
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 1000
|
||||
},
|
||||
datalist: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
datalist: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.list = val
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.scroll_box {
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.swiper {
|
||||
height: 400rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-item::after {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.swiper-item .line1 {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.swiper-item .line2 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.swiper-item .line2 .line2-amount {
|
||||
color: #EF4A4A;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,21 +1,37 @@
|
|||
const debug = true;
|
||||
const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||
// #ifdef H5
|
||||
const proxyApi = "/api"
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
const baseUrl = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
const baseUrlwws = 'wss://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
// const baseUrl = "https://cashierapplet.sxczgkj.cn/cashierService" //测试
|
||||
// const baseUrlwws = 'wss://cashierapplet.sxczgkj.cn/cashierService' // 测试
|
||||
// #ifdef MP-WEIXIN || APP || MP-ALIPAY
|
||||
// const proxyApi = 'http://192.168.1.15:9888/cashierService' // 王伟
|
||||
// const proxyApi = 'http://192.168.1.27:9888/cashierService' // 帆哥
|
||||
// const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试
|
||||
// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||
// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||
// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布
|
||||
// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布
|
||||
const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
const baseUrl = debug ? proxyApi : 'http://192.168.2.161:9889/cashierService/' // 线上
|
||||
const baseUrl = debug ? proxyApi + '/cashierService' : "https://cashier.sxczgkj.cn/cashierService"
|
||||
const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService' // 线上
|
||||
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/netty' // 线上
|
||||
|
||||
// const baseUrl = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||
// const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试
|
||||
// #endif
|
||||
|
||||
// import VConsole from "./vConsole.js"
|
||||
// if (debug) {
|
||||
// // new VConsole()
|
||||
// new VConsole()
|
||||
// }
|
||||
const version = '109'
|
||||
const version = '100'
|
||||
const autoRemoveCache = {
|
||||
count: 100000,
|
||||
size: 100000
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import md5 from './md5'
|
||||
import Api from "@/common/js/api.js"
|
||||
|
||||
/**
|
||||
* 转换对象为x-www-form-urlencoded
|
||||
|
|
@ -10,26 +11,26 @@ let transformRequest = obj => {
|
|||
let query = ''
|
||||
let name, value, fullSubName, subName, subValue, innerObj, i
|
||||
|
||||
for(name in obj) {
|
||||
for (name in obj) {
|
||||
value = obj[name]
|
||||
|
||||
if(value instanceof Array) {
|
||||
for(i = 0; i < value.length; ++i) {
|
||||
if (value instanceof Array) {
|
||||
for (i = 0; i < value.length; ++i) {
|
||||
subValue = value[i]
|
||||
fullSubName = name + '[' + i + ']'
|
||||
innerObj = {}
|
||||
innerObj[fullSubName] = subValue
|
||||
query += transformRequest(innerObj) + '&'
|
||||
}
|
||||
} else if(value instanceof Object) {
|
||||
for(subName in value) {
|
||||
} else if (value instanceof Object) {
|
||||
for (subName in value) {
|
||||
subValue = value[subName]
|
||||
fullSubName = name + '[' + subName + ']'
|
||||
innerObj = {}
|
||||
innerObj[fullSubName] = subValue
|
||||
query += transformRequest(innerObj) + '&'
|
||||
}
|
||||
} else if(value !== undefined && value !== null) {
|
||||
} else if (value !== undefined && value !== null) {
|
||||
query += encodeURIComponent(name) + '=' +
|
||||
encodeURIComponent(value) + '&'
|
||||
}
|
||||
|
|
@ -44,7 +45,7 @@ let timestamp = function() {
|
|||
|
||||
let isNavigating = false
|
||||
let isNavigate = () => {
|
||||
if(isNavigating) {
|
||||
if (isNavigating) {
|
||||
return true
|
||||
} else {
|
||||
isNavigating = true
|
||||
|
|
@ -62,11 +63,11 @@ let guid = (function() {
|
|||
let guid = new Date().getTime().toString(32),
|
||||
i
|
||||
|
||||
for(i = 0; i < 5; i++) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
guid += Math.floor(Math.random() * 65535).toString(32)
|
||||
}
|
||||
|
||||
return(prefix || '') + guid + (counter++).toString(32)
|
||||
return (prefix || '') + guid + (counter++).toString(32)
|
||||
}
|
||||
}())
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ let sortTransform = (obj) => {
|
|||
objKeys = objKeys.sort()
|
||||
|
||||
var ret = {}
|
||||
for(var i = 0; i < objKeys.length; i++) {
|
||||
for (var i = 0; i < objKeys.length; i++) {
|
||||
let objVal = obj[objKeys[i]]
|
||||
ret[objKeys[i]] = objVal
|
||||
}
|
||||
|
|
@ -95,8 +96,8 @@ function isEmptyObject(v) {
|
|||
return Object.keys(v).length == 0
|
||||
}
|
||||
|
||||
function sleep (time) {
|
||||
return new Promise((resolve) => setTimeout(resolve, time))
|
||||
function sleep(time) {
|
||||
return new Promise((resolve) => setTimeout(resolve, time))
|
||||
}
|
||||
|
||||
const throttle = function(func, wait = 200, options) {
|
||||
|
|
@ -110,7 +111,7 @@ const throttle = function(func, wait = 200, options) {
|
|||
var context, args, result
|
||||
var timeout = null
|
||||
var previous = 0
|
||||
if(!options) options = {
|
||||
if (!options) options = {
|
||||
leading: true,
|
||||
trailing: false
|
||||
}
|
||||
|
|
@ -118,26 +119,26 @@ const throttle = function(func, wait = 200, options) {
|
|||
previous = options.leading === false ? 0 : new Date().getTime()
|
||||
timeout = null
|
||||
result = func.apply(context, args)
|
||||
if(!timeout) context = args = null
|
||||
if (!timeout) context = args = null
|
||||
}
|
||||
return function() {
|
||||
var now = new Date().getTime()
|
||||
if(!previous && options.leading === false) previous = now
|
||||
if (!previous && options.leading === false) previous = now
|
||||
// 计算剩余时间
|
||||
var remaining = wait - (now - previous)
|
||||
context = this
|
||||
args = arguments
|
||||
// 当到达wait指定的时间间隔,则调用func函数
|
||||
if(remaining <= 0 || remaining > wait) {
|
||||
if (remaining <= 0 || remaining > wait) {
|
||||
// 由于setTimeout存在最小时间精度问题,因此会存在到达wait的时间间隔,但之前设置的setTimeout操作还没被执行,因此为保险起见,这里先清理setTimeout操作
|
||||
if(timeout) {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout)
|
||||
timeout = null
|
||||
}
|
||||
previous = now
|
||||
result = func.apply(context, args)
|
||||
if(!timeout) context = args = null
|
||||
} else if(!timeout && options.trailing !== false) {
|
||||
if (!timeout) context = args = null
|
||||
} else if (!timeout && options.trailing !== false) {
|
||||
// options.trailing=true时,延时执行func函数
|
||||
timeout = setTimeout(later, remaining)
|
||||
}
|
||||
|
|
@ -153,13 +154,13 @@ const debounce = function(func, wait, immediate) {
|
|||
// 当wait指定的时间间隔期间多次调用_.debounce返回的函数,则会不断更新timestamp的值,导致last < wait && last >= 0一直为true,从而不断启动新的计时器延时执行func
|
||||
var last = new Date().getTime() - timestamp
|
||||
|
||||
if(last < wait && last >= 0) {
|
||||
if (last < wait && last >= 0) {
|
||||
timeout = setTimeout(later, wait - last)
|
||||
} else {
|
||||
timeout = null
|
||||
if(!immediate) {
|
||||
if (!immediate) {
|
||||
result = func.apply(context, args)
|
||||
if(!timeout) context = args = null
|
||||
if (!timeout) context = args = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -171,8 +172,8 @@ const debounce = function(func, wait, immediate) {
|
|||
// 第一次调用该方法时,且immediate为true,则调用func函数
|
||||
var callNow = immediate && !timeout
|
||||
// 在wait指定的时间间隔内首次调用该方法,则启动计时器定时调用func函数
|
||||
if(!timeout) timeout = setTimeout(later, wait)
|
||||
if(callNow) {
|
||||
if (!timeout) timeout = setTimeout(later, wait)
|
||||
if (callNow) {
|
||||
result = func.apply(context, args)
|
||||
context = args = null
|
||||
}
|
||||
|
|
@ -181,12 +182,14 @@ const debounce = function(func, wait, immediate) {
|
|||
}
|
||||
}
|
||||
|
||||
Promise.prototype.finally = function (callback) {
|
||||
let P = this.constructor
|
||||
return this.then(
|
||||
value => P.resolve(callback()).then(() => value),
|
||||
reason => P.resolve(callback()).then(() => { throw reason })
|
||||
)
|
||||
Promise.prototype.finally = function(callback) {
|
||||
let P = this.constructor
|
||||
return this.then(
|
||||
value => P.resolve(callback()).then(() => value),
|
||||
reason => P.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
const info_distance = function(e) { //获取元素位置
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
@ -204,6 +207,97 @@ const getCurrentRoute = function() {
|
|||
return '/' + getCurrentPage().route
|
||||
}
|
||||
|
||||
const pluschooseImage = function() {
|
||||
// #ifdef APP
|
||||
if (plus.os.name == 'Android' && plus.navigator.checkPermission('android.permission.CAMERA') ===
|
||||
'undetermined') {
|
||||
//未授权
|
||||
uni.showModal({
|
||||
title: '权限说明',
|
||||
content: '便于您使用该功能上传您的照片/图片等,请您确认授权相机与相册,否则无法使用该功能',
|
||||
confirmText: "去设置",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openAppAuthorizeSetting({
|
||||
success(res) {
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
return true
|
||||
// #endif
|
||||
}
|
||||
|
||||
const getUserInfo = function (successCallback, failCallback) {
|
||||
// #ifdef MP-WEIXIN
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
// 微信小程序环境
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: async (infoRes) => {
|
||||
let res = await Api.userwxlogin({
|
||||
code: data.code, //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
source: 'wechat'
|
||||
})
|
||||
if (res.code == 0) {
|
||||
resolve(res)
|
||||
}
|
||||
},
|
||||
fail: (err) => {}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
return new Promise((resolve, reject) => {
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_base',
|
||||
success: async (data) => {
|
||||
console.log(data)
|
||||
// 支付宝小程序环境
|
||||
// my.getAuthUserInfo({
|
||||
// success: async (infoRes) => {
|
||||
let res = await Api.userwxlogin({
|
||||
code: data.authCode, //临时登录凭证
|
||||
// rawData: JSON.stringify(infoRes),
|
||||
source: 'alipay'
|
||||
})
|
||||
if (res.code == 0) {
|
||||
resolve(res)
|
||||
}
|
||||
// },
|
||||
// fail: (err) => {}
|
||||
// });
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// #endif
|
||||
}
|
||||
|
||||
const payment = function () {
|
||||
|
||||
}
|
||||
|
||||
uni.utils = {
|
||||
md5,
|
||||
transformRequest,
|
||||
|
|
@ -219,5 +313,8 @@ uni.utils = {
|
|||
throttle,
|
||||
debounce,
|
||||
getCurrentPage,
|
||||
getCurrentRoute
|
||||
}
|
||||
getCurrentRoute,
|
||||
pluschooseImage,
|
||||
getUserInfo,
|
||||
payment
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
fill
|
||||
} from "lodash"
|
||||
|
||||
import store from "../store"
|
||||
const preCacheKeyClearFetch = 'storage:clear:fetch:'
|
||||
|
||||
uni.pro.interceptor('request', {
|
||||
|
|
@ -44,9 +44,22 @@ function requestrequest(options) {
|
|||
}
|
||||
|
||||
async function request(options) {
|
||||
let networkType = ''
|
||||
uni.getNetworkType({
|
||||
success: (res) => {
|
||||
networkType = res.networkType
|
||||
}
|
||||
});
|
||||
if (networkType == 'none') {
|
||||
uni.showToast({
|
||||
title: '网络异常,请检查网络',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if (options.toast) {
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
|
|
@ -61,14 +74,31 @@ async function request(options) {
|
|||
}
|
||||
if (options.type == 1) {
|
||||
options.header = {
|
||||
version: uni.conf.version,
|
||||
type: uni.getSystemInfoSync().platform,
|
||||
// #ifdef APP-PLUS
|
||||
environment: 'app',
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
environment: 'h5',
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
environment: 'wx',
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
environment: 'alipay',
|
||||
// environment: 'alipay',
|
||||
// #endif
|
||||
token: uni.cache.get('token'),
|
||||
openId: uni.cache.get('miniAppOpenId'),
|
||||
id: uni.cache.get('userInfo').id,
|
||||
loginName: "",
|
||||
clientType: ''
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY || APP-PLUS
|
||||
options.url = uni.conf.baseUrl + options.url
|
||||
let res = await requestrequest(options);
|
||||
// #endif
|
||||
|
|
@ -76,41 +106,39 @@ async function request(options) {
|
|||
let res = await uni.pro.request(options);
|
||||
// #endif
|
||||
if (res.code != 0) {
|
||||
if (res.code == 401) {
|
||||
uni.showToast({
|
||||
title: res.message || res.msg,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
uni.cache.clear();
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
})
|
||||
if (res.code == -4) {
|
||||
// uni.showToast({
|
||||
// title: res.message || res.msg,
|
||||
// icon: "none",
|
||||
// success: () => {
|
||||
// // setTimeout(res => {
|
||||
// // store.dispatch("loginEvent"); //获取shapid
|
||||
// // }, 1000)
|
||||
// }
|
||||
// })
|
||||
|
||||
uni.$u.throttle(store.dispatch("loginEvent"), 1000); //获取shapid
|
||||
|
||||
} else if (res.code == 482) {
|
||||
let nowTime = new Date() / 1000 | 0
|
||||
let offset = parseInt(res.data.message) - parseInt(nowTime);
|
||||
uni.cache.set('storage:offset-time', offset, -1)
|
||||
return await request(options)
|
||||
} else {
|
||||
if (options.toast) {
|
||||
uni.showToast({
|
||||
title: res.message || res.msg || res.error,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
setTimeout(res => {
|
||||
if (options.toast) {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.hideLoading()
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
uni.pro.hideLoading()
|
||||
// #endif
|
||||
}
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
}
|
||||
uni.showToast({
|
||||
title: res.message || res.msg || res.error,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
setTimeout(res => {
|
||||
if (options.toast) {
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
uni.pro.hideLoading()
|
||||
// #endif
|
||||
}
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
|
|
@ -194,7 +222,8 @@ function get(url, data, toast = true, type = 1) {
|
|||
return request({
|
||||
url,
|
||||
data,
|
||||
toast
|
||||
toast,
|
||||
type
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +242,8 @@ function post(url, data, toast = true, method = 'POST', type = 1) {
|
|||
url,
|
||||
method,
|
||||
data,
|
||||
toast
|
||||
toast,
|
||||
type
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ uni.pro.uploadFile = (obj) => {
|
|||
|
||||
uni.pro.navigateTo = (pageName, extras = {}) => {
|
||||
let url = uni.url.getUrl(pageName, extras)
|
||||
return uni.navigateTo({
|
||||
url
|
||||
})
|
||||
return uni.navigateTo({
|
||||
url
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
uni.pro.redirectTo = (pageName, extras = {}) => {
|
||||
let url = uni.url.getUrl(pageName, extras)
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ function get(key) {
|
|||
if (!res) {
|
||||
return ''
|
||||
}
|
||||
|
||||
// res = JSON.parse(res)
|
||||
|
||||
if (res.__expiretime && res.__expiretime < uni.utils.timestamp()) {
|
||||
|
||||
if (res.expire > 0 && res.expire < uni.utils.timestamp()) {
|
||||
console.log(res)
|
||||
remove(key)
|
||||
return ''
|
||||
} else {
|
||||
return res
|
||||
return res.data
|
||||
}
|
||||
} catch (e) {
|
||||
return ''
|
||||
|
|
@ -56,15 +56,13 @@ function getStorageData(key) {
|
|||
* @param {Number} expire 指定秒数后过期
|
||||
* @return void
|
||||
*/
|
||||
function set(key, value, expire = uni.conf.default_expire) {
|
||||
let cacheItem = {}
|
||||
cacheItem = value
|
||||
// console.log(cacheItem)
|
||||
if (expire > 0) {
|
||||
cacheItem.__expiretime = uni.utils.timestamp() + expire
|
||||
function set(key, value, expire = 0) {
|
||||
let obj = {
|
||||
data: value, //存储的数据
|
||||
time: Date.now() / 1000, //记录存储的时间戳
|
||||
expire: expire //记录过期时间,单位秒
|
||||
}
|
||||
// uni.setStorageSync(key,JSON.stringify(cacheItem))
|
||||
uni.setStorageSync(key,cacheItem)
|
||||
uni.setStorageSync(key, obj)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
9
main.js
9
main.js
|
|
@ -3,13 +3,15 @@ import uView from '@/uni_modules/uview-ui'
|
|||
import useStorage from '@/utils/useStroage.js'
|
||||
import './framework/bootstrap'
|
||||
import Api from "./common/js/api.js"
|
||||
import Shop from "./common/js/shop.js"
|
||||
import store from './store'
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$store = store
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
store,
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
|
|
@ -19,7 +21,10 @@ Vue.use(uView)
|
|||
uni.$u.config.unit = 'rpx'
|
||||
Vue.prototype.useStorage = useStorage
|
||||
Vue.prototype.api = Api;
|
||||
Vue.prototype.shop = Shop;
|
||||
Vue.prototype.$onLaunched = new Promise(resolve => {
|
||||
Vue.prototype.$isResolve = resolve
|
||||
})
|
||||
|
||||
// #ifdef VUE3
|
||||
import {
|
||||
createSSRApp
|
||||
|
|
|
|||
214
manifest.json
214
manifest.json
|
|
@ -1,98 +1,118 @@
|
|||
{
|
||||
"name": "cashier_weapp",
|
||||
"appid": "__UNI__8092421",
|
||||
"description": "",
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": "100",
|
||||
"transformPx": false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {
|
||||
"Barcode": {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"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.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.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<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.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp": {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "wxd88fffa983758a30",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
},
|
||||
"usingComponents": true,
|
||||
"libVersion": "latest"
|
||||
},
|
||||
"h5": {
|
||||
"devServer": {
|
||||
"https": false,
|
||||
"disableHostCheck": false,
|
||||
"proxy": {
|
||||
"/api": {
|
||||
"target": "https://p40312246f.goho.co/cashierService/",
|
||||
// "target" : "https://ky.sxczgkj.cn",
|
||||
"ws": false,
|
||||
"changeOrigin": true, //是否跨域
|
||||
"secure": false, // 设置支持https协议的代理
|
||||
"pathRewrite": {
|
||||
"^/api": "" //需要rewrite重写的,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"template": "template.h5.html",
|
||||
"router": {
|
||||
"mode": "history",
|
||||
"base": "/h5/"
|
||||
}
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion": "2"
|
||||
}
|
||||
"name" : "cashier_weapp",
|
||||
"appid" : "__UNI__8092421",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"Barcode" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"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.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.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<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.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"ad" : {}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wxd88fffa983758a30",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"es6" : true,
|
||||
"postcss" : true
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"libVersion" : "latest",
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : [ "getLocation", "onLocationChange", "chooseLocation", "chooseAddress" ]
|
||||
},
|
||||
"h5" : {
|
||||
"devServer" : {
|
||||
"https" : false,
|
||||
"disableHostCheck" : false,
|
||||
"proxy" : {
|
||||
"/api" : {
|
||||
"target" : "https://wxcashiertest.sxczgkj.cn",
|
||||
// "target" : "https://ky.sxczgkj.cn",
|
||||
"ws" : false,
|
||||
"changeOrigin" : true, //是否跨域
|
||||
"secure" : false, // 设置支持https协议的代理
|
||||
"pathRewrite" : {
|
||||
"^/api" : "" //需要rewrite重写的,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"template" : "template.h5.html",
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : "/h5/"
|
||||
}
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true,
|
||||
"appid" : "2021004145625815",
|
||||
"devServer" : {
|
||||
"autoOpen" : true // 设置为true自动打开支付宝小程序
|
||||
},
|
||||
"unipush" : {
|
||||
"enable" : false
|
||||
}
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"format": 2
|
||||
}
|
||||
|
|
@ -2,16 +2,15 @@
|
|||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
else
|
||||
export NODE_PATH="$NODE_PATH:$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
exec "$basedir/node" "$basedir/../sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../sass/sass.js" "$@"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
@SETLOCAL
|
||||
@IF NOT DEFINED NODE_PATH (
|
||||
@SET "NODE_PATH=%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
@SET "NODE_PATH=%NODE_PATH%;%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
)
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\.store\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
) ELSE (
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\.store\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sass\sass.js" %*
|
||||
|
|
|
|||
|
|
@ -2,40 +2,27 @@
|
|||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
$pathsep=":"
|
||||
$env_node_path=$env:NODE_PATH
|
||||
$new_node_path="$basedir\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
$pathsep=";"
|
||||
} else {
|
||||
$new_node_path="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
}
|
||||
if ([string]::IsNullOrEmpty($env_node_path)) {
|
||||
$env:NODE_PATH=$new_node_path
|
||||
} else {
|
||||
$env:NODE_PATH="$env_node_path$pathsep$new_node_path"
|
||||
}
|
||||
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
$input | & "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
& "$basedir/node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
$input | & "node$exe" "$basedir/../sass/sass.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../.store/sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
& "node$exe" "$basedir/../sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
$env:NODE_PATH=$env_node_path
|
||||
exit $ret
|
||||
|
|
|
|||
|
|
@ -13,10 +13,5 @@
|
|||
"John-David Dalton <john.david.dalton@gmail.com>",
|
||||
"Mathias Bynens <mathias@qiwi.be>"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\""
|
||||
},
|
||||
"__npminstall_done": true,
|
||||
"_from": "lodash@4.17.21",
|
||||
"_resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz"
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\"" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ module.exports = {
|
|||
{
|
||||
loader: "sass-loader",
|
||||
options: {
|
||||
sassOptions: (loaderContext) => {
|
||||
sassOptions: (content, loaderContext) => {
|
||||
// More information about available properties https://webpack.js.org/api/loaders/
|
||||
const { resourcePath, rootContext } = loaderContext;
|
||||
const relativePath = path.relative(rootContext, resourcePath);
|
||||
|
|
@ -677,14 +677,10 @@ Type:
|
|||
type warnRuleAsWarning = boolean;
|
||||
```
|
||||
|
||||
Default: `false`
|
||||
Default: `true`
|
||||
|
||||
Treats the `@warn` rule as a webpack warning.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> It will be `true` by default in the next major release.
|
||||
|
||||
**style.scss**
|
||||
|
||||
```scss
|
||||
|
|
|
|||
|
|
@ -96,5 +96,4 @@ async function loader(content) {
|
|||
}
|
||||
callback(null, result.css.toString(), map);
|
||||
}
|
||||
var _default = loader;
|
||||
exports.default = _default;
|
||||
var _default = exports.default = loader;
|
||||
|
|
@ -113,7 +113,7 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
|||
if (!sassOptions.logger) {
|
||||
const needEmitWarning = loaderOptions.warnRuleAsWarning !== false;
|
||||
const logger = loaderContext.getLogger("sass-loader");
|
||||
const formatSpan = span => `${span.url || "-"}:${span.start.line}:${span.start.column}: `;
|
||||
const formatSpan = span => `Warning on line ${span.start.line}, column ${span.start.column} of ${span.url || "-"}:${span.start.line}:${span.start.column}:\n`;
|
||||
const formatDebugSpan = span => `[debug:${span.start.line}:${span.start.column}] `;
|
||||
sassOptions.logger = {
|
||||
debug(message, loggerOptions) {
|
||||
|
|
@ -129,11 +129,14 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
|||
if (loggerOptions.deprecation) {
|
||||
builtMessage += "Deprecation ";
|
||||
}
|
||||
if (loggerOptions.span && !loggerOptions.stack) {
|
||||
builtMessage = formatSpan(loggerOptions.span);
|
||||
if (loggerOptions.span) {
|
||||
builtMessage += formatSpan(loggerOptions.span);
|
||||
}
|
||||
builtMessage += message;
|
||||
if (loggerOptions.stack) {
|
||||
if (loggerOptions.span && loggerOptions.span.context) {
|
||||
builtMessage += `\n\n${loggerOptions.span.start.line} | ${loggerOptions.span.context}`;
|
||||
}
|
||||
if (loggerOptions.stack && loggerOptions.stack !== "null") {
|
||||
builtMessage += `\n\n${loggerOptions.stack}`;
|
||||
}
|
||||
if (needEmitWarning) {
|
||||
|
|
@ -227,6 +230,11 @@ async function getSassOptions(loaderContext, loaderOptions, content, implementat
|
|||
|
||||
// Allow passing custom importers to `sass`/`node-sass`. Accepts `Function` or an array of `Function`s.
|
||||
sassOptions.importer = sassOptions.importer ? proxyCustomImporters(Array.isArray(sassOptions.importer) ? sassOptions.importer.slice() : [sassOptions.importer], loaderContext) : [];
|
||||
|
||||
// Regression on the `sass-embedded` side
|
||||
if (loaderOptions.webpackImporter === false && sassOptions.importer.length === 0) {
|
||||
sassOptions.importer = undefined;
|
||||
}
|
||||
sassOptions.includePaths = [].concat(process.cwd()).concat(
|
||||
// We use `includePaths` in context for resolver, so it should be always absolute
|
||||
(sassOptions.includePaths ? sassOptions.includePaths.slice() : []).map(includePath => _path.default.isAbsolute(includePath) ? includePath : _path.default.join(process.cwd(), includePath))).concat(process.env.SASS_PATH ? process.env.SASS_PATH.split(process.platform === "win32" ? ";" : ":") : []);
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
else
|
||||
export NODE_PATH="$NODE_PATH:$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" "$@"
|
||||
fi
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
@SETLOCAL
|
||||
@IF NOT DEFINED NODE_PATH (
|
||||
@SET "NODE_PATH=%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
) ELSE (
|
||||
@SET "NODE_PATH=%NODE_PATH%;%~dp0\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
)
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\..\..\..\..\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
) ELSE (
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\..\..\..\..\sass@1.69.5\node_modules\sass\sass.js" %*
|
||||
)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
$pathsep=":"
|
||||
$env_node_path=$env:NODE_PATH
|
||||
$new_node_path="$basedir\C:\Users\Administrator\Documents\HBuilderProjects\cashier_weapp\node_modules\.store\sass@1.69.5\node_modules"
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
$pathsep=";"
|
||||
} else {
|
||||
$new_node_path="$basedir/C:/Users/Administrator/Documents/HBuilderProjects/cashier_weapp/node_modules/.store/sass@1.69.5/node_modules"
|
||||
}
|
||||
if ([string]::IsNullOrEmpty($env_node_path)) {
|
||||
$env:NODE_PATH=$new_node_path
|
||||
} else {
|
||||
$env:NODE_PATH="$env_node_path$pathsep$new_node_path"
|
||||
}
|
||||
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../../../../../sass@1.69.5/node_modules/sass/sass.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
$env:NODE_PATH=$env_node_path
|
||||
exit $ret
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "sass-loader",
|
||||
"version": "13.3.2",
|
||||
"version": "13.3.3",
|
||||
"description": "Sass loader for webpack",
|
||||
"license": "MIT",
|
||||
"repository": "webpack-contrib/sass-loader",
|
||||
|
|
@ -66,52 +66,48 @@
|
|||
"neo-async": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.21.5",
|
||||
"@babel/core": "^7.21.5",
|
||||
"@babel/preset-env": "^7.21.5",
|
||||
"@commitlint/cli": "^17.6.1",
|
||||
"@commitlint/config-conventional": "^17.6.1",
|
||||
"@babel/cli": "^7.22.9",
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/preset-env": "^7.22.9",
|
||||
"@commitlint/cli": "^17.6.7",
|
||||
"@commitlint/config-conventional": "^17.6.7",
|
||||
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
||||
"babel-jest": "^29.5.0",
|
||||
"babel-jest": "^29.6.2",
|
||||
"bootstrap-sass": "^3.4.1",
|
||||
"bootstrap-v4": "npm:bootstrap@^4.5.3",
|
||||
"bootstrap-v5": "npm:bootstrap@^5.0.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"cspell": "^6.31.1",
|
||||
"css-loader": "^6.7.3",
|
||||
"cspell": "^6.31.2",
|
||||
"css-loader": "^6.8.1",
|
||||
"del": "^6.1.1",
|
||||
"del-cli": "^4.0.1",
|
||||
"enhanced-resolve": "^5.13.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"fibers": "^5.0.3",
|
||||
"enhanced-resolve": "^5.15.0",
|
||||
"eslint": "^8.46.0",
|
||||
"eslint-config-prettier": "^8.9.0",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"foundation-sites": "^6.7.5",
|
||||
"husky": "^8.0.3",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-node-single-context": "^29.0.0",
|
||||
"lint-staged": "^13.2.2",
|
||||
"jest": "^29.6.2",
|
||||
"jest-environment-node-single-context": "^29.1.0",
|
||||
"lint-staged": "^13.2.3",
|
||||
"material-components-web": "^9.0.0",
|
||||
"memfs": "^3.5.1",
|
||||
"node-sass": "^8.0.0",
|
||||
"node-sass-glob-importer": "^5.3.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.8.8",
|
||||
"sass": "^1.62.1",
|
||||
"sass-embedded": "^1.62.0",
|
||||
"semver": "^7.5.0",
|
||||
"sass": "^1.64.2",
|
||||
"sass-embedded": "^1.64.2",
|
||||
"semver": "^7.5.4",
|
||||
"standard-version": "^9.3.1",
|
||||
"style-loader": "^3.3.2",
|
||||
"webpack": "^5.81.0"
|
||||
"style-loader": "^3.3.3",
|
||||
"webpack": "^5.88.2"
|
||||
},
|
||||
"keywords": [
|
||||
"sass",
|
||||
"libsass",
|
||||
"webpack",
|
||||
"loader"
|
||||
],
|
||||
"__npminstall_done": true,
|
||||
"_from": "sass-loader@13.3.2",
|
||||
"_resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-13.3.2.tgz"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,6 +87,39 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
_macros and macros license:
|
||||
|
||||
Copyright 2024, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
analyzer, protobuf and protoc_plugin license:
|
||||
|
|
@ -615,6 +648,32 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
dart_mappable and type_plus license:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Kilian Schulte
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
ffi and package_config license:
|
||||
|
|
@ -973,6 +1032,39 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
native_stack_traces license:
|
||||
|
||||
Copyright 2020, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
native_synchronization license:
|
||||
|
|
@ -1118,32 +1210,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||
THE SOFTWARE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
pointycastle license:
|
||||
|
||||
|
||||
Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
pub_api_client license:
|
||||
|
|
@ -1570,6 +1636,71 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
web license:
|
||||
|
||||
Copyright 2023, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
web_socket license:
|
||||
|
||||
Copyright 2024, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
yaml license:
|
||||
|
|
|
|||
|
|
@ -1,51 +1 @@
|
|||
{
|
||||
"name": "sass",
|
||||
"description": "A pure JavaScript implementation of Sass.",
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/sass/dart-sass/issues",
|
||||
"homepage": "https://github.com/sass/dart-sass",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sass/dart-sass"
|
||||
},
|
||||
"author": {
|
||||
"name": "Natalie Weizenbaum",
|
||||
"email": "nweiz@google.com",
|
||||
"url": "https://github.com/nex3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chokidar": ">=3.0.0 <4.0.0",
|
||||
"immutable": "^4.0.0",
|
||||
"source-map-js": ">=0.6.2 <2.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"style",
|
||||
"scss",
|
||||
"sass",
|
||||
"preprocessor",
|
||||
"css"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./types/index.d.ts",
|
||||
"node": {
|
||||
"require": "./sass.node.js",
|
||||
"default": "./sass.node.mjs"
|
||||
},
|
||||
"default": {
|
||||
"require": "./sass.default.cjs",
|
||||
"default": "./sass.default.js"
|
||||
}
|
||||
},
|
||||
"version": "1.69.5",
|
||||
"bin": {
|
||||
"sass": "sass.js"
|
||||
},
|
||||
"main": "sass.node.js",
|
||||
"__npminstall_done": true,
|
||||
"_from": "sass@1.69.5",
|
||||
"_resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.5.tgz"
|
||||
}
|
||||
{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.77.8","bin":{"sass":"sass.js"},"main":"sass.node.js"}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -10,6 +10,10 @@ export const compile = _cliPkgExports.compile;
|
|||
export const compileAsync = _cliPkgExports.compileAsync;
|
||||
export const compileString = _cliPkgExports.compileString;
|
||||
export const compileStringAsync = _cliPkgExports.compileStringAsync;
|
||||
export const initCompiler = _cliPkgExports.initCompiler;
|
||||
export const initAsyncCompiler = _cliPkgExports.initAsyncCompiler;
|
||||
export const Compiler = _cliPkgExports.Compiler;
|
||||
export const AsyncCompiler = _cliPkgExports.AsyncCompiler;
|
||||
export const Logger = _cliPkgExports.Logger;
|
||||
export const SassArgumentList = _cliPkgExports.SassArgumentList;
|
||||
export const SassBoolean = _cliPkgExports.SassBoolean;
|
||||
|
|
@ -38,3 +42,6 @@ export const TRUE = _cliPkgExports.TRUE;
|
|||
export const FALSE = _cliPkgExports.FALSE;
|
||||
export const NULL = _cliPkgExports.NULL;
|
||||
export const types = _cliPkgExports.types;
|
||||
export const NodePackageImporter = _cliPkgExports.NodePackageImporter;
|
||||
export const deprecations = _cliPkgExports.deprecations;
|
||||
export const Version = _cliPkgExports.Version;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ library.load({
|
|||
chokidar: require("chokidar"),
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
nodeModule: require("module"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports;
|
|||
library.load({
|
||||
util: require("util"),
|
||||
stream: require("stream"),
|
||||
nodeModule: require("module"),
|
||||
fs: require("fs"),
|
||||
immutable: require("immutable"),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ export const compile = cjs.compile;
|
|||
export const compileAsync = cjs.compileAsync;
|
||||
export const compileString = cjs.compileString;
|
||||
export const compileStringAsync = cjs.compileStringAsync;
|
||||
export const initCompiler = cjs.initCompiler;
|
||||
export const initAsyncCompiler = cjs.initAsyncCompiler;
|
||||
export const Compiler = cjs.Compiler;
|
||||
export const AsyncCompiler = cjs.AsyncCompiler;
|
||||
export const Logger = cjs.Logger;
|
||||
export const SassArgumentList = cjs.SassArgumentList;
|
||||
export const SassBoolean = cjs.SassBoolean;
|
||||
|
|
@ -32,6 +36,9 @@ export const TRUE = cjs.TRUE;
|
|||
export const FALSE = cjs.FALSE;
|
||||
export const NULL = cjs.NULL;
|
||||
export const types = cjs.types;
|
||||
export const NodePackageImporter = cjs.NodePackageImporter;
|
||||
export const deprecations = cjs.deprecations;
|
||||
export const Version = cjs.Version;
|
||||
|
||||
let printedDefaultExportDeprecation = false;
|
||||
function defaultExportDeprecation() {
|
||||
|
|
@ -59,6 +66,22 @@ export default {
|
|||
defaultExportDeprecation();
|
||||
return cjs.compileStringAsync;
|
||||
},
|
||||
get initCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.initCompiler;
|
||||
},
|
||||
get initAsyncCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.initAsyncCompiler;
|
||||
},
|
||||
get Compiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Compiler;
|
||||
},
|
||||
get AsyncCompiler() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.AsyncCompiler;
|
||||
},
|
||||
get Logger() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Logger;
|
||||
|
|
@ -171,4 +194,16 @@ export default {
|
|||
defaultExportDeprecation();
|
||||
return cjs.types;
|
||||
},
|
||||
get NodePackageImporter() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.NodePackageImporter;
|
||||
},
|
||||
get deprecations() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.deprecations;
|
||||
},
|
||||
get Version() {
|
||||
defaultExportDeprecation();
|
||||
return cjs.Version;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,6 +37,104 @@ export interface CompileResult {
|
|||
sourceMap?: RawSourceMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of creating a synchronous compiler. Returned by
|
||||
* {@link initCompiler}.
|
||||
*
|
||||
* @category Compile
|
||||
*/
|
||||
export class Compiler {
|
||||
/**
|
||||
* Throws an error if constructed directly, instead of via
|
||||
* {@link initCompiler}.
|
||||
*/
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* The {@link compile} method exposed through a Compiler instance while it is
|
||||
* active. If this is called after {@link dispose} on the Compiler
|
||||
* instance, an error will be thrown.
|
||||
*
|
||||
* During the Compiler instance's lifespan, given the same input, this will
|
||||
* return an identical result to the {@link compile} method exposed at the
|
||||
* module root.
|
||||
*/
|
||||
compile(path: string, options?: Options<'sync'>): CompileResult;
|
||||
|
||||
/**
|
||||
* The {@link compileString} method exposed through a Compiler instance while
|
||||
* it is active. If this is called after {@link dispose} on the Compiler
|
||||
* instance, an error will be thrown.
|
||||
*
|
||||
* During the Compiler instance's lifespan, given the same input, this will
|
||||
* return an identical result to the {@link compileString} method exposed at
|
||||
* the module root.
|
||||
*/
|
||||
compileString(source: string, options?: StringOptions<'sync'>): CompileResult;
|
||||
|
||||
/**
|
||||
* Ends the lifespan of this Compiler instance. After this is invoked, all
|
||||
* calls to the Compiler instance's {@link compile} or {@link compileString}
|
||||
* methods will result in an error.
|
||||
*/
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of creating an asynchronous compiler. Returned by
|
||||
* {@link initAsyncCompiler}.
|
||||
*
|
||||
* @category Compile
|
||||
*/
|
||||
export class AsyncCompiler {
|
||||
/**
|
||||
* Throws an error if constructed directly, instead of via
|
||||
* {@link initAsyncCompiler}.
|
||||
*/
|
||||
private constructor();
|
||||
|
||||
/**
|
||||
* The {@link compileAsync} method exposed through an Async Compiler instance
|
||||
* while it is active. If this is called after {@link dispose} on the Async
|
||||
* Compiler instance, an error will be thrown.
|
||||
*
|
||||
* During the Async Compiler instance's lifespan, given the same input, this
|
||||
* will return an identical result to the {@link compileAsync} method exposed
|
||||
* at the module root.
|
||||
*/
|
||||
compileAsync(
|
||||
path: string,
|
||||
options?: Options<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* The {@link compileStringAsync} method exposed through an Async Compiler
|
||||
* instance while it is active. If this is called after {@link dispose} on the
|
||||
* Async Compiler instance, an error will be thrown.
|
||||
*
|
||||
* During the Async Compiler instance's lifespan, given the same input, this
|
||||
* will return an identical result to the {@link compileStringAsync} method
|
||||
* exposed at the module root.
|
||||
*/
|
||||
compileStringAsync(
|
||||
source: string,
|
||||
options?: StringOptions<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* Ends the lifespan of this Async Compiler instance. After this is invoked,
|
||||
* all subsequent calls to the Compiler instance's `compileAsync` or
|
||||
* `compileStringAsync` methods will result in an error.
|
||||
*
|
||||
* Any compilations that are submitted before `dispose` will not be cancelled,
|
||||
* and will be allowed to settle.
|
||||
*
|
||||
* After all compilations have been settled and Sass completes any internal
|
||||
* task cleanup, `dispose` will resolve its promise.
|
||||
*/
|
||||
dispose(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
|
||||
* returns a {@link CompileResult}, and if it fails it throws an {@link
|
||||
|
|
@ -44,10 +142,16 @@ export interface CompileResult {
|
|||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileAsync} is almost always faster than {@link compile}**, due to
|
||||
* the overhead of emulating synchronous messaging with worker threads and
|
||||
* concurrent compilations being blocked on main thread.
|
||||
* **Heads up!** When using the [sass-embedded] npm package for single
|
||||
* compilations, **{@link compileAsync} is almost always faster than
|
||||
* {@link compile}**, due to the overhead of emulating synchronous messaging
|
||||
* with worker threads and concurrent compilations being blocked on main thread.
|
||||
*
|
||||
* If you are running multiple compilations with the [sass-embedded] npm
|
||||
* package, using a {@link Compiler} will provide some speed improvements over
|
||||
* the module-level methods, and an {@link AsyncCompiler} will be much faster.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* @example
|
||||
*
|
||||
|
|
@ -99,12 +203,18 @@ export function compileAsync(
|
|||
*
|
||||
* This only allows synchronous {@link Importer}s and {@link CustomFunction}s.
|
||||
*
|
||||
* **Heads up!** When using the `sass-embedded` npm package,
|
||||
* **{@link compileStringAsync} is almost always faster than
|
||||
* **Heads up!** When using the [sass-embedded] npm package for single
|
||||
* compilations, **{@link compileStringAsync} is almost always faster than
|
||||
* {@link compileString}**, due to the overhead of emulating synchronous
|
||||
* messaging with worker threads and concurrent compilations being blocked on
|
||||
* main thread.
|
||||
*
|
||||
* If you are running multiple compilations with the [sass-embedded] npm
|
||||
* package, using a {@link Compiler} will provide some speed improvements over
|
||||
* the module-level methods, and an {@link AsyncCompiler} will be much faster.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
|
|
@ -162,3 +272,71 @@ export function compileStringAsync(
|
|||
source: string,
|
||||
options?: StringOptions<'async'>
|
||||
): Promise<CompileResult>;
|
||||
|
||||
/**
|
||||
* Creates a synchronous {@link Compiler}. Each compiler instance exposes the
|
||||
* {@link compile} and {@link compileString} methods within the lifespan of the
|
||||
* Compiler. Given identical input, these methods will return results identical
|
||||
* to their counterparts exposed at the module root. To use asynchronous
|
||||
* compilation, use {@link initAsyncCompiler}.
|
||||
*
|
||||
* When calling the compile functions multiple times, using a compiler instance
|
||||
* with the [sass-embedded] npm package is much faster than using the top-level
|
||||
* compilation methods or the [sass] npm package.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* [sass]: https://www.npmjs.com/package/sass
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
* function setup() {
|
||||
* const compiler = sass.initCompiler();
|
||||
* const result1 = compiler.compileString('a {b: c}').css;
|
||||
* const result2 = compiler.compileString('a {b: c}').css;
|
||||
* compiler.dispose();
|
||||
*
|
||||
* // throws error
|
||||
* const result3 = sass.compileString('a {b: c}').css;
|
||||
* }
|
||||
* ```
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.70.0", node: false
|
||||
*/
|
||||
export function initCompiler(): Compiler;
|
||||
|
||||
/**
|
||||
* Creates an asynchronous {@link AsyncCompiler}. Each compiler
|
||||
* instance exposes the {@link compileAsync} and {@link compileStringAsync}
|
||||
* methods within the lifespan of the Compiler. Given identical input, these
|
||||
* methods will return results identical to their counterparts exposed at the
|
||||
* module root. To use synchronous compilation, use {@link initCompiler};
|
||||
*
|
||||
* When calling the compile functions multiple times, using a compiler instance
|
||||
* with the [sass-embedded] npm package is much faster than using the top-level
|
||||
* compilation methods or the [sass] npm package.
|
||||
*
|
||||
* [sass-embedded]: https://www.npmjs.com/package/sass-embedded
|
||||
*
|
||||
* [sass]: https://www.npmjs.com/package/sass
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* const sass = require('sass');
|
||||
* async function setup() {
|
||||
* const compiler = await sass.initAsyncCompiler();
|
||||
* const result1 = await compiler.compileStringAsync('a {b: c}').css;
|
||||
* const result2 = await compiler.compileStringAsync('a {b: c}').css;
|
||||
* await compiler.dispose();
|
||||
*
|
||||
* // throws error
|
||||
* const result3 = await sass.compileStringAsync('a {b: c}').css;
|
||||
* }
|
||||
* ```
|
||||
* @category Compile
|
||||
* @compatibility dart: "1.70.0", node: false
|
||||
*/
|
||||
export function initAsyncCompiler(): Promise<AsyncCompiler>;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export interface CanonicalizeContext {
|
|||
* Like all importers, this implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
* to {@link Options.importers} or {@link StringOptions.importer}.
|
||||
*
|
||||
* @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return
|
||||
* synchronously, but in return it can be passed to {@link compile} and {@link
|
||||
|
|
@ -122,7 +122,7 @@ export interface FileImporter<
|
|||
* An object that implements custom Sass loading logic for [`@use`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/use) and [`@import`
|
||||
* rules](https://sass-lang.com/documentation/at-rules/import). It can be passed
|
||||
* to {@link Options.importers} or {@link StringOptionsWithImporter.importer}.
|
||||
* to {@link Options.importers} or {@link StringOptions.importer}.
|
||||
*
|
||||
* Importers that simply redirect to files on disk are encouraged to use the
|
||||
* {@link FileImporter} interface instead.
|
||||
|
|
@ -308,6 +308,139 @@ export interface Importer<sync extends 'sync' | 'async' = 'sync' | 'async'> {
|
|||
nonCanonicalScheme?: string | string[];
|
||||
}
|
||||
|
||||
declare const nodePackageImporterKey: unique symbol;
|
||||
|
||||
/**
|
||||
* The built-in Node.js package importer. This loads pkg: URLs from node_modules
|
||||
* according to the standard Node.js resolution algorithm.
|
||||
*
|
||||
* A Node.js package importer is exposed as a class that can be added to the
|
||||
* `importers` option.
|
||||
*
|
||||
*```js
|
||||
* const sass = require('sass');
|
||||
* sass.compileString('@use "pkg:vuetify', {
|
||||
* importers: [new sass.NodePackageImporter()]
|
||||
* });
|
||||
*```
|
||||
*
|
||||
* ## Writing Sass packages
|
||||
*
|
||||
* Package authors can control what is exposed to their users through their
|
||||
* `package.json` manifest. The recommended method is to add a `sass`
|
||||
* conditional export to `package.json`.
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "exports": {
|
||||
* ".": {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* "import": "./dist/js/index.mjs",
|
||||
* "default": "./dist/js/index.js"
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a package user to write `@use "pkg:uicomponents"` to load the
|
||||
* file at `node_modules/uicomponents/src/scss/index.scss`.
|
||||
*
|
||||
* The Node.js package importer supports the variety of formats supported by
|
||||
* Node.js [package entry points], allowing authors to expose multiple subpaths.
|
||||
*
|
||||
* [package entry points]:
|
||||
* https://nodejs.org/api/packages.html#package-entry-points
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "exports": {
|
||||
* ".": {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* },
|
||||
* "./colors.scss": {
|
||||
* "sass": "./src/scss/_colors.scss",
|
||||
* },
|
||||
* "./theme/*.scss": {
|
||||
* "sass": "./src/scss/theme/*.scss",
|
||||
* },
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a package user to write:
|
||||
*
|
||||
* - `@use "pkg:uicomponents";` to import the root export.
|
||||
* - `@use "pkg:uicomponents/colors";` to import the colors partial.
|
||||
* - `@use "pkg:uicomponents/theme/purple";` to import a purple theme.
|
||||
*
|
||||
* Note that while library users can rely on the importer to resolve
|
||||
* [partials](https://sass-lang.com/documentation/at-rules/use#partials), [index
|
||||
* files](https://sass-lang.com/documentation/at-rules/use#index-files), and
|
||||
* extensions, library authors must specify the entire file path in `exports`.
|
||||
*
|
||||
* In addition to the `sass` condition, the `style` condition is also
|
||||
* acceptable. Sass will match the `default` condition if it's a relevant file
|
||||
* type, but authors are discouraged from relying on this. Notably, the key
|
||||
* order matters, and the importer will resolve to the first value with a key
|
||||
* that is `sass`, `style`, or `default`, so you should always put `default`
|
||||
* last.
|
||||
*
|
||||
* To help package authors who haven't transitioned to package entry points
|
||||
* using the `exports` field, the Node.js package importer provides several
|
||||
* fallback options. If the `pkg:` URL does not have a subpath, the Node.js
|
||||
* package importer will look for a `sass` or `style` key at the root of
|
||||
* `package.json`.
|
||||
*
|
||||
* ```json
|
||||
* // node_modules/uicomponents/package.json
|
||||
* {
|
||||
* "sass": "./src/scss/index.scss",
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* This allows a user to write `@use "pkg:uicomponents";` to import the
|
||||
* `index.scss` file.
|
||||
*
|
||||
* Finally, the Node.js package importer will look for an `index` file at the
|
||||
* package root, resolving partials and extensions. For example, if the file
|
||||
* `_index.scss` exists in the package root of `uicomponents`, a user can import
|
||||
* that with `@use "pkg:uicomponents";`.
|
||||
*
|
||||
* If a `pkg:` URL includes a subpath that doesn't have a match in package entry
|
||||
* points, the Node.js importer will attempt to find that file relative to the
|
||||
* package root, resolving for file extensions, partials and index files. For
|
||||
* example, if the file `src/sass/_colors.scss` exists in the `uicomponents`
|
||||
* package, a user can import that file using `@use
|
||||
* "pkg:uicomponents/src/sass/colors";`.
|
||||
*
|
||||
* @compatibility dart: "1.71.0", node: false
|
||||
* @category Importer
|
||||
*/
|
||||
export class NodePackageImporter {
|
||||
/** Used to distinguish this type from any arbitrary object. */
|
||||
private readonly [nodePackageImporterKey]: true;
|
||||
|
||||
/**
|
||||
* The NodePackageImporter has an optional `entryPointDirectory` option, which
|
||||
* is the directory where the Node Package Importer should start when
|
||||
* resolving `pkg:` URLs in sources other than files on disk. This will be
|
||||
* used as the `parentURL` in the [Node Module
|
||||
* Resolution](https://nodejs.org/api/esm.html#resolution-algorithm-specification)
|
||||
* algorithm.
|
||||
*
|
||||
* In order to be found by the Node Package Importer, a package will need to
|
||||
* be inside a node_modules folder located in the `entryPointDirectory`, or
|
||||
* one of its parent directories, up to the filesystem root.
|
||||
*
|
||||
* Relative paths will be resolved relative to the current working directory.
|
||||
* If a path is not provided, this defaults to the parent directory of the
|
||||
* Node.js entrypoint. If that's not available, this will throw an error.
|
||||
*/
|
||||
constructor(entryPointDirectory?: string);
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of successfully loading a stylesheet with an {@link Importer}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,18 +3,31 @@
|
|||
// implementations.
|
||||
|
||||
export {
|
||||
AsyncCompiler,
|
||||
CompileResult,
|
||||
Compiler,
|
||||
compile,
|
||||
compileAsync,
|
||||
compileString,
|
||||
compileStringAsync,
|
||||
initCompiler,
|
||||
initAsyncCompiler,
|
||||
} from './compile';
|
||||
export {
|
||||
deprecations,
|
||||
Deprecation,
|
||||
Deprecations,
|
||||
DeprecationOrId,
|
||||
DeprecationStatus,
|
||||
Version,
|
||||
} from './deprecations';
|
||||
export {Exception} from './exception';
|
||||
export {
|
||||
CanonicalizeContext,
|
||||
FileImporter,
|
||||
Importer,
|
||||
ImporterResult,
|
||||
NodePackageImporter,
|
||||
} from './importer';
|
||||
export {Logger, SourceSpan, SourceLocation} from './logger';
|
||||
export {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {Logger} from '../logger';
|
||||
import {LegacyImporter} from './importer';
|
||||
import {LegacyFunction} from './function';
|
||||
import {NodePackageImporter} from '../importer';
|
||||
|
||||
/**
|
||||
* Options for {@link render} and {@link renderSync} that are shared between
|
||||
|
|
@ -508,6 +509,24 @@ export interface LegacySharedOptions<sync extends 'sync' | 'async'> {
|
|||
* @compatibility dart: "1.43.0", node: false
|
||||
*/
|
||||
logger?: Logger;
|
||||
|
||||
/**
|
||||
* If this option is set to an instance of `NodePackageImporter`, Sass will
|
||||
* use the built-in Node.js package importer to resolve Sass files with a
|
||||
* `pkg:` URL scheme. Details for library authors and users can be found in
|
||||
* the {@link NodePackageImporter} documentation.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* sass.renderSync({
|
||||
* data: '@use "pkg:vuetify";',
|
||||
* pkgImporter: new sass.NodePackageImporter()
|
||||
* });
|
||||
* ```
|
||||
* @category Plugins
|
||||
* @compatibility dart: "2.0", node: false
|
||||
*/
|
||||
pkgImporter?: NodePackageImporter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import {Deprecation} from '../deprecations';
|
||||
import {SourceSpan} from './source_span';
|
||||
|
||||
export {SourceLocation} from './source_location';
|
||||
|
|
@ -43,17 +44,21 @@ export interface Logger {
|
|||
*
|
||||
* @param message - The warning message.
|
||||
* @param options.deprecation - Whether this is a deprecation warning.
|
||||
* @param options.deprecationType - The type of deprecation this warning is
|
||||
* for, if any.
|
||||
* @param options.span - The location in the Sass source code that generated this
|
||||
* warning.
|
||||
* @param options.stack - The Sass stack trace at the point the warning was issued.
|
||||
*/
|
||||
warn?(
|
||||
message: string,
|
||||
options: {
|
||||
deprecation: boolean;
|
||||
span?: SourceSpan;
|
||||
stack?: string;
|
||||
}
|
||||
options: (
|
||||
| {
|
||||
deprecation: true;
|
||||
deprecationType: Deprecation;
|
||||
}
|
||||
| {deprecation: false}
|
||||
) & {span?: SourceSpan; stack?: string}
|
||||
): void;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import {FileImporter, Importer} from './importer';
|
||||
import {DeprecationOrId, Version} from './deprecations';
|
||||
import {FileImporter, Importer, NodePackageImporter} from './importer';
|
||||
import {Logger} from './logger';
|
||||
import {Value} from './value';
|
||||
import {PromiseOr} from './util/promise_or';
|
||||
|
|
@ -122,6 +123,20 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
*/
|
||||
charset?: boolean;
|
||||
|
||||
/**
|
||||
* A set of deprecations to treat as fatal.
|
||||
*
|
||||
* If a deprecation warning of any provided type is encountered during
|
||||
* compilation, the compiler will error instead.
|
||||
*
|
||||
* If a `Version` is provided, then all deprecations that were active in that
|
||||
* compiler version will be treated as fatal.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
fatalDeprecations?: (DeprecationOrId | Version)[];
|
||||
|
||||
/**
|
||||
* Additional built-in Sass functions that are available in all stylesheets.
|
||||
* This option takes an object whose keys are Sass function signatures like
|
||||
|
|
@ -198,6 +213,17 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
*/
|
||||
functions?: Record<string, CustomFunction<sync>>;
|
||||
|
||||
/**
|
||||
* A set of future deprecations to opt into early.
|
||||
*
|
||||
* Future deprecations passed here will be treated as active by the compiler,
|
||||
* emitting warnings as necessary.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
futureDeprecations?: DeprecationOrId[];
|
||||
|
||||
/**
|
||||
* Custom importers that control how Sass resolves loads from rules like
|
||||
* [`@use`](https://sass-lang.com/documentation/at-rules/use) and
|
||||
|
|
@ -208,8 +234,8 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
* - The importer that was used to load the current stylesheet, with the
|
||||
* loaded URL resolved relative to the current stylesheet's canonical URL.
|
||||
*
|
||||
* - Each {@link Importer} or {@link FileImporter} in {@link importers}, in
|
||||
* order.
|
||||
* - Each {@link Importer}, {@link FileImporter}, or
|
||||
* {@link NodePackageImporter} in {@link importers}, in order.
|
||||
*
|
||||
* - Each load path in {@link loadPaths}, in order.
|
||||
*
|
||||
|
|
@ -218,7 +244,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
*
|
||||
* @category Plugins
|
||||
*/
|
||||
importers?: (Importer<sync> | FileImporter<sync>)[];
|
||||
importers?: (Importer<sync> | FileImporter<sync> | NodePackageImporter)[];
|
||||
|
||||
/**
|
||||
* Paths in which to look for stylesheets loaded by rules like
|
||||
|
|
@ -266,16 +292,30 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
* so that they can get fixed as soon as possible!
|
||||
*
|
||||
* **Heads up!** If {@link compileString} or {@link compileStringAsync} is
|
||||
* called without {@link StringOptionsWithoutImporter.url}, <em>all</em>
|
||||
* stylesheets it loads will be considered dependencies. Since it doesn’t have
|
||||
* a path of its own, everything it loads is coming from a load path rather
|
||||
* than a relative import.
|
||||
* called without {@link StringOptions.url}, <em>all</em> stylesheets it loads
|
||||
* will be considered dependencies. Since it doesn’t have a path of its own,
|
||||
* everything it loads is coming from a load path rather than a relative
|
||||
* import.
|
||||
*
|
||||
* @defaultValue `false`
|
||||
* @category Messages
|
||||
*/
|
||||
quietDeps?: boolean;
|
||||
|
||||
/**
|
||||
* A set of active deprecations to ignore.
|
||||
*
|
||||
* If a deprecation warning of any provided type is encountered during
|
||||
* compilation, the compiler will ignore it instead.
|
||||
*
|
||||
* **Heads up!** The deprecated functionality you're depending on will
|
||||
* eventually break.
|
||||
*
|
||||
* @category Messages
|
||||
* @compatiblity dart: "1.74.0", node: false
|
||||
*/
|
||||
silenceDeprecations?: DeprecationOrId[];
|
||||
|
||||
/**
|
||||
* Whether or not Sass should generate a source map. If it does, the source
|
||||
* map will be available as {@link CompileResult.sourceMap}.
|
||||
|
|
@ -348,9 +388,10 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field isn't passed, the
|
||||
* entrypoint file can load files relative to itself if a `file://` URL is
|
||||
* passed to the {@link url} field.
|
||||
* If the {@link StringOptions.importer} field isn't passed, the entrypoint file
|
||||
* can load files relative to itself if a `file://` URL is passed to the {@link
|
||||
* url} field. If it is passed, the entrypoint file uses it to load files
|
||||
* relative to itself.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
|
|
@ -358,7 +399,7 @@ export interface Options<sync extends 'sync' | 'async'> {
|
|||
*
|
||||
* @category Options
|
||||
*/
|
||||
export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
||||
export interface StringOptions<sync extends 'sync' | 'async'>
|
||||
extends Options<sync> {
|
||||
/**
|
||||
* The {@link Syntax} to use to parse the entrypoint stylesheet.
|
||||
|
|
@ -369,6 +410,19 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
|||
*/
|
||||
syntax?: Syntax;
|
||||
|
||||
/**
|
||||
* The importer to use to handle loads that are relative to the entrypoint
|
||||
* stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* passed to {@link importer}. (It's passed as-is if {@link url} isn't
|
||||
* passed.) If the importer doesn't recognize it, it's then passed to {@link
|
||||
* importers} and {@link loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
importer?: Importer<sync> | FileImporter<sync>;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet.
|
||||
*
|
||||
|
|
@ -378,62 +432,24 @@ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
|
|||
* loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
* @compatibility feature: "Undefined URL with importer", dart: "1.75.0", node: false
|
||||
*
|
||||
* Earlier versions of Dart Sass required {@link url} to be defined when
|
||||
* passing {@link StringOptions.importer}.
|
||||
*/
|
||||
url?: URL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* If the {@link StringOptionsWithImporter.importer} field is passed, the
|
||||
* entrypoint file uses it to load files relative to itself and the {@link url}
|
||||
* field is mandatory.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
* @deprecated Use {@link StringOptions} instead.
|
||||
*/
|
||||
export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
|
||||
extends StringOptionsWithoutImporter<sync> {
|
||||
/**
|
||||
* The importer to use to handle loads that are relative to the entrypoint
|
||||
* stylesheet.
|
||||
*
|
||||
* A relative load's URL is first resolved relative to {@link url}, then
|
||||
* passed to {@link importer}. If the importer doesn't recognize it, it's then
|
||||
* passed to {@link importers} and {@link loadPaths}.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
importer: Importer<sync> | FileImporter<sync>;
|
||||
|
||||
/**
|
||||
* The canonical URL of the entrypoint stylesheet. If this is passed along
|
||||
* with {@link importer}, it's used to resolve relative loads in the
|
||||
* entrypoint stylesheet.
|
||||
*
|
||||
* @category Input
|
||||
*/
|
||||
url: URL;
|
||||
}
|
||||
type StringOptionsWithoutImporter<sync extends 'sync' | 'async'> =
|
||||
StringOptions<sync>;
|
||||
|
||||
/**
|
||||
* Options that can be passed to {@link compileString} or {@link
|
||||
* compileStringAsync}.
|
||||
*
|
||||
* This is a {@link StringOptionsWithImporter} if it has a {@link
|
||||
* StringOptionsWithImporter.importer} field, and a {@link
|
||||
* StringOptionsWithoutImporter} otherwise.
|
||||
*
|
||||
* @typeParam sync - This lets the TypeScript checker verify that asynchronous
|
||||
* {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't
|
||||
* passed to {@link compile} or {@link compileString}.
|
||||
*
|
||||
* @category Options
|
||||
* @deprecated Use {@link StringOptions} instead.
|
||||
*/
|
||||
export type StringOptions<sync extends 'sync' | 'async'> =
|
||||
| StringOptionsWithImporter<sync>
|
||||
| StringOptionsWithoutImporter<sync>;
|
||||
type StringOptionsWithImporter<sync extends 'sync' | 'async'> =
|
||||
StringOptions<sync>;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,6 +4,7 @@
|
|||
"sass-loader": "^13.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"dayjs": "^1.11.12",
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
386
pages.json
386
pages.json
|
|
@ -3,13 +3,122 @@
|
|||
{
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
// #ifdef MP-ALIPAY
|
||||
"navigationBarTitleText": "",
|
||||
// #endif
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
},
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/jtoday",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/tothestore",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/drinks",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/freedaily",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/coupons/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "红包中心"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/hotlist",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/uindexlist",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择城市"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/product/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/product/generalstore",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通用门店"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户授权"
|
||||
"navigationBarTitleText": "登录",
|
||||
"enablePullDownRefresh": false,
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/register",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -18,10 +127,12 @@
|
|||
"navigationBarTitleText": "订单列表"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/order/order_detail",
|
||||
"path": "pages/order/successful",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
"navigationBarTitleText": "支付成功",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -31,6 +142,27 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/storedManage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "储值管理"
|
||||
}
|
||||
},{
|
||||
"path": "pages/member/setPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "密码设置"
|
||||
}
|
||||
},{
|
||||
"path": "pages/member/instructions",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用须知"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/make/make",
|
||||
"style": {
|
||||
"navigationBarTitleText": "在线预定"
|
||||
|
|
@ -39,7 +171,21 @@
|
|||
{
|
||||
"path": "pages/user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationBarBackgroundColor": "#FFD158",
|
||||
"navigationStyle": "custom",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"path": "pages/user/repairpassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设置安全密码",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -49,16 +195,29 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_detail/order_detail",
|
||||
"path": "pages/order_food/order_food",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/order_food/order_food",
|
||||
"path": "pages/order_food/order_food_search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "white"
|
||||
"navigationBarTextStyle": "black",
|
||||
"mp-alipay": {
|
||||
"transparentTitle": "always",
|
||||
"titlePenetrate": "YES",
|
||||
"allowsBounceVertical": "NO"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -70,13 +229,212 @@
|
|||
{
|
||||
"path": "pages/user/coupon",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的优惠卷"
|
||||
"navigationBarTitleText": "我的优惠券"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/user/my_info",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人资料"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/user/shop/index",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "积分商城",
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTextStyle": "black"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "pages/user/shop/detail",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "积分明细",
|
||||
// "navigationStyle": "custom",
|
||||
// "navigationBarTextStyle": "black"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "pages/user/shop/shopinfo",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "商品详情",
|
||||
// "navigationBarTextStyle": "black"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/chooseasong/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "歌曲列表",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/chooseasong/record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "点单记录",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/address/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地址列表",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/address/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加地址",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/user/shop/confirm",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单",
|
||||
"navigationBarTextStyle": "black"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/group_order/order_groupdetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/product/placeOrder",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提交订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/group_order/refund",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/memberdetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/member/billDetails",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账单明细",
|
||||
"navigationBarBackgroundColor": "#E9B385"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/member/activatedmemberone",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "会员卡"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pagesQueueUp",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "在线排队"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesOrder",
|
||||
"pages": [
|
||||
{
|
||||
"path": "orderAMeal/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "点单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "confirm_order/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单",
|
||||
"navigationBarBackgroundColor": "#E8AD7B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "order_detail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesPoints",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分商城",
|
||||
"navigationBarBackgroundColor": "#E9B183"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "goodsDetail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "exchangeRecord/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "兑换记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "exchangeRecordDetail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "IntegralDetail/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分明细"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "confirm_order/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "确认订单",
|
||||
"navigationBarBackgroundColor": "#E9B183"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pagesInviteFriends",
|
||||
"pages": [
|
||||
{
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请好友",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "银收客",
|
||||
"navigationBarTitleText": "零点八零",
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"backgroundColor": "#F2F2F2"
|
||||
},
|
||||
|
|
@ -98,12 +456,6 @@
|
|||
"pagePath": "pages/order/order",
|
||||
"text": "订单"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/tabbar/3.png",
|
||||
"selectedIconPath": "static/tabbar/3-1.png",
|
||||
"pagePath": "pages/make/make",
|
||||
"text": "预约"
|
||||
},
|
||||
{
|
||||
"iconPath": "static/tabbar/4.png",
|
||||
"selectedIconPath": "static/tabbar/4-1.png",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,642 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='false' :title='"歌曲列表"' :titleshow='true' :heightshow='true' :namecolor='"#fff"' iconcolor='#fff'></navseat>
|
||||
<view class="search flex-between">
|
||||
<view class="searchinput flex-between">
|
||||
<input type="text" class="searchinput_input" placeholder-style="color:#FFFFFF" @input="onInput"
|
||||
v-model="keyWord" placeholder="搜索" />
|
||||
<u-icon name="search" @click="init_fn" color="#fff" size="48"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" id="demo" style="width:100%;" :style="{'height':Height}" @scroll="handleScroll"
|
||||
show-scrollbar="false" @scrolltolower="lower">
|
||||
<view class="contentclass">
|
||||
<view class="contentclassbox">
|
||||
<view class="contentclassboxitem flex-between" v-for="(item,index) in list" :key="index">
|
||||
<view class="contentclassboxleft flex-start">
|
||||
<view class="onecontentclassboxleft flex-colum-start">
|
||||
<text class="onecontentclassboxleft_one">{{item.name}}</text>
|
||||
<text class="onecontentclassboxleft_tow">{{item.originSinger}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentclassboxright" @click="clicshowpopupk(item)">
|
||||
点歌
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <image style="margin:100rpx auto 32rpx auto;"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/nomore.png" v-if="is_end"
|
||||
mode="aspectFill"></image> -->
|
||||
|
||||
<u-loadmore :status="form.status" loadmore-text="上滑加载更多" @loadmore="loadmorelang" fontSize="28"
|
||||
color="#999" iconSize="28" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="positionfixed">
|
||||
<view class="positionfixedimage flex-colum">
|
||||
<image class="positionfixedimage_image"
|
||||
:src="songimg?songimg:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/mei.png'"
|
||||
mode="aspectFill">
|
||||
</image>
|
||||
</view>
|
||||
<view class="positionfixedbox flex-between">
|
||||
<view class="positionfixedbox_item flex-colum">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/yue.png" mode="aspectFill">
|
||||
</image>
|
||||
<view class="positionfixedbox_itemtexto">
|
||||
<u-notice-bar style="width: 100rpx;" :text="songName" :iconshow='false'
|
||||
color='rgba(255, 255, 255, 0.73)' speed='40' fontSize='24'
|
||||
bgColor='transparent'></u-notice-bar>
|
||||
<!-- <text class="">{{songName || '暂无人点歌,快来...'}}</text> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="positionfixedbox_item flex-colum" @click="clickrecord">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/yidian.png"
|
||||
mode="aspectFill"></image>
|
||||
<text>已点</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="showpopup" @close="showpopup = false" mode="center" :round="24" bgColor="transparent">
|
||||
<view class="contentu-popup">
|
||||
<view class="contentuPopupOne">
|
||||
点歌
|
||||
</view>
|
||||
<view class="contentuPopupitem flex-between">
|
||||
<view class="contentuPopupitemone">
|
||||
点歌人昵称:
|
||||
</view>
|
||||
<view class="contentuPopupiteminput">
|
||||
<input type="text" v-model="fromName" placeholder="您的称呼" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentuPopupitem flex-between">
|
||||
<view class="contentuPopupitemone">
|
||||
你想点给谁:
|
||||
</view>
|
||||
<view class="contentuPopupiteminput">
|
||||
<input type="text" v-model="toName" placeholder="TA的称呼" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentuPopupitem flex-between">
|
||||
<view class="contentuPopupitemone">
|
||||
您的祝福语:
|
||||
</view>
|
||||
<view class="contentuPopupiteminput">
|
||||
<input type="text" v-model="note" placeholder=" " />
|
||||
</view>
|
||||
<!-- <view class="contentuPopupiteminput">
|
||||
<u--textarea style="font-size: 24rpx;" v-model="note" placeholder=" "></u--textarea>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="contentupopupboutton flex-between">
|
||||
<view class="contentupopupbouttonO" @click="showpopup = false">
|
||||
取消
|
||||
</view>
|
||||
<view class="contentupopupbouttonT" @tap="$u.debounce(clickervicesongpost, 500)">
|
||||
立刻支付
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
import _ from 'lodash'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Height: '',
|
||||
songId: '',
|
||||
fromName: '',
|
||||
toName: '',
|
||||
note: '',
|
||||
showpopup: false,
|
||||
list: [],
|
||||
is_end: false,
|
||||
keyWord: '',
|
||||
form: {
|
||||
page: 1,
|
||||
size: 12,
|
||||
status: 'loadmore',
|
||||
},
|
||||
shopId: "11",
|
||||
songName: '', //正在播放歌曲名字
|
||||
songimg: '',
|
||||
timer: null //定时器
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
// 隐藏首页按钮
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
if (options.q) {
|
||||
this.shopId = this.getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
if (getApp().globalData.shopId) { this.shopId = getApp().globalData.shopId }
|
||||
// #endif
|
||||
|
||||
},
|
||||
computed: {},
|
||||
mounted() {},
|
||||
onShow() {
|
||||
if (!uni.cache.get('miniAppOpenId')) {//单独登录
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
try {
|
||||
let res = await this.api.businessopenId({
|
||||
code: data.code, //临时登录凭证
|
||||
})
|
||||
if (res.code == 0) {
|
||||
console.log(res)
|
||||
uni.cache.set('miniAppOpenId', res.data)
|
||||
this.init_fn()
|
||||
// uni.cache.set('userInfo', res.data.userInfo);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.init_fn()
|
||||
}
|
||||
this.createTimer() //单独每20秒请求一次
|
||||
},
|
||||
onUnload() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
onHide() {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
// onReachBottom() {
|
||||
// this.cashierService()
|
||||
// },
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.GetTop()
|
||||
}, 200)
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleScroll(e) {
|
||||
console.log(e.detail.scrollTop)
|
||||
},
|
||||
lower() {
|
||||
console.log('触底加载')
|
||||
this.cashierService()
|
||||
},
|
||||
createTimer() {
|
||||
this.timer = setInterval(() => {
|
||||
this.apisongsinging()
|
||||
}, 20000)
|
||||
},
|
||||
async apisongsinging() { //查看现在是否有人点歌
|
||||
let {
|
||||
data
|
||||
} = await this.api.songsinging()
|
||||
console.log(data)
|
||||
this.songName = data.songName ? data.songName : '暂无人点歌,快来...'
|
||||
this.songimg = data.img
|
||||
},
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onInput(e) {
|
||||
this.handleClick();
|
||||
},
|
||||
handleClick: _.debounce(function() {
|
||||
this.init_fn();
|
||||
// 函数执行内容
|
||||
}, 600),
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.is_end = false
|
||||
this.form.page = 1
|
||||
this.form.size = 12
|
||||
this.form.status = 'loadmore'
|
||||
this.cashierService()
|
||||
this.apisongsinging()
|
||||
},
|
||||
// 列表
|
||||
async cashierService() {
|
||||
let res = await this.api.cashierServicesong({
|
||||
keyWord: this.keyWord,
|
||||
size: this.form.size,
|
||||
page: this.form.page,
|
||||
shopId: this.shopId,
|
||||
})
|
||||
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
if (this.form.page == 1 && res.data.list.length == 0) {
|
||||
this.list = []
|
||||
this.is_end = true
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
// 唤起弹框
|
||||
clicshowpopupk(item) {
|
||||
this.fromName = ''
|
||||
this.toName = ''
|
||||
this.note = ''
|
||||
this.showpopup = true
|
||||
this.songId = item.id
|
||||
},
|
||||
async clickervicesongpost(item) {
|
||||
let res = await this.api.cashierServicesongpost({
|
||||
songId: this.songId,
|
||||
fromName: this.fromName,
|
||||
toName: this.toName,
|
||||
note: this.note,
|
||||
shopId: this.shopId,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.nonceStr, // 随机字符串
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
success: (res) => {
|
||||
this.showpopup = false
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.hideLoading()
|
||||
uni.navigateTo({
|
||||
url: '/pages/chooseasong/record?shopId=' + this.shopId
|
||||
})
|
||||
// uni.switchTab({
|
||||
// url: '/pages/order/order'
|
||||
// });
|
||||
}, 1000)
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
setTimeout(res => {
|
||||
this.showpopup = false
|
||||
uni.hideLoading()
|
||||
// uni.switchTab({
|
||||
// url: '/pages/order/order'
|
||||
// });
|
||||
}, 500)
|
||||
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
//获取元素距离顶部的距离
|
||||
GetTop() {
|
||||
uni.getSystemInfo({
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
var screenHeight = data.safeArea.height
|
||||
let query = uni.createSelectorQuery().in(this);
|
||||
query.select('#demo').boundingClientRect(res => {
|
||||
console.log(res)
|
||||
this.Height = screenHeight - res.top - 10 + 'px'
|
||||
}).exec();
|
||||
this.$u.getRect('.contentclass').then(res => {
|
||||
console.log(res, 111)
|
||||
// this.Height = screenHeight - res.top + 'px'
|
||||
// console.log(this.Height)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
clickrecord() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/chooseasong/record?shopId=' + this.shopId
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
// page {
|
||||
|
||||
// }
|
||||
:deep(.u-notice__left-icon) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/background.png);
|
||||
background-size: 100% 100%;
|
||||
|
||||
.search {
|
||||
width: 100%;
|
||||
|
||||
padding: 12rpx 28rpx;
|
||||
|
||||
.searchinput {
|
||||
padding: 0rpx 32rpx;
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 36rpx 36rpx 36rpx 36rpx;
|
||||
|
||||
.searchinput_input {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
flex: auto;
|
||||
|
||||
}
|
||||
|
||||
.searchinputu-icon {
|
||||
background: #000;
|
||||
padding: 10rpx 24rpx;
|
||||
background: #333333;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.searchimage {
|
||||
margin-left: 40rpx;
|
||||
width: 45.25rpx;
|
||||
height: 50.12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.contentclass {
|
||||
padding: 0rpx 28rpx 215rpx 28rpx;
|
||||
overflow: auto;
|
||||
|
||||
.contentclassbox {
|
||||
width: 100%;
|
||||
padding: 12rpx 24rpx;
|
||||
// background: #FFFFFF;
|
||||
|
||||
.contentclassboxitem {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.contentclassboxleft {
|
||||
.contentclassboxleftimage {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.onecontentclassboxleft {
|
||||
margin-left: 16rpx;
|
||||
|
||||
.onecontentclassboxleft_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentclassboxleft_tow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentclassboxright {
|
||||
padding: 8rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #FFF6FF;
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
border: 2rpx solid #FCF4FF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.positionfixed {
|
||||
position: fixed;
|
||||
width: 95%;
|
||||
height: 166rpx;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
padding: 0 16rpx;
|
||||
transform: translate(-50%, 0);
|
||||
border-radius: 80rpx 80rpx 0 0;
|
||||
background: rgba(129, 125, 207, 0.2);
|
||||
backdrop-filter: blur(20px);
|
||||
|
||||
// .positionfixedimage::before {
|
||||
// content: "";
|
||||
// position: absolute;
|
||||
// width: 50px;
|
||||
// height: 50px;
|
||||
// top: 100rpx;
|
||||
// left: -50px;
|
||||
// background: radial-gradient(circle at 0 0, transparent 50px, rgba(129, 125, 207, 0.2) 50px);
|
||||
// backdrop-filter: blur(20px);
|
||||
// }
|
||||
|
||||
// .positionfixedimage::after {
|
||||
// content: "";
|
||||
// width: 180%;
|
||||
// height: 100%;
|
||||
// position: absolute;
|
||||
// left: 50%;
|
||||
// transform: translate(-50%, 0);
|
||||
// top: 0;
|
||||
// z-index: -1;
|
||||
// content: '';
|
||||
// border-radius: 0 0 50% 50%; //顶部圆弧,底部圆弧: 0 0 50% 50%
|
||||
// background: #000000;
|
||||
// }
|
||||
|
||||
.positionfixedimage {
|
||||
position: absolute;
|
||||
top: -70rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
background: #000000;
|
||||
z-index: 9;
|
||||
|
||||
.positionfixedimage_image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
animation: rotate 5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
/* 动画开始时旋转0度 */
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
/* 动画结束时旋转360度 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.positionfixedbox {
|
||||
padding: 44rpx 74rpx 42rpx 74rpx;
|
||||
|
||||
.positionfixedbox_item {
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
text {
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.positionfixedbox_itemtexto {
|
||||
width: 100rpx;
|
||||
padding: 0 0;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
// animation: aniMove 5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes aniMove {
|
||||
0% {
|
||||
transform: translateX(50%);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentu-popup {
|
||||
width: 694rpx;
|
||||
padding: 32rpx 24rpx 32rpx 24rpx;
|
||||
border-radius: 24rpx;
|
||||
background: rgba(129, 125, 207, 0.2);
|
||||
backdrop-filter: blur(20px);
|
||||
|
||||
.contentuPopupOne {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.contentuPopupitem {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.contentuPopupitemone {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.contentuPopupiteminput {
|
||||
margin-left: 16rpx;
|
||||
flex: auto;
|
||||
padding-bottom: 8rpx;
|
||||
border-bottom: 2rpx solid rgba(255, 255, 255, 0.5);
|
||||
|
||||
input {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentupopupboutton {
|
||||
padding: 50rpx 70rpx 0 70rpx;
|
||||
|
||||
.contentupopupbouttonO {
|
||||
width: 196rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.contentupopupbouttonT {
|
||||
width: 196rpx;
|
||||
height: 56rpx;
|
||||
background: linear-gradient(180deg, #8864EB 0%, #B349CC 100%);
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
line-height: 56rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,264 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='false' :title='"点单记录"' :titleshow='true' :heightshow='true' :namecolor='"#fff"'
|
||||
iconcolor="#fff" @Topdistance='Topdistance'>
|
||||
</navseat>
|
||||
<view class="content" :style="{'height':Height}">
|
||||
<scroll-view scroll-y="true" style="width:100%;" :style="{'height':Height}" show-scrollbar="false"
|
||||
@scrolltolower="lower">
|
||||
<view class="scrollview" :style="{'height':Height}">
|
||||
<view class="contentbox" v-for="(item,index) in list" :key="index">
|
||||
<view class="contentboxtop flex-between">
|
||||
<text class="contentboxtopname">{{item.name}}</text>
|
||||
<text v-if="item.state == '-1'" class="contentboxtopname_weizhifu">未支付</text>
|
||||
<text v-if="item.state == '0'">已取消</text>
|
||||
<view class="contentboxtopone" v-if="item.state == '1'">
|
||||
<text class="contentboxtopone_one">前面还有{{item.preCount}}首</text>
|
||||
<text class="contentboxtopone_tow">已支付</text>
|
||||
</view>
|
||||
<text class="contentboxtopnametow" v-if="item.state == '2'">演唱中</text>
|
||||
<text class="contentboxtopnametowthere" v-if="item.state == '3'">已演唱</text>
|
||||
</view>
|
||||
<view class="contentboxtopO">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
<view class="contentboxtopT">
|
||||
下单时间:{{$u.timeFormat(item.create_time,'yyyy-mm-dd hh:MM') || '无'}}
|
||||
</view>
|
||||
<image class="contentboxafter" src="" mode=""></image>
|
||||
</view>
|
||||
<!-- <image style="margin:100rpx auto 32rpx auto;"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/nomore.png" v-if="is_end"
|
||||
mode="aspectFill"></image> -->
|
||||
<view style="padding: 32rpx 0;">
|
||||
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Height: '',
|
||||
list: [],
|
||||
is_end: false,
|
||||
form: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
status: 'loadmore',
|
||||
},
|
||||
shopId: '10'
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.shopId = e.shopId
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
// this.Topdistance()
|
||||
}, 500)
|
||||
},
|
||||
onShow() {
|
||||
this.cashierService()
|
||||
},
|
||||
methods: {
|
||||
Topdistance(res) {
|
||||
// console.log(res,111)
|
||||
var resdata = res
|
||||
uni.getSystemInfo({
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
this.Height = data.screenHeight - 32 - resdata + 'px'
|
||||
// console.log(this.Height)
|
||||
// console.log(this.Height)
|
||||
}
|
||||
})
|
||||
},
|
||||
lower() {
|
||||
console.log('触底加载')
|
||||
this.cashierService()
|
||||
},
|
||||
async cashierService() {
|
||||
let res = await this.api.cashierServicerecord({
|
||||
size: this.form.size,
|
||||
page: this.form.page,
|
||||
state: '', //-1 未支付 0 已取消 1 已支付 2 演唱中 3 已演唱
|
||||
shopId: this.shopId
|
||||
})
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
if (this.form.page == 1 && res.data.list.length == 0) {
|
||||
this.list = []
|
||||
this.is_end = true
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.status = 'loading';
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
|
||||
}
|
||||
},
|
||||
//获取元素距离顶部的距离
|
||||
GetTop() {
|
||||
uni.getSystemInfo({
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
this.$u.getRect('.content').then(res => {
|
||||
console.log(res, 111)
|
||||
this.Height = data.safeArea.height - 32 + 'px'
|
||||
// console.log(this.Height)
|
||||
})
|
||||
// console.log(this.Height)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/background.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
z-index: 99;
|
||||
padding: 32rpx 28rpx 0rpx 28rpx;
|
||||
overflow: auto;
|
||||
|
||||
.scrollview {
|
||||
overflow: auto;
|
||||
|
||||
.contentbox:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.contentbox {
|
||||
position: relative;
|
||||
margin-top: 48rpx;
|
||||
width: 100%;
|
||||
background: rgba(129, 125, 207, 0.2);
|
||||
border: 2px solid #828282;
|
||||
backdrop-filter: blur(20px);
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
|
||||
.contentboxafter {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 482rpx;
|
||||
height: 14rpx;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/dibuyin.png);
|
||||
background-size: 100% 100%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
.contentboxtop {
|
||||
padding: 16rpx 24rpx;
|
||||
border-bottom: 2rpx solid #F6F6F6;
|
||||
|
||||
.contentboxtopname {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.contentboxtopone {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.contentboxtopone_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #F9DDF9;
|
||||
}
|
||||
|
||||
.contentboxtopone_tow {
|
||||
margin-left: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #32AA52;
|
||||
text-shadow: 0px 6px 6px rgba(50, 170, 82, 0.55);
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxtopnametow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #FF9C39;
|
||||
text-shadow: 0px 4px 4px rgba(255, 156, 57, 0.37);
|
||||
}
|
||||
|
||||
.contentboxtopname_weizhifu {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-shadow: 0px 4px 4px rgba(255, 255, 255, 0.37);
|
||||
}
|
||||
|
||||
.contentboxtopnametowthere {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
text-shadow: 0px 4px 4px rgba(255, 255, 255, 0.37);
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxtopO {
|
||||
padding: 0 24rpx;
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.contentboxtopT {
|
||||
padding: 0rpx 24rpx 32rpx 24rpx;
|
||||
margin-top: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/Meituanquan.png"
|
||||
style="width: 39.46rpx;height: 40rpx;" mode=""></image>
|
||||
<text>优惠券</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
{{info.expDate}}
|
||||
</view>
|
||||
<button v-if="info.refundAble=='1'" class="buttonStyle" @click="makephone(info.phone)">申请退款</button>
|
||||
<view style="height: 2rpx;width: 100%;background-color: #EFEFEF;margin-top: 16rpx;"> </view>
|
||||
<view class="rightStyle" v-for="(item,i) in info.coupons">
|
||||
<text :class="[item.isRefund==1?'tdl':'' ]">
|
||||
{{item.couponNo}}
|
||||
</text>
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/QRcode.png" v-if="info.status=='unused'"
|
||||
style="width: 39.46rpx;height: 40rpx;margin-right: 50rpx;" mode="" @click="openQR"></image>
|
||||
<text v-else>已退款</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
makephone(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
});
|
||||
// uni.pro.navigateTo('group_order/refund',{})
|
||||
},
|
||||
openQR() {
|
||||
this.$emit('clickEvent')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.buttonStyle {
|
||||
position: absolute;
|
||||
right: 58rpx;
|
||||
top: 56rpx;
|
||||
width: 180rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #E8E8E8;
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.rightStyle {
|
||||
.df(space-between);
|
||||
margin-top: 16rpx;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
|
||||
.tdl {
|
||||
color: #999;
|
||||
text-decoration: line-through
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/shangdian.png"
|
||||
style="width: 40rpx;height: 36.44rpx;" mode=""></image>
|
||||
<text>商家信息</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
{{info.shopName}}
|
||||
</view>
|
||||
<view class="addreeStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/dingwei.png"
|
||||
style="width: 17.9rpx;height: 22rpx;margin-right: 6rpx;" mode=""></image>{{info.distances}} |
|
||||
{{info.address}}
|
||||
</view>
|
||||
<view class="rightStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/dianhua.png" @click="makephone(info.phone)"
|
||||
style="width: 39.46rpx;height: 40rpx;margin-right: 50rpx;" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
makephone(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.buttonStyle {
|
||||
width: 158rpx;
|
||||
height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #E8E8E8;
|
||||
position: absolute;
|
||||
right: 58rpx;
|
||||
top: 56rpx;
|
||||
}
|
||||
|
||||
.addreeStyle {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 22rpx;
|
||||
.df;
|
||||
}
|
||||
|
||||
.rightStyle {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 126rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/sfmoney.png"
|
||||
style="width: 28.29rpx;height: 31.93rpx;" mode=""></image>
|
||||
<text>订单信息</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>订</text> <text>单</text> <text>号:</text>
|
||||
</view>
|
||||
<text>{{info.orderNo}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>手</text> <text>机</text> <text>号:</text>
|
||||
</view>
|
||||
<text>{{info.phone}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>付</text> <text>款</text> <text>时</text> <text>间:</text>
|
||||
</view>
|
||||
<text>{{info.payTime==null?'':info.payTime}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>数</text> <text>量:</text>
|
||||
</view>
|
||||
<text>{{info.number}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>总</text> <text>价:</text>
|
||||
</view>
|
||||
<text>{{info.orderAmount}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>优</text> <text>惠</text> <text>明</text> <text>细:</text>
|
||||
</view>
|
||||
<text style="color: #FF4C11;">{{info.saveAmount}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>待</text><text>支</text> <text>付:</text>
|
||||
</view>
|
||||
<text>{{info.payAmount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.df(flex-start, stretch);
|
||||
margin-top: 16rpx;
|
||||
margin-left: 40rpx;
|
||||
|
||||
>view {
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
margin-right: 50rpx;
|
||||
width: 120rpx;
|
||||
.df(space-between)
|
||||
}
|
||||
|
||||
>text {
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/sfmoney.png"
|
||||
style="width: 28.29rpx;height: 31.93rpx;" mode=""></image>
|
||||
<text>实付金额</text>
|
||||
<text>¥{{info.payAmount}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>订</text> <text>单</text> <text>号:</text>
|
||||
</view>
|
||||
<text>{{info.orderNo}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>手</text> <text>机</text> <text>号:</text>
|
||||
</view>
|
||||
<text>{{info.phone}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>付</text> <text>款</text> <text>时</text> <text>间:</text>
|
||||
</view>
|
||||
<text>{{info.payTime}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>数</text> <text>量:</text>
|
||||
</view>
|
||||
<text>{{info.number}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>总</text> <text>价:</text>
|
||||
</view>
|
||||
<text>{{info.orderAmount}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
<text>实</text> <text>付:</text>
|
||||
</view>
|
||||
<text>{{info.payAmount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.df(flex-start, stretch);
|
||||
margin-top: 16rpx;
|
||||
margin-left: 40rpx;
|
||||
>view {
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
margin-right: 50rpx;
|
||||
width: 120rpx;
|
||||
.df(space-between)
|
||||
}
|
||||
|
||||
>text {
|
||||
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/dengpao.png"
|
||||
style="width: 33.19rpx;height: 43.92rpx;" mode=""></image>
|
||||
<text>温馨提示</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
有效期:
|
||||
</view>
|
||||
<text>{{info.notice.dateUsed}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
使用时间:
|
||||
</view>
|
||||
<text>{{info.notice.availableTime}}</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view>
|
||||
使用规则:
|
||||
</view>
|
||||
<text>{{info.notice.invoiceInfo}}</text>
|
||||
</view>
|
||||
<view @click="clickEvent" class="lookstyle" v-if="islook">
|
||||
查看更多<u-icon name="arrow-down" color="#575B66" size="28"></u-icon>
|
||||
</view>
|
||||
<view class="More" v-else>
|
||||
<u-parse :content="info.notice.usageRules"></u-parse>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {
|
||||
islook: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
this.islook = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
.df(flex-start, stretch);
|
||||
margin-top: 16rpx;
|
||||
|
||||
>view {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.More {
|
||||
margin-left: 119rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
|
||||
.buttonStyle {
|
||||
width: 158rpx;
|
||||
height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #E8E8E8;
|
||||
position: absolute;
|
||||
right: 58rpx;
|
||||
top: 56rpx;
|
||||
}
|
||||
|
||||
.addreeStyle {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 22rpx;
|
||||
.df;
|
||||
}
|
||||
|
||||
.rightStyle {
|
||||
margin-top: 16rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
.df(space-between);
|
||||
|
||||
>view>text {
|
||||
margin-left: 8rpx;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.lookstyle {
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
.df(center);
|
||||
}
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<template>
|
||||
<view class="Box">
|
||||
<view class="fontStyle">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/canyin.png"
|
||||
style="width: 40rpx;height: 36.44rpx;" mode=""></image>
|
||||
<text>到店吃套餐</text>
|
||||
</view>
|
||||
<view style="margin-left: 52rpx;" v-for="(item ,i ) in info.tagVos" :key="i">
|
||||
<view class="content">
|
||||
{{item.title}} {{item.goods.length}} 选 {{item.number}}
|
||||
</view>
|
||||
<view class="rightStyle" v-for="(ele,index) in item.goods" :key="index">
|
||||
<view>
|
||||
{{ele.name}} <text>({{ele.groupNum}}{{ele.unitName}})</text>
|
||||
</view>
|
||||
<text>¥{{ele.lowPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
makephone(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Box {
|
||||
width: 750rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
.df;
|
||||
|
||||
>text {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-left: 12rpx
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.buttonStyle {
|
||||
width: 158rpx;
|
||||
height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
border: 2rpx solid #E8E8E8;
|
||||
position: absolute;
|
||||
right: 58rpx;
|
||||
top: 56rpx;
|
||||
}
|
||||
|
||||
.addreeStyle {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 22rpx;
|
||||
.df;
|
||||
}
|
||||
|
||||
.rightStyle {
|
||||
margin-top: 16rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
.df(space-between);
|
||||
|
||||
>view>text {
|
||||
margin-left: 8rpx;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<template>
|
||||
<view class="title">
|
||||
<text class="fontStyle">{{info.proName}}</text>
|
||||
<view class="titleBox">
|
||||
<image :src="info.proImg" mode=""
|
||||
style="width: 102rpx;height: 102rpx;border-radius: 12rpx 12rpx 12rpx 12rpx;"></image>
|
||||
<view class="ml-20 rightText">
|
||||
<view>
|
||||
{{info.avaTime}}
|
||||
</view>
|
||||
<view style="margin-top: 8rpx;">{{info.proDetail}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="moneyStyle" @click="fivecontentclick(info.proId)">
|
||||
<text class="moneys">¥{{info.orderAmount}}</text>
|
||||
<u-icon name="arrow-right" color="#000" size="28"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['info'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fivecontentclick(proId) {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
id: proId
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.title {
|
||||
width: 750rpx;
|
||||
height: 206rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
padding: 32rpx 64rpx;
|
||||
margin-top: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.fontStyle {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.titleBox {
|
||||
.df();
|
||||
|
||||
.rightText {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.moneyStyle {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 80rpx;
|
||||
.df();
|
||||
|
||||
.moneys {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ml-20 {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
display: flex;
|
||||
justify-content: @start;
|
||||
align-items: @position;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<!-- 团购订单详情 -->
|
||||
<view>
|
||||
<!-- 头部 -->
|
||||
<groupTitle :info="listinfo"></groupTitle>
|
||||
<!-- 券
|
||||
if (e == 'closed') return '已完成'
|
||||
else if (e == 'unpaid') return '待付款'
|
||||
else if (e == 'unused') return '待使用'
|
||||
else if (e == 'refund') return '已退款'
|
||||
else if (e == 'cancelled') return '已取消'
|
||||
else return "1"
|
||||
-->
|
||||
<groupCoupons :info="listinfo" @clickEvent='clickEvent'
|
||||
v-if="listinfo.status=='unused'||listinfo.status=='refund'"></groupCoupons>
|
||||
<!-- 商家信息 -->
|
||||
<groupMerchants :info="listinfo"></groupMerchants>
|
||||
<!-- 到店 -->
|
||||
<groupStore :info="listinfo"></groupStore>
|
||||
<!-- 提示 -->
|
||||
<groupPrompt :info="listinfo"></groupPrompt>
|
||||
<!-- 实付 -->
|
||||
<groupPay :info="listinfo" v-if="listinfo.status=='unused'||listinfo.status=='refund'"></groupPay>
|
||||
<!-- 订单信息 -->
|
||||
<groupOrderInfo :info="listinfo" v-else></groupOrderInfo>
|
||||
<view class="customerService" @click="makephone(listinfo.phone)">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/kefu.png"
|
||||
style="width: 40rpx;height: 43.21rpx;" mode=""></image>
|
||||
联系客服
|
||||
</view>
|
||||
|
||||
<view style="height: 100rpx;" v-if="listinfo.status == 'unpaid'"> </view>
|
||||
<!-- 待支付按钮 -->
|
||||
<view class="payBox" v-if="listinfo.status == 'unpaid'">
|
||||
<button @click="payEvent" class="payStyle">立即支付</button>
|
||||
</view>
|
||||
<!-- 二维码展示 -->
|
||||
<view class="qrimg" v-if="isQrimg" @click="clickEvent">
|
||||
<tki-qrcode ref="qrcode" size="400" :val="qrValue" :loadMake="true" @result="qrR" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 只有两个有变动,美团券和实付金额、订单信息
|
||||
* 1.支付完成/已退款/有美团券、
|
||||
* 待支付/已完成没有美团券
|
||||
* 2.支付完成、已退款有实付金额
|
||||
* 待支付、已完成有订单信息没有实付金额
|
||||
**/
|
||||
import groupTitle from './components/groupTitle.vue'
|
||||
import groupCoupons from './components/groupCoupons.vue'
|
||||
import groupMerchants from './components/groupMerchants.vue'
|
||||
import groupStore from './components/groupStore.vue'
|
||||
import groupPrompt from './components/groupPrompt.vue'
|
||||
import groupPay from './components/groupPay.vue'
|
||||
import groupOrderInfo from './components/groupOrderInfo.vue'
|
||||
import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
|
||||
export default {
|
||||
components: {
|
||||
groupTitle,
|
||||
groupCoupons,
|
||||
groupMerchants,
|
||||
groupStore,
|
||||
groupPrompt,
|
||||
groupPay,
|
||||
tkiQrcode,
|
||||
groupOrderInfo
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderId = e.orderId
|
||||
this.orderorderInfo()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
orderId: "",
|
||||
listinfo: null,
|
||||
isQrimg: false,
|
||||
qrValue: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async payEvent() {
|
||||
let res = await this.api.payOrderPay({
|
||||
payType: 'wechatPay',
|
||||
orderId: this.listinfo.id,
|
||||
orderType: 'group'
|
||||
})
|
||||
if (res) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.appId, // 微信支付商户号
|
||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.nonceStr, // 随机字符串
|
||||
package: res.data.package, // 固定值
|
||||
signType: res.data.signType, //固定值
|
||||
paySign: res.data.paySign, //签名
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
uni.navigateBack()
|
||||
},
|
||||
fail: (err) => {
|
||||
setTimeout(res => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, 2000)
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
clickEvent() {
|
||||
this.qrValue =this.listinfo.coupons[0].couponNo
|
||||
console.log(this.listinfo.coupons[0].couponNo)
|
||||
// this.qrValue = this.qrEvent()
|
||||
this.isQrimg = !this.isQrimg
|
||||
},
|
||||
qrR(e) {
|
||||
console.log(112312)
|
||||
},
|
||||
// 拼接code值
|
||||
qrEvent() {
|
||||
let str = ''
|
||||
this.listinfo.coupons.forEach(res => {
|
||||
if (res.couponNo) {
|
||||
str += res.couponNo + ','
|
||||
}
|
||||
})
|
||||
return str
|
||||
},
|
||||
orderorderInfo() {
|
||||
let _this = this
|
||||
uni.getStorage({
|
||||
key: "getLocationstorage",
|
||||
success: async function(data) {
|
||||
let {
|
||||
lat,
|
||||
lng
|
||||
} = data.data
|
||||
let res = await _this.api.groupOrderInfoDetail({
|
||||
id: _this.orderId,
|
||||
lat,
|
||||
lng
|
||||
})
|
||||
if (res.code == 0) {
|
||||
_this.listinfo = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
makephone(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.qrimg {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 0%;
|
||||
left: 0%;
|
||||
}
|
||||
|
||||
.payBox {
|
||||
width: 100vw;
|
||||
height: 140rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
bottom: 0%;
|
||||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
|
||||
|
||||
.payStyle {
|
||||
background-color: #fe7620;
|
||||
color: #fff;
|
||||
width: 90%;
|
||||
border: 10rpx solid #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.customerService {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
width: 100%;
|
||||
padding: 78rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,323 @@
|
|||
<template>
|
||||
<!-- 退款 -->
|
||||
<view class="refund">
|
||||
<view class="refundBox">
|
||||
<view class="refundBoxA">
|
||||
<image src="../../static/avatar.png"
|
||||
style="width: 86rpx;height: 86rpx;border-radius: 12rpx 12rpx 12rpx 12rpx;" mode=""></image>
|
||||
<view>
|
||||
【辣与不辣随心选】汉堡3选1MT19
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;height: 2rpx;background-color: #E6E6E6;margin-top: 18rpx;"> </view>
|
||||
<view class="refundBoxB">
|
||||
<view>
|
||||
退款数量
|
||||
</view>
|
||||
<view>
|
||||
最多可退1张
|
||||
</view>
|
||||
<!-- 计步器 -->
|
||||
<u-number-box class="Unumber" v-model="Unumbervalue" style="position: absolute;right: 20rpx;"
|
||||
:disabled="true"></u-number-box>
|
||||
</view>
|
||||
<view style="width: 100%;height: 2rpx;background-color: #E6E6E6;margin-top: 32rpx;"> </view>
|
||||
<view class="refundBoxC">
|
||||
<view>
|
||||
退款金额
|
||||
</view>
|
||||
<view>
|
||||
1-3 个工作日退还至原支付方,以实际退款金额为准
|
||||
</view>
|
||||
<view>$9.9</view>
|
||||
</view>
|
||||
<view style="width: 100%;height: 2rpx;background-color: #E6E6E6;margin-top: 32rpx;"> </view>
|
||||
<view class="refundBoxD">
|
||||
<view>退款原因 <text style="color: #FF4C11;">*</text> </view>
|
||||
<view class="as-input" @click="openFood">
|
||||
<view class="placeholder" v-if="fruitName==undefined||fruitName==''">请至少选择一项</view>
|
||||
<view class="as-content" v-else>{{fruitName}}</view>
|
||||
<!-- <uni-icons type="forward" size="16" color="#c0c4cc" class="customer-icon"></uni-icons> -->
|
||||
<u-icon name="arrow-right" color="#666666" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 100%;height: 2rpx;background-color: #E6E6E6;margin-top: 32rpx;"> </view>
|
||||
<view class="refundBoxE">
|
||||
<view>退款说明 </view>
|
||||
<textarea placeholder-style="font-size: 24rpx;color: #999999;" @input="sumfontnum" :value='tareaValue'
|
||||
placeholder="请输入退款说明,我们将用心倾听你的任何不满" name="" id="" maxlength="200" cols="30" rows="10"
|
||||
style="padding: 16rpx 26rpx;margin-top: 16rpx;border: solid 2rpx #999;border-radius: 18rpx 18rpx 18rpx 18rpx;"></textarea>
|
||||
<view class="Unumberxz"><text>{{fontNum}}</text>/200</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttonBox">
|
||||
<button class="buttonStyle">
|
||||
提交订单
|
||||
</button>
|
||||
</view>
|
||||
<niceui-popup-select ref="showFruit" :columns="foods" :selectValue="fruitId" :is-search="false"
|
||||
:option="{label:'name', value:'id'}" @confirm="confirmFruit"></niceui-popup-select>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Unumbervalue: 1,
|
||||
tareaValue: '',
|
||||
fontNum: 0,
|
||||
foods: [{
|
||||
id: '1',
|
||||
name: '计划有变没时间消费'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '买多了/买错了'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '担心安全问题(天气等)'
|
||||
}, {
|
||||
id: '3',
|
||||
name: '担心安全问题(天气等)'
|
||||
}, {
|
||||
id: '3',
|
||||
name: '担心安全问题(天气等)'
|
||||
}, {
|
||||
id: '3',
|
||||
name: '担心安全问题(天气等)'
|
||||
}, {
|
||||
id: '3',
|
||||
name: '担心安全问题(天气等)'
|
||||
},
|
||||
],
|
||||
fruitId: [],
|
||||
fruitName:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 限制文本框字数
|
||||
sumfontnum(e) {
|
||||
console.log(e)
|
||||
this.fontNum = e.detail.value.length
|
||||
},
|
||||
confirmFruit(value, data) {
|
||||
this.fruitId = value
|
||||
this.fruitName = data.map(it => it.name)
|
||||
this.$refs.showFruit.closePopup()
|
||||
},
|
||||
|
||||
openFood() {
|
||||
this.$refs.showFruit.showPopup()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.refundBox {
|
||||
background-color: #fff;
|
||||
padding: 32rpx 64rpx;
|
||||
|
||||
.refundBoxA {
|
||||
.df(flex-start, stretch);
|
||||
|
||||
>view {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.refundBoxB {
|
||||
position: relative;
|
||||
|
||||
>view:first-child {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.Unumber {
|
||||
|
||||
// transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.refundBoxC {
|
||||
position: relative;
|
||||
|
||||
>view:first-child {
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
>view:last-child {
|
||||
position: absolute;
|
||||
right: 0rpx;
|
||||
top: 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
}
|
||||
|
||||
.refundBoxD {
|
||||
.df(space-between);
|
||||
// margin-top: 32rpx;
|
||||
padding-top: 32rpx;
|
||||
|
||||
>view:first-child {
|
||||
.df;
|
||||
width: 160rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
>view:last-child {
|
||||
// .df();
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.refundBoxE {
|
||||
margin-top: 32rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
position: relative;
|
||||
|
||||
.Unumberxz {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
bottom: 14rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
|
||||
>text {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.buttonBox {
|
||||
width: 100%;
|
||||
height: 136rpx;
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
// .df(center,center);
|
||||
|
||||
.buttonStyle {
|
||||
margin-left: 50%;
|
||||
margin-top: 40rpx;
|
||||
transform: translateX(-50%);
|
||||
width: 712rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(110deg, #F1A666 0%, #FF4C11 100%);
|
||||
border-radius: 48rpx 48rpx 48rpx 48rpx;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.df(@start: flex-start, @position: center) {
|
||||
// @start: flex-start(默认) space-between(两端对齐) space-around(间隔相等)
|
||||
// @position:stretch(默认) center(垂直居中)
|
||||
display: flex;
|
||||
align-items: @position;
|
||||
justify-content: @start;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
/deep/ .u-number-box {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 30%;
|
||||
}
|
||||
|
||||
radio-group,
|
||||
checkbox-group {
|
||||
width: 92%;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
background-color: #f7f7f7;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
|
||||
}
|
||||
|
||||
.uni-title {
|
||||
font-size: 33rpx;
|
||||
font-weight: bold;
|
||||
padding: 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.uni-list-cell {
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 20rpx;
|
||||
|
||||
.uni-list-cell-left {
|
||||
font-size: 35rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-list-cell-db {
|
||||
flex: 1
|
||||
}
|
||||
|
||||
.as-input {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.customer-icon {
|
||||
padding: 0 0 0 5rpx;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
font-size: 33rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.as-content {
|
||||
color: #333;
|
||||
font-size: 33rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
<template>
|
||||
<view class="onecontent flex-between">
|
||||
<view class="onecontentleft">
|
||||
现有<text style="color: #FC851E;font-size: 24rpx;">
|
||||
{{bannervo.coupons==null?116:bannervo.coupons}}人
|
||||
</text>
|
||||
已免单
|
||||
</view>
|
||||
<view class="onecontentright flex-start">
|
||||
<view class="onecontentrightimage">
|
||||
<view class="swiperPanel" @touchstart="startMove" @touchend="endMove">
|
||||
<view class="swiperItem" v-for="(item, index) in bannervo.counponsInfo" :key="index"
|
||||
:style="{transform: itemStyle[index].transform, zIndex: itemStyle[index].zIndex, opacity: itemStyle[index].opacity}">
|
||||
<view class="children">
|
||||
<image class="pic" :src="item.logo"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontentrighttext">
|
||||
<swiper class="swiper" circular :autoplay="true" :vertical='true' :interval="2000">
|
||||
<swiper-item class="swiperitem" v-for="(item,index) in bannervo.counponsInfo" :key="index">
|
||||
{{item.name}}已省{{item.money}}元钱
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 小内切圆 -->
|
||||
<view class="after"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import customSwiper from '@/components/blackmonth-swiper/index'
|
||||
export default {
|
||||
components: {
|
||||
customSwiper
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isScroll: false,
|
||||
minCount: 0,
|
||||
fontColor: 'black',
|
||||
timersetInterval: '0', //定时器
|
||||
slideNote: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
screenWidth: 0
|
||||
};
|
||||
},
|
||||
props: {
|
||||
bannervo: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
counponsInfo: []
|
||||
}
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
},
|
||||
timersetnteritem: {
|
||||
type: String,
|
||||
default: '0'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
timersetnteritem(newVal, oldVal) {
|
||||
// console.log(newVal, oldVal)
|
||||
if (newVal == 1) {
|
||||
clearTimeout(this.timersetInterval);
|
||||
this.timersetInterval = null;
|
||||
} else {
|
||||
this.timersetIntervalnewVal()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.timersetIntervalnewVal()
|
||||
},
|
||||
methods: {
|
||||
timersetIntervalnewVal() {
|
||||
this.timersetInterval = setInterval(() => {
|
||||
this.endMove()
|
||||
}, 2000);
|
||||
},
|
||||
startMove(e) {
|
||||
this.slideNote.x = e.changedTouches[0] ? e.changedTouches[0].pageX : 0;
|
||||
this.slideNote.y = e.changedTouches[0] ? e.changedTouches[0].pageY : 0;
|
||||
},
|
||||
endMove(e) {
|
||||
// this.itemStyless = []
|
||||
var newList = JSON.parse(JSON.stringify(this.itemStyle))
|
||||
// console.log(newList)
|
||||
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
|
||||
// 向左滑动
|
||||
var last = [newList.pop()]
|
||||
newList = last.concat(newList)
|
||||
// } else {
|
||||
// 向右滑动
|
||||
// newList.push(newList[0])
|
||||
// newList.splice(0, 1)
|
||||
// }
|
||||
this.$emit('changeValue', newList);
|
||||
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.onecontent {
|
||||
position: relative;
|
||||
margin-top: -34rpx;
|
||||
padding: 14rpx 28rpx 44rpx 28rpx;
|
||||
width: 100%;
|
||||
background: linear-gradient(92deg, #FCECAA 0%, #fff 100%);
|
||||
border-radius: 40rpx 0rpx 0rpx 0rpx;
|
||||
|
||||
.onecontentleft {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 700;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
text {
|
||||
color: #FC851E;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.onecontentright {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.onecontentrightimage {
|
||||
width: 65rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
|
||||
.swiperPanel {
|
||||
height: 28rpx;
|
||||
width: 100rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.swiperItem {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transition: all .5s;
|
||||
|
||||
/* 定义一个动画关键帧 */
|
||||
|
||||
|
||||
.children {
|
||||
height: 100%;
|
||||
width: 25%;
|
||||
// margin: 2rpx auto;
|
||||
|
||||
|
||||
/* 应用动画,设置动画时长、循环次数和速度曲线 */
|
||||
.pic {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 50%;
|
||||
// box-shadow: 0 0 10px #333;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentrightimageabsolute {
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
height: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
.onecontentrightimageabsolutetow {
|
||||
width: 100%;
|
||||
left: 14rpx;
|
||||
top: 0;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
// .onecontentrightswiper {
|
||||
// border: 50%;
|
||||
// width: 28rpx;
|
||||
// height: 28rpx;
|
||||
// background: red;
|
||||
// }
|
||||
}
|
||||
|
||||
.onecontentrighttext {
|
||||
width: 232rpx;
|
||||
|
||||
.swiper {
|
||||
height: 28rpx;
|
||||
// width: 232rpx;
|
||||
|
||||
.swiperitem {
|
||||
width: 100rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #333333;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.after {
|
||||
position: absolute;
|
||||
top: -40rpx;
|
||||
right: 0;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<view class="fourcontent flex-between">
|
||||
<view class="fourcontent_item flex-start" v-for="(item,index) in menu" :key="index"
|
||||
@click="viewHistorycategoryss(item,index)"
|
||||
:class="!item.isChild && viewHistoryindex == index ? 'fourcontent_itemactev':''">
|
||||
<text>{{item.name}}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
menu: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
},
|
||||
viewHistoryindex: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
viewHistorycategoryss(item, index) {
|
||||
console.log(item, index)
|
||||
uni.$emit('viewHistory', {
|
||||
item:item,
|
||||
index:index
|
||||
});
|
||||
},
|
||||
clickdistrict(item) {
|
||||
switch (item.jumpType) {
|
||||
case 'absolute':
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
url: item.absUrl
|
||||
});
|
||||
break;
|
||||
case 'relative':
|
||||
uni.pro.navigateTo(item.absUrl, item);
|
||||
break;
|
||||
case 'scan':
|
||||
if (!uni.utils.pluschooseImage()) {
|
||||
return false
|
||||
}
|
||||
// #ifdef H5
|
||||
if (this.wxSdk) {
|
||||
wx.scanQRCode({
|
||||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||||
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
||||
success: res => {
|
||||
// 当needResult 为 1 时,扫码返回的结果
|
||||
console.log(res.resultStr, res)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '微信sdk初始化失败,请重新加载',
|
||||
success: res => {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
// #ifdef APP || MP-WEIXIN
|
||||
uni.scanCode({
|
||||
success: res => {
|
||||
console.log(res.result, res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.fourcontent {
|
||||
padding: 32rpx 28rpx 32rpx 28rpx;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.fourcontent_item {
|
||||
flex-wrap: nowrap;
|
||||
margin-left: 22rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
|
||||
text {
|
||||
width: max-content;
|
||||
}
|
||||
}
|
||||
|
||||
.fourcontent_itemactev {
|
||||
background: #fee06a;
|
||||
}
|
||||
|
||||
.fourcontent_item:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<view class="towcontent flex-between">
|
||||
<view v-if="(item.absUrl!=''||item.jumpType=='scan')&&item.name!='积分商城'" class="towcontent_item flex-colum" v-for="(item,index) in district" :key="index"
|
||||
@click="clickdistrict(item,index)">
|
||||
<image :src="item.coverImg" mode="aspectFill"></image>
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
district: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clickdistrict(item) {
|
||||
console.log(item,'调试')
|
||||
switch (item.jumpType) {
|
||||
case 'absolute':
|
||||
uni.pro.navigateTo('webview/webview', {
|
||||
url: item.absUrl
|
||||
});
|
||||
break;
|
||||
case 'scan_applet':
|
||||
uni.navigateToMiniProgram(JSON.parse(item.value))
|
||||
break;
|
||||
case 'relative':
|
||||
uni.setStorage({
|
||||
key: 'itemData',
|
||||
data: item,
|
||||
});
|
||||
uni.pro.navigateTo(item.absUrl, item.name);
|
||||
break;
|
||||
case 'scan':
|
||||
if (!uni.utils.pluschooseImage()) {
|
||||
return false
|
||||
}
|
||||
// #ifdef APP || MP-WEIXIN || MP-ALIPAY
|
||||
uni.scanCode({
|
||||
success: async(res) => {
|
||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
let data = await this.api.productqueryShop({
|
||||
code: uni.cache.get('tableCode'),
|
||||
})
|
||||
if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) {
|
||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||
tableCode: tableCode,
|
||||
shopId: data.data.storeInfo.id,
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: tableCode,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
fail:( res) =>{
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.towcontent {
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
padding: 32rpx 40rpx;
|
||||
width: 100%;
|
||||
background: #F9F9F9;
|
||||
border-radius: 48rpx 48rpx 0rpx 0rpx;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.towcontent_item {
|
||||
width: 25%;
|
||||
margin-left: 34rpx;
|
||||
|
||||
image {
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
margin-top: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent_item:nth-child(1) {
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,309 @@
|
|||
<template>
|
||||
<!-- #ifndef APP-PLUS || MP-WEIXIN -->
|
||||
<view class="fivecontent">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="fivecontent" :style="isFixedTop?`margin-top:${HeighT.heightBar}px`:''">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="fivecontent" :class="{statusbarmargin:isFixedTop}">
|
||||
<!-- #endif -->
|
||||
<view class="fivecontent_item" v-for="(item,index) in 12" :key="index">
|
||||
<view class="fivecontent_item_nav flex-start">
|
||||
<image src="@/static/avatar.png" mode="aspectFill"></image>
|
||||
<view class="fivecontent_item_nav_left">
|
||||
<view class="fivecontent_item_nav_lefttop flex-between">
|
||||
<view>
|
||||
幸运咖啡(荣民时代广场店)
|
||||
</view>
|
||||
<view>
|
||||
龙首.151m
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_nav_leftlang flex-start">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
|
||||
mode="aspectFill"></image>
|
||||
<text>人气连锁品牌</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_box">
|
||||
<view class="fivecontent_item_boxitem flex-between">
|
||||
<image src="@/static/avatar.png" mode=""></image>
|
||||
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
||||
<view class="fivecontent_item_boxitemleftone flex-between">
|
||||
<view>全场饮品任选</view>
|
||||
<text>已抢15789份</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefttow flex-start">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
|
||||
mode="aspectFill"></image>
|
||||
<text>人气连锁品牌</text>
|
||||
</view>
|
||||
<view class="indexboxitemleftthere flex-colum-start">
|
||||
<view class="indexboxitemleftthereabsolute">
|
||||
马上抢
|
||||
</view>
|
||||
<view class="indexboxitemlefttheretext flex-start">
|
||||
<view class="indexboxitemlefttheretextone">
|
||||
<text>¥</text>
|
||||
<text>1444</text>
|
||||
</view>
|
||||
<view class="indexboxitemlefttheretexttow">
|
||||
¥111
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="indexboxitemleftthere_countdown flex-between">
|
||||
<text class="indexboxitemleftthere_countdowntext">共省4元</text>
|
||||
<view class="indexboxitemleftthere_countdowntexts">
|
||||
<uni-countdown :show-day="false" :day="1" :hour="1" :minute="12"
|
||||
:second="40" color="#FFFFFF" border-color="#00B26A"
|
||||
splitorColor="#FFFFFF" :font-size="8"></uni-countdown>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isFixedTop: false, //吸顶是否显示
|
||||
Topdistance: 3000, //吸顶初始距离
|
||||
keyword: '',
|
||||
current: 0,
|
||||
opacity: false,
|
||||
};
|
||||
},
|
||||
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacity = false
|
||||
} else {
|
||||
this.opacity = true
|
||||
}
|
||||
if (e.scrollTop >= this.Topdistance) { //类别导航栏
|
||||
this.isFixedTop = true
|
||||
} else {
|
||||
this.isFixedTop = false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
setTimeout(() => {
|
||||
this.GetTop()
|
||||
}, 1000)
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
GetTop() {
|
||||
//获取元素距离顶部的距离
|
||||
this.$u.getRect('.fourcontent').then(res => {
|
||||
this.Topdistance = res.top - this.HeighT.heightBar
|
||||
})
|
||||
},
|
||||
viewHistory() {
|
||||
//移动高度=滚动高度 + 距离上面的位置 - 导航条 - 状态栏高度
|
||||
uni.pageScrollTo({
|
||||
scrollTop: this.Topdistance + 1,
|
||||
duration: 300
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.fivecontent {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.fivecontent_item {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.fivecontent_item_nav {
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_left {
|
||||
flex: auto;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.fivecontent_item_nav_lefttop {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_leftlang {
|
||||
margin-top: 8rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
text {
|
||||
margin-left: 6rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_box {
|
||||
margin-top: 20rpx;
|
||||
border-top: 2rpx solid #E5E5E5;
|
||||
padding-top: 14rpx;
|
||||
|
||||
.fivecontent_item_boxitem {
|
||||
image {
|
||||
width: 192rpx;
|
||||
height: 192rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemleft {
|
||||
margin-left: 24rpx;
|
||||
flex: auto;
|
||||
|
||||
.fivecontent_item_boxitemleftone {
|
||||
width: 100%;
|
||||
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow {
|
||||
margin-top: 8rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
text {
|
||||
margin-left: 6rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.indexboxitemleftthere {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding-left: 16rpx;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.indexboxitemleftthereabsolute {
|
||||
position: absolute;
|
||||
top: 14rpx;
|
||||
right: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.indexboxitemlefttheretext {
|
||||
.indexboxitemlefttheretextone {
|
||||
text {
|
||||
font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #FF5053;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-weight: bold;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
text:nth-child(1) {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.indexboxitemlefttheretexttow {
|
||||
margin-left: 12rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdown {
|
||||
width: 100%;
|
||||
|
||||
.indexboxitemleftthere_countdowntext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdowntexts {
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
margin-left: 16rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<view class="viewswiper">
|
||||
<u-swiper :list="carousel" keyName="coverImg" @change="e => current = e.current" indicatorStyle="right: 20px" height='484'>
|
||||
<view slot="indicator" class="indicator">
|
||||
<view class="indicator__dot" v-for="(item, index) in carousel" :key="index"
|
||||
:class="[index === current && 'indicator__dot--active']"
|
||||
:style="[index === current && {'width':16+'px'}]">
|
||||
</view>
|
||||
</view>
|
||||
</u-swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0
|
||||
};
|
||||
},
|
||||
props: {
|
||||
carousel: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.viewswiper {
|
||||
.indicator {
|
||||
margin-bottom: 46rpx;
|
||||
@include flex(row);
|
||||
justify-content: center;
|
||||
|
||||
&__dot {
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
border-radius: 100px;
|
||||
background-color: rgba(255, 255, 255, 0.35);
|
||||
margin: 0 5px;
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&--active {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.indicator-num {
|
||||
padding: 2px 0;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
border-radius: 100px;
|
||||
width: 35px;
|
||||
@include flex;
|
||||
justify-content: center;
|
||||
|
||||
&__text {
|
||||
color: #FFFFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,262 @@
|
|||
<template>
|
||||
<view class="therecontent flex-between">
|
||||
<view class="therecontent_box_item">
|
||||
<view class="therecontent_box_imge flex-between" @click="jrtoday(0)">
|
||||
<view class="therecontent_box_imge_text">
|
||||
{{todayList.name}}
|
||||
</view>
|
||||
<view class="therecontent_box_imge_right flex-start">
|
||||
<view>
|
||||
{{todayList.date}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#666666" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="therecontent_box_itembox">
|
||||
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in todayList.todayList"
|
||||
:key="index" @click="clickproduct(item)">
|
||||
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill"></image>
|
||||
<view class="therecontent_box_itembox_itemview flex-colum-start">
|
||||
<view class="therecontent_box_itembox_itemviewone">
|
||||
<text
|
||||
style="margin-left: 0;">{{item.productName.length>5?item.productName.substring(0,5)+'...':item.productName}}</text>
|
||||
</view>
|
||||
<view class="therecontent_box_itembox_itemviewtow flex-around">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/xia.png" mode="widthFix">
|
||||
</image>
|
||||
<view>
|
||||
{{item.discount || '1'}}折
|
||||
</view>
|
||||
</view>
|
||||
<view class="therecontent_box_itembox_itemviewthere ">
|
||||
<text>¥{{item.salePrice}}</text>
|
||||
<text>¥{{item.originPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="therecontent_box_item">
|
||||
<view class="therecontent_box_imge flex-between"
|
||||
style="background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box2.png) no-repeat; background-size: cover;"
|
||||
@click="jrtoday(1)">
|
||||
<view class="therecontent_box_imge_text">
|
||||
{{salesList.name}}
|
||||
</view>
|
||||
<view class="therecontent_box_imge_right flex-start">
|
||||
<view>
|
||||
{{salesList.date}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#666666" size="16"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="therecontent_box_itembox">
|
||||
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList"
|
||||
:key="index" @click="clickproduct(item)">
|
||||
<image :src="`${item.image}?x-oss-process=image/resize,m_lfit,w_114,h_136`" mode="aspectFill"></image>
|
||||
<view class="therecontent_box_itembox_itemview flex-colum-start">
|
||||
<view class="therecontent_box_itembox_itemviewone flex-start">
|
||||
<view class="therecontent_box_itembox_itemviewoneafter">
|
||||
TOP.{{index + 1}}
|
||||
</view>
|
||||
<text>{{ item.productName.length>5?item.productName.substring(0,5)+'...':item.productName }}</text>
|
||||
</view>
|
||||
<view class="therecontent_box_itembox_itemviewtowdiscount flex-around">
|
||||
已抢{{item.realSalesNumber}}份
|
||||
</view>
|
||||
<view class="therecontent_box_itembox_itemviewthere ">
|
||||
<text>¥{{item.salePrice}}</text>
|
||||
<text>¥{{item.originPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
salesList: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
salesList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
todayList: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
todayList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '每日特价'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickproduct(item) {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
id: item.id
|
||||
})
|
||||
},
|
||||
jrtoday(e) {
|
||||
if (e == 0) {
|
||||
uni.pro.navigateTo('index/jtoday')
|
||||
} else {
|
||||
uni.pro.navigateTo('index/hotlist')
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.therecontent {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.therecontent_box_item {
|
||||
width: 336rpx;
|
||||
border-radius: 18rpx;
|
||||
background: #FFFFFF;
|
||||
height: 396rpx;
|
||||
|
||||
.therecontent_box_itembox {
|
||||
padding: 10rpx 18rpx 24rpx 24rpx;
|
||||
|
||||
.therecontent_box_itembox_item {
|
||||
margin-top: 20rpx;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
image {
|
||||
width: 114rpx;
|
||||
height: 136rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_itemview {
|
||||
margin-left: 12rpx;
|
||||
|
||||
.therecontent_box_itembox_itemviewone {
|
||||
width: 168rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
|
||||
text {
|
||||
margin-left: 4rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_itemviewoneafter {
|
||||
width: 48rpx;
|
||||
height: 24rpx;
|
||||
line-height: 24rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%);
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_itemviewtow {
|
||||
margin-top: 8rpx;
|
||||
width: 60rpx;
|
||||
// padding: 4rpx 10rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #FF7127;
|
||||
|
||||
image {
|
||||
width: 9.74rpx;
|
||||
height: 13.51rpx;
|
||||
}
|
||||
|
||||
view {
|
||||
padding-right: 2rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_itemviewtowdiscount {
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_itemviewthere {
|
||||
// margin-top: 4rpx;
|
||||
// align-items: flex-end;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: Bold;
|
||||
font-size: 24rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #999999;
|
||||
text-decoration-line: line-through;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.therecontent_box_itembox_item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.therecontent_box_imge {
|
||||
padding: 24rpx 16rpx 6rpx 24rpx;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/towcontent_box1.png) no-repeat;
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
background-size: cover;
|
||||
|
||||
.therecontent_box_imge_text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.therecontent_box_imge_right {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
// font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,553 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="containertop">
|
||||
<view class="containertopbox">
|
||||
<view class="containertopboxone flex-start">
|
||||
<view>可使用红包</view>
|
||||
<text>{{totalnumber}}张</text>
|
||||
</view>
|
||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index"
|
||||
@click="clickiconone(item)">
|
||||
<view class="containertopboxitemleft flex-colum"
|
||||
:class="item.status == 0?'':'containertopboxitemlefts'">
|
||||
<view class="containertopboxitemleft_one"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_ones'">
|
||||
<text style="font-size: 28rpx;">¥</text>
|
||||
<text>{{item.couponsAmount || 0}}</text>
|
||||
</view>
|
||||
<view class="containertopboxitemleft_tow"
|
||||
:class="item.status == 0?'':'containertopboxitemleft_tows'">
|
||||
优惠券(元)
|
||||
</view>
|
||||
</view>
|
||||
<view class="containertopboxitemright">
|
||||
<view class="containertopboxitemright_one">
|
||||
无门槛使用
|
||||
</view>
|
||||
<view class="containertopboxitemright_tow">
|
||||
通用红包券
|
||||
</view>
|
||||
<view class="containertopboxitemright_there">
|
||||
有效期至:{{$u.timeFormat(item.endTime, 'yyyy/mm/dd') || '0'}}
|
||||
</view>
|
||||
<view
|
||||
:class="item.status == 0?'containertopboxitemright_four':'containertopboxitemright_fours'">
|
||||
<text v-if="orderfood">
|
||||
{{item.status == 0 ? '去使用':'无法使用'}}
|
||||
</text>
|
||||
<text v-else>
|
||||
{{item.status == 0 ? '兑换积分':'已过期'}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<navigator url="/pages/user/coupon" hover-class="navigator-hover"
|
||||
style="margin-top: 20rpx;font-weight: 400;font-size: 28rpx;text-align: center; width: 100%;">
|
||||
查看更多
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="containerbottom">
|
||||
<view class="containerbottomtop">
|
||||
<view class="containerbottomtoptopbox flex-start">
|
||||
<view>可购买红包</view>
|
||||
<text>(根据您的订单金额推荐更适合您的优惠力度)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="containerbottombox_bottom">
|
||||
<view class="containerbottombox_bottomone">
|
||||
购买省钱包,本单立减
|
||||
</view>
|
||||
<view v-for="(item,index) in orderlist" :key="index">
|
||||
<view class="containerbottombox_bottomtow">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="containerbottombox_bottombox flex-start" v-for="(item1,index1) in item.listdata"
|
||||
:key="index1" @click="clickicon(item1)">
|
||||
<view class="containerbottombox_bottomthere">
|
||||
<view class="containerbottombox_bottomthere_topitem">
|
||||
<view class="onecontainerbottombox_bottomthere_topitem">
|
||||
<view class="containerbottombox_bottomthere_topitemone">
|
||||
通用红包
|
||||
</view>
|
||||
<view class="containerbottombox_bottomthere_topitemtow flex-center">
|
||||
<view class="a">
|
||||
¥
|
||||
</view>
|
||||
<view class="b">
|
||||
{{item1.couponsAmount}}
|
||||
</view>
|
||||
<view class="c">
|
||||
无门槛
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontainerbottombox_bottomthere_topitem">
|
||||
有效期:{{$u.timeFormat(item1.updateTime, 'yyyy/mm/dd') || '0'}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="therecontainerbottombox_bottomthere_topitem flex-around">
|
||||
<u-icon v-if="item1.id == item1id" name="checkmark-circle" color="#F1CB66"
|
||||
size="45"></u-icon>
|
||||
<text v-else class="theretext"></text>
|
||||
<view :class="item1.id == item1id?'c':'b'">
|
||||
<text :class="item1.id == item1id?'c':'b'"
|
||||
style="font-size:20rpx ;">¥</text>{{item1.couponsPrice}}/张
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
totalnumber: '',
|
||||
list: [],
|
||||
orderlist: [{
|
||||
listdata: {},
|
||||
}], //获取优惠券参数列表
|
||||
item1id: '',
|
||||
form: {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore'
|
||||
},
|
||||
orderfood: '', //等于0扫码点餐下单
|
||||
amount: '' //下单金额传来的值
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
try {
|
||||
this.orderfood = e.orderfood //等于0扫码点餐下单
|
||||
this.amount = e.amount
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.ordermineCouponsthis()
|
||||
this.ordergetYhqParass()
|
||||
},
|
||||
methods: {
|
||||
clickicon(e) { //团购优惠卷
|
||||
this.item1id = e.id
|
||||
e.clickiconone = 1
|
||||
let data = e
|
||||
if (this.orderfood == 0) { //等于0扫码点餐下单
|
||||
if (this.amount > e.couponsAmount) {
|
||||
uni.$emit('emitclickorderfood', e)
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '优惠券面值大于支付金额',
|
||||
icon: "none",
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
clickiconone(e) { //自己优惠劵处理
|
||||
e.clickiconone = 0
|
||||
let data = e
|
||||
if (this.orderfood == 0) { //等于0扫码点餐下单
|
||||
if (this.amount > e.couponsAmount) {
|
||||
uni.$emit('emitclickorderfood', data)
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '优惠券面值大于支付金额',
|
||||
icon: "none",
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
async ordergetYhqParass() { //类型列表
|
||||
let res = await this.api.ordergetYhqPara()
|
||||
try {
|
||||
this.orderlist = res.data
|
||||
for (let i = 0; i <= res.data.length; i++) {
|
||||
this.orderfindCouponses(i, this.orderlist[i].name);
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
async orderfindCouponses(i, name) {
|
||||
let res = await this.api.orderfindCoupons({
|
||||
page: 1,
|
||||
size: 10,
|
||||
type: name
|
||||
})
|
||||
this.orderlist[i].listdata = res.data.list
|
||||
console.log(this.orderlist)
|
||||
this.$forceUpdate();
|
||||
},
|
||||
async ordermineCouponsthis() {
|
||||
let res = await this.api.ordermineCoupons({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
status: 0,
|
||||
page: this.form.page,
|
||||
size: this.form.size,
|
||||
orderId:''
|
||||
})
|
||||
try {
|
||||
this.totalnumber = res.data.total
|
||||
this.list = res.data.list.slice(0, 2)
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
.containertop {
|
||||
padding: 48rpx 32rpx;
|
||||
|
||||
.containertopbox {
|
||||
.containertopboxone {
|
||||
view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text {
|
||||
margin-left: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitem {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
.containertopboxitemleft {
|
||||
position: relative;
|
||||
width: 182rpx;
|
||||
height: 192rpx;
|
||||
background: #F1CB66;
|
||||
border-radius: 18rpx 0rpx 0rpx 18rpx;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
|
||||
::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
left: 166rpx;
|
||||
background: #f9f9f9;
|
||||
display: inline-block;
|
||||
width: 32rpx;
|
||||
height: 16rpx;
|
||||
border-radius: 0 0 32rpx 32rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0rpx;
|
||||
left: 166rpx;
|
||||
background: #f9f9f9;
|
||||
display: inline-block;
|
||||
width: 32rpx;
|
||||
height: 16rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
|
||||
z-index: 999;
|
||||
|
||||
}
|
||||
|
||||
.containertopboxitemleft_one {
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 60rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemleft_ones {
|
||||
text {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemleft_tow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.containertopboxitemleft_tows {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.containertopboxitemlefts {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.containertopboxitemright {
|
||||
position: relative;
|
||||
padding: 0 32rpx;
|
||||
flex: auto;
|
||||
height: 192rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
border-radius: 0rpx 18rpx 18rpx 0rpx;
|
||||
|
||||
.containertopboxitemright_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
padding: 12rpx 0;
|
||||
border-bottom: 1rpx dotted #707070;
|
||||
}
|
||||
|
||||
.containertopboxitemright_tow {
|
||||
margin-top: 14rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.containertopboxitemright_there {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.containertopboxitemright_four {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 50%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 0 14rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: #FE665E;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.containertopboxitemright_fours {
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 50%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
padding: 0 14rpx;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
text-align: center;
|
||||
background: #F7F7F7;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.containerbottom {
|
||||
.containerbottomtop {
|
||||
padding: 0 32rpx;
|
||||
|
||||
.containerbottomtoptopbox {
|
||||
view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.containerbottombox_bottom {
|
||||
margin-top: 16rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 42rpx 0rpx 0rpx 42rpx;
|
||||
|
||||
// overflow-x: auto;
|
||||
.containerbottombox_bottomone {
|
||||
padding: 20rpx 64rpx 0 64rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.containerbottombox_bottomtow {
|
||||
margin-top: 16rpx;
|
||||
padding: 0 64rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.containerbottombox_bottombox {
|
||||
padding-left: 34rpx;
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.containerbottombox_bottomthere:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.containerbottombox_bottomthere {
|
||||
margin-top: 16rpx;
|
||||
margin-left: 46rpx;
|
||||
|
||||
.containerbottombox_bottomthere_topitem {
|
||||
width: 236rpx;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: #fd5977;
|
||||
|
||||
.towcontainerbottombox_bottomthere_topitem {
|
||||
padding: 20rpx 0 16rpx 0;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontainerbottombox_bottomthere_topitem::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -6rpx;
|
||||
width: 100%;
|
||||
height: 20rpx;
|
||||
background: #fef7f5;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
border-radius: 0 0 50% 50%;
|
||||
}
|
||||
|
||||
.onecontainerbottombox_bottomthere_topitem {
|
||||
position: relative;
|
||||
background: #fef7f5;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
|
||||
.containerbottombox_bottomthere_topitemone {
|
||||
width: 136rpx;
|
||||
height: 40rpx;
|
||||
background: #F1CB66;
|
||||
text-align: center;
|
||||
border-radius: 0rpx 0rpx 20rpx 20rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
line-height: 40rpx;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.containerbottombox_bottomthere_topitemtow {
|
||||
align-items: baseline;
|
||||
width: 100%;
|
||||
|
||||
.a {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 40rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
|
||||
.b {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 70rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
|
||||
.c {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
}
|
||||
|
||||
.containerbottombox_bottomthere_topitemthere {
|
||||
position: relative;
|
||||
height: 50rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 20rpx;
|
||||
color: #FFFFFF;
|
||||
width: 100%;
|
||||
z-index: 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.therecontainerbottombox_bottomthere_topitem {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.theretext {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #E8E8E8;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.c {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #FF4C11;
|
||||
}
|
||||
|
||||
.b {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,673 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
|
||||
|
||||
<view class="onecontent">
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode="aspectFill"></image>
|
||||
<!-- 小内切圆 -->
|
||||
<view class="after"></view>
|
||||
<view class="onecontentabsolute">
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<!-- <view :class="isFixedTop?'towcontentlistxitemboxfixed':''" :style="{'top':customheighttop + 'px'}">
|
||||
<view class="towcontentlistxitem flex-start">
|
||||
<view class="towcontentlistxitembox flex-colum"
|
||||
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in listbox" :key="index" @click="towcontentclick(index)">
|
||||
<text>{{item.name}}</text>
|
||||
<image v-if="towcontentclickindex == index"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-if="isFixedTop" :style="{'height':windowHeight - seighT + 'px'}"></view>
|
||||
<view class="towcontentboutton" :style="{'height':seighT + 'px'}">
|
||||
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"> -->
|
||||
<view class="fivecontent_item" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
|
||||
<view class="fivecontent_item_nav flex-start">
|
||||
<image class="fivecontent_item_navimage" :src="item.shopImage" mode="aspectFill"></image>
|
||||
<view class="fivecontent_item_nav_left">
|
||||
<view class="fivecontent_item_nav_lefttop flex-between">
|
||||
<view>
|
||||
{{item.shopName}}
|
||||
</view>
|
||||
<view>
|
||||
{{item.distances}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_nav_lefttopstart flex-start">
|
||||
<view class="fivecontent_item_nav_leftlang flex-start" v-for="(s,index1) in item.shopTag"
|
||||
:key="index1" :style="{'background':s.backColor,'color':s.backColor}">
|
||||
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg" :src="s.shareImg"
|
||||
mode="aspectFill"></image>
|
||||
<text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_box">
|
||||
<view class="fivecontent_item_boxitem flex-between">
|
||||
<image :src="item.image" mode=""></image>
|
||||
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
||||
<view class="fivecontent_item_boxitemleftone flex-between">
|
||||
<view>{{item.productName.length>7?item.productName.substring(0,7)+'...':item.productName}}</view>
|
||||
<text>已抢{{item.realSalesNumber}}份</text>
|
||||
</view>
|
||||
<view class="flex-start flexstartboxfttow">
|
||||
<view class="fivecontent_item_boxitemlefttow flex-start"
|
||||
v-for="(c,index2) in item.proTag" :key="index2"
|
||||
:style="{'background':c.backColor,'color':c.backColor}">
|
||||
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
|
||||
:src="c.shareImg" mode="aspectFill"></image>
|
||||
<text class="fivecontent_item_boxitemlefttowtext">{{c.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="indexboxitemleftthere flex-colum-start">
|
||||
<view class="indexboxitemleftthereabsolute">
|
||||
马上抢
|
||||
</view>
|
||||
<view class="indexboxitemlefttheretext flex-start">
|
||||
<view class="fivecontent_item_boxitemlefthere_one flex-start">
|
||||
<text class="flex_startone">到手</text>
|
||||
<text class="flex_starttow">¥{{item.salePrice}}</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_tow">
|
||||
{{item.discount || ''}}折
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_there">
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="indexboxitemleftthere_countdown flex-between">
|
||||
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}元</text>
|
||||
<view class="indexboxitemleftthere_countdowntexts">
|
||||
<uni-countdown @timeup="updateCity" :show-day="false"
|
||||
:day="item.end_times.d" :hour="item.end_times.h"
|
||||
:minute="item.end_times.m" :second="item.end_times.s"
|
||||
:indexs='index' color="#FFFFFF" border-color="#00B26A"
|
||||
splitorColor="#FFFFFF" :font-size="7"></uni-countdown>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
|
||||
<!-- </scroll-view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titlename: '咖啡',
|
||||
opacitys: false,
|
||||
towcontentclickindex: 0,
|
||||
windowHeight: '',
|
||||
seighT: '',
|
||||
customheighttop: '', //top高度
|
||||
isFixedTop: false,
|
||||
Topdistance: 3000, //吸顶初始距离
|
||||
list: [],
|
||||
toplist: {},
|
||||
listbox: [],
|
||||
form: {
|
||||
address: '', //地址
|
||||
type: '', //品类
|
||||
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
|
||||
distance: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore'
|
||||
},
|
||||
type:''
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacitys = false
|
||||
} else {
|
||||
this.opacitys = true
|
||||
}
|
||||
if (e.scrollTop >= this.Topdistance) { //类别导航栏
|
||||
this.isFixedTop = true
|
||||
} else {
|
||||
this.isFixedTop = false
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
let _this = this
|
||||
uni.getStorage({
|
||||
key: 'itemData',
|
||||
success: function(res) {
|
||||
_this.type = res.data.value
|
||||
_this.distiricttopCommon()
|
||||
// setTimeout(() => {
|
||||
_this.GetTop()
|
||||
// _this.init_fn()
|
||||
// }, 1000)
|
||||
}
|
||||
});
|
||||
// this.type = e.value
|
||||
// this.distiricttopCommon()
|
||||
// setTimeout(() => {
|
||||
// this.GetTop()
|
||||
// }, 1000)
|
||||
},
|
||||
onShow() {
|
||||
let _this = this
|
||||
uni.getStorage({
|
||||
key: 'itemData',
|
||||
success: function(res) {
|
||||
_this.type = res.data.value
|
||||
_this.distiricttopCommon()
|
||||
// setTimeout(() => {
|
||||
// _this.GetTop()
|
||||
_this.init_fn()
|
||||
// }, 1000)
|
||||
}
|
||||
});
|
||||
// this.init_fn()
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clickproduct(item){
|
||||
uni.pro.navigateTo('product/index',{
|
||||
id:item.id
|
||||
})
|
||||
},
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.form = {
|
||||
address: uni.cache.get('getLocationstorage').address, //地址
|
||||
lng: uni.cache.get('getLocationstorage').lng,
|
||||
lat: uni.cache.get('getLocationstorage').lat,
|
||||
type:this.type, //品类
|
||||
orderBy:0, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
dateType: 1,
|
||||
status: 'loadmore'
|
||||
}
|
||||
this.onLoadlist()
|
||||
},
|
||||
async distiricttopCommon(e) {
|
||||
let res = await this.api.distiricttopCommon({
|
||||
type: this.type, //团购卷品类Id/subShop-预约到店
|
||||
orderBy: ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.toplist = res.data.carousel[0]
|
||||
this.listbox = res.data.menu
|
||||
}
|
||||
},
|
||||
async onLoadlist() {
|
||||
try {
|
||||
let res = await this.api.indexlist(this.form)
|
||||
var dates = new Date().getTime();
|
||||
res.data.list.forEach((item, index) => {
|
||||
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
|
||||
if (leftTime >= 0) {
|
||||
let d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
|
||||
let h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
|
||||
let m = Math.floor(leftTime / 1000 / 60 % 60);
|
||||
let s = Math.floor(leftTime / 1000 % 60);
|
||||
item.end_times = {
|
||||
d: d,
|
||||
h: h,
|
||||
m: m,
|
||||
s: s
|
||||
}
|
||||
} else {
|
||||
item.end_times = 0
|
||||
}
|
||||
})
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
//G滚动底部
|
||||
loadMore(e) {
|
||||
console.log(e)
|
||||
},
|
||||
//获取元素距离顶部的距离
|
||||
GetTop() {
|
||||
uni.getSystemInfo({
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
this.windowHeight = data.windowHeight - data.statusBarHeight //总高度
|
||||
// #ifdef MP-WEIXIN
|
||||
const custom = wx.getMenuButtonBoundingClientRect()
|
||||
this.seighT = data.windowHeight - custom.height - custom.top;
|
||||
console.log(custom)
|
||||
this.customheighttop = custom.height + custom.top
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.customheighttop = data.statusBarHeight / 2
|
||||
this.seighT = data.windowHeight - data.statusBarHeight / 2
|
||||
// #endif
|
||||
this.$u.getRect('.towcontentlistxitembt').then(res => {
|
||||
this.seighT = this.seighT - res.height //高度
|
||||
})
|
||||
this.$u.getRect('.towcontentlistxitem').then(res => {
|
||||
this.Topdistance = res.top - this.HeighT.heightBar //滚动距离 //滚动距离
|
||||
this.seighT = this.seighT - res.height //高度
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
towcontentclick(index) {
|
||||
this.towcontentclickindex = index
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
height: 492rpx;
|
||||
position: relative;
|
||||
|
||||
.onecontentimage {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.after {
|
||||
position: absolute;
|
||||
bottom: 32rpx;
|
||||
right: 0;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||
}
|
||||
|
||||
.onecontentabsolute {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
padding: 0 52rpx;
|
||||
bottom: 64rpx;
|
||||
|
||||
.onecontentabsoluteitem {
|
||||
padding: 8rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
image {
|
||||
width: 24.16rpx;
|
||||
height: 29.31rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 0 16rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentabsoluteitembotton {
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(109deg, #FF9D84 0%, #FFFFFF 100%);
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
|
||||
.towcontentlistxitemboxfixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
margin-top: 0rpx !important;
|
||||
}
|
||||
|
||||
.towcontentlistxitem {
|
||||
// margin-top: -32rpx;
|
||||
padding: 36rpx 28rpx 0rpx 28rpx;
|
||||
border-radius: 24rpx 0rpx 0rpx 0rpx;
|
||||
background: #F9F9F9;
|
||||
|
||||
.towcontentlistxitembox:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.towcontentlistxitembox {
|
||||
margin-left: 48rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentlistxitemboxopacity {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 38.83rpx;
|
||||
height: 8.62rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentlistxitembt {
|
||||
padding: 28rpx;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
background: #F9F9F9;
|
||||
|
||||
.towcontentlistxitembtitem {
|
||||
flex: none;
|
||||
padding: 8rpx 24rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
|
||||
.towcontentlistxitembtitem:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.towcontentlistxitembtitemaktev {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
background: #FEE06A;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.towcontentboutton {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.fivecontent_item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.fivecontent_item {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.fivecontent_item_nav {
|
||||
image {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_left {
|
||||
flex: auto;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.fivecontent_item_nav_lefttop {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_leftlang {
|
||||
margin-top: 8rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
text {
|
||||
margin-left: 6rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_leftlang:nth-child(2) {
|
||||
margin-left: 12rpx;
|
||||
background: #FEE9DF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_box {
|
||||
margin-top: 20rpx;
|
||||
border-top: 2rpx solid #E5E5E5;
|
||||
padding-top: 14rpx;
|
||||
|
||||
.fivecontent_item_boxitem {
|
||||
image {
|
||||
width: 192rpx;
|
||||
height: 192rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemleft {
|
||||
margin-left: 24rpx;
|
||||
flex: auto;
|
||||
|
||||
.fivecontent_item_boxitemleftone {
|
||||
width: 100%;
|
||||
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow {
|
||||
margin-top: 8rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
text {
|
||||
margin-left: 6rpx;
|
||||
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow:nth-child(2) {
|
||||
margin-left: 12rpx;
|
||||
background: #FFD6D7;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
}
|
||||
|
||||
.indexboxitemleftthere {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding-left: 16rpx;
|
||||
width: 100%;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.indexboxitemleftthereabsolute {
|
||||
position: absolute;
|
||||
top: 14rpx;
|
||||
right: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.indexboxitemlefttheretext {
|
||||
// width: 100%;
|
||||
margin-top: 12rpx;
|
||||
// align-items: flex-end;
|
||||
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.fivecontent_item_boxitemlefthere_one {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.flex_startone {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.flex_starttow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_tow {
|
||||
margin-left: 4rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #FF7127;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_there {
|
||||
margin-left: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #999999;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdown {
|
||||
width: 100%;
|
||||
padding-right: 7rpx;
|
||||
margin-top: 2rpx;
|
||||
.indexboxitemleftthere_countdowntext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdowntexts {
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 16rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,377 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='opacity' :title='titlename' :titleshow='true'></navseat>
|
||||
<view class="onecontent">
|
||||
<view class="onecontentabsolute"></view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<view class="towcontentone">
|
||||
<image class="towcontentoneimage" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/mrmd1.png"
|
||||
mode="aspectFill"></image>
|
||||
<view class="towcontentonebox">
|
||||
<image class="towcontentoneboximage"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/mrmd2.png" mode="aspectFill">
|
||||
</image>
|
||||
<view class="towcontentoneboxswiper">
|
||||
<swiper class="swiper" circular :autoplay='true' :vertical='true' display-multiple-items="4"
|
||||
:interval="'3000'">
|
||||
<swiper-item class="swiperitem" v-for="(item,index) in orderfindWiningUserlist"
|
||||
:key="index">
|
||||
<view class="swiper-item">{{item.userName}}* 免单{{item.orderAmount}}元订单号:{{item.orderNo}}
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentoness">
|
||||
<view class="towcontentonebox_box">
|
||||
订单数:{{total}}
|
||||
</view>
|
||||
<view class="towcontentonebox">
|
||||
<view class="towcontentoneboxswiper">
|
||||
<view class="swiper-item" style="margin-bottom: 32rpx;">
|
||||
<view class="swiper_itemone">
|
||||
免单状态
|
||||
</view>
|
||||
<view class="swiper_itemtow">
|
||||
订单号
|
||||
</view>
|
||||
<view class="swiper_itemthere">
|
||||
金额
|
||||
</view>
|
||||
</view>
|
||||
<view class="swiperitem" v-for="(item,index) in ordermineWinnerList" :key="index">
|
||||
<view class="swiper-item" style="margin-top: 32rpx;">
|
||||
<view class="swiper_itemone">
|
||||
{{item.isRefund == true ? '已免单':'待免单'}}
|
||||
</view>
|
||||
<view class="swiper_itemtow">
|
||||
{{item.orderNo}}
|
||||
</view>
|
||||
<view class="swiper_itemthere">
|
||||
{{item.orderAmount}}元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <swiper class="swiper" circular :autoplay='true' :vertical='true' interval="3000"
|
||||
display-multiple-items="4">
|
||||
<swiper-item class="swiperitem" v-for="(item,index) in orderfindWiningUserlist"
|
||||
:key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="swiper_itemone">
|
||||
{{item.orderAmount}}元
|
||||
</view>
|
||||
<view class="swiper_itemtow">
|
||||
{{item.orderNo}}
|
||||
</view>
|
||||
<view class="swiper_itemthere">
|
||||
{{item.isRefund == true ? '已免单':'待免单'}}
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontenttow">
|
||||
注:每笔订单完成后30天内均有机会获得免单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
forEach
|
||||
} from 'lodash';
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titlename: '',
|
||||
opacity: false,
|
||||
orderfindWiningUserlist: [],
|
||||
ordermineWinnerList: [],
|
||||
form: {
|
||||
address: '', //地址
|
||||
type: '', //品类
|
||||
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore'
|
||||
},
|
||||
total:0
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderfindWiningUser()
|
||||
this.ordermineWinnerEvent()
|
||||
let _this = this
|
||||
uni.getStorage({
|
||||
key: 'itemData',
|
||||
success: function(res) {
|
||||
_this.titlename = res.data.name
|
||||
}
|
||||
});
|
||||
},
|
||||
onReachBottom() {
|
||||
this.ordermineWinnerEvent()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacity = false
|
||||
} else {
|
||||
this.opacity = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
cut(str, firstStr, lastStr) {
|
||||
let start = str.indexOf(firstStr);
|
||||
let end = str.lastIndexOf(lastStr);
|
||||
return str.slice(start, end + 1); //slice方法截取的部分不包括第二参数所在位置
|
||||
},
|
||||
|
||||
async ordermineWinnerEvent() {
|
||||
let res = await this.api.ordermineWinner({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
page: this.form.page,
|
||||
size: this.form.size
|
||||
})
|
||||
if(res.code ==0){
|
||||
this.total = res.data.total
|
||||
if(this.form.page==1){
|
||||
this.ordermineWinnerList = res.data.list
|
||||
}else{
|
||||
this.ordermineWinnerList.push(...res.data.list)
|
||||
}
|
||||
this.form.page = ++this.form.page;
|
||||
}
|
||||
},
|
||||
async orderfindWiningUser() {
|
||||
let res = await this.api.orderfindWiningUser()
|
||||
this.orderfindWiningUserlist = res.data.map((i) => {
|
||||
i.userName = i.userName.slice(0, 1)
|
||||
return i
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
height: 684.19rpx;
|
||||
position: relative;
|
||||
background: linear-gradient(96deg, #F9F2D9 0%, #FBE1DA 100%);
|
||||
|
||||
.onecontentabsolute {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 534.19rpx;
|
||||
width: 100%;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/mrmd.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
position: relative;
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
margin-top: -100rpx;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(249, 242, 217, 0.77) 10%, #F5DFDF 100%);
|
||||
|
||||
.towcontentone {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background: linear-gradient(180deg, rgba(255, 241, 204, 0.77) 0%, rgba(255, 255, 255, 0.56) 40%, #FFFFFF 100%);
|
||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
padding: 32rpx 24rpx;
|
||||
|
||||
.towcontentoneimage {
|
||||
position: absolute;
|
||||
top: -30rpx;
|
||||
left: 50%;
|
||||
transform: translatex(-50%);
|
||||
width: 118rpx;
|
||||
height: 46rpx;
|
||||
}
|
||||
|
||||
.towcontentonebox {
|
||||
width: 100%;
|
||||
|
||||
.towcontentoneboximage {
|
||||
width: 171.63rpx;
|
||||
height: 37.24rpx;
|
||||
}
|
||||
|
||||
.towcontentoneboxswiper {
|
||||
width: 100%;
|
||||
padding-top: 24rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.swiper {
|
||||
height: 242rpx;
|
||||
|
||||
.swiperitem {
|
||||
height: 40rpx;
|
||||
|
||||
.swiper-item {
|
||||
display: block;
|
||||
height: 40rpx;
|
||||
text-align: left;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentoness {
|
||||
margin-top: 48rpx;
|
||||
width: 100%;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||
padding: 38rpx 48rpx;
|
||||
|
||||
.towcontentonebox_box {
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
width: 262rpx;
|
||||
height: 58rpx;
|
||||
line-height: 58rpx;
|
||||
background: #FFA436;
|
||||
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.towcontentonebox {
|
||||
width: 100%;
|
||||
|
||||
.towcontentoneboximage {
|
||||
width: 171.63rpx;
|
||||
height: 37.24rpx;
|
||||
}
|
||||
|
||||
.swiper-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.swiper_itemone {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.swiper_itemtow {
|
||||
width: auto;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.swiper_itemthere {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentoneboxswiper {
|
||||
width: 100%;
|
||||
// height: 242rpx;
|
||||
padding-top: 24rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.swiper {
|
||||
height: 230rpx;
|
||||
|
||||
.swiperitem {
|
||||
height: 40rpx;
|
||||
|
||||
.swiper-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.swiper_itemone {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.swiper_itemtow {
|
||||
width: auto;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.swiper_itemthere {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttow {
|
||||
margin-top: 32rpx;
|
||||
padding-bottom: 144rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,577 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
|
||||
<view class="onecontent">
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode=" "></image>
|
||||
<view class="onecontentabsolute">
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<view :class="isFixedTop?'towcontentlistxitemboxfixed':''" :style="{'top':customheighttop + 'px'}">
|
||||
<view class="towcontentlistxitem flex-start">
|
||||
<view class="towcontentlistxitembox flex-colum"
|
||||
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in listbox" :key="index" @click="towcontentclick(item,index)">
|
||||
<text>{{item.name}}</text>
|
||||
<image v-if="towcontentclickindex == index"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="towcontentlistxitembt flex-start">
|
||||
<view class="towcontentlistxitembtitem"
|
||||
:class="index==xitembtitemindex?'towcontentlistxitembtitemaktev':''"
|
||||
v-for="(item,index) in xitembtitem" :key="index" @click="clickxitembtitemindex(item,index)">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view v-if="isFixedTop" :style="{'height':windowHeight - seighT + 'px'}"></view>
|
||||
<view class="towcontentboutton" :style="{'height':seighT + 'px'}">
|
||||
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"> -->
|
||||
<view class="fivecontent_item" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
|
||||
<view class="fivecontent_item_box">
|
||||
<view class="fivecontent_item_boxitem flex-between">
|
||||
<image :src="item.image" mode=""></image>
|
||||
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
||||
<view class="fivecontent_item_boxitemleftone">
|
||||
<view class="fivecontent_item_boxitemleftone_t"><text
|
||||
class="fivecontent_item_boxitemleftone_o">热销TOP.{{index + 1}}</text>{{item.productName}}份
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefttow flex-between">
|
||||
<view class="fivecontent_item_boxitemlefttow_o flex-start">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/dw.png" mode="">
|
||||
</image>
|
||||
<view> {{item.productName}}</view>
|
||||
</view>
|
||||
<text class="fivecontent_item_boxitemlefttow_t">{{item.distances}}</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere flex-start">
|
||||
<view class="fivecontent_item_boxitemlefthere_one flex-start">
|
||||
<text class="flex_startone">券后</text>
|
||||
<text class="flex_starttow">¥{{item.salePrice}}</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_tow">
|
||||
{{item.discount || ''}}折
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_there">
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefour flex-start">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/H.png" mode="">
|
||||
</image>
|
||||
<text>已抢{{item.realSalesNumber}}份</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefive">
|
||||
马上抢
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view><u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
|
||||
<!-- </scroll-view> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 小内切圆 -->
|
||||
<!-- <view class="after"></view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titlename: '西安',
|
||||
opacitys: false,
|
||||
towcontentclickindex: 0,
|
||||
windowHeight: '',
|
||||
seighT: '',
|
||||
customheighttop: '', //top高度
|
||||
isFixedTop: false,
|
||||
Topdistance: 3000, //吸顶初始距离
|
||||
list: [],
|
||||
toplist: {},
|
||||
listbox: [{
|
||||
name: '全部'
|
||||
},
|
||||
{
|
||||
name: '美食正餐'
|
||||
},
|
||||
{
|
||||
name: '饮品小吃'
|
||||
}
|
||||
],
|
||||
xitembtitemindex: 0,
|
||||
|
||||
xitembtitem: [{
|
||||
name: '2小时销量飙升榜',
|
||||
dateType: 1
|
||||
},
|
||||
{
|
||||
name: '今日热榜',
|
||||
dateType: 0
|
||||
}
|
||||
],
|
||||
form: {},
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacitys = false
|
||||
} else {
|
||||
this.opacitys = true
|
||||
}
|
||||
if (e.scrollTop >= this.Topdistance) { //类别导航栏
|
||||
this.isFixedTop = true
|
||||
} else {
|
||||
this.isFixedTop = false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.distiricttopCommon()
|
||||
|
||||
setTimeout(() => {
|
||||
this.GetTop()
|
||||
}, 1000)
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
},
|
||||
computed: {
|
||||
HeighT() { //手机类型的尺寸
|
||||
return this.$store.getters.is_BarHeight
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
//飙升榜
|
||||
clickxitembtitemindex(item, index) {
|
||||
this.xitembtitemindex = index
|
||||
this.list = []
|
||||
this.form.dateType = item.dateType
|
||||
this.form.page = 1
|
||||
this.form.size = 10
|
||||
this.form.status = 'loadmore'
|
||||
this.onLoadlist()
|
||||
},
|
||||
towcontentclick(item, index) {
|
||||
this.towcontentclickindex = index
|
||||
this.list = []
|
||||
this.form.type = item.value
|
||||
this.form.page = 1
|
||||
this.form.size = 10
|
||||
this.form.status = 'loadmore'
|
||||
this.onLoadlist()
|
||||
},
|
||||
// 下面初始数据
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.form = {
|
||||
address: uni.cache.get('getLocationstorage').address, //地址
|
||||
lng: uni.cache.get('getLocationstorage').lng,
|
||||
lat: uni.cache.get('getLocationstorage').lat,
|
||||
type: '', //品类
|
||||
orderBy: 4, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
dateType: 1,
|
||||
status: 'loadmore'
|
||||
}
|
||||
this.onLoadlist()
|
||||
},
|
||||
//G滚动底部
|
||||
loadMore(e) {
|
||||
console.log(e)
|
||||
},
|
||||
//获取元素距离顶部的距离
|
||||
GetTop() {
|
||||
uni.getSystemInfo({
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
this.windowHeight = data.windowHeight - data.statusBarHeight //总高度
|
||||
// #ifdef MP-WEIXIN
|
||||
const custom = wx.getMenuButtonBoundingClientRect()
|
||||
this.seighT = data.windowHeight - custom.height - custom.top;
|
||||
console.log(custom)
|
||||
this.customheighttop = custom.height + custom.top
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.customheighttop = data.statusBarHeight / 2
|
||||
this.seighT = data.windowHeight - data.statusBarHeight / 2
|
||||
// #endif
|
||||
this.$u.getRect('.towcontentlistxitembt').then(res => {
|
||||
this.seighT = this.seighT - res.height //高度
|
||||
})
|
||||
this.$u.getRect('.towcontentlistxitem').then(res => {
|
||||
this.Topdistance = res.top - this.HeighT.heightBar //滚动距离 //滚动距离
|
||||
this.seighT = this.seighT - res.height //高度
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
async distiricttopCommon() {
|
||||
let res = await this.api.distiricttopCommon({
|
||||
type: '', //团购卷品类Id/subShop-预约到店
|
||||
orderBy: 4
|
||||
})
|
||||
console.log(res.data)
|
||||
if (res.code == 0) {
|
||||
this.toplist = res.data.carousel[0]
|
||||
this.listbox = res.data.menu
|
||||
}
|
||||
},
|
||||
clickproduct(item) {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
id:item.id
|
||||
})
|
||||
},
|
||||
async onLoadlist() {
|
||||
try {
|
||||
let res = await this.api.indexlist(this.form)
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
height: 492rpx;
|
||||
position: relative;
|
||||
|
||||
.onecontentimage {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.onecontentabsolute {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
padding: 0 52rpx;
|
||||
bottom: 64rpx;
|
||||
|
||||
.onecontentabsoluteitem {
|
||||
padding: 8rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
image {
|
||||
width: 24.16rpx;
|
||||
height: 29.31rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 0 16rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentabsoluteitembotton {
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(109deg, #FF9D84 0%, #FFFFFF 100%);
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
|
||||
.towcontentlistxitemboxfixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
margin-top: 0rpx !important;
|
||||
}
|
||||
|
||||
.towcontentlistxitem {
|
||||
// margin-top: -32rpx;
|
||||
padding: 36rpx 28rpx 0rpx 28rpx;
|
||||
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
||||
background: #F9F9F9;
|
||||
|
||||
.towcontentlistxitembox:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.towcontentlistxitembox {
|
||||
margin-left: 48rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentlistxitemboxopacity {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 38.83rpx;
|
||||
height: 8.62rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentlistxitembt {
|
||||
padding: 28rpx;
|
||||
overflow-x: auto;
|
||||
flex-wrap: nowrap;
|
||||
background: #F9F9F9;
|
||||
|
||||
.towcontentlistxitembtitem {
|
||||
flex: none;
|
||||
padding: 8rpx 24rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
|
||||
.towcontentlistxitembtitem:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.towcontentlistxitembtitemaktev {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
background: #FEE06A;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.towcontentboutton {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.fivecontent_item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.fivecontent_item {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
|
||||
.fivecontent_item_box {
|
||||
|
||||
.fivecontent_item_boxitem {
|
||||
image {
|
||||
width: 208rpx;
|
||||
height: 208rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemleft {
|
||||
margin-left: 24rpx;
|
||||
flex: 1;
|
||||
justify-content: flex-start;
|
||||
position: relative;
|
||||
.fivecontent_item_boxitemleftone {
|
||||
width: 100%;
|
||||
|
||||
.fivecontent_item_boxitemleftone_t {
|
||||
.fivecontent_item_boxitemleftone_o {
|
||||
margin-right: 10rpx;
|
||||
display: inline-block;
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FFFFFF;
|
||||
padding: 2rpx 6rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%);
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
}
|
||||
|
||||
font-family: Source Han Sans CN,
|
||||
Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-box-orient:vertical;
|
||||
-webkit-line-clamp:2;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow {
|
||||
width: 100%;
|
||||
margin-top: 14rpx;
|
||||
|
||||
.fivecontent_item_boxitemlefttow_o {
|
||||
image {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
view {
|
||||
margin-left: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow_t {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere {
|
||||
width: 100%;
|
||||
margin-top: 12rpx;
|
||||
align-items: flex-end;
|
||||
|
||||
.fivecontent_item_boxitemlefthere_one {
|
||||
align-items: flex-end;
|
||||
|
||||
.flex_startone {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.flex_starttow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_tow {
|
||||
margin-left: 4rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #FF7127;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_there {
|
||||
margin-left: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #999999;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefour {
|
||||
margin-top: 12rpx;
|
||||
background: #FFEEE9;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
|
||||
image {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF5053;
|
||||
}
|
||||
}
|
||||
.fivecontent_item_boxitemlefive{
|
||||
position: absolute;
|
||||
padding: 8rpx 12rpx;
|
||||
background: #FEE06A;
|
||||
bottom: 32rpx;
|
||||
right: 0;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.after {
|
||||
position: absolute;
|
||||
top: -40rpx;
|
||||
right: 0;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,201 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="contentbox" :style="'background:url('+(shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
|
||||
<view class="contentboxitem flex-between">
|
||||
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill">
|
||||
</image>
|
||||
<text class="contentboxitemlefttextone">点餐</text>
|
||||
<text class="contentboxitemlefttexttow">在线点不排队</text>
|
||||
</view>
|
||||
<view class="contentboxitemright">
|
||||
<view class="contentboxitemright_item flex-between" @click="memberindex('member/memberdetails')">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
|
||||
</image>
|
||||
<view class="contentboxitemright_itembox flex-colum">
|
||||
<text>会员</text>
|
||||
<text>入会享权益</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentboxitemright_item flex-between" @click="memberindex('member/index')">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
|
||||
mode="aspectFill"></image>
|
||||
<view class="contentboxitemright_itembox flex-colum">
|
||||
<text>充值</text>
|
||||
<text>充值享更多优惠</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: null,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
shopUserInfo: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {
|
||||
amount: '',
|
||||
shopName: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
shopExtend: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.userInfo = uni.cache.get('userInfo');
|
||||
},
|
||||
methods: {
|
||||
scanCodehandle(i) {
|
||||
setTimeout(()=>{
|
||||
uni.cache.set('forceUpdate',2)
|
||||
},200)
|
||||
uni.scanCode({
|
||||
success: async (res) => {
|
||||
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
|
||||
uni.cache.set('tableCode', tableCode)
|
||||
if (tableCode) {
|
||||
let data = await this.api.productqueryShop({
|
||||
code: uni.cache.get('tableCode'),
|
||||
})
|
||||
console.log()
|
||||
|
||||
if ( data.data.shopTableInfo && !data.data.shopTableInfo.choseCount ) {
|
||||
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
|
||||
tableCode: tableCode,
|
||||
shopId: data.data.storeInfo.id,
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('order_food/order_food', {
|
||||
tableCode: tableCode,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
}
|
||||
})
|
||||
},
|
||||
memberindex(url) {
|
||||
uni.pro.navigateTo(url, {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'index',
|
||||
})
|
||||
|
||||
},
|
||||
getQueryString(url, name) { //解码
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||
var r = url.substr(1).match(reg)
|
||||
if (r != null) {
|
||||
return r[2]
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F6F8FA;
|
||||
}
|
||||
|
||||
.content {
|
||||
.contentbox {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 1046rpx;
|
||||
padding: 0 24rpx;
|
||||
|
||||
.contentboxitem {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 90%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 50%);
|
||||
padding: 38rpx 0 26rpx 0;
|
||||
background: rgba(255, 255, 255, 0.98);
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
||||
|
||||
.contentboxitemleft {
|
||||
width: 50%;
|
||||
border-right: 2rpx solid #623618;
|
||||
|
||||
image {
|
||||
width: 134rpx;
|
||||
height: 134rpx;
|
||||
}
|
||||
|
||||
.contentboxitemlefttextone {
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.contentboxitemlefttexttow {
|
||||
margin-top: 2rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.contentboxitemright {
|
||||
width: 50%;
|
||||
padding: 0 34rpx;
|
||||
|
||||
.contentboxitemright_item:nth-child(2) {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.contentboxitemright_item {
|
||||
image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
}
|
||||
|
||||
.contentboxitemright_itembox {
|
||||
width: 170rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-top: 2rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,515 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
|
||||
<view class="onecontent">
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode=""></image>
|
||||
<view class="onecontentabsolute">
|
||||
<view class="onecontentabsoluteitem flex-between">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/l.png" mode=""></image>
|
||||
<input :disabled="true" type="text" placeholder="订阅提醒,每日爆品上线不错过" />
|
||||
<view class="onecontentabsoluteitembotton">
|
||||
订阅提醒
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<view class="fivecontent_item" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
|
||||
<view class="fivecontent_item_nav flex-start">
|
||||
<image class="fivecontent_item_navimage" :src="item.shopImage" mode="aspectFill"></image>
|
||||
<view class="fivecontent_item_nav_left">
|
||||
<view class="fivecontent_item_nav_lefttop flex-between">
|
||||
<view>
|
||||
{{item.shopName}}
|
||||
</view>
|
||||
<view style="margin-top: 20rpx;">
|
||||
{{item.distances}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_nav_lefttopstart flex-start">
|
||||
<view class="fivecontent_item_nav_leftlang flex-start" v-for="(s,index1) in item.shopTag"
|
||||
:key="index1" :style="{'background':s.backColor,'color':s.backColor}">
|
||||
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg" :src="s.shareImg"
|
||||
mode="aspectFill"></image>
|
||||
<text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_item_box">
|
||||
<view class="fivecontent_item_boxitem flex-between">
|
||||
<image :src="item.image" mode=""></image>
|
||||
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
||||
<view class="fivecontent_item_boxitemleftone flex-between">
|
||||
<view>{{item.productName.length>7?item.productName.substring(0,7)+'...':item.productName}}</view>
|
||||
<text>已抢{{item.realSalesNumber}}份</text>
|
||||
</view>
|
||||
<view class="flex-start flexstartboxfttow">
|
||||
<view class="fivecontent_item_boxitemlefttow flex-start"
|
||||
v-for="(c,index2) in item.proTag" :key="index2"
|
||||
:style="{'background':c.backColor,'color':c.backColor}">
|
||||
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
|
||||
:src="c.shareImg" mode="aspectFill"></image>
|
||||
<text class="fivecontent_item_boxitemlefttowtext">{{c.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="indexboxitemleftthere flex-colum-start">
|
||||
<view class="indexboxitemleftthereabsolute">
|
||||
马上抢
|
||||
</view>
|
||||
<view class="indexboxitemlefttheretext flex-start">
|
||||
<view class="fivecontent_item_boxitemlefthere_one flex-start">
|
||||
<text class="flex_startone">到手</text>
|
||||
<text class="flex_starttow">¥{{item.salePrice}}</text>
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_tow">
|
||||
{{item.discount || ''}}折
|
||||
</view>
|
||||
<view class="fivecontent_item_boxitemlefthere_there">
|
||||
¥{{item.originPrice}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="indexboxitemleftthere_countdown flex-between">
|
||||
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}元</text>
|
||||
<view class="indexboxitemleftthere_countdowntexts">
|
||||
<uni-countdown @timeup="updateCity" :show-day="false" :day="item.end_times.d"
|
||||
:hour="item.end_times.h" :minute="item.end_times.m"
|
||||
:second="item.end_times.s" :indexs='index' color="#FFFFFF"
|
||||
border-color="#00B26A" splitorColor="#FFFFFF"
|
||||
:font-size="10"></uni-countdown>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
|
||||
</view>
|
||||
<!-- 小内切圆 -->
|
||||
<!-- <view class="after"></view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titlename: '今日上新',
|
||||
opacity: false,
|
||||
list: [],
|
||||
toplist: {},
|
||||
form: {
|
||||
address: uni.cache.get('getLocationstorage').address, //地址
|
||||
lng: uni.cache.get('getLocationstorage').lng,
|
||||
lat: uni.cache.get('getLocationstorage').lat,
|
||||
type: '', //品类
|
||||
orderBy: 0, //1.理我最近 2.销量优先 3.价格优先
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore'
|
||||
},
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacity = false
|
||||
} else {
|
||||
this.opacity = true
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.distiricttopCommon()
|
||||
},
|
||||
onShow() {
|
||||
this.onLoadlist()
|
||||
},
|
||||
methods: {
|
||||
async distiricttopCommon() {
|
||||
let res = await this.api.distiricttopCommon({
|
||||
type: '', //团购卷品类Id/subShop-预约到店
|
||||
orderBy: 0
|
||||
})
|
||||
console.log(res.data)
|
||||
if (res.code == 0) {
|
||||
this.toplist = res.data.carousel[0]
|
||||
}
|
||||
},
|
||||
clickproduct(item) {
|
||||
uni.pro.navigateTo('product/index',{
|
||||
id:item.id
|
||||
})
|
||||
},
|
||||
async onLoadlist() {
|
||||
try {
|
||||
this.form = {
|
||||
address: uni.cache.get('getLocationstorage').address, //地址
|
||||
lng: uni.cache.get('getLocationstorage').lng,
|
||||
lat: uni.cache.get('getLocationstorage').lat,
|
||||
type: '', //团购卷品类Id
|
||||
distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km
|
||||
orderBy: 0, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
|
||||
}
|
||||
let res = await this.api.indexlist(this.form)
|
||||
var dates = new Date().getTime();
|
||||
res.data.list.forEach((item, index) => {
|
||||
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
|
||||
if (leftTime >= 0) {
|
||||
let d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
|
||||
let h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
|
||||
let m = Math.floor(leftTime / 1000 / 60 % 60);
|
||||
let s = Math.floor(leftTime / 1000 % 60);
|
||||
item.end_times = {
|
||||
d: d,
|
||||
h: h,
|
||||
m: m,
|
||||
s: s
|
||||
}
|
||||
} else {
|
||||
item.end_times = 0
|
||||
}
|
||||
})
|
||||
console.log(res.data.list)
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
// if (res.data.pageNum == 1) {
|
||||
// this.is_end = true
|
||||
// }
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
height: 492rpx;
|
||||
position: relative;
|
||||
|
||||
.onecontentimage {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/nav.png) no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.onecontentabsolute {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
padding: 0 52rpx;
|
||||
bottom: 64rpx;
|
||||
|
||||
.onecontentabsoluteitem {
|
||||
padding: 8rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
image {
|
||||
width: 24.16rpx;
|
||||
height: 29.31rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 0 16rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentabsoluteitembotton {
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(109deg, #FF9D84 0%, #FFFFFF 100%);
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
padding: 0 28rpx;
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
|
||||
.fivecontent_item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.fivecontent_item {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.fivecontent_item_nav {
|
||||
.fivecontent_item_navimage {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_left {
|
||||
flex: auto;
|
||||
margin-left: 12rpx;
|
||||
|
||||
.fivecontent_item_nav_lefttop {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_lefttopstart {
|
||||
margin-top: 8rpx;
|
||||
|
||||
.fivecontent_item_nav_leftlang {
|
||||
margin-left: 12rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
.fivecontent_item_nav_leftlangtext {
|
||||
margin-left: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_leftlangimage {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_nav_leftlang:nth-child(1) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_box {
|
||||
margin-top: 20rpx;
|
||||
border-top: 2rpx solid #E5E5E5;
|
||||
padding-top: 14rpx;
|
||||
|
||||
.fivecontent_item_boxitem {
|
||||
image {
|
||||
width: 192rpx;
|
||||
height: 192rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemleft {
|
||||
margin-left: 24rpx;
|
||||
flex: auto;
|
||||
|
||||
.fivecontent_item_boxitemleftone {
|
||||
width: 100%;
|
||||
|
||||
text {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
view {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.flexstartboxfttow {
|
||||
.fivecontent_item_boxitemlefttow {
|
||||
margin-left: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
width: max-content;
|
||||
padding: 4rpx 10rpx;
|
||||
background: #FFF9E1;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
|
||||
.fivecontent_item_boxitemlefttowtext {
|
||||
margin-left: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #F9A511;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttowimage {
|
||||
width: 10.82rpx;
|
||||
height: 14.06rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow:nth-child(1) {
|
||||
margin-left: 0;
|
||||
background: #FFD6D7;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefttow:nth-child(2) {
|
||||
margin-left: 12rpx;
|
||||
background: #FFD6D7;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
}
|
||||
|
||||
.indexboxitemleftthere {
|
||||
position: relative;
|
||||
margin-top: 30rpx;
|
||||
padding-left: 16rpx;
|
||||
width: 100%;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.indexboxitemleftthereabsolute {
|
||||
position: absolute;
|
||||
top: 14rpx;
|
||||
right: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.indexboxitemlefttheretext {
|
||||
// width: 100%;
|
||||
margin-top: 12rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.fivecontent_item_boxitemlefthere_one {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.flex_startone {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.flex_starttow {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_tow {
|
||||
margin-left: 4rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
border: 2rpx solid #FF7127;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
.fivecontent_item_boxitemlefthere_there {
|
||||
margin-left: 6rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 16rpx;
|
||||
color: #999999;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdown {
|
||||
width: 100%;
|
||||
padding-right: 7rpx;
|
||||
margin-top: 2rpx;
|
||||
|
||||
.indexboxitemleftthere_countdowntext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
padding-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.indexboxitemleftthere_countdowntexts {
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 16rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.after {
|
||||
position: absolute;
|
||||
top: -40rpx;
|
||||
right: 0;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,307 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- 占位符导航栏 -->
|
||||
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
|
||||
<view class="onecontent">
|
||||
<image class="onecontentimage" :src="toplist.coverImg" mode="aspectFill"></image>
|
||||
<view class="onecontentabsolute">
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<view class="fivecontent_item flex-between" v-for="(item,index) in list" :key="index">
|
||||
<view class="fivecontent_itemone flex-start">
|
||||
<image class="fivecontent_itemoneimage" :src="item.coverImg" mode=""></image>
|
||||
<view class="fivecontent_itemonebox">
|
||||
<view class="fivecontent_itemoneboxone flex-start">
|
||||
<view class="fivecontent_itemoneboxone_o">
|
||||
热销TOP{{index}}
|
||||
</view>
|
||||
<view class="fivecontent_itemoneboxone_t">
|
||||
{{item.shopName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_itemoneboxtow flex-start" @click="goMap(item)">
|
||||
<image class="fivecontent_itemoneboxtowimage"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/dw.png" mode="widthFix"></image>
|
||||
<view class="fivecontent_itemoneboxtow_o">
|
||||
{{item.address.length>7?item.address.substring(0,7)+'...':item.address}}
|
||||
</view>
|
||||
<view class="fivecontent_itemoneboxtow_t">
|
||||
{{item.distances}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fivecontent_itemtow" @click="makePhoneCall(item)">
|
||||
马上预约
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
|
||||
</view>
|
||||
<!-- 小内切圆 -->
|
||||
<!-- <view class="after"></view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import navseat from '@/components/navseat.vue'
|
||||
export default {
|
||||
components: {
|
||||
navseat
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titlename: '今日上新',
|
||||
opacity: false,
|
||||
list: {},
|
||||
toplist: {},
|
||||
form: {
|
||||
address: '', //地址
|
||||
type: '', //品类
|
||||
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
|
||||
other: '', //附近1KM 1选中 0不选中
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore'
|
||||
},
|
||||
};
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop <= 44) { //搜索导航栏
|
||||
this.opacity = false
|
||||
} else {
|
||||
this.opacity = true
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
this.distiricttopCommon()
|
||||
},
|
||||
methods: {
|
||||
goMap(d) {
|
||||
uni.openLocation({
|
||||
longitude: (d.lng * 1),
|
||||
latitude: (d.lat * 1)
|
||||
})
|
||||
// uni.openLocation({
|
||||
// longitude: uni.cache.get('getLocationstorage').lng,
|
||||
// latitude: uni.cache.get('getLocationstorage').lat
|
||||
// })
|
||||
},
|
||||
init_fn(e) {
|
||||
this.list = []
|
||||
this.form.page = 1 //页数
|
||||
this.form.size = 10 //页数
|
||||
this.form.status = 'loadmore' //页数
|
||||
this.distirictsubShopList()
|
||||
},
|
||||
makePhoneCall(item) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: item.phone //仅为示例
|
||||
});
|
||||
},
|
||||
async distiricttopCommon() {
|
||||
let res = await this.api.distiricttopCommon({
|
||||
type: 'subShop', //团购卷品类Id/subShop-预约到店
|
||||
orderBy: ''
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.toplist = res.data.carousel[0]
|
||||
}
|
||||
},
|
||||
async distirictsubShopList() {
|
||||
let res = await this.api.distirictsubShopList({
|
||||
address: uni.cache.get('getLocationstorage').address, //地址
|
||||
lng: uni.cache.get('getLocationstorage').lng,
|
||||
lat: uni.cache.get('getLocationstorage').lat,
|
||||
distanceInKm: '10', //默认10 以经纬度为中心 多大范围以内 单位km
|
||||
isPage: '', //是否分页 1分页 0不分页
|
||||
page: this.form.page, //页数
|
||||
size: this.form.size, //页容量
|
||||
})
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list]
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
height: 460rpx;
|
||||
position: relative;
|
||||
|
||||
.onecontentimage {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
|
||||
}
|
||||
|
||||
.onecontentabsolute {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
padding: 0 52rpx;
|
||||
bottom: 64rpx;
|
||||
|
||||
.onecontentabsoluteitem {
|
||||
padding: 8rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
image {
|
||||
width: 24.16rpx;
|
||||
height: 29.31rpx;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 0 16rpx;
|
||||
flex: auto;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentabsoluteitembotton {
|
||||
width: 120rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(109deg, #FF9D84 0%, #FFFFFF 100%);
|
||||
border-radius: 28rpx 28rpx 28rpx 28rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
position: relative;
|
||||
margin-top: -32rpx;
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 24rpx 24rpx 0rpx 0rpx;
|
||||
background: #F9F9F9;
|
||||
|
||||
.fivecontent_item:nth-child(1) {
|
||||
margin-top: 0;
|
||||
|
||||
}
|
||||
|
||||
.fivecontent_item {
|
||||
background: #FFFFFF;
|
||||
padding: 16rpx 24rpx;
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
|
||||
.fivecontent_itemone {
|
||||
.fivecontent_itemoneimage {
|
||||
width: 84rpx;
|
||||
height: 84rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.fivecontent_itemonebox {
|
||||
margin-left: 16rpx;
|
||||
height: 84rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.fivecontent_itemoneboxone {
|
||||
.fivecontent_itemoneboxone_o {
|
||||
padding: 2rpx 8rpx;
|
||||
background: linear-gradient(116deg, #FF9D2B 0%, #FF4805 100%);
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
font-family: Roboto, Roboto;
|
||||
font-weight: 500;
|
||||
font-size: 16rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.fivecontent_itemoneboxone_t {
|
||||
margin-left: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_itemoneboxtow {
|
||||
margin-top: 10rpx;
|
||||
|
||||
.fivecontent_itemoneboxtowimage {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.fivecontent_itemoneboxtow_o {
|
||||
margin-left: 8rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.fivecontent_itemoneboxtow_t {
|
||||
margin-left: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent_itemtow {
|
||||
padding: 8rpx 16rpx;
|
||||
background: #FEE06A;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.after {
|
||||
position: absolute;
|
||||
top: -40rpx;
|
||||
right: 0;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
text-align: center;
|
||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="container">
|
||||
<!-- 建议放在外层 -->
|
||||
<view class="contentnav">
|
||||
当前城市
|
||||
</view>
|
||||
<!-- 不建议放在层层嵌套的view中,除非您清楚知道自己为什么需要这么做 -->
|
||||
</view>
|
||||
<u-index-list class="container" :index-list="indexList" style="height: 100%;" @select='clickSelect'
|
||||
:scrollTop="scrollTop">
|
||||
<view v-for="(item, index) in itemArr" :key="index" style="height: 100%;">
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<u-index-anchor :id="item.id" :index="item.id" :text="indexList[index]"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<u-index-item style="height: 100%;">
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<u-index-anchor :id="item.id" :index="item.id" :text="indexList[index]"></u-index-anchor>
|
||||
<!-- #endif -->
|
||||
<!-- <view class="list-cell">
|
||||
{{item.cities}}
|
||||
</view> -->
|
||||
<view class="list-cell" v-for="(cell,index1) in item.cities" :key="index1">
|
||||
{{cell.name}}
|
||||
</view>
|
||||
</u-index-item>
|
||||
</view>
|
||||
</u-index-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import city from '@/common/js/city.json'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
indexList: city.alphabet,
|
||||
itemArr: city.cityList
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickSelect(e) {
|
||||
//从当前位置到达目标位置
|
||||
console.log(">>>当前节点", e, this.scrollTop)
|
||||
try {
|
||||
uni.createSelectorQuery().select('#' + e).boundingClientRect((data) => {
|
||||
console.log(">>data", data)
|
||||
//目标位置的节点:类或者id
|
||||
uni.createSelectorQuery().select('.container').boundingClientRect((res) => {
|
||||
console.log(data, res)
|
||||
console.log(">>res.top", res.top)
|
||||
//最外层盒子的节点:类或者id
|
||||
this.$nextTick(() => {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: data.top - res.top,
|
||||
// selector: '#' + e,
|
||||
duration: 100 //app端这个必须设置成0
|
||||
})
|
||||
})
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
.exec()
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* 使用>>>来穿透组件边界 */
|
||||
.content {
|
||||
.list-cell {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
padding: 10px 24rpx;
|
||||
overflow: hidden;
|
||||
color: #323233;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,31 +1,11 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="containerbox flex-colum">
|
||||
<view class="containerimage_logo">
|
||||
<image class="input_itemone" src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/login2.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="containertext">
|
||||
微信昵称
|
||||
</view>
|
||||
<view class="containerbottom">
|
||||
<view class="containerbottom_text flex-colum-start">
|
||||
<text>该程序获得以下授权:</text>
|
||||
<text>获得您的手机号</text>
|
||||
</view>
|
||||
<view class="containerbottom_item flex-between">
|
||||
<navigator class="containerbottomone" open-type="exit" target="miniProgram"><button
|
||||
class="containerbottomone" open-type="launchApp" app-parameter="wechat"
|
||||
binderror="launchAppError">
|
||||
暂不授权
|
||||
</button></navigator>
|
||||
<button class="containerbottomtow" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
确认授权
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box flex-center">
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/Logo" mode=""></image>
|
||||
</view>
|
||||
<view class="top_box">
|
||||
<button class="toLogin" open-type="getPhoneNumber" @getphonenumber="userlogin">快速登录 </button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -33,273 +13,170 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: ''
|
||||
}
|
||||
h: null, //动态高度
|
||||
types: '', //判断是否是微信扫码点餐进来
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
uni.cache.clear();
|
||||
|
||||
mounted() {
|
||||
this.computed_h();
|
||||
this.userlogin() // 静默登录
|
||||
},
|
||||
methods: {
|
||||
async userlogin() {
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
uni.login({ //alipay weixin
|
||||
// #ifdef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
// 静默登录
|
||||
// userlogin(reslange) {
|
||||
// uni.login({
|
||||
// provider: 'weixin',
|
||||
// success: async (data) => {
|
||||
// if (data.errMsg == "login:ok") {
|
||||
// console.log(data.code, '调试-code')
|
||||
// let res = await this.api.userwxlogins({
|
||||
// code: data.code,
|
||||
// // rawData: infoRes.rawData,
|
||||
// // signature: infoRes.signature,
|
||||
// // iv: reslange.detail.iv,
|
||||
// // encryptedData: resdataa.detail.encryptedData
|
||||
// })
|
||||
// if (res.code == 0) {}
|
||||
// // if (uni.cache.get('types') == 'types') {
|
||||
// // uni.reLaunch({
|
||||
// // url: '/pages/order_food/order_food'
|
||||
// // });
|
||||
// // } else {
|
||||
// // uni.pro.switchTab('index/index')
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
// 正常登录
|
||||
async userlogin(reslange) {
|
||||
var resdataa = reslange
|
||||
// if (resdataa.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
success: async (data) => {
|
||||
try {
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: async (infoRes) => {
|
||||
console.log(infoRes, 81);
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await this.api.userwxlogin({
|
||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
encryptedData: infoRes
|
||||
.encryptedData, // 用户非敏感信息
|
||||
code: data.code, //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
signature: infoRes.signature,
|
||||
iv: infoRes.iv,
|
||||
phone: this.phone
|
||||
// signature: infoRes.signature,
|
||||
// iv: infoRes.detail.iv,
|
||||
// encryptedData: infoRes.detail
|
||||
// .encryptedData
|
||||
})
|
||||
if (res.code == 0) {
|
||||
console.log(res, 88)
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
uni.cache.set('shopUser', res.data.shopUser);
|
||||
uni.pro.switchTab('index/index')
|
||||
if (uni.cache.get('types') == 'types') {
|
||||
uni.reLaunch({
|
||||
url: '/pages/order_food/order_food'
|
||||
});
|
||||
} else {
|
||||
uni.pro.switchTab('index/index')
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
fail: (err) => {}
|
||||
});
|
||||
|
||||
// uni.pro.navigateTo('pay_code/pay_code', {
|
||||
// nickName:userInfo.nickName,
|
||||
// nickName:userInfo.nickName
|
||||
// })
|
||||
// uni.getUserInfo({
|
||||
// provider: 'weixin',
|
||||
// success: async (infoRes) => {
|
||||
// console.log(infoRes, 81);
|
||||
// // let res = await this.api.userwxlogin({
|
||||
// // code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
// // rawData: '', // 用户非敏感信息
|
||||
// // rawData: '' // 签名
|
||||
// // })
|
||||
// // if (res) {
|
||||
// // console.log(res, 88)
|
||||
// // }
|
||||
// },
|
||||
// fail: (err) => {
|
||||
// console.log(err)
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: '获取手机号失败!请重新获取',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// }
|
||||
},
|
||||
async getPhoneNumber(res) { // 获取手机号
|
||||
var resdataa = res
|
||||
console.log(res)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let resdata = await this.api.logingetPhoneNumber({
|
||||
code: data.code,
|
||||
iv: resdataa.detail.iv,
|
||||
encryptedData: resdataa.detail.encryptedData
|
||||
})
|
||||
console.log(resdata)
|
||||
if (resdata.data) {
|
||||
this.phone = resdata.data
|
||||
this.userlogin()
|
||||
}
|
||||
// this.userlogin()
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
// #endif
|
||||
async computed_h() {
|
||||
//获取div宽度
|
||||
let content_Icon = await uni.utils.info_distance('box');
|
||||
let system_info = await uni.getSystemInfo();
|
||||
let h = null;
|
||||
h = system_info.windowHeight - content_Icon.height + 'px';
|
||||
this.h = {
|
||||
height: h
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
button {}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
// position: relative;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
|
||||
.containerbox {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
.box {
|
||||
// padding-top: 110rpx;
|
||||
position: fixed;
|
||||
top: 110rpx;
|
||||
left: 50%;
|
||||
z-index: 22;
|
||||
transform: translateX(-50%);
|
||||
|
||||
.containerimage_logo {
|
||||
margin-top: 66rpx;
|
||||
border-radius: 50%;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.containertext {
|
||||
margin-top: 32rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
.containerbottom {
|
||||
margin-top: 40rpx;
|
||||
border-top: 1px solid #ccc;
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.containerbottom_text {
|
||||
margin-top: 32rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-size: 24rpx;
|
||||
color: #847f7f;
|
||||
}
|
||||
}
|
||||
|
||||
.containerbottom_item {
|
||||
margin-top: 60rpx;
|
||||
|
||||
.containerbottomone {
|
||||
padding: 10rpx 80rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.containerbottomone::after {
|
||||
background: none;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.containerbottomtow {
|
||||
font-size: 24rpx;
|
||||
background: #baf505;
|
||||
border: none;
|
||||
padding: 10rpx 80rpx;
|
||||
}
|
||||
|
||||
.containerbottomtow::after {
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
top: -118rpx;
|
||||
z-index: 90;
|
||||
padding: 0 28rpx;
|
||||
.top_box::after {
|
||||
position: absolute;
|
||||
// content: url(@/static/icon.png);
|
||||
width: 282rpx;
|
||||
height: 280rpx;
|
||||
top: -240rpx;
|
||||
right: 32rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.wrapper_box {
|
||||
.top_box {
|
||||
z-index: 9;
|
||||
padding: 0 64rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: #ffffff;
|
||||
border-radius: 40rpx 40rpx 0px 0px;
|
||||
top: 220rpx;
|
||||
|
||||
.toLogin {
|
||||
margin-top: 212rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 32rpx;
|
||||
padding: 16rpx 30rpx;
|
||||
|
||||
.input_content {
|
||||
.input_item {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.input_itemone {
|
||||
width: 49.68rpx;
|
||||
height: 49.68rpx;
|
||||
}
|
||||
|
||||
.input_itemtow {
|
||||
position: relative;
|
||||
flex: auto;
|
||||
margin-left: 16rpx;
|
||||
|
||||
.input_itemtowicon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10rpx 0;
|
||||
border-bottom: 2rpx solid rgba(229, 229, 229, 0.7);
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.agreement {
|
||||
margin-top: 24rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #7c8e97;
|
||||
|
||||
.agreement-Item {
|
||||
color: #4ca1fc;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-button {
|
||||
margin: 40rpx auto 50rpx auto;
|
||||
width: 90%;
|
||||
background: #2F87FD;
|
||||
padding: 28rpx 0;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
font-size: 36rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
background: #F1CB66;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
height: 84rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,278 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="containerbox flex-colum">
|
||||
<view class="containerimage_logo">
|
||||
<image class="input_itemone" src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/login2.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
<view class="containertext">
|
||||
微信昵称
|
||||
</view>
|
||||
<view class="containerbottom">
|
||||
<view class="containerbottom_text flex-colum-start">
|
||||
<text>该程序获得以下授权:</text>
|
||||
<text>获得您的手机号</text>
|
||||
</view>
|
||||
<view class="containerbottom_item flex-between">
|
||||
<navigator class="containerbottomone" open-type="exit" target="miniProgram"><button
|
||||
class="containerbottomone" open-type="launchApp" app-parameter="wechat"
|
||||
binderror="launchAppError">
|
||||
暂不授权
|
||||
</button></navigator>
|
||||
<button class="containerbottomtow" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||
确认授权
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.cache.clear();
|
||||
|
||||
},
|
||||
methods: {
|
||||
async userlogin() {
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
uni.login({ //alipay weixin
|
||||
// #ifdef MP-ALIPAY
|
||||
provider: 'alipay',
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
provider: 'weixin',
|
||||
// #endif
|
||||
success: async (data) => {
|
||||
try {
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: async (infoRes) => {
|
||||
let res = await this.api.userwxlogin({
|
||||
code: data.code, //临时登录凭证
|
||||
encryptedData: infoRes
|
||||
.encryptedData, // 用户非敏感信息
|
||||
rawData: infoRes.rawData,
|
||||
signature: infoRes.signature,
|
||||
iv: infoRes.iv,
|
||||
phone: this.phone
|
||||
})
|
||||
if (res.code == 0) {
|
||||
console.log(res, 88)
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
uni.pro.switchTab('index/index')
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
async getPhoneNumber(res) { // 获取手机号
|
||||
var resdataa = res
|
||||
console.log(res)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let resdata = await this.api.logingetPhoneNumber({
|
||||
code: data.code,
|
||||
iv: resdataa.detail.iv,
|
||||
encryptedData: resdataa.detail.encryptedData
|
||||
})
|
||||
console.log(resdata)
|
||||
if (resdata.data) {
|
||||
this.phone = resdata.data
|
||||
this.userlogin()
|
||||
}
|
||||
// this.userlogin()
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
// #endif
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
button {}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
|
||||
.containerbox {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
.containerimage_logo {
|
||||
margin-top: 66rpx;
|
||||
border-radius: 50%;
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.containertext {
|
||||
margin-top: 32rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
|
||||
.containerbottom {
|
||||
margin-top: 40rpx;
|
||||
border-top: 1px solid #ccc;
|
||||
width: 100%;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.containerbottom_text {
|
||||
margin-top: 32rpx;
|
||||
|
||||
text:nth-child(1) {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
font-size: 24rpx;
|
||||
color: #847f7f;
|
||||
}
|
||||
}
|
||||
|
||||
.containerbottom_item {
|
||||
margin-top: 60rpx;
|
||||
|
||||
.containerbottomone {
|
||||
padding: 10rpx 80rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.containerbottomone::after {
|
||||
background: none;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.containerbottomtow {
|
||||
font-size: 24rpx;
|
||||
background: #baf505;
|
||||
border: none;
|
||||
padding: 10rpx 80rpx;
|
||||
}
|
||||
|
||||
.containerbottomtow::after {
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
top: -118rpx;
|
||||
z-index: 90;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.wrapper_box {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 32rpx;
|
||||
padding: 16rpx 30rpx;
|
||||
|
||||
.input_content {
|
||||
.input_item {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.input_itemone {
|
||||
width: 49.68rpx;
|
||||
height: 49.68rpx;
|
||||
}
|
||||
|
||||
.input_itemtow {
|
||||
position: relative;
|
||||
flex: auto;
|
||||
margin-left: 16rpx;
|
||||
|
||||
.input_itemtowicon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10rpx 0;
|
||||
border-bottom: 2rpx solid rgba(229, 229, 229, 0.7);
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.agreement {
|
||||
margin-top: 24rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #7c8e97;
|
||||
|
||||
.agreement-Item {
|
||||
color: #4ca1fc;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-button {
|
||||
margin: 40rpx auto 50rpx auto;
|
||||
width: 90%;
|
||||
background: #2F87FD;
|
||||
padding: 28rpx 0;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
font-size: 36rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,375 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="box flex-colum-start">
|
||||
<text>您好,</text>
|
||||
<text>欢迎使用零点八零</text>
|
||||
</view>
|
||||
<view class="top_box" :style="h">
|
||||
<view class="top_box_one">
|
||||
<text class="top_box_one_text">用户昵称</text>
|
||||
<input type="text" v-model="form.nickName" placeholder="请输入用户昵称" data-key="mobile" />
|
||||
</view>
|
||||
<view class="top_box_one">
|
||||
<text class="top_box_one_text">手机号码</text>
|
||||
<input type="text" v-model="form.telephone" placeholder="请输入手机号码" data-key="mobile" />
|
||||
</view>
|
||||
<view class="top_box_one">
|
||||
<text class="top_box_one_text">密码</text>
|
||||
<input type="mobile" v-model="form.password" placeholder="8-16位密码" maxlength="16"
|
||||
:password="!showPassword" />
|
||||
<view class="repeat" @click="display">
|
||||
<u-icon name="eye" v-if="showPassword"></u-icon>
|
||||
<u-icon v-else name="eye-off"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top_box_one">
|
||||
<text class="top_box_one_text">验证码</text>
|
||||
<input type="mobile" v-model="form.code" placeholder="请输入短信验证码" maxlength="6" />
|
||||
<view class="repeats">
|
||||
<view v-if="showText == true" class="yzm"
|
||||
style="padding: 8rpx 16rpx 6rpx 16rpx; background: #288efb; border-radius: 15rpx"
|
||||
@click="CodeRegister">
|
||||
{{ Recapture }}
|
||||
</view>
|
||||
<view v-else
|
||||
style="color: #ccc; background-color: #f9f9f9; padding: 8rpx 16rpx 6rpx 16rpx; border-radius: 15rpx">
|
||||
{{ second }}s重新发送</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="top_box_one">
|
||||
<text class="top_box_one_text" @click="showTips">
|
||||
邀请码(选填)
|
||||
<uni-icons type="help" size="18"></uni-icons>
|
||||
</text>
|
||||
<input type="mobile" v-model="form.inviteCode" placeholder="请输入邀请人邀请码" />
|
||||
</view> -->
|
||||
<view class="Register" @click="Register">注册</view>
|
||||
<view class="agreement flex-start">
|
||||
<u-checkbox-group><u-checkbox shape="circle" @change="radioChange"
|
||||
size="12"></u-checkbox></u-checkbox-group>
|
||||
<text>阅读并同意银收客</text>
|
||||
<view class="agreement-Item" @click="Privacy(1)">《用户协议》</view>
|
||||
及
|
||||
<view class="agreement-Item" @click="Privacy(3)">《隐私政策》</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radioChangeItem: false, //单选框
|
||||
h: null,
|
||||
showPassword: false,
|
||||
// 注册定时器 初始值
|
||||
second: 60,
|
||||
showText: true,
|
||||
Recapture: '发送验证码',
|
||||
form: {
|
||||
nickName: '',
|
||||
telephone: '',
|
||||
password: '',
|
||||
code: '',
|
||||
inviteCode: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.computed_h();
|
||||
},
|
||||
onLoad() {},
|
||||
methods: {
|
||||
showTips() {
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '若该邀请码的用户无推广权限,将自动绑定到其上级名下',
|
||||
showCancel: false
|
||||
});
|
||||
},
|
||||
leftClick() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
async CodeRegister() {
|
||||
//发起验证码
|
||||
if (this.form.telephone == null || this.form.telephone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const res = await this.api.phoneValidateCode({
|
||||
// post 手机验证码
|
||||
phone: this.form.telephone
|
||||
});
|
||||
console.log(res);
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: '验证码获取成功',
|
||||
icon: 'none'
|
||||
});
|
||||
// 定时器
|
||||
this.showText = false;
|
||||
this.Recapture = '重新获取';
|
||||
var interval = setInterval(() => {
|
||||
let times = --this.second;
|
||||
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
clearInterval(interval);
|
||||
this.second = 60;
|
||||
this.showText = true;
|
||||
}, 60000);
|
||||
}
|
||||
},
|
||||
radioChange(n) {
|
||||
//是否同意
|
||||
console.log(n);
|
||||
this.radioChangeItem = n;
|
||||
},
|
||||
display() {
|
||||
// 切换密码显示隐藏
|
||||
this.showPassword = !this.showPassword;
|
||||
},
|
||||
async Privacy(e) {
|
||||
if (e == 1) {
|
||||
//用户协议
|
||||
let res = await this.api.agreementgetAgreementOne({
|
||||
discern: 0
|
||||
});
|
||||
uni.pro.navigateTo('my/about/agreement', {
|
||||
discern: 0,
|
||||
list: res.data.content
|
||||
});
|
||||
} else {
|
||||
let res3 = await this.api.agreementgetAgreementOne({
|
||||
discern: 3
|
||||
});
|
||||
uni.pro.navigateTo('my/about/agreement', {
|
||||
discern: 3,
|
||||
list: res3.data.content
|
||||
});
|
||||
}
|
||||
},
|
||||
async computed_h() {
|
||||
//获取div宽度
|
||||
let content_Icon = await uni.utils.info_distance('box');
|
||||
let content_top_box = await uni.utils.info_distance('top_box');
|
||||
let system_info = await uni.getSystemInfo();
|
||||
var h_ = null;
|
||||
if (content_Icon.height + content_top_box.height > system_info.windowHeight) {
|
||||
console.log(135);
|
||||
h_ = content_top_box.height + 30 + 'px';
|
||||
} else {
|
||||
h_ = system_info.windowHeight - content_Icon.height + 'px';
|
||||
}
|
||||
this.h = {
|
||||
height: h_
|
||||
};
|
||||
},
|
||||
async Register() {
|
||||
//注册
|
||||
if (this.form.nickName == null || this.form.nickName == '') {
|
||||
uni.showToast({
|
||||
title: '请输入用户昵称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.telephone == null || this.form.telephone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.password == null || this.form.password == '' || uni.$u.trim(this.form.password, 'all') ==
|
||||
'') {
|
||||
uni.showToast({
|
||||
title: '请输入密码或密码不能输入空格',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.code == null || this.form.code == '') {
|
||||
uni.showToast({
|
||||
title: '请输入验证码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.radioChangeItem == false) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请先阅读《用户协议》和《隐私政策》'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let res = await this.api.cashierServiceloginregister({
|
||||
telephone: this.form.telephone,
|
||||
nickName: this.form.nickName,
|
||||
password: this.form.password,
|
||||
code: this.form.code,
|
||||
// inviteCode: this.form.inviteCode,
|
||||
source: 'promoter'
|
||||
});
|
||||
if (res) {
|
||||
setTimeout((res) => {
|
||||
uni.showToast({
|
||||
title: '注册成功',
|
||||
icon: 'none',
|
||||
success: () => {
|
||||
uni.navigateTo({
|
||||
url: '../login/login'
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1500);
|
||||
// uni.cache.set('storage:authorization', res.data.auth_token);
|
||||
// this.$store.commit('set_login', true);
|
||||
// uni.pro.switchTab('index/index');
|
||||
}
|
||||
// if (result.status === 1) {
|
||||
// this.login(result.data);
|
||||
// uni.navigateBack();
|
||||
// } else {
|
||||
// this.$api.msg(result.msg);
|
||||
// this.logining = false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
width: 100%;
|
||||
background: linear-gradient(104deg, #4679ff 0%, #2868e8 47%, #2a94fc 100%);
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
|
||||
.top {
|
||||
position: absolute;
|
||||
left: 64rpx;
|
||||
|
||||
.u-navbar--fixed {
|
||||
top: 88rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
padding-top: 228rpx;
|
||||
padding-left: 64rpx;
|
||||
padding-bottom: 144rpx;
|
||||
|
||||
text {
|
||||
font-size: 40rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.top_box::after {
|
||||
position: absolute;
|
||||
// content: url(@/static/icon.png);
|
||||
width: 282rpx;
|
||||
height: 280rpx;
|
||||
top: -240rpx;
|
||||
right: 32rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.top_box {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: #ffffff;
|
||||
border-radius: 40rpx 40rpx 0px 0px;
|
||||
|
||||
.top_box_one {
|
||||
position: relative;
|
||||
width: 85%;
|
||||
margin-top: 64rpx;
|
||||
border-bottom: 6rpx solid #e5e5e5;
|
||||
|
||||
.top_box_one_text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 36rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 18rpx 0 20rpx 0;
|
||||
}
|
||||
|
||||
.repeat {
|
||||
position: absolute;
|
||||
bottom: 26rpx;
|
||||
right: 0;
|
||||
width: 25rpx;
|
||||
height: 17rpx;
|
||||
}
|
||||
|
||||
.repeats {
|
||||
position: absolute;
|
||||
bottom: 26rpx;
|
||||
right: 0;
|
||||
font-size: 24rpx;
|
||||
z-index: 9;
|
||||
font-family: $uni_family;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.top_box_tow {
|
||||
width: 85%;
|
||||
|
||||
text {
|
||||
margin-top: 34rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: $uni_family;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.Register {
|
||||
width: 75%;
|
||||
margin-top: 112rpx;
|
||||
padding: 10rpx 0;
|
||||
text-align: center;
|
||||
background: #288efb;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-size: 36rpx;
|
||||
font-family: $uni_family;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.agreement {
|
||||
margin-top: 14rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #7c8e97;
|
||||
|
||||
.agreement-Item {
|
||||
color: #4ca1fc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
</view>
|
||||
<view class="item" @click="goMap">
|
||||
<text class="t" style="margin-right: 12upx">门店地址:{{shopInfo.address || '无'}}</text>
|
||||
<u-icon :name="require('@/static/icon_address.png')"></u-icon>
|
||||
<!-- <u-icon :name="require('@/static/icon_address.png')"></u-icon> -->
|
||||
</view>
|
||||
<!-- <view class="item">
|
||||
<text class="t undline">点击查看近期预约</text>
|
||||
|
|
@ -27,7 +27,6 @@
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopUser: {},
|
||||
userInfo: {},
|
||||
shopInfo:{}
|
||||
};
|
||||
|
|
@ -62,16 +61,11 @@
|
|||
},
|
||||
async loginwxuserInfo() {
|
||||
let res = await this.api.loginwxuserInfo({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
shopId: uni.cache.get('shopUser').shopId
|
||||
userId: uni.cache.get('userInfo').id
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
uni.cache.set('shopUser', res.data.shopUser);
|
||||
uni.cache.set('shopInfo', res.data.shopInfo);
|
||||
this.shopUser = uni.cache.get('shopUser')
|
||||
uni.cache.set('userInfo', res.data);
|
||||
this.userInfo = uni.cache.get('userInfo')
|
||||
this.shopInfo = uni.cache.get('shopInfo')
|
||||
}
|
||||
},
|
||||
makePhoneCall(e) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
<template>
|
||||
<view>
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/wkthuiyuanbg.png" class="imgstyle" mode=""></image>
|
||||
<button class="btnclass" open-type="getPhoneNumber" @getphonenumber="sumbit">立即开通 </button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopId: "",
|
||||
switchdata: true, // 绑定后
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.shopId = e.shopId
|
||||
},
|
||||
onUnload() {
|
||||
if (this.switchdata) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sumbit(d) {
|
||||
if (d.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
shopId: this.shopId
|
||||
})
|
||||
if (res.code == 0) {
|
||||
let resdata = await this.api.loginwxuserInfo({
|
||||
userId: uni.cache.get('userInfo').id
|
||||
})
|
||||
if (resdata.code == 0) {
|
||||
this.switchdata = false
|
||||
uni.cache.set('userInfo', resdata.data);
|
||||
uni.pro.redirectTo('/pages/member/index', {
|
||||
shopId: this.shopId,
|
||||
type: 'index'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.imgstyle {
|
||||
width: 694rpx;
|
||||
height: 414rpx;
|
||||
margin: 70rpx auto;
|
||||
}
|
||||
|
||||
.btnclass {
|
||||
width: 694rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
background: #6D89A4;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
<template>
|
||||
<!-- 账单明细 -->
|
||||
<view>
|
||||
<view class="bild">
|
||||
<view class="bildLeft">
|
||||
<text>我的余额</text>
|
||||
<view>{{info.amount||0}}</view>
|
||||
</view>
|
||||
<view class="bildRight">
|
||||
<text>我的积分</text>
|
||||
<view>{{info.accountPoints||0}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="navTop">
|
||||
<view @click="clickEvent(1)" :class="[active==1?'fonts':'']">
|
||||
余额明细
|
||||
<view :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
|
||||
</view>
|
||||
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
|
||||
积分明细
|
||||
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listStyle " v-for="(item,i) in list" :key="i">
|
||||
<!-- <image class="head_img" :src="item.head_img?item.head_img:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
||||
<view class="flex-start">
|
||||
<view class="listStyle_left">
|
||||
<view class="listrigth">
|
||||
<view>{{active == 1 ? item.biz_name : item.content}}</view>
|
||||
<view :class="{colorStyle: (active==1&&item.type == '+') || (active==2&&item.floatType=='add')}">
|
||||
{{ active == 1 ? item.type : (item.floatType == 'add'?'+':'')}}
|
||||
{{active == 1 ? item.amount : item.floatPoints}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="listrigth2">
|
||||
<view>{{$u.timeFormat(active == 1 ? item.create_time : item.createTime, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
||||
<view v-if="active == 1">余额:{{item.balance}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
active: 1,
|
||||
list: [],
|
||||
form: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
memberId: null
|
||||
},
|
||||
info: null,
|
||||
shopId: null
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(JSON.parse(e.shopUserInfo))
|
||||
this.info = JSON.parse(e.shopUserInfo)
|
||||
this.form.memberId = this.info.id;
|
||||
this.shopId = this.info.shopId;
|
||||
this.getlist()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
// 检测是否包含In
|
||||
checkIn(str) {
|
||||
let reg = RegExp(/In/)
|
||||
return str.match(reg)
|
||||
},
|
||||
async getlist() {
|
||||
if (this.active == 1) {
|
||||
let res = await this.api.queryMemberAccount({
|
||||
...this.form
|
||||
})
|
||||
if (res.code == 0 && res.data.list.length > 0) {
|
||||
this.list = this.list.concat(res.data.list)
|
||||
this.form.page++
|
||||
}
|
||||
} else {
|
||||
|
||||
let res = await this.api.queryMemberPointsLog({
|
||||
shopId: this.shopId,
|
||||
...this.form
|
||||
})
|
||||
if (res.code == 0 && res.data.list.length > 0) {
|
||||
this.list = this.list.concat(res.data.list)
|
||||
this.form.page++
|
||||
}
|
||||
}
|
||||
},
|
||||
clickEvent(i) {
|
||||
this.active = i;
|
||||
this.form.page = 1;
|
||||
this.list = []
|
||||
this.getlist()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.bild {
|
||||
height: 320rpx;
|
||||
background-image: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/billingDetails.png');
|
||||
background-size: 750rpx 320rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
||||
.bildLeft,
|
||||
.bildRight {
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
|
||||
>view,
|
||||
>text {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
>view {
|
||||
margin-top: 34rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navTop {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
margin-top: -60rpx;
|
||||
padding: 0 120rpx;
|
||||
font-size: 28rpx;
|
||||
.fonts {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
position: relative;
|
||||
|
||||
.xian {
|
||||
width: 58rpx;
|
||||
height: 6rpx;
|
||||
background: #333;
|
||||
border-radius: 2rpx 2rpx 2rpx 2rpx;
|
||||
position: absolute;
|
||||
bottom: -16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.listStyle {
|
||||
padding: 28rpx;
|
||||
padding-top: 50rpx;
|
||||
width: 100%;
|
||||
|
||||
.listrigth,
|
||||
.listrigth2 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
// padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.listrigth {
|
||||
.colorStyle {
|
||||
color: #FF7127;
|
||||
}
|
||||
|
||||
>view {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.listStyle_left{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.head_img{
|
||||
border-radius: 50%;
|
||||
margin-right: 32rpx;
|
||||
}
|
||||
.listrigth2 {
|
||||
margin-top: 16rpx;
|
||||
|
||||
>view {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,484 @@
|
|||
<template>
|
||||
<!-- 店铺详情 -->
|
||||
<u-popup :show="memberOpen" :round="20" overlayOpacity="0.8" mode="bottom" @close="showClose" height="500">
|
||||
<view class="register-member-wrap">
|
||||
<view class="register-title">欢迎加入{{shopUserInfo.shopName?shopUserInfo.shopName:'本店'}}</view>
|
||||
<view class="register-tip">请完善个人信息完成会员注册</view>
|
||||
<view class="register-content">
|
||||
<view class="reg-head">
|
||||
<view class="reg-head-img">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="reg-head-img" type="default" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<image class="reg-head-img" :src="userHeadImg || 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" mode="aspectFill"></image>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button class="reg-head-img" @click="onChooseAvatar">
|
||||
<image class="reg-head-img" :src="userHeadImg || 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/head_default.png'" mode="aspectFill"></image>
|
||||
</button>
|
||||
<!-- #endif -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="lable">昵称<text style="color: #CD1A1A;">*</text></view>
|
||||
<u-input class="value" v-model="nickName" fontSize="14px" type="text" input-align="left" placeholder="请输入昵称" :custom-style="{border:'none'}" placeholderStyle="color:#999;font-size: 28rpx"/>
|
||||
</view>
|
||||
<view class="reg-cell" @click="calendarShow = true">
|
||||
<view class="lable">生日</view>
|
||||
<view class="value" :style="{color: birthDay ? '#333' : '#999'}">{{ birthDay || '请选择日期'}}</view>
|
||||
<!-- <u-calendar @close="calendarShow = false" monthNum="99" minDate="1945-01-01" maxDate="2055-12-12" :show="calendarShow" mode="single" @confirm="confirmCalendar"></u-calendar> -->
|
||||
<!-- <u-picker :show="calendarShow" ref="uPicker" :columns="columns" @confirm="confirm" @change="changeHandler"></u-picker> -->
|
||||
<!-- <picker :show="calendarShow" mode="date"></picker> -->
|
||||
<u-datetime-picker
|
||||
mode="date"
|
||||
@cancel="calendarShow = false"
|
||||
:show="calendarShow"
|
||||
:minDate="-2208988800000"
|
||||
v-model="value1"
|
||||
itemHeight="66"
|
||||
visibleItemCount="5"
|
||||
@confirm="confirmTime"
|
||||
></u-datetime-picker>
|
||||
<u-icon name="arrow-down-fill" color="#000" size="23"></u-icon>
|
||||
</view>
|
||||
<view class="reg-cell">
|
||||
<view class="lable">手机号</view>
|
||||
<u-input class="value" v-model="telephone" fontSize="14px" type="text" input-align="left" readonly placeholder="获取手机号" :custom-style="{border:'none'}" placeholder-style="color:#999;font-size: 28rpx"/>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button class="getPhone" open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button class="getPhone" open-type="getAuthorize" scope='phoneNumber' @getAuthorize="getPhone" @error="getPhoneError">
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="text">{{'获取手机号'}}</view>
|
||||
</button>
|
||||
</view>
|
||||
<view class="agreement">
|
||||
<view class="agreement_tip">我已阅读并同意以下内容</view>
|
||||
<view class="agreement_item" @click="isProtocol = !isProtocol">
|
||||
<u-checkbox-group >
|
||||
<u-checkbox :checked="isProtocol" shape="circle" activeColor="#E3AD7F" @change="radioChange" size="35" iconSize="20"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text @click.stop="viewProtocol(1)" class="agreement_item_text">用户协议/隐私条款</text>
|
||||
</view>
|
||||
<!-- <view class="agreement_item">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30"></u-checkbox>
|
||||
</u-checkbox-group>
|
||||
<text class="agreement_item_text">隐私条款</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="register_btn" @tap="$u.debounce(registerMember, 500)" >快速注册</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
shopId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value1: Number(new Date()),
|
||||
calendarShow: false,
|
||||
userId: null,
|
||||
userHeadImg: "",
|
||||
nickName: "",
|
||||
telephone: "",
|
||||
birthDay: "",
|
||||
isProtocol: false,
|
||||
shopUserInfo: null,
|
||||
memberOpen: false,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.shopId = uni.cache.get('shopId')
|
||||
console.log(this.memberOpen)
|
||||
this.init()
|
||||
// console.log(this.userInfo)
|
||||
// this.userId = this.userInfo.id;
|
||||
// console.log(this.userInfo, '调试1113');
|
||||
},
|
||||
|
||||
methods: {
|
||||
async init() {
|
||||
if ( uni.cache.get('shopUserInfo') && this.shopId == uni.cache.get('shopUserInfo').id ) {
|
||||
this.shopUserInfo = uni.cache.get('shopUserInfo');
|
||||
} else {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": this.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.shopUserInfo = res.data;
|
||||
}
|
||||
}
|
||||
this.memberOpen = this.shopUserInfo.isVip == 0 ? true : false;
|
||||
this.userHeadImg = this.shopUserInfo.headImg;
|
||||
this.nickName = this.shopUserInfo.nickName && this.shopUserInfo.nickName != '微信用户' ? this.shopUserInfo.nickName : '';
|
||||
this.telephone = this.shopUserInfo.telephone;
|
||||
this.birthDay = this.shopUserInfo.birthDay
|
||||
},
|
||||
|
||||
showClose (){
|
||||
console.log(2)
|
||||
uni.navigateBack()
|
||||
},
|
||||
radioChange(n) {
|
||||
//是否同意
|
||||
console.log(n);
|
||||
this.isProtocol = n;
|
||||
},
|
||||
/**
|
||||
* 查看协议
|
||||
*/
|
||||
viewProtocol (){
|
||||
wx.openPrivacyContract({
|
||||
success: () => {}, // 打开成功
|
||||
fail: () => {}, // 打开失败
|
||||
complete: () => {}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 上传头像
|
||||
* @param {Object} e
|
||||
*/
|
||||
onChooseAvatar(e) {
|
||||
let _this = this;
|
||||
//#ifdef MP-WEIXIN
|
||||
let avatarUrl = e.detail.avatarUrl
|
||||
uni.uploadFile({
|
||||
url: uni.conf.baseUrl + '/common/upload',
|
||||
// url: uni.conf.baseUrl + '/common/upload',
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
environment: 'app',
|
||||
type: 'android',
|
||||
version: '1.7.3',
|
||||
'content-type': 'multipart/form-data'
|
||||
},
|
||||
fileType:'image',
|
||||
name: "file",
|
||||
formData: {
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let { data } = JSON.parse(uploadFileRes.data)
|
||||
this.userHeadImg = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
//#ifdef MP-ALIPAY
|
||||
uni.chooseImage({
|
||||
count: 1, // 默认9,设置图片的数量
|
||||
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
||||
success: function (res) {
|
||||
// 成功选择图片后
|
||||
let avatarUrl = res.tempFilePaths[0]; // 获取文件路径
|
||||
|
||||
my.uploadFile({
|
||||
url: uni.conf.baseUrl + '/common/upload',
|
||||
// url: uni.conf.baseUrl + '/common/upload',
|
||||
filePath: avatarUrl,
|
||||
header: {
|
||||
environment: 'app',
|
||||
type: 'android',
|
||||
version: '1.7.3',
|
||||
'content-type': 'multipart/form-data'
|
||||
},
|
||||
fileType:'image',
|
||||
name: "file",
|
||||
formData: {
|
||||
file: avatarUrl,
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let { data } = JSON.parse(uploadFileRes.data)
|
||||
_this.userHeadImg = data
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 确定生日
|
||||
* @param {Object} e
|
||||
*/
|
||||
confirmTime(e) {
|
||||
this.calendarShow = false;
|
||||
this.birthDay = this.getDate(e.value);
|
||||
// console.log(this.getDate(e.value))
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取手机号
|
||||
* @param {Object} d
|
||||
*/
|
||||
async getPhone(d) {
|
||||
// #ifdef MP-WEIXIN
|
||||
if (d.detail.iv) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await this.api.userwxlogins({
|
||||
code: data.code,
|
||||
encryptedData: d.detail.encryptedData,
|
||||
iv: d.detail.iv,
|
||||
source: "wechar"
|
||||
})
|
||||
this.telephone = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-ALIPAY
|
||||
// 支付宝小程序环境
|
||||
my.getAuthCode({
|
||||
scopes: 'auth_user',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
my.getPhoneNumber({
|
||||
success: async (data) => {
|
||||
let res = await this.api.userwxlogins({
|
||||
encryptedData: JSON.parse(data.response).response,
|
||||
source: "alipay"
|
||||
})
|
||||
this.telephone = res.data
|
||||
// console.log(this.phonetitle)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
getPhoneError (e) {
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
/**
|
||||
* 格式化时间戳
|
||||
* @param {Object} time
|
||||
*/
|
||||
getDate(time) {
|
||||
const date = new Date(time);
|
||||
// const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}-${month}-${day}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* 注册会员
|
||||
*/
|
||||
async registerMember () {
|
||||
console.log(this.birthDay)
|
||||
// if ( this.userHeadImg == "" || this.userHeadImg == null ) {
|
||||
// uni.showToast({
|
||||
// title: '请选择会员头像',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if ( this.nickName == "" || this.nickName == null ) {
|
||||
uni.showToast({
|
||||
title: '请输入会员昵称',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if ( this.birthDay == "" || this.birthDay == null ) {
|
||||
// uni.showToast({
|
||||
// title: '请选择日期',
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
if ( this.telephone == "" || this.telephone == null ) {
|
||||
uni.showToast({
|
||||
title: '请获取手机号',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if ( !this.isProtocol ) {
|
||||
uni.showToast({
|
||||
title: '请勾选协议',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let res = await this.api.openMember({
|
||||
id: uni.cache.get('userInfo').id,
|
||||
shopId: this.shopId,
|
||||
nickName: this.nickName,
|
||||
headImg: this.userHeadImg,
|
||||
telephone: this.telephone,
|
||||
birthDay: this.birthDay
|
||||
})
|
||||
if ( res.code == 0 ) {
|
||||
|
||||
this.$emit('getRegisterMember', false)
|
||||
this.memberOpen = false;
|
||||
let res = await this.api.loginwxuserInfo({
|
||||
userId: uni.cache.get('userInfo').id
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-datetime-picker {
|
||||
height: 300px !important;
|
||||
}
|
||||
.register-member-wrap{
|
||||
padding: 64rpx 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.register-title{
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.register-tip{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.register-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.reg-head{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 64rpx;
|
||||
.reg-head-img{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
.reg-head-edit{
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 14rpx;
|
||||
}
|
||||
}
|
||||
.reg-cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
.lable{
|
||||
width: 120rpx;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.value{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
padding: 12rpx 0 12rpx 18rpx;
|
||||
}
|
||||
.u-input{
|
||||
input{
|
||||
font-size: 28rpx!important;
|
||||
}
|
||||
}
|
||||
.getPhone{
|
||||
background-color: none;
|
||||
border: 2rpx solid #E3AD7F;
|
||||
color: #E3AD7F;
|
||||
font-size: 28rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
// #ifdef MP-ALIPAY
|
||||
padding-top: 0;
|
||||
display: initial;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 5rpx;
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
.agreement{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 48rpx;
|
||||
.agreement_tip{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.agreement_item{
|
||||
display: flex;
|
||||
padding-top: 32rpx;
|
||||
padding-bottom: 16rpx;
|
||||
.agreement_item_text{
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #E3AD7F;
|
||||
}
|
||||
}
|
||||
}
|
||||
.register_btn{
|
||||
width: 572rpx;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
background: #E3AD7F;
|
||||
border-radius: 48rpx 48rpx 48rpx 48rpx;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #FFFFFF;
|
||||
margin: 30rpx auto 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,136 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="list">
|
||||
<view class="list_item" @click="handleClick(item)" v-for="(item,index) in list" :key="index">
|
||||
<view class="list_item_title">{{ item.title }}</view>
|
||||
<view class="list-cell">
|
||||
<view class="list-cell-item" v-for="(item1,index1) in item.list" :key="index1">
|
||||
<view class="list-cell-item-title"> {{ item1.title }}</view>
|
||||
<view class="list-cell-item-content">
|
||||
<view class="list-cell-item-content-text" v-for="(item2,index2) in item1.list" :key="index2">{{item2}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: null,
|
||||
list: [
|
||||
{
|
||||
title: "充值规则",
|
||||
list: [
|
||||
{
|
||||
title: "满赠规则",
|
||||
list: [
|
||||
"充300元送15元+0积分+0元券",
|
||||
"充500元送40元+0积分+0元券",
|
||||
"充1000元送100元+0积分+0元券",
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "适用门店",
|
||||
list: [
|
||||
"适用于1家门店",
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "使用规则",
|
||||
list: [
|
||||
{
|
||||
title: "使用须知",
|
||||
list: [
|
||||
"按比例",
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "免密支付",
|
||||
list: [
|
||||
"免密支付已开通",
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "适用商品",
|
||||
list: [
|
||||
"全部商品可用",
|
||||
]
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.userInfo = e
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* 跳转
|
||||
*/
|
||||
handleClick ( item ) {
|
||||
uni.pro.navigateTo(item.url, this.userInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.container{
|
||||
padding: 48rpx 20rpx;
|
||||
.list{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.list_item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 32rpx;
|
||||
.list_item_title{
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.list-cell{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.list-cell-item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
padding-bottom: 32rpx;
|
||||
margin-bottom: 32rpx;
|
||||
.list-cell-item-title{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.list-cell-item-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.list-cell-item-content-text{
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.list_item:last-child .list-cell-item:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontentone">
|
||||
我的会员卡<text v-if="list.length!=0">({{list.length}})</text>
|
||||
</view>
|
||||
<view class="flex-colum">
|
||||
<view class="towcontentitem" v-if="list.length>0" v-for="(item,index) in list" :key="index"
|
||||
@click="eeInfo(item)">
|
||||
<image class="towcontentitemimage"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
|
||||
<view class="towcontentitemone flex-start">
|
||||
<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
|
||||
<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
|
||||
<!-- 余额:<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-between">
|
||||
<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
|
||||
<text>{{item.shopName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length <= 0 && is_end" class="flex-colum">
|
||||
<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" iconSize='24' fontSize='24' height='40' />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
bgnothave: uni.getStorageSync('bgnothave'),
|
||||
list: [],
|
||||
is_end: false,
|
||||
nickname: uni.cache.get('userInfo').nickName,
|
||||
form: {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
},
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
type: null,
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e)
|
||||
if ( e.type ) {
|
||||
this.type = e.type;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.list = []
|
||||
this.form = {
|
||||
page: 1, //页数
|
||||
size: 10, //页容量
|
||||
status: 'loadmore',
|
||||
},
|
||||
this.paygetShopByMember()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.paygetShopByMember()
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
async paygetShopByMember() {
|
||||
let res = await this.api.paygetShopByMember({
|
||||
page: this.form.page,
|
||||
pageSize: this.form.size,
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
shopId: ''
|
||||
})
|
||||
|
||||
if (res.data.pages < this.form.page) {
|
||||
this.form.status = 'nomore'
|
||||
if (this.form.page == 1 && res.data.list == 0) {
|
||||
this.is_end = true
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
async eeInfo(item) {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": item.shopId,
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if ( res.code == 0 ) {
|
||||
uni.cache.set('shopUserInfo',res.data)
|
||||
uni.cache.set('shopId', item.shopId)
|
||||
if ( this.type && this.type == 'user_payCode') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(item)
|
||||
})
|
||||
} else if ( this.type && this.type == 'user_recharge') {
|
||||
uni.pro.navigateTo('member/index', {
|
||||
shopId: item.shopId,
|
||||
type: 'index',
|
||||
})
|
||||
} else if ( this.type && this.type == 'user_points') {
|
||||
uni.pro.navigateTo('/pagesPoints/index/index', {
|
||||
shopId: item.shopId,
|
||||
type: 'member_list',
|
||||
})
|
||||
} else {
|
||||
uni.pro.navigateTo('member/memberdetails', {
|
||||
shopId: item.shopId
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
border-top: 16rpx solid #f7f7f7;
|
||||
padding: 28rpx;
|
||||
padding-bottom: 40rpx;
|
||||
|
||||
.flex-colum_image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
text {
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentone {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.flex-colum {
|
||||
.towcontentitem {
|
||||
margin-top: 22rpx;
|
||||
width: 96%;
|
||||
position: relative;
|
||||
height: 224rpx;
|
||||
padding: 32rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.towcontentitemimage {
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12rpx;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.towcontentitemone {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
.towcontentitemoneimage {
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.towcontentitemonetext {
|
||||
width: 60%;
|
||||
margin-left: 16rpx;
|
||||
font-size: 32rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #422A07;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
bottom: 18rpx;
|
||||
padding: 0 32rpx;
|
||||
// margin-top: 52rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #422A07;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue