已支付订单列表:where.payStatus = 1;

This commit is contained in:
2024-07-10 22:44:18 +08:00
parent 9dd834adb5
commit 1311eb03b8
611 changed files with 92828 additions and 400 deletions
+378
View File
@@ -0,0 +1,378 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_shop_goods_index = require("../../api/shop/goods/index.js");
const api_layout_index = require("../../api/layout/index.js");
const api_shop_merchant_index = require("../../api/shop/merchant/index.js");
require("../../utils/request.js");
const api_booking_field_index = require("../../api/booking/field/index.js");
const api_booking_period_index = require("../../api/booking/period/index.js");
const store_modules_tenant = require("../../store/modules/tenant.js");
const tenantStore = store_modules_tenant.useTenantStore();
const lineBg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAOCAYAAABdC15GAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFxSURBVHgBzZNRTsJAEIb/WTW+lpiY+FZPIDew3ABP4GJ8hxsI9zBpOYHeQDwBPQI+mRiRvpLojtPdYhCorQqF/6GdbGd2vvwzBXZcNAt4oj1ANeUoAT5iqkUjbEFLHNmhD1YPEvpZ3ghkGlVDCkc94/BmHMq998I5ONiY1ZBfpKAyuOtgAc5yOEDmYEWNh32BHF91sGHZHmwW4azciN9aQwnz3SJEgOmte+R2tdLprTYoa50mvuomlLpD4Y3oQZnov6D2RzCqI93bWOHaEmAGqQUyRBlZR1WfarcD/EJ2z8DtzDGvsMCwpm8XOCfDUsVOCYhiqRxI/CTQo4UOvjzO7Pow18vfywneuUHHUUxLn55lLw5JFpZ8bEUcY8oXdOLWiHLTxvoGpLqoUmy6dBT15o/ox3znpoycAmxUsiJTbs1cmxeVKp+0zmFIS7bGWiVghC7Vwse8jFKAX9eljh4ggKLLv7uaQvG9/F59Oo2SouxPu7OTCxN/s8wAAAAASUVORK5CYII=";
const _sfc_main = {
data() {
return {
id: 0,
list: [{
name: "周三",
value: "05月08日"
}, {
name: "周四",
value: "05月09日"
}, {
name: "周五",
value: "05月10日"
}, {
name: "周六",
value: "05月11日"
}, {
name: "周日",
value: "05月12日"
}, {
name: "周一",
value: "05月13日"
}, {
name: "周二",
value: "05月14日"
}],
week: 0,
items: ["全场", "半场"],
lineBg,
// 时段
periodList: [],
// 场地
fieldList: [],
order: [],
// 订单总金额
total: 0,
keys: [],
// 场馆列表
merchant: {},
// 网站参数
fields: {},
// 幻灯片广告
ads: [],
// 小程序导航图标
navigation: [],
// 小程序导航图标(双排)
doubleNavigation: [],
isLogin: false,
disabled: false,
styleType: {
color: "#ff0000"
},
activeColor: {
color: "#303133"
}
};
},
onLoad(option) {
this.id = option.id;
this.reload();
},
computed: {
total() {
const app2 = this;
app2.total = 0;
app2.order.map((d) => {
console.log(d.totalPrice);
app2.total = app2.total + d.totalPrice;
});
return app2.total;
}
},
methods: {
async reload() {
const app2 = this;
const info = await tenantStore.fetchTenantInfo();
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
app2.isLogin = true;
}
if (info.fields) {
info.fields.map((d) => {
const key = d.name;
app2.fields[key] = d.value;
});
}
if (info.serverTime) {
this.week = info.serverTime.week;
}
if (info.websiteLogo) {
common_vendor.index.setStorageSync("app_logo", info.websiteLogo);
app2.logo = info.websiteLogo;
}
if (info.mpMenus) {
console.log("info.mpMenus: ", info.mpMenus);
const arr = info.mpMenus.filter((d) => d.type == 2 && d.rows == 0);
const arr1 = info.mpMenus.filter((d) => d.type == 2 && d.rows == 1);
const arr2 = info.mpMenus.filter((d) => d.type == 2 && d.rows == 2);
if (arr) {
app2.navigation = arr;
}
if (arr1) {
app2.doubleNavigation.push(arr1);
}
if (arr2) {
app2.doubleNavigation.push(arr2);
}
}
Promise.all([app2.getMerchant(), app2.getBookingField(), app2.getBookingPeriod()]).then((res) => {
app2.merchant = res[0];
console.log("Promise.all", app2.merchant);
});
},
getSiteInfo() {
return new Promise((resolve, reject) => {
api_layout_index.getSiteInfo().then((result) => {
resolve(result);
}).catch(reject);
});
},
onDisabled() {
this.disabled = !this.disabled;
},
navTo(url) {
common_vendor.index.navigateTo({
url
});
},
listAdList() {
},
pageGoods() {
return new Promise((resolve, reject) => {
api_shop_goods_index.pageGoods({}).then((result) => {
resolve(result.list);
}).catch(reject);
});
},
getMerchantList() {
return new Promise((resolve, reject) => {
api_shop_merchant_index.listMerchant({}).then((result) => {
resolve(result);
}).catch(reject);
});
},
getMerchant() {
api_shop_merchant_index.getMerchant(this.id).then((data) => {
app.merchant = data;
if (data.files) {
app.ads = JSON.parse(data.files);
}
common_vendor.index.setNavigationBarTitle({
title: data.merchantName
});
});
},
getBookingField() {
api_booking_field_index.listField({
merchantId: this.id,
isStatus: 1
}).then((list) => {
this.fieldList = list;
});
},
getBookingPeriod() {
const {
week
} = this;
const merchantId = this.id;
const isStatus = 1;
api_booking_period_index.listPeriod({
merchantId,
isStatus,
week
}).then((list) => {
this.periodList = list;
});
},
change(e) {
const {
index
} = e.detail;
const id = this.merchant[index].merchantId;
this.openUrl(`/package/booking/booking?id=${id}`);
},
callPhone(phone) {
common_vendor.index.makePhoneCall({
phoneNumber: phone
});
},
onMap() {
common_vendor.index.getLocation({
type: "gcj02",
//返回可以用于uni.openLocation的经纬度
success: function(res) {
console.log("返回可以用于uni.openLocation的经纬度: ", res);
const latitude = this.merchant.latitude;
const longitude = this.merchant.longitude;
common_vendor.index.openLocation({
latitude,
longitude,
success: function() {
console.log("success");
}
});
}
});
},
openUrl(url) {
if (!this.isLogin) {
this.$refs.login.open("bottom");
return false;
} else {
common_vendor.index.navigateTo({
url
});
}
},
onField(i, i2) {
const app2 = this;
const p = this.periodList[i];
const f = this.fieldList[i2];
const key = `${p.periodId}_${f.fieldId}`;
const index = app2.order.findIndex((d) => d.key == key);
console.log("index: ", index);
console.log("app.order.length: ", app2.order.length);
if (index >= 0) {
app2.order.splice(index, 1);
} else {
if (app2.order.length > 1) {
common_vendor.index.showToast({
title: "最多预定两个场地!",
icon: "none"
});
return false;
}
app2.order.push({
key,
fid: f.fieldId,
pid: p.periodId,
totalPrice: p.price
});
}
},
isActive(text) {
const index = this.order.find((d) => d.key == text);
if (index) {
return true;
}
},
save() {
common_vendor.index.navigateTo({
url: "/package/booking/cashier"
});
}
}
};
if (!Array) {
const _easycom_uv_tabs2 = common_vendor.resolveComponent("uv-tabs");
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
const _easycom_uv_badge2 = common_vendor.resolveComponent("uv-badge");
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
const _easycom_uv_count_to2 = common_vendor.resolveComponent("uv-count-to");
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uv_tabs2 + _easycom_uni_segmented_control2 + _easycom_uv_badge2 + _easycom_uv_icon2 + _easycom_uv_count_to2 + _easycom_uv_button2 + _easycom_ws_login2)();
}
const _easycom_uv_tabs = () => "../../uni_modules/uv-tabs/components/uv-tabs/uv-tabs.js";
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
const _easycom_uv_badge = () => "../../uni_modules/uv-badge/components/uv-badge/uv-badge.js";
const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
const _easycom_uv_count_to = () => "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to.js";
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uv_tabs + _easycom_uni_segmented_control + _easycom_uv_badge + _easycom_uv_icon + _easycom_uv_count_to + _easycom_uv_button + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.p({
list: $data.list,
itemStyle: {
height: "58px"
},
activeStyle: {
color: "#2ba91c"
},
lineColor: "#2ba91c",
inactiveStyle: {
color: "#808080"
}
}),
b: common_vendor.o(_ctx.onClickItem),
c: common_vendor.p({
current: _ctx.current,
values: $data.items,
activeColor: "#2ba91c",
inActiveColor: "#ff0000"
}),
d: common_vendor.p({
isDot: true,
type: "blank"
}),
e: common_vendor.p({
isDot: true,
type: "info"
}),
f: common_vendor.p({
isDot: true,
type: "success"
}),
g: common_vendor.p({
isDot: true,
type: "warning"
}),
h: common_vendor.t($data.order),
i: common_vendor.f($data.periodList, (item, index, i0) => {
return {
a: common_vendor.t(item.timePeriod),
b: common_vendor.f($data.fieldList, (item2, index2, i1) => {
return {
a: common_vendor.t(item2.fieldName),
b: common_vendor.n($options.isActive(`${item.periodId}_${item2.fieldId}`) ? "active web-bg-success" : ""),
c: common_vendor.o(($event) => $options.onField(index, index2), index2),
d: index2
};
}),
c: common_vendor.t(item.price),
d: index
};
}),
j: common_vendor.p({
name: "shopping-cart",
size: "36",
color: "#ffffff"
}),
k: common_vendor.p({
type: "error",
max: "99",
value: $data.order.length
}),
l: common_vendor.p({
startVal: 0,
decimals: "2",
duration: "100",
color: "#ebcf00",
bold: true,
endVal: $options.total
}),
m: common_vendor.o($options.save),
n: common_vendor.p({
customStyle: {
background: "linear-gradient(to right, #70b915, #008e04)",
borderRadius: "0 30px 30px 0",
color: "#ffffff",
order: "none",
padding: "22px 30px"
},
text: "去支付"
}),
o: common_vendor.sr("login", "f5dda94d-10"),
p: common_vendor.o($options.reload),
q: common_vendor.p({
logo: _ctx.logo
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f5dda94d"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/booking/cashier.vue"]]);
wx.createPage(MiniProgramPage);
+12
View File
@@ -0,0 +1,12 @@
{
"navigationBarTitleText": "订单确认",
"usingComponents": {
"uv-tabs": "../../uni_modules/uv-tabs/components/uv-tabs/uv-tabs",
"uni-segmented-control": "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control",
"uv-badge": "../../uni_modules/uv-badge/components/uv-badge/uv-badge",
"uv-icon": "../../uni_modules/uv-icon/components/uv-icon/uv-icon",
"uv-count-to": "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to",
"uv-button": "../../uni_modules/uv-button/components/uv-button/uv-button",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login"
}
}
+1
View File
@@ -0,0 +1 @@
<view class="container data-v-f5dda94d"><uv-tabs wx:if="{{a}}" class="data-v-f5dda94d" u-i="f5dda94d-0" bind:__l="__l" u-p="{{a}}"></uv-tabs><view class="uni-padding-wrap uni-common-mt data-v-f5dda94d"><uni-segmented-control wx:if="{{c}}" class="data-v-f5dda94d" bindclickItem="{{b}}" u-i="f5dda94d-1" bind:__l="__l" u-p="{{c}}"/></view><view class="uni-badge-wrap data-v-f5dda94d"><view class="badge-item data-v-f5dda94d"><uv-badge wx:if="{{d}}" class="data-v-f5dda94d" u-i="f5dda94d-2" bind:__l="__l" u-p="{{d}}"></uv-badge><text class="web-text-secondary data-v-f5dda94d">可预约</text></view><view class="badge-item data-v-f5dda94d"><uv-badge wx:if="{{e}}" class="data-v-f5dda94d" u-i="f5dda94d-3" bind:__l="__l" u-p="{{e}}"></uv-badge><text class="web-text-secondary data-v-f5dda94d">已出售</text></view><view class="badge-item data-v-f5dda94d"><uv-badge wx:if="{{f}}" class="data-v-f5dda94d" u-i="f5dda94d-4" bind:__l="__l" u-p="{{f}}"></uv-badge><text class="web-text-secondary data-v-f5dda94d">我的选择</text></view><view class="badge-item data-v-f5dda94d"><uv-badge wx:if="{{g}}" class="data-v-f5dda94d" u-i="f5dda94d-5" bind:__l="__l" u-p="{{g}}"></uv-badge><text class="web-text-secondary data-v-f5dda94d">已预定半场</text></view></view> {{h}} <view class="checkout-body web-text-primary data-v-f5dda94d"><block wx:for="{{i}}" wx:for-item="item" wx:key="d"><view class="period-item data-v-f5dda94d"><view class="period data-v-f5dda94d">{{item.a}}</view><view class="field-list data-v-f5dda94d"><block wx:for="{{item.b}}" wx:for-item="item2" wx:key="d"><view class="{{['field', 'data-v-f5dda94d', item2.b]}}" bindtap="{{item2.c}}"><text class="field-name data-v-f5dda94d">{{item2.a}}</text><text class="price data-v-f5dda94d">{{item.c}}元</text></view></block></view></view></block><view class="period-item data-v-f5dda94d" style="display:none"><view class="period data-v-f5dda94d">18:00 - 20:00</view><view class="field-list data-v-f5dda94d"><view class="field web-bg-info data-v-f5dda94d"><text class="field-name data-v-f5dda94d">1号场地</text><text class="price data-v-f5dda94d">580元</text></view><view class="field web-bg-success active data-v-f5dda94d"><text class="field-name data-v-f5dda94d">2号场地</text><text class="price data-v-f5dda94d">580元</text></view><view class="field web-bg-warning data-v-f5dda94d"><text class="field-name data-v-f5dda94d">3号场地</text><text class="price data-v-f5dda94d">580元</text></view></view></view></view></view><view class="checkout-car data-v-f5dda94d"><view class="car-selected data-v-f5dda94d"><uv-icon wx:if="{{j}}" class="data-v-f5dda94d" u-i="f5dda94d-6" bind:__l="__l" u-p="{{j}}"></uv-icon><uv-badge wx:if="{{k}}" class="data-v-f5dda94d" u-i="f5dda94d-7" bind:__l="__l" u-p="{{k}}"></uv-badge></view><view class="car-total data-v-f5dda94d"><text class="data-v-f5dda94d" style="color:#ebcf00">¥</text><uv-count-to wx:if="{{l}}" class="data-v-f5dda94d" u-i="f5dda94d-8" bind:__l="__l" u-p="{{l}}"></uv-count-to></view><uv-button wx:if="{{n}}" class="save-btn data-v-f5dda94d" bindclick="{{m}}" u-i="f5dda94d-9" bind:__l="__l" u-p="{{n}}"></uv-button></view><ws-login wx:if="{{q}}" class="r data-v-f5dda94d" u-r="login" binddone="{{p}}" u-i="f5dda94d-10" bind:__l="__l" u-p="{{q}}"/>
+300
View File
@@ -0,0 +1,300 @@
page {
background-size: 100%;
background-repeat: no-repeat;
background-color: #f0f2f5;
width: 750rpx;
overflow-x: hidden;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.merchant-name.data-v-f5dda94d {
padding: 30rpx;
font-weight: 500;
font-size: 42rpx;
background-color: #ffffff;
}
.checkout-car.data-v-f5dda94d {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
}
.checkout-car .car-selected.data-v-f5dda94d {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.checkout-car .car-total.data-v-f5dda94d {
display: flex;
color: #ebcf00;
align-items: center;
}
.booking-tel.data-v-f5dda94d {
position: fixed;
z-index: 1;
top: 270px;
right: 0;
width: 80px;
height: 38px;
border-radius: 50px 0 0 50px;
background: linear-gradient(to right, #ccff66, #008e04);
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 26rpx;
}
.popup-booking-tel.data-v-f5dda94d {
background-color: #ffffff;
width: 560rpx;
min-height: 400rpx;
border-radius: 20rpx;
margin: auto;
padding: 20px;
z-index: 9999;
display: flex;
flex-direction: column;
}
.popup-booking-tel .title.data-v-f5dda94d {
font-weight: bold;
font-size: 38rpx;
text-align: center;
padding: 10px 0;
}
.popup-booking-tel .desc.data-v-f5dda94d {
line-height: 2rem;
}
.uni-padding-wrap.data-v-f5dda94d {
width: 180rpx;
margin: 20rpx auto;
}
.uni-badge-wrap.data-v-f5dda94d {
display: flex;
justify-content: space-around;
}
.uni-badge-wrap .badge-item.data-v-f5dda94d {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
}
.uni-badge-wrap .badge-item text.data-v-f5dda94d {
padding: 2rpx;
}
.uni-badge-wrap .badge-item .web-text-secondary.data-v-f5dda94d {
padding-left: 8rpx;
}
.checkout-body.data-v-f5dda94d {
padding: 20rpx;
}
.checkout-body .period-item.data-v-f5dda94d {
margin: 12rpx 0;
}
.checkout-body .period-item .period.data-v-f5dda94d {
line-height: 2rem;
padding-left: 12rpx;
font-size: 28rpx;
}
.checkout-body .period-item .field-list.data-v-f5dda94d {
display: flex;
flex-wrap: wrap;
}
.checkout-body .period-item .field-list .web-bg-info.data-v-f5dda94d {
background-color: #e6e6e6 !important;
}
.checkout-body .period-item .field-list .web-bg-success.data-v-f5dda94d {
color: #2ba91c !important;
border: 1px solid #2ba91c !important;
}
.checkout-body .period-item .field-list .web-bg-warning.data-v-f5dda94d {
background-color: #c9e294 !important;
}
.checkout-body .period-item .field-list .active.data-v-f5dda94d:before {
border-radius: 0 0 12rpx 0;
content: "";
position: absolute;
right: 0;
bottom: 0;
border: 24rpx solid #2ba91c;
border-top-color: transparent;
border-left-color: transparent;
}
.checkout-body .period-item .field-list .active.data-v-f5dda94d:after {
content: "";
width: 5px;
height: 10px;
position: absolute;
right: 3px;
bottom: 4px;
border: 1px solid #fff;
border-top-color: transparent;
border-left-color: transparent;
transform: rotate(45deg);
border-radius: 4rpx;
}
.checkout-body .period-item .field-list .field.data-v-f5dda94d {
width: 118rpx;
height: 118rpx;
margin: 9rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 16rpx;
line-height: 1.3rem;
position: relative;
color: #333333;
background-color: #ffffff;
border: 1px solid #808080;
}
.checkout-body .period-item .field-list .field .field-name.data-v-f5dda94d {
font-size: 23rpx;
}
.checkout-body .period-item .field-list .field .price.data-v-f5dda94d {
font-size: 25rpx;
}
.xieyi.data-v-f5dda94d {
margin: 30rpx auto;
padding: 20rpx 30rpx;
}
.xieyi .text.data-v-f5dda94d {
margin-left: 5rpx;
}
.xieyi .text .link.data-v-f5dda94d {
color: #0f80ff;
}
.user-oreder.data-v-f5dda94d {
padding: 16px 0;
}
.user-oreder .web-cell-content.data-v-f5dda94d {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.user-oreder .web-text-center.data-v-f5dda94d {
text-align: center;
}
.card-title.data-v-f5dda94d {
width: 700rpx;
margin: 12rpx auto;
font-size: 38rpx;
font-weight: 500;
margin-top: 32rpx;
}
.merchant-card-title.data-v-f5dda94d {
width: 700rpx;
margin: 12rpx auto;
font-size: 40rpx;
font-weight: 500;
margin-top: 32rpx;
}
.card-body.data-v-f5dda94d {
width: 740rpx;
margin: auto;
}
.card-body .merchant-card.data-v-f5dda94d {
margin: 12rpx auto;
background: #ffffff;
border-radius: 10rpx;
border-color: slategrey;
border-radius: 16rpx;
}
.card-body .merchant-card .merchant-image.data-v-f5dda94d {
width: 200rpx;
border-radius: 16rpx 16rpx 0 0;
height: 140rpx !important;
}
.card-body .merchant-card .merchant-name.data-v-f5dda94d {
padding: 12rpx;
font-weight: 500;
font-size: 26rpx;
text-align: center;
}
.card-body .merchant-card .merchant-desc.data-v-f5dda94d {
width: 400rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.navigation.data-v-f5dda94d {
padding: 0 30rpx 0 30rpx;
}
.scroll-list.data-v-f5dda94d {
display: flex;
flex-direction: column;
}
.scroll-list__item.data-v-f5dda94d {
margin-right: 20px;
}
.scroll-list__item__image.data-v-f5dda94d {
width: 60px;
height: 60px;
border-radius: 4px;
}
.scroll-list__item__text.data-v-f5dda94d {
color: #808080;
text-align: center;
font-size: 12px;
margin-top: 5px;
}
.scroll-list__line.data-v-f5dda94d {
display: flex;
flex-direction: row;
margin-top: 10px;
}
.scroll-list__line__item.data-v-f5dda94d {
margin-right: 30px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.scroll-list__line__item__image.data-v-f5dda94d {
width: 61px;
height: 48px;
}
.scroll-list__line__item__text.data-v-f5dda94d {
margin-top: 5px;
color: #808080;
font-size: 12px;
text-align: center;
}
.scroll-list__line__item--no-margin-right.data-v-f5dda94d {
margin-right: 0;
}
.scroll-list__line__item__text.data-v-f5dda94d {
white-space: nowrap;
}
+519
View File
@@ -0,0 +1,519 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_layout_index = require("../../api/layout/index.js");
const api_shop_merchant_index = require("../../api/shop/merchant/index.js");
require("../../utils/request.js");
const api_booking_period_index = require("../../api/booking/period/index.js");
const store_modules_car = require("../../store/modules/car.js");
const utils_common = require("../../utils/common.js");
const carStore = store_modules_car.useCarStore();
const {
orderInfo,
totalPrice,
carNum,
merchant,
type,
dateTime,
childrenPrice
} = common_vendor.storeToRefs(carStore);
const _sfc_main = {
data() {
return {
// 场馆ID
merchantId: 0,
// 场馆信息
merchant,
// 未来7天
next7day: [],
// 预定信息
orderInfo,
// 订单总金额
totalPrice,
// 儿童票价
childrenPrice,
// 预定日期
dateTime: null,
// 0全场 1半场
type: 0,
// 星期几
week: 0,
// 是否可以预定半场
isHalf: 0,
// 服务器时间
serverTime: {},
items: ["全场", "半场"],
// 搜索条件
where: {},
// 时段
periodList: [],
// 场地
fieldList: [],
// 选中的场地
selection: [],
// 是否已登录
isLogin: false,
// 是否同意协议
disabled: false,
// 购物车信息
showCarInfo: false
};
},
onLoad(option) {
this.merchantId = option.id;
this.reload();
},
onShow() {
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
this.isLogin = true;
}
},
computed: {
totalPrice() {
const app = this;
let totalPrice2 = 0;
app.selection.map((d) => {
totalPrice2 = totalPrice2 + d.price;
});
carStore.totalPrice = totalPrice2;
console.log("totalPrice: ", totalPrice2);
return totalPrice2;
},
carNum() {
return this.selection.length;
}
},
methods: {
async reload() {
const app = this;
common_vendor.index.showLoading({
title: "数据读取中."
});
Promise.all([app.getServerTime(), app.getNext7day(), app.getMerchant()]).then((res) => {
const serverTime = res[0];
const next7day = res[1];
const merchant2 = res[2];
app.serverTime = serverTime;
app.next7day = next7day;
app.merchant = merchant2;
common_vendor.index.setNavigationBarTitle({
title: merchant2.merchantName
});
carStore.setMerchant(merchant2);
app.next7day = next7day.map((d, i) => {
if (!app.dateTime && i == 0) {
app.dateTime = d.dateTime;
app.week = d.week;
carStore.dateTime = d.dateTime;
}
d.name = utils_common.getWeek(d.week);
d.value = d.date;
return d;
});
app.getBookingPeriod();
}).catch(() => {
common_vendor.index.showToast({
title: "请检查您的网络.",
icon: "none"
});
common_vendor.index.hideLoading();
});
},
onDisabled() {
this.disabled = !this.disabled;
},
onDateTime(e) {
console.log("e: ", e);
this.week = e.week;
this.dateTime = e.dateTime;
carStore.dateTime = e.dateTime;
carStore.orderInfo = [];
this.selection = [];
this.reload();
},
onType(e) {
const index = e.currentIndex;
if (index == 0) {
this.type = 0;
this.isHalf = 0;
}
if (index == 1) {
this.type = 1;
this.isHalf = 1;
}
this.reload();
},
getMerchant() {
return new Promise((resolve, reject) => {
api_shop_merchant_index.getMerchant(this.merchantId).then((result) => {
resolve(result);
}).catch(reject);
});
},
getServerTime() {
return new Promise((resolve, reject) => {
api_layout_index.getServerTime().then((result) => {
resolve(result);
}).catch(reject);
});
},
getNext7day() {
return new Promise((resolve, reject) => {
api_layout_index.getNext7day().then((result) => {
resolve(result);
}).catch(reject);
});
},
// getBookingField() {
// FieldApi.listField({
// merchantId: this.merchantId,
// isStatus: 1,
// isHalf: this.isHalf,
// dateTime: `${this.dateTime}`
// }).then(list => {
// this.fieldList = list;
// })
// },
getBookingPeriod() {
const {
serverTime
} = this;
const now = /* @__PURE__ */ new Date();
const hours = now.getHours();
const minutes = now.getMinutes();
const startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : void 0;
const week = this.week == 0 ? 7 : this.week;
api_booking_period_index.listPeriod({
merchantId: this.merchantId,
isStatus: 0,
week,
dateTime: `${this.dateTime}`,
startTime,
half: this.isHalf
}).then((list) => {
this.periodList = list;
common_vendor.index.hideLoading();
}).catch((err) => {
this.periodList = [];
common_vendor.index.showToast({
title: err.message,
icon: "none"
});
common_vendor.index.hideLoading();
if (err.message == "您还有未支付订单,请先支付") {
setTimeout(() => {
return common_vendor.index.switchTab({
url: "/pages/order/order"
});
}, 1e3);
}
});
},
callPhone(phone) {
common_vendor.index.makePhoneCall({
phoneNumber: phone
});
},
openCarInfo() {
this.$refs.popup.open("bottom");
},
closeCarInfo() {
this.$refs.popup.close();
},
onMap() {
common_vendor.index.getLocation({
type: "gcj02",
//返回可以用于uni.openLocation的经纬度
success: function(res) {
console.log("返回可以用于uni.openLocation的经纬度: ", res);
const latitude = this.merchant.latitude;
const longitude = this.merchant.longitude;
common_vendor.index.openLocation({
latitude,
longitude,
success: function() {
console.log("success");
}
});
}
});
},
onField(item, period) {
if (item.sold) {
return;
}
const app = this;
const { merchant: merchant2 } = this;
const key = utils_common.getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`);
const index = app.selection.findIndex((d) => d.key == key);
if (index >= 0) {
app.selection.splice(index, 1);
} else {
if (app.selection.length > 1) {
common_vendor.index.showToast({
title: "最多预定两个场地!",
icon: "none"
});
return false;
}
const split = item.timePeriod.split("-");
app.selection.push({
key,
merchantId: this.merchantId,
merchantCode: merchant2.merchantCode,
fieldId: item.fieldId,
fieldName: item.fieldName,
price: item.price,
childrenPrice: period.childrenPrice,
adultNum: 1,
childrenNum: 0,
merchantName: merchant2.merchantName,
isChildren: item.isChildren,
isHalf: this.type,
timePeriod: item.timePeriod,
periodId: item.periodId,
startTime: `${split[0].trim()}:00`,
endTime: `${split[1].trim()}:00`,
orderCode: key,
dateTime: `${this.dateTime}`,
comments: `${this.dateTime} (${utils_common.getWeek(this.week)}) ${item.timePeriod}`
});
console.log(app.selection);
console.log("period: ", period);
console.log("item.isChildren: ", item.isChildren);
if (item.isChildren == 1) {
console.log("item.isChildren2: ", item.isChildren);
carStore.childrenPrice = period.childrenPrice;
} else {
carStore.childrenPrice = 0;
}
carStore.orderInfo = app.selection;
carStore.carNum = app.selection.length;
carStore.totalPrice = totalPrice;
carStore.payPrice = totalPrice;
carStore.setPeriod(period);
}
},
getStratTime(value) {
const split = value.split("-");
const timeText = split[0].replace(" ", "");
const startTime = (/* @__PURE__ */ new Date(`${this.dateTime} ${timeText}:00`)).getTime();
return startTime / 1e3 || 0;
},
isActive(item) {
const index = this.selection.find((d) => d.key == utils_common.getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`));
if (item.sold) {
if (item.isHalf == 1) {
return "web-bg-warning";
}
return "web-bg-info";
}
if (index) {
return "active web-bg-success";
}
},
// isActive(text,item) {
// const index = this.selection.find(d => d.key == getKey(text))
// if(item.sold){
// if(item.isHalf == 1){
// return 'web-bg-warning'
// }
// return 'web-bg-info'
// }
// if (index) {
// return 'active web-bg-success'
// }
// },
remove(item) {
const index = this.selection.findIndex((d) => d.key == item.key);
this.selection.splice(index, 1);
carStore.orderInfo = this.selection;
},
save() {
common_vendor.index.$uv.route({
url: "/package/booking/confirm"
});
}
}
};
if (!Array) {
const _easycom_uv_tabs2 = common_vendor.resolveComponent("uv-tabs");
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
const _easycom_uv_badge2 = common_vendor.resolveComponent("uv-badge");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
const _easycom_uv_count_to2 = common_vendor.resolveComponent("uv-count-to");
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uv_tabs2 + _easycom_uni_segmented_control2 + _easycom_uv_badge2 + _easycom_uv_gap2 + _easycom_uv_icon2 + _easycom_uv_count_to2 + _easycom_uv_button2 + _easycom_uni_icons2 + _easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uni_popup2 + _easycom_ws_login2)();
}
const _easycom_uv_tabs = () => "../../uni_modules/uv-tabs/components/uv-tabs/uv-tabs.js";
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
const _easycom_uv_badge = () => "../../uni_modules/uv-badge/components/uv-badge/uv-badge.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
const _easycom_uv_count_to = () => "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to.js";
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uv_tabs + _easycom_uni_segmented_control + _easycom_uv_badge + _easycom_uv_gap + _easycom_uv_icon + _easycom_uv_count_to + _easycom_uv_button + _easycom_uni_icons + _easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uni_popup + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.merchant
}, $data.merchant ? {
b: common_vendor.t($data.merchant.merchantId),
c: common_vendor.t($data.merchant.merchantCode),
d: common_vendor.t($data.merchant.merchantName),
e: common_vendor.t($data.dateTime),
f: common_vendor.t($data.week),
g: common_vendor.t($options.totalPrice),
h: common_vendor.t($data.type),
i: common_vendor.t($data.orderInfo)
} : {}, {
j: common_vendor.o($options.onDateTime),
k: common_vendor.p({
list: $data.next7day,
itemStyle: {
height: "58px"
},
activeStyle: {
color: "#2ba91c"
},
lineColor: "#2ba91c",
inactiveStyle: {
color: "#808080"
}
}),
l: common_vendor.o($options.onType),
m: common_vendor.p({
current: _ctx.current,
values: $data.items,
activeColor: "#2ba91c",
inActiveColor: "#ff0000"
}),
n: common_vendor.p({
isDot: true,
type: "blank"
}),
o: common_vendor.p({
isDot: true,
type: "info"
}),
p: common_vendor.p({
isDot: true,
type: "success"
}),
q: common_vendor.p({
isDot: true,
type: "warning"
}),
r: $data.periodList.length > 0
}, $data.periodList.length > 0 ? {
s: common_vendor.f($data.periodList, (item, index, i0) => {
return {
a: common_vendor.t(item.timePeriod),
b: common_vendor.f(item.fieldList, (field, index2, i1) => {
return {
a: common_vendor.t(field.fieldName),
b: common_vendor.n($options.isActive(field)),
c: common_vendor.o(($event) => $options.onField(field, item), index2),
d: index2
};
}),
c: common_vendor.t(item.price),
d: index
};
})
} : {}, {
t: common_vendor.p({
height: "50"
}),
v: common_vendor.p({
name: "shopping-cart",
size: "36",
color: "#ffffff"
}),
w: common_vendor.p({
type: "error",
max: "99",
value: $options.carNum
}),
x: common_vendor.o((...args) => $options.openCarInfo && $options.openCarInfo(...args)),
y: common_vendor.p({
startVal: 0,
decimals: "2",
duration: "100",
color: "#ebcf00",
bold: true,
endVal: $options.totalPrice
}),
z: common_vendor.o($options.save),
A: common_vendor.p({
disabled: $data.orderInfo.length == 0,
customStyle: {
background: "linear-gradient(to right, #70b915, #008e04)",
borderRadius: "0 30px 30px 0",
color: "#ffffff",
border: "none",
padding: "22px 30px"
},
text: "下一步"
}),
B: common_vendor.f($data.orderInfo, (item, index, i0) => {
return {
a: common_vendor.o(($event) => $options.remove(item), index),
b: "6e113c20-15-" + i0 + "," + ("6e113c20-14-" + i0),
c: common_vendor.o(($event) => $options.remove(item), index),
d: "6e113c20-14-" + i0 + ",6e113c20-13",
e: common_vendor.p({
title: `${item.fieldName} ¥${item.price}`,
label: `${item.dateTime}`,
cellStyle: {
padding: "10px 5px"
}
}),
f: index
};
}),
C: common_vendor.p({
type: "trash",
size: "20",
color: "#f76b4e"
}),
D: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
E: common_vendor.o($options.closeCarInfo),
F: common_vendor.p({
title: `购物车`,
extra: "关闭",
border: false,
["is-shadow"]: false,
padding: 0
}),
G: common_vendor.p({
height: "70"
}),
H: common_vendor.sr("popup", "6e113c20-11"),
I: common_vendor.sr("login", "6e113c20-17"),
J: common_vendor.o($options.reload),
K: common_vendor.p({
logo: _ctx.logo
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6e113c20"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/booking/checkout.vue"]]);
wx.createPage(MiniProgramPage);
+18
View File
@@ -0,0 +1,18 @@
{
"navigationBarTitleText": "场地预定",
"usingComponents": {
"uv-tabs": "../../uni_modules/uv-tabs/components/uv-tabs/uv-tabs",
"uni-segmented-control": "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control",
"uv-badge": "../../uni_modules/uv-badge/components/uv-badge/uv-badge",
"uv-gap": "../../uni_modules/uv-gap/components/uv-gap/uv-gap",
"uv-icon": "../../uni_modules/uv-icon/components/uv-icon/uv-icon",
"uv-count-to": "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to",
"uv-button": "../../uni_modules/uv-button/components/uv-button/uv-button",
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uv-cell": "../../uni_modules/uv-cell/components/uv-cell/uv-cell",
"uv-cell-group": "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group",
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login"
}
}
+1
View File
@@ -0,0 +1 @@
<view class="container data-v-6e113c20"><view wx:if="{{a}}" class="web-debug web-text-success data-v-6e113c20" style="display:none"> 场馆ID:{{b}} 场馆编号:{{c}} 场馆名称:{{d}} 日期:{{e}} 星期:{{f}} 订单总金额:{{g}} 类型:{{h}} 场地信息:{{i}}</view><uv-tabs wx:if="{{k}}" class="data-v-6e113c20" bindchange="{{j}}" u-i="6e113c20-0" bind:__l="__l" u-p="{{k}}"></uv-tabs><view class="uni-padding-wrap uni-common-mt data-v-6e113c20"><uni-segmented-control wx:if="{{m}}" class="data-v-6e113c20" bindclickItem="{{l}}" u-i="6e113c20-1" bind:__l="__l" u-p="{{m}}"/></view><view class="uni-badge-wrap data-v-6e113c20"><view class="badge-item data-v-6e113c20"><uv-badge wx:if="{{n}}" class="data-v-6e113c20" u-i="6e113c20-2" bind:__l="__l" u-p="{{n}}"></uv-badge><text class="web-text-secondary data-v-6e113c20">可预约</text></view><view class="badge-item data-v-6e113c20"><uv-badge wx:if="{{o}}" class="data-v-6e113c20" u-i="6e113c20-3" bind:__l="__l" u-p="{{o}}"></uv-badge><text class="web-text-secondary data-v-6e113c20">已出售</text></view><view class="badge-item data-v-6e113c20"><uv-badge wx:if="{{p}}" class="data-v-6e113c20" u-i="6e113c20-4" bind:__l="__l" u-p="{{p}}"></uv-badge><text class="web-text-secondary data-v-6e113c20">我的选择</text></view><view class="badge-item data-v-6e113c20"><uv-badge wx:if="{{q}}" class="data-v-6e113c20" u-i="6e113c20-5" bind:__l="__l" u-p="{{q}}"></uv-badge><text class="web-text-secondary data-v-6e113c20">已预定半场</text></view></view><view wx:if="{{r}}" class="checkout-body web-text-primary data-v-6e113c20"><block wx:for="{{s}}" wx:for-item="item" wx:key="d"><view class="period-item data-v-6e113c20"><view class="period data-v-6e113c20">{{item.a}}</view><view class="field-list data-v-6e113c20"><block wx:for="{{item.b}}" wx:for-item="field" wx:key="d"><view class="{{['field', 'data-v-6e113c20', field.b]}}" bindtap="{{field.c}}"><text class="field-name data-v-6e113c20">{{field.a}}</text><text class="price data-v-6e113c20">{{item.c}}元</text></view></block></view></view></block><view class="period-item data-v-6e113c20" style="display:none"><view class="period data-v-6e113c20">18:00 - 20:00</view><view class="field-list data-v-6e113c20"><view class="field web-bg-info data-v-6e113c20"><text class="field-name data-v-6e113c20">1号场地</text><text class="price data-v-6e113c20">580元</text></view><view class="field web-bg-success active data-v-6e113c20"><text class="field-name data-v-6e113c20">2号场地</text><text class="price data-v-6e113c20">580元</text></view><view class="field web-bg-warning data-v-6e113c20"><text class="field-name data-v-6e113c20">3号场地</text><text class="price data-v-6e113c20">580元</text></view></view></view></view></view><uv-gap wx:if="{{t}}" class="data-v-6e113c20" u-i="6e113c20-6" bind:__l="__l" u-p="{{t}}"></uv-gap><view class="checkout-car data-v-6e113c20"><view class="car-selected data-v-6e113c20" bindtap="{{x}}"><uv-icon wx:if="{{v}}" class="data-v-6e113c20" u-i="6e113c20-7" bind:__l="__l" u-p="{{v}}"></uv-icon><uv-badge wx:if="{{w}}" class="data-v-6e113c20" u-i="6e113c20-8" bind:__l="__l" u-p="{{w}}"></uv-badge></view><view class="car-total data-v-6e113c20"><text class="data-v-6e113c20" style="color:#ebcf00">¥</text><uv-count-to wx:if="{{y}}" class="data-v-6e113c20" u-i="6e113c20-9" bind:__l="__l" u-p="{{y}}"></uv-count-to></view><uv-button wx:if="{{A}}" class="save-btn data-v-6e113c20" bindclick="{{z}}" u-i="6e113c20-10" bind:__l="__l" u-p="{{A}}"></uv-button></view><uni-popup class="r data-v-6e113c20" u-s="{{['d']}}" u-r="popup" style="margin-bottom:200px" u-i="6e113c20-11" bind:__l="__l"><uni-card wx:if="{{F}}" class="data-v-6e113c20" u-s="{{['d']}}" bindclick="{{E}}" u-i="6e113c20-12,6e113c20-11" bind:__l="__l" u-p="{{F}}"><uv-cell-group wx:if="{{D}}" class="data-v-6e113c20" u-s="{{['d']}}" u-i="6e113c20-13,6e113c20-12" bind:__l="__l" u-p="{{D}}"><block wx:for="{{B}}" wx:for-item="item" wx:key="f"><uv-cell wx:if="{{item.e}}" class="data-v-6e113c20" u-s="{{['right-icon']}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}"><view slot="right-icon"><uni-icons wx:if="{{C}}" class="data-v-6e113c20" bindclick="{{item.a}}" u-i="{{item.b}}" bind:__l="__l" u-p="{{C}}"></uni-icons><text class="web-text-secondary data-v-6e113c20" style="font-size:24rpx" bindtap="{{item.c}}">移除</text></view></uv-cell></block></uv-cell-group></uni-card><uv-gap wx:if="{{G}}" class="data-v-6e113c20" u-i="6e113c20-16,6e113c20-11" bind:__l="__l" u-p="{{G}}"></uv-gap></uni-popup><ws-login wx:if="{{K}}" class="r data-v-6e113c20" u-r="login" binddone="{{J}}" u-i="6e113c20-17" bind:__l="__l" u-p="{{K}}"/>
+167
View File
@@ -0,0 +1,167 @@
page {
background-size: 100%;
background-repeat: no-repeat;
background-color: #f0f2f5;
width: 750rpx;
overflow-x: hidden;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.merchant-name.data-v-6e113c20 {
padding: 30rpx;
font-weight: 500;
font-size: 42rpx;
background-color: #ffffff;
}
.checkout-car.data-v-6e113c20 {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
}
.checkout-car .car-selected.data-v-6e113c20 {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
position: relative;
}
.checkout-car .car-total.data-v-6e113c20 {
display: flex;
color: #ebcf00;
align-items: center;
}
.popup-car-info.data-v-6e113c20 {
margin-bottom: 100px;
padding: 20rpx;
background-color: #ffffff;
width: 660rpx;
margin: 150rpx auto;
}
.uni-padding-wrap.data-v-6e113c20 {
width: 180rpx;
margin: 20rpx auto;
}
.uni-badge-wrap.data-v-6e113c20 {
display: flex;
justify-content: space-around;
}
.uni-badge-wrap .badge-item.data-v-6e113c20 {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
}
.uni-badge-wrap .badge-item text.data-v-6e113c20 {
padding: 2rpx;
}
.uni-badge-wrap .badge-item .web-text-secondary.data-v-6e113c20 {
padding-left: 8rpx;
}
.checkout-body.data-v-6e113c20 {
padding: 24rpx;
}
.checkout-body .period-item.data-v-6e113c20 {
margin: 12rpx 0;
}
.checkout-body .period-item .period.data-v-6e113c20 {
line-height: 2rem;
padding-left: 12rpx;
font-size: 28rpx;
}
.checkout-body .period-item .field-list.data-v-6e113c20 {
display: flex;
flex-wrap: wrap;
}
.checkout-body .period-item .field-list .web-bg-info.data-v-6e113c20 {
background-color: #909399 !important;
color: #ffffff !important;
}
.checkout-body .period-item .field-list .web-bg-success.data-v-6e113c20 {
color: #2ba91c !important;
border: 1px solid #2ba91c !important;
}
.checkout-body .period-item .field-list .active.data-v-6e113c20:before {
border-radius: 0 0 12rpx 0;
content: "";
position: absolute;
right: 0;
bottom: 0;
border: 24rpx solid #2ba91c;
border-top-color: transparent;
border-left-color: transparent;
}
.checkout-body .period-item .field-list .active.data-v-6e113c20:after {
content: "";
width: 5px;
height: 10px;
position: absolute;
right: 3px;
bottom: 4px;
border: 1px solid #fff;
border-top-color: transparent;
border-left-color: transparent;
transform: rotate(45deg);
border-radius: 4rpx;
}
.checkout-body .period-item .field-list .field.data-v-6e113c20 {
width: 118rpx;
height: 118rpx;
margin: 9rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 16rpx;
line-height: 1.3rem;
position: relative;
color: #333333;
background-color: #ffffff;
border: 1px solid #808080;
}
.checkout-body .period-item .field-list .field .field-name.data-v-6e113c20 {
font-size: 23rpx;
}
.checkout-body .period-item .field-list .field .price.data-v-6e113c20 {
font-size: 25rpx;
}
.xieyi.data-v-6e113c20 {
margin: 30rpx auto;
padding: 20rpx 30rpx;
}
.xieyi .text.data-v-6e113c20 {
margin-left: 5rpx;
}
.xieyi .text .link.data-v-6e113c20 {
color: #0f80ff;
}
+747
View File
@@ -0,0 +1,747 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_shop_order_index = require("../../api/shop/order/index.js");
const api_booking_users_index = require("../../api/booking/users/index.js");
const api_booking_userCard_index = require("../../api/booking/userCard/index.js");
const api_system_payment_index = require("../../api/system/payment/index.js");
const api_passport_login_index = require("../../api/passport/login/index.js");
const utils_decimal = require("../../utils/decimal.js");
const utils_common = require("../../utils/common.js");
const store_modules_car = require("../../store/modules/car.js");
const store_modules_user = require("../../store/modules/user.js");
const userStore = store_modules_user.useUserStore();
const carStore = store_modules_car.useCarStore();
const { merchantId, orderInfo, period, totalPrice, reducePrice, payPrice, childrenPrice, carNum, carNum2, merchant, type, dateTime } = common_vendor.storeToRefs(carStore);
const _sfc_main = {
data() {
return {
orderId: 0,
userInfo: {},
// 表单信息
form: {
cardId: 0,
payType: 1
},
// 支付方式
payment: [],
// 场馆信息
merchant,
merchantId,
orderInfo,
carNum,
carNum2: 0,
week: 0,
totalPrice,
reducePrice: 0,
payPrice,
childrenPrice,
period,
cardId: 0,
getWeek: utils_common.getWeek,
payType: 1,
isLogin: false,
disabled: false,
cardList: [],
userCard: {},
// isRefresh: true,
// 支付密码是否正确
isPayPasswordCorrect: false,
disabledPayPayPassword: false,
payPassword: "",
// 折扣率
discount: 1,
// 票类型
radiolist: [
{
name: "成人票",
price: 50,
totalPrice: 50,
disabled: false
},
{
name: "儿童票",
price: 35,
totalPrice: 35,
disabled: false
}
],
radiovalue: "成人票"
};
},
onLoad(option) {
if (option.id) {
this.orderId = option.id;
this.form.orderId = option.id;
}
this.reload();
},
onShow() {
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
this.isLogin = true;
}
this.openLogin();
},
// computed: {
// payPrice(){
// console.log('this.payPrice: ',this.payPrice);
// },
// carNum(){
// console.log('orderInfo[0].adultNum: ',this.adultNum);
// return this.adultNum;
// // return carStore.payPrice;
// }
// },
methods: {
async reload() {
const app = this;
const { form, orderId, merchant: merchant2, totalPrice: totalPrice2, orderInfo: orderInfo2 } = this;
app.userInfo = await userStore.fetchUserInfo();
api_booking_users_index.getByPhone({
phone: app.userInfo.phone
}).then((data) => {
if (data) {
app.hideUser = false;
app.userInfo.ouid = data.userId;
app.userInfo = Object.assign({}, app.userInfo, data);
}
});
form.type = 1;
form.payPrice = totalPrice2;
form.orderInfo = orderInfo2;
app.payPrice = totalPrice2;
if (merchant2) {
app.merchantId = merchant2.merchantId;
form.merchantId = merchant2.merchantId;
form.merchantName = merchant2.merchantName;
form.merchantCode = merchant2.merchantCode;
form.comments = merchant2.merchantName + " " + orderInfo2[0].fieldName + " " + orderInfo2[0].dateTime;
}
console.log("重新赋值订单信息: ", orderId);
if (orderId > 0) {
api_shop_order_index.getOrder(orderId).then((data) => {
app.form = data;
app.orderInfo = data.orderInfo;
app.totalPrice = data.totalPrice;
app.reducePrice = data.reducePrice;
app.payPrice = data.payPrice;
app.merchantId = data.merchantId;
app.childrenPrice = data.orderInfo[0].childrenPrice;
if (data.orderInfo[0].adultNum > 0) {
app.radiovalue = "成人票";
app.carNum = data.orderInfo[0].adultNum;
}
if (data.orderInfo[0].childrenNum > 0) {
app.radiovalue = "儿童票";
app.carNum = data.orderInfo[0].childrenNum;
}
carStore.setOrderInfo(data.orderInfo);
});
}
Promise.all([app.getUserCard(), app.getPayment()]).then((res) => {
const userCard = res[0];
const payment = res[1];
app.userCard = userCard;
app.payment = payment.map((d) => {
if (d.type == 0) {
d.name = `${d.name} (余额¥${app.userInfo.balance})`;
}
if (d.type == 2 && userCard) {
d.name = `${userCard.name}(¥${userCard.remainingMoney})`;
}
return d;
});
if (userCard) {
form.cardId = userCard.id;
form.payType = 2;
app.payType = 2;
if (userCard.type == 1) ;
if (userCard.type == 2) ;
if (userCard.type == 3) ;
if (userCard.type == 2) ;
if (userCard.type == 5) {
app.discount = utils_decimal.cal.cheng(userCard.discount, 0.1);
const orderPrice = totalPrice2 || form.totalPrice;
if (orderPrice) {
console.log("orderPrice: ", orderPrice);
const lastTotalPrice = utils_decimal.cal.cheng(orderPrice, app.discount);
console.log("折后金额: ", lastTotalPrice);
app.reducePrice = utils_decimal.cal.jian(orderPrice, lastTotalPrice);
console.log("减少的金额: ", app.reducePrice);
app.payPrice = orderPrice * app.discount;
console.log("实付额: ", app.payPrice);
}
}
}
});
},
// 读取可用的会员卡
async getUserCard() {
return new Promise((resolve, reject) => {
const { merchantId: merchantId2 } = this;
api_booking_userCard_index.findUseCard({
sid: merchantId2
}).then((result) => {
resolve(result);
}).catch(reject);
});
},
// 读取支付方式列表
getPayment() {
return new Promise((resolve, reject) => {
api_system_payment_index.select({ status: true }).then((result) => {
resolve(result);
}).catch(reject);
});
},
onDisabled() {
this.disabled = !this.disabled;
},
navTo(url) {
common_vendor.index.navigateTo({
url
});
},
// 切换支付方式
async onPayType(index) {
const app = this;
const { form, totalPrice: totalPrice2, carNum: carNum3, childrenPrice: childrenPrice2, radiovalue } = this;
app.payType = index;
app.form.payType = index;
app.form.cardId = 0;
console.log("childrenPrice: ", childrenPrice2);
app.payPrice = 0;
app.reducePrice = 0;
await app.countTotalPrice();
if (index === 2) {
await app.reload();
}
},
openUrl(url) {
if (!this.isLogin) {
this.$refs.login.open("bottom");
return false;
} else {
common_vendor.index.navigateTo({
url
});
}
},
// 弹出登录提示框
openLogin() {
if (!this.isLogin) {
this.$refs.login.open("bottom");
return false;
}
},
// 验证支付密码
onPayPassword() {
if (this.payPassword == "" || !this.payPassword) {
common_vendor.index.showToast({
title: "请输入支付密码",
icon: "none"
});
return false;
}
this.disabledPayPayPassword = true;
const { payPassword } = this;
api_passport_login_index.checkPayPassword({ payPassword }).then((res) => {
this.disabledPayPayPassword = false;
this.isPayPasswordCorrect = true;
this.save();
}).catch((err) => {
common_vendor.index.showToast({
title: err.message,
icon: "none"
});
this.disabledPayPayPassword = false;
});
},
onAdultNum(e) {
const app = this;
const index = e.value;
app.carNum = index;
app.orderInfo[0].adultNum = index;
app.countTotalPrice();
},
onAdultNum2(e) {
const app = this;
const index = e.value;
app.carNum2 = index;
app.orderInfo[0].childrenNum = index;
app.countTotalPrice();
},
// 重新计算金额
countTotalPrice() {
const app = this;
const prices = [];
app.orderInfo.map((d) => {
prices.push(d.price * d.adultNum + d.childrenPrice * d.childrenNum);
});
const sum = prices.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
console.log(sum);
app.totalPrice = sum;
app.payPrice = sum;
},
save() {
const app = this;
console.log("payPrice000: ", app.payPrice);
console.log(carStore.payPrice);
const { form, merchant: merchant2, orderInfo: orderInfo2, totalPrice: totalPrice2, payPrice: payPrice2 } = this;
if (!this.disabled) {
common_vendor.index.showToast({
title: "请先阅读并同意服务协议",
icon: "none"
});
return false;
}
if (orderInfo2.length == 0) {
common_vendor.index.showToast({
title: "订单信息不存在",
icon: "none"
});
return false;
}
if (form.payType == 2 && !app.userCard) {
common_vendor.index.showToast({
title: "没有找到可用的会员卡",
icon: "none"
});
return false;
}
if (form.payType == 0 && !this.isPayPasswordCorrect) {
app.$refs.payPasswordForm.open("center");
return false;
}
common_vendor.index.showLoading({
title: "订单提交中."
});
form.payPrice = app.payPrice;
form.totalPrice = app.payPrice;
form.reducePrice = app.reducePrice;
api_shop_order_index.addOrder({
type: 1,
orderId: form.orderId,
merchantId: form.merchantId,
merchantName: form.merchantName,
merchantCode: form.merchantCode,
// 订单金额
totalPrice: app.payPrice,
// 实付金额
payPrice: app.payPrice,
// 预定场地信息
orderInfo: form.orderInfo,
comments: form.comments,
// 微信支付
payType: form.payType,
// 下单日期
dateTime: form.dateTime,
// 会员卡ID
cardId: form.cardId
}).then((data) => {
const orderInfo3 = data;
if (form.payType == 1) {
common_vendor.index.requestPayment({
provider: orderInfo3.provider,
// 服务提供商
timeStamp: orderInfo3.timeStamp,
// 时间戳
nonceStr: orderInfo3.nonceStr,
// 随机字符串
package: orderInfo3.package,
signType: orderInfo3.signType,
// 签名算法
paySign: orderInfo3.paySign,
// 签名
success: function(res) {
common_vendor.index.showToast({
title: "支付成功",
icon: "success"
});
setTimeout(function() {
app.disabled = false;
common_vendor.index.reLaunch({
url: "/pages/order/order",
success: function(e) {
var page = getCurrentPages()[0];
if (page == void 0 || page == null) return;
page.onLoad();
}
});
}, 1500);
},
fail: function(err) {
console.log("支付失败", err);
app.disabled = false;
common_vendor.index.reLaunch({
url: "/pages/order/order",
success: function(e) {
var page = getCurrentPages()[0];
if (page == void 0 || page == null) return;
page.onLoad();
}
});
}
});
}
if (form.payType == 0) {
if (!orderInfo3) {
return common_vendor.index.showToast({
title: "支付失败",
icon: "error"
});
}
if (orderInfo3) {
common_vendor.index.showToast({
title: "支付成功",
icon: "success"
});
setTimeout(function() {
app.disabled = false;
app.$refs.payPasswordForm.close();
common_vendor.index.reLaunch({
url: "/pages/order/order",
success: function(e) {
var page = getCurrentPages()[0];
if (page == void 0 || page == null) return;
page.onLoad();
}
});
}, 1500);
}
}
if (form.payType == 2) {
if (!orderInfo3) {
return common_vendor.index.showToast({
title: "支付失败",
icon: "error"
});
}
if (orderInfo3) {
common_vendor.index.showToast({
title: "支付成功",
icon: "success"
});
setTimeout(function() {
app.disabled = false;
common_vendor.index.reLaunch({
url: "/pages/order/order",
success: function(e) {
var page = getCurrentPages()[0];
if (page == void 0 || page == null) return;
page.onLoad();
}
});
}, 1500);
}
}
common_vendor.index.hideLoading();
}).catch((res) => {
common_vendor.index.showToast({
title: res.message || "请检查您的网络.",
icon: "none"
});
common_vendor.index.hideLoading();
});
}
}
};
if (!Array) {
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_uv_number_box2 = common_vendor.resolveComponent("uv-number-box");
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uv_count_to2 = common_vendor.resolveComponent("uv-count-to");
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
const _easycom_uv_code_input2 = common_vendor.resolveComponent("uv-code-input");
const _easycom_uni_forms_item2 = common_vendor.resolveComponent("uni-forms-item");
const _easycom_uni_forms2 = common_vendor.resolveComponent("uni-forms");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uv_cell2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uv_number_box2 + _easycom_uv_icon2 + _easycom_uni_icons2 + _easycom_uv_gap2 + _easycom_uv_count_to2 + _easycom_uv_button2 + _easycom_ws_login2 + _easycom_uv_code_input2 + _easycom_uni_forms_item2 + _easycom_uni_forms2 + _easycom_uni_popup2)();
}
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_uv_number_box = () => "../../uni_modules/uv-number-box/components/uv-number-box/uv-number-box.js";
const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uv_count_to = () => "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to.js";
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
const _easycom_uv_code_input = () => "../../uni_modules/uv-code-input/components/uv-code-input/uv-code-input.js";
const _easycom_uni_forms_item = () => "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.js";
const _easycom_uni_forms = () => "../../uni_modules/uni-forms/components/uni-forms/uni-forms.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uv_cell + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uv_number_box + _easycom_uv_icon + _easycom_uni_icons + _easycom_uv_gap + _easycom_uv_count_to + _easycom_uv_button + _easycom_ws_login + _easycom_uv_code_input + _easycom_uni_forms_item + _easycom_uni_forms + _easycom_uni_popup)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.t($data.radiolist),
b: common_vendor.t($data.carNum),
c: common_vendor.t($data.childrenPrice),
d: common_vendor.t($data.orderInfo),
e: $data.merchant
}, $data.merchant ? {
f: common_vendor.t($data.merchant.merchantId),
g: common_vendor.t($data.merchant.merchantCode),
h: common_vendor.t($data.merchant.merchantName),
i: common_vendor.t(_ctx.dateTime),
j: common_vendor.t($data.week),
k: common_vendor.t($data.totalPrice),
l: common_vendor.t(_ctx.type),
m: common_vendor.t($data.payPrice),
n: common_vendor.t($data.period),
o: common_vendor.t($data.orderInfo)
} : {}, {
p: $data.userInfo.realName
}, $data.userInfo.realName ? {
q: common_vendor.t($data.userInfo.realName)
} : {
r: common_vendor.o(($event) => $options.navTo(`/package/user/personal`))
}, {
s: common_vendor.p({
title: "真实姓名",
cellStyle: {
padding: "10px 5px"
},
border: false
}),
t: common_vendor.p({
title: "手机号码",
cellStyle: {
padding: "10px 5px"
},
value: $data.userInfo.phone,
border: false
}),
v: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
w: common_vendor.p({
title: "预约人信息",
border: false,
["is-shadow"]: false
}),
x: $data.orderInfo.length == 0
}, $data.orderInfo.length == 0 ? {} : {}, {
y: $data.orderInfo
}, $data.orderInfo ? {
z: common_vendor.p({
title: `场馆`,
label: $data.form.merchantName,
cellStyle: {
padding: "10px 5px"
}
}),
A: common_vendor.f($data.orderInfo, (item, index, i0) => {
return common_vendor.e($data.childrenPrice > 0 ? {
a: "246b5229-7-" + i0 + ",246b5229-5",
b: common_vendor.p({
title: `${item.fieldName}`,
label: `${item.dateTime} ${$data.getWeek(this.week)} ${item.timePeriod}`,
cellStyle: {
padding: "10px 5px"
}
})
} : {
c: "246b5229-8-" + i0 + ",246b5229-5",
d: common_vendor.p({
title: `${item.fieldName}`,
label: `${item.dateTime} ${$data.getWeek(this.week)} ${item.timePeriod}`,
value: `¥${item.price}`,
cellStyle: {
padding: "10px 5px"
}
})
}, {
e: common_vendor.f($data.radiolist, (item2, index2, i1) => {
return common_vendor.e($data.childrenPrice > 0 ? common_vendor.e({
a: common_vendor.t(item2.name),
b: item2.name == "成人票"
}, item2.name == "成人票" ? {
c: common_vendor.t(item2.price)
} : {}, {
d: item2.name == "儿童票"
}, item2.name == "儿童票" ? {
e: common_vendor.t(item2.price)
} : {}, {
f: item2.name === "成人票"
}, item2.name === "成人票" ? {
g: common_vendor.o($options.onAdultNum, index2),
h: "246b5229-10-" + i0 + "-" + i1 + "," + ("246b5229-9-" + i0 + "-" + i1),
i: common_vendor.o(($event) => $data.carNum = $event, index2),
j: common_vendor.p({
min: 0,
max: 1e3,
disabled: $data.orderId > 0,
modelValue: $data.carNum
})
} : {}, {
k: item2.name === "儿童票"
}, item2.name === "儿童票" ? {
l: common_vendor.o($options.onAdultNum2, index2),
m: "246b5229-11-" + i0 + "-" + i1 + "," + ("246b5229-9-" + i0 + "-" + i1),
n: common_vendor.o(($event) => $data.carNum2 = $event, index2),
o: common_vendor.p({
min: 0,
max: 1e3,
disabled: $data.orderId > 0,
modelValue: $data.carNum2
})
} : {}, {
p: "246b5229-9-" + i0 + "-" + i1 + ",246b5229-5",
q: common_vendor.p({
iconStyle: "checkbox-mark",
cellStyle: {
padding: "10px 5px"
},
border: false
})
}) : {}, {
r: index2
});
}),
f: index
});
}),
B: $data.childrenPrice > 0,
C: $data.childrenPrice > 0
} : {}, {
D: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
E: common_vendor.p({
title: "订单信息",
border: false,
["is-shadow"]: false
}),
F: common_vendor.f($data.payment, (item, index, i0) => {
return common_vendor.e({
a: item.type == $data.payType
}, item.type == $data.payType ? {
b: "246b5229-15-" + i0 + "," + ("246b5229-14-" + i0),
c: common_vendor.p({
size: "30rpx",
name: "checkbox-mark"
})
} : {}, {
d: common_vendor.o(($event) => $options.onPayType(item.type), index),
e: "246b5229-14-" + i0 + ",246b5229-13",
f: common_vendor.p({
title: `${item.name}`,
icon: `${item.image}`,
cellStyle: {
padding: "20rpx 10rpx",
borderRadius: "8rpx",
backgroundColor: item.type == $data.payType ? "#f6fff1" : ""
},
border: false
}),
g: index
});
}),
G: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
H: common_vendor.t($data.reducePrice),
I: common_vendor.t($data.payPrice || 0),
J: common_vendor.p({
title: `选择支付方式`,
border: false,
["is-shadow"]: false
}),
K: !$data.disabled
}, !$data.disabled ? {
L: common_vendor.o($options.onDisabled),
M: common_vendor.p({
type: "circle",
size: "20",
color: "#a4a5a7"
})
} : {
N: common_vendor.o($options.onDisabled),
O: common_vendor.p({
type: "checkbox",
size: "20",
color: "#11a954"
})
}, {
P: common_vendor.o(($event) => $options.navTo("/package/article/detail?articleId=501")),
Q: common_vendor.o(($event) => $options.navTo("/package/article/detail?articleId=502")),
R: common_vendor.o((...args) => $options.onDisabled && $options.onDisabled(...args)),
S: common_vendor.p({
height: "50"
}),
T: common_vendor.p({
decimals: "2",
duration: "50",
color: "#ebcf00",
bold: true,
endVal: $data.payPrice
}),
U: common_vendor.o($options.save),
V: common_vendor.p({
disabled: !$data.disabled,
customStyle: {
background: "linear-gradient(to right, #70b915, #008e04)",
borderRadius: "0 30px 30px 0",
color: "#ffffff",
border: "none",
padding: "22px 30px"
},
text: "提交订单"
}),
W: common_vendor.sr("login", "246b5229-21"),
X: common_vendor.o($options.reload),
Y: common_vendor.p({
logo: _ctx.logo
}),
Z: common_vendor.o($options.onPayPassword),
aa: common_vendor.o(($event) => $data.payPassword = $event),
ab: common_vendor.p({
mode: "box",
dot: true,
space: 0,
maxlength: 6,
hairline: true,
modelValue: $data.payPassword
}),
ac: common_vendor.p({
label: "支付密码",
name: "payPassword",
required: true
}),
ad: common_vendor.sr("form", "246b5229-24,246b5229-23"),
ae: common_vendor.p({
["label-width"]: 80
}),
af: common_vendor.o(($event) => $options.navTo(`/package/user/pay-password`)),
ag: common_vendor.p({
title: "请输入支付密码",
border: false,
["is-shadow"]: false,
padding: 0
}),
ah: common_vendor.sr("payPasswordForm", "246b5229-22"),
ai: common_vendor.p({
type: "center",
["border-radius"]: "10px 10px 0 0"
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-246b5229"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/booking/confirm.vue"]]);
wx.createPage(MiniProgramPage);
+19
View File
@@ -0,0 +1,19 @@
{
"navigationBarTitleText": "订单确认",
"usingComponents": {
"uv-cell": "../../uni_modules/uv-cell/components/uv-cell/uv-cell",
"uv-cell-group": "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group",
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card",
"uv-number-box": "../../uni_modules/uv-number-box/components/uv-number-box/uv-number-box",
"uv-icon": "../../uni_modules/uv-icon/components/uv-icon/uv-icon",
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uv-gap": "../../uni_modules/uv-gap/components/uv-gap/uv-gap",
"uv-count-to": "../../uni_modules/uv-count-to/components/uv-count-to/uv-count-to",
"uv-button": "../../uni_modules/uv-button/components/uv-button/uv-button",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login",
"uv-code-input": "../../uni_modules/uv-code-input/components/uv-code-input/uv-code-input",
"uni-forms-item": "../../uni_modules/uni-forms/components/uni-forms-item/uni-forms-item",
"uni-forms": "../../uni_modules/uni-forms/components/uni-forms/uni-forms",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}
File diff suppressed because one or more lines are too long
+107
View File
@@ -0,0 +1,107 @@
page {
background-size: 100%;
background-repeat: no-repeat;
background-color: #f0f2f5;
width: 750rpx;
overflow-x: hidden;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.checkout-car.data-v-246b5229 {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
}
.checkout-car .car-selected.data-v-246b5229 {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.checkout-car .car-total.data-v-246b5229 {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
}
.card-actions.data-v-246b5229 {
display: flex;
flex-direction: row;
justify-content: flex-end;
height: 45px;
border-top: 1px #eee solid;
}
.card-actions-item.data-v-246b5229 {
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item .web-text-heading.data-v-246b5229 {
font-size: 38rpx;
margin-left: 28rpx;
}
.card-actions-item-text.data-v-246b5229 {
font-size: 12px;
color: #666;
margin-left: 5px;
}
.xieyi.data-v-246b5229 {
margin-bottom: 80rpx;
padding: 0 30rpx;
}
.xieyi .text.data-v-246b5229 {
margin-left: 5rpx;
}
.xieyi .text .link.data-v-246b5229 {
color: #0f80ff;
}
.pay-password-card.data-v-246b5229 {
width: 600rpx;
min-height: 300rpx;
margin: 30rpx auto;
background-color: #ffffff;
text-align: center;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.pay-password-card .web-text-primary.data-v-246b5229 {
line-height: 2rem;
padding: 20rpx 0;
}
.to-pay-btn.data-v-246b5229 {
width: 400rpx !important;
margin: 40rpx auto;
}
+257
View File
@@ -0,0 +1,257 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_shop_merchant_index = require("../../api/shop/merchant/index.js");
const store_modules_car = require("../../store/modules/car.js");
const carStore = store_modules_car.useCarStore();
const _sfc_main = {
data() {
return {
id: 0,
// 场馆信息
merchant: {},
// 场馆相册
photo: [],
isLogin: false,
disabled: true
};
},
onLoad(option) {
this.id = option.id;
carStore.merchantId = option.id;
this.reload();
},
onShow() {
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
this.isLogin = true;
}
},
methods: {
async reload() {
const app = this;
Promise.all([app.getMerchant()]).then((res) => {
const merchant = res[0];
app.merchant = merchant;
common_vendor.index.setNavigationBarTitle({
title: merchant.merchantName
});
if (merchant.files) {
app.photo = JSON.parse(merchant.files);
}
carStore.setMerchant(merchant);
carStore.merchantId = merchant.merchantId;
carStore.merchantName = merchant.merchantName;
carStore.merchantCode = merchant.merchantCode;
});
},
getMerchant() {
return new Promise((resolve, reject) => {
api_shop_merchant_index.getMerchant(this.id).then((result) => {
resolve(result);
}).catch(reject);
});
},
onDisabled() {
this.disabled = !this.disabled;
},
navTo(url) {
common_vendor.index.navigateTo({
url
});
},
mapTo(item) {
console.log("item: ", item.lngAndLat);
const arr = item.lngAndLat.split(",");
console.log("arr: ", arr);
common_vendor.index.openLocation({
latitude: parseFloat(arr[1]),
longitude: parseFloat(arr[0]),
success: function() {
console.log("success");
}
});
},
openBookingTel() {
this.$refs.popup.open("center");
},
closeBookingTel() {
this.$refs.popup.close();
},
callPhone(phone) {
common_vendor.index.makePhoneCall({
phoneNumber: phone
});
},
onMap() {
common_vendor.index.getLocation({
type: "gcj02",
//返回可以用于uni.openLocation的经纬度
success: function(res) {
console.log("返回可以用于uni.openLocation的经纬度: ", res);
const latitude = this.merchant.latitude;
const longitude = this.merchant.longitude;
common_vendor.index.openLocation({
latitude,
longitude,
success: function() {
console.log("success");
}
});
}
});
},
save() {
if (!this.disabled) {
common_vendor.index.showToast({
title: "请先阅读并同意订票协议",
icon: "none"
});
return false;
}
common_vendor.index.navigateTo({
url: "/package/booking/checkout?id=" + this.id
});
}
}
};
if (!Array) {
const _easycom_uv_swiper2 = common_vendor.resolveComponent("uv-swiper");
const _easycom_uv_cell2 = common_vendor.resolveComponent("uv-cell");
const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
const _easycom_uv_cell_group2 = common_vendor.resolveComponent("uv-cell-group");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uv_button2 = common_vendor.resolveComponent("uv-button");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uv_swiper2 + _easycom_uv_cell2 + _easycom_uv_icon2 + _easycom_uv_cell_group2 + _easycom_uni_card2 + _easycom_uni_icons2 + _easycom_uv_button2 + _easycom_uv_gap2 + _easycom_uni_popup2 + _easycom_ws_login2)();
}
const _easycom_uv_swiper = () => "../../uni_modules/uv-swiper/components/uv-swiper/uv-swiper.js";
const _easycom_uv_cell = () => "../../uni_modules/uv-cell/components/uv-cell/uv-cell.js";
const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
const _easycom_uv_cell_group = () => "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uv_button = () => "../../uni_modules/uv-button/components/uv-button/uv-button.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uv_swiper + _easycom_uv_cell + _easycom_uv_icon + _easycom_uv_cell_group + _easycom_uni_card + _easycom_uni_icons + _easycom_uv_button + _easycom_uv_gap + _easycom_uni_popup + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
list: $data.photo,
indicator: true,
indicatorMode: "line",
circular: true,
height: "200",
radius: "0"
}),
b: common_vendor.p({
title: "营业时间",
label: $data.merchant.businessTime,
cellStyle: {
padding: "10px 5px"
}
}),
c: common_vendor.p({
title: "场馆地址",
label: $data.merchant.address,
cellStyle: {
padding: "10px 5px"
}
}),
d: common_vendor.p({
size: "50rpx",
name: "map-fill",
color: "#5ac725"
}),
e: common_vendor.o(($event) => $options.mapTo($data.merchant)),
f: common_vendor.p({
title: "场馆位置",
label: `距离【${$data.merchant.merchantName}】3.8公里·约7分钟`,
isLink: true,
cellStyle: {
padding: "10px 5px"
}
}),
g: common_vendor.o(($event) => $options.callPhone($data.merchant.phone)),
h: common_vendor.p({
title: "服务前台电话",
label: $data.merchant.phone,
border: false,
cellStyle: {
padding: "10px 5px"
}
}),
i: common_vendor.p({
customStyle: {
backgroundColor: "#ffffff"
},
border: false
}),
j: common_vendor.p({
title: $data.merchant.merchantName,
border: false,
["is-shadow"]: false,
padding: 0
}),
k: $data.merchant.content,
l: common_vendor.p({
title: "场地介绍",
["is-shadow"]: false,
border: false,
padding: 0
}),
m: !$data.disabled
}, !$data.disabled ? {
n: common_vendor.o($options.onDisabled),
o: common_vendor.p({
type: "circle",
size: "20",
color: "#a4a5a7"
})
} : {
p: common_vendor.o($options.onDisabled),
q: common_vendor.p({
type: "checkbox",
size: "20",
color: "#11a954"
})
}, {
r: common_vendor.o(($event) => $options.navTo("/package/article/detail?articleId=503")),
s: common_vendor.o((...args) => $options.onDisabled && $options.onDisabled(...args)),
t: common_vendor.o($options.save),
v: common_vendor.p({
customStyle: {
background: "linear-gradient(to right, #ccff66, #008e04)",
borderRadius: "30px",
color: "#ffffff"
},
text: "预定场地"
}),
w: common_vendor.p({
height: "50"
}),
x: common_vendor.o((...args) => $options.openBookingTel && $options.openBookingTel(...args)),
y: common_vendor.p({
name: "close-circle",
color: "#ffffff",
size: "30"
}),
z: common_vendor.o((...args) => $options.closeBookingTel && $options.closeBookingTel(...args)),
A: common_vendor.sr("popup", "dfe028cf-13"),
B: common_vendor.p({
type: "center"
}),
C: common_vendor.sr("login", "dfe028cf-15"),
D: common_vendor.o($options.reload),
E: common_vendor.p({
logo: _ctx.logo
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-dfe028cf"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/booking/index.vue"]]);
wx.createPage(MiniProgramPage);
+15
View File
@@ -0,0 +1,15 @@
{
"navigationBarTitleText": "场地信息",
"usingComponents": {
"uv-swiper": "../../uni_modules/uv-swiper/components/uv-swiper/uv-swiper",
"uv-cell": "../../uni_modules/uv-cell/components/uv-cell/uv-cell",
"uv-icon": "../../uni_modules/uv-icon/components/uv-icon/uv-icon",
"uv-cell-group": "../../uni_modules/uv-cell/components/uv-cell-group/uv-cell-group",
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card",
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uv-button": "../../uni_modules/uv-button/components/uv-button/uv-button",
"uv-gap": "../../uni_modules/uv-gap/components/uv-gap/uv-gap",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login"
}
}
+1
View File
@@ -0,0 +1 @@
<view class="container data-v-dfe028cf"><view class="uv-demo-block data-v-dfe028cf"><uv-swiper wx:if="{{a}}" class="data-v-dfe028cf" u-i="dfe028cf-0" bind:__l="__l" u-p="{{a}}"></uv-swiper></view><uni-card wx:if="{{j}}" class="data-v-dfe028cf" u-s="{{['d']}}" u-i="dfe028cf-1" bind:__l="__l" u-p="{{j}}"><uv-cell-group wx:if="{{i}}" class="data-v-dfe028cf" u-s="{{['d']}}" u-i="dfe028cf-2,dfe028cf-1" bind:__l="__l" u-p="{{i}}"><uv-cell wx:if="{{b}}" class="data-v-dfe028cf" u-i="dfe028cf-3,dfe028cf-2" bind:__l="__l" u-p="{{b}}"></uv-cell><uv-cell wx:if="{{c}}" class="data-v-dfe028cf" u-i="dfe028cf-4,dfe028cf-2" bind:__l="__l" u-p="{{c}}"></uv-cell><uv-cell wx:if="{{f}}" class="data-v-dfe028cf" u-s="{{['right-icon']}}" bindclick="{{e}}" u-i="dfe028cf-5,dfe028cf-2" bind:__l="__l" u-p="{{f}}"><uv-icon class="data-v-dfe028cf" style="color:#ff0000" u-i="dfe028cf-6,dfe028cf-5" bind:__l="__l" u-p="{{d}}" slot="right-icon"></uv-icon></uv-cell><uv-cell wx:if="{{h}}" class="data-v-dfe028cf" bindclick="{{g}}" u-i="dfe028cf-7,dfe028cf-2" bind:__l="__l" u-p="{{h}}"></uv-cell></uv-cell-group></uni-card><uni-card wx:if="{{l}}" class="data-v-dfe028cf" u-s="{{['d']}}" u-i="dfe028cf-8" bind:__l="__l" u-p="{{l}}"><view class="web-text-heading booking-content data-v-dfe028cf"><view class="data-v-dfe028cf"><rich-text class="data-v-dfe028cf" nodes="{{k}}"/></view></view></uni-card><view class="xieyi web-cell web-text-secondary web-cell-align-top data-v-dfe028cf"><view class="web-cell web-cell-content web-cell-align-top data-v-dfe028cf"><uni-icons wx:if="{{m}}" class="data-v-dfe028cf" bindclick="{{n}}" u-i="dfe028cf-9" bind:__l="__l" u-p="{{o}}"></uni-icons><uni-icons wx:else class="data-v-dfe028cf" bindclick="{{p}}" u-i="dfe028cf-10" bind:__l="__l" u-p="{{q||''}}"></uni-icons><view class="text data-v-dfe028cf" bindtap="{{s}}"><text class="data-v-dfe028cf">我已阅读并同意</text><text class="link data-v-dfe028cf" catchtap="{{r}}">《订票协议》</text></view></view></view><view class="save-btn data-v-dfe028cf"><uv-button wx:if="{{v}}" class="data-v-dfe028cf" bindclick="{{t}}" u-i="dfe028cf-11" bind:__l="__l" u-p="{{v}}"></uv-button></view></view><uv-gap wx:if="{{w}}" class="data-v-dfe028cf" u-i="dfe028cf-12" bind:__l="__l" u-p="{{w}}"></uv-gap><view class="booking-tel data-v-dfe028cf" bindtap="{{x}}">活动订场</view><uni-popup wx:if="{{B}}" class="r data-v-dfe028cf" u-s="{{['d']}}" u-r="popup" u-i="dfe028cf-13" bind:__l="__l" u-p="{{B}}"><view class="popup-booking-tel data-v-dfe028cf"><text class="title data-v-dfe028cf">场馆热线</text><text class="desc data-v-dfe028cf">主体育场、足球训练场:0771-4953380</text><text class="desc data-v-dfe028cf">体育馆、综合训练馆、网球馆:0771-4953380</text><text class="desc data-v-dfe028cf">游泳跳水馆:0771-4736008</text><text class="title data-v-dfe028cf">参观接待</text><text class="desc data-v-dfe028cf">预约电话:0771-4736955</text><text class="desc data-v-dfe028cf">传真号码:0771-4736955</text><text class="title data-v-dfe028cf">大型活动订场</text><text class="desc data-v-dfe028cf">预约电话:0771-4736970、0771-4736994</text><text class="title data-v-dfe028cf">威拓普健身馆</text><text class="desc data-v-dfe028cf">联系电话:0771-5588699</text></view><view class="web-cell popup-close data-v-dfe028cf" bindtap="{{z}}"><uv-icon wx:if="{{y}}" class="data-v-dfe028cf" u-i="dfe028cf-14,dfe028cf-13" bind:__l="__l" u-p="{{y}}"></uv-icon></view></uni-popup><ws-login wx:if="{{E}}" class="r data-v-dfe028cf" u-r="login" binddone="{{D}}" u-i="dfe028cf-15" bind:__l="__l" u-p="{{E}}"/>
+102
View File
@@ -0,0 +1,102 @@
page {
background-size: 100%;
background-repeat: no-repeat;
background-color: #f0f2f5;
width: 750rpx;
overflow-x: hidden;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.merchant-name.data-v-dfe028cf {
padding: 30rpx;
font-weight: 500;
font-size: 42rpx;
background-color: #ffffff;
}
.save-btn.data-v-dfe028cf {
width: 700rpx;
left: 25rpx;
height: 80rpx;
position: fixed;
bottom: 30rpx;
}
.booking-tel.data-v-dfe028cf {
position: fixed;
z-index: 1;
top: 270px;
right: 0;
width: 80px;
height: 38px;
border-radius: 50px 0 0 50px;
background: linear-gradient(to right, #ccff66, #008e04);
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 13px;
}
.popup-booking-tel.data-v-dfe028cf {
background-color: #ffffff;
width: 560rpx;
min-height: 400rpx;
border-radius: 20rpx;
margin: auto;
padding: 20px;
z-index: 9999;
display: flex;
flex-direction: column;
}
.popup-booking-tel .title.data-v-dfe028cf {
font-weight: bold;
font-size: 38rpx;
text-align: center;
padding: 10px 0;
}
.popup-booking-tel .desc.data-v-dfe028cf {
line-height: 2rem;
}
.popup-close.data-v-dfe028cf {
display: flex;
margin-top: 24rpx;
justify-content: center;
}
.booking-content.data-v-dfe028cf {
padding: 10px;
font-size: 30rpx;
line-height: 1.5rem;
}
.xieyi.data-v-dfe028cf {
margin-bottom: 80rpx;
padding: 0 30rpx;
}
.xieyi .text.data-v-dfe028cf {
margin-left: 5rpx;
}
.xieyi .text .link.data-v-dfe028cf {
color: #0f80ff;
}
+222
View File
@@ -0,0 +1,222 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../utils/request.js");
const api_layout_index = require("../../api/layout/index.js");
const api_shop_merchant_index = require("../../api/shop/merchant/index.js");
const store_modules_tenant = require("../../store/modules/tenant.js");
require("../../store/modules/user.js");
const tenantStore = store_modules_tenant.useTenantStore();
const _sfc_main = {
data() {
return {
itemType: null,
items: ["关注", "推荐"],
// 场馆列表
merchant: [],
// 网站参数
fields: {},
// 幻灯片广告
ads: [],
// 幻灯片链接地址
pathList: [],
// 项目列表
itemList: [],
// 小程序导航图标
navigation: [],
// 小程序导航图标(双排)
doubleNavigation: [],
isLogin: false,
// 骨架屏
hideTools: true,
mp_menu_display_method: 0
};
},
onLoad(o) {
this.itemType = o.type;
this.reload();
},
methods: {
async reload() {
const app = this;
const info = await tenantStore.fetchTenantInfo();
if (common_vendor.index.getStorageSync("user_id") && common_vendor.index.getStorageSync("access_token")) {
app.isLogin = true;
}
if (info.fields) {
info.fields.map((d) => {
const key = d.name;
app.fields[key] = d.value;
if (d.name == "h5_url") {
common_vendor.index.setStorageSync(d.name, d.value);
}
if (d.name == "mp_menu_display_method") {
app.mp_menu_display_method = d.value;
}
});
}
if (info.ads) {
const ad = info.ads.filter((d) => d.adType == "幻灯片");
if (ad) {
const adsList = JSON.parse(ad[0].images);
adsList.map((d) => {
app.ads.push(d.url);
});
app.pathList = JSON.parse(ad[0].path);
}
app.hideTools = false;
}
if (info.websiteName) {
common_vendor.index.setNavigationBarTitle({
title: info.websiteName
});
}
if (info.websiteLogo) {
common_vendor.index.setStorageSync("app_logo", info.websiteLogo);
app.logo = info.websiteLogo;
}
if (info.mpMenus) {
const arr = info.mpMenus.filter((d) => d.type == 2 && d.rows == 0);
const arr1 = info.mpMenus.filter((d) => d.type == 2 && d.rows == 1);
info.mpMenus.filter((d) => d.type == 2 && d.rows == 2);
app.navigation = [];
app.doubleNavigation = [];
if (arr1) {
app.doubleNavigation.push(arr);
app.doubleNavigation.push(arr1);
} else {
app.doubleNavigation.push(arr);
}
if (arr) {
app.navigation = arr;
}
}
Promise.all([app.getMerchantList()]).then((res) => {
app.merchant = res[0];
});
},
getSiteInfo() {
return new Promise((resolve, reject) => {
api_layout_index.getSiteInfo().then((result) => {
resolve(result);
}).catch(reject);
});
},
getMerchantList() {
const { itemType } = this;
return new Promise((resolve, reject) => {
api_shop_merchant_index.listMerchant({ itemType }).then((result) => {
resolve(result);
}).catch(reject);
});
},
change(e) {
const { index } = e.detail;
const id = this.merchant[index].merchantId;
this.openUrl(`/package/booking/index?id=${id}`);
},
onAds(index) {
const { pathList } = this;
this.openUrl(pathList[index]);
},
openUrl(url) {
if (!this.isLogin) {
this.$refs.login.open("bottom");
return false;
} else {
common_vendor.index.navigateTo({
url
});
}
}
}
};
if (!Array) {
const _easycom_uni_grid_item2 = common_vendor.resolveComponent("uni-grid-item");
const _easycom_uni_grid2 = common_vendor.resolveComponent("uni-grid");
const _easycom_uv_skeleton2 = common_vendor.resolveComponent("uv-skeleton");
const _easycom_uv_gap2 = common_vendor.resolveComponent("uv-gap");
const _easycom_uni_card2 = common_vendor.resolveComponent("uni-card");
const _easycom_ws_login2 = common_vendor.resolveComponent("ws-login");
(_easycom_uni_grid_item2 + _easycom_uni_grid2 + _easycom_uv_skeleton2 + _easycom_uv_gap2 + _easycom_uni_card2 + _easycom_ws_login2)();
}
const _easycom_uni_grid_item = () => "../../uni_modules/uni-grid/components/uni-grid-item/uni-grid-item.js";
const _easycom_uni_grid = () => "../../uni_modules/uni-grid/components/uni-grid/uni-grid.js";
const _easycom_uv_skeleton = () => "../../uni_modules/uv-skeleton/components/uv-skeleton/uv-skeleton.js";
const _easycom_uv_gap = () => "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
const _easycom_uni_card = () => "../../uni_modules/uni-card/components/uni-card/uni-card.js";
const _easycom_ws_login = () => "../../uni_modules/ws-login/components/ws-login/ws-login.js";
if (!Math) {
(_easycom_uni_grid_item + _easycom_uni_grid + _easycom_uv_skeleton + _easycom_uv_gap + _easycom_uni_card + _easycom_ws_login)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.merchant.length > 0
}, $data.merchant.length > 0 ? {
b: common_vendor.f($data.merchant, (item, index, i0) => {
return {
a: item.image,
b: common_vendor.t(item.merchantName),
c: index,
d: "5f22de14-1-" + i0 + ",5f22de14-0",
e: common_vendor.p({
index
})
};
}),
c: common_vendor.o($options.change),
d: common_vendor.p({
column: 3,
borderColor: "transparent",
highlight: true
})
} : {
e: common_vendor.p({
rows: "2",
avatar: true,
loading: $data.hideTools,
title: false
}),
f: common_vendor.p({
height: "16"
}),
g: common_vendor.p({
rows: "2",
avatar: true,
loading: $data.hideTools,
title: false
}),
h: common_vendor.p({
height: "16"
}),
i: common_vendor.p({
rows: "2",
avatar: true,
loading: $data.hideTools,
title: false
}),
j: common_vendor.p({
height: "16"
}),
k: common_vendor.p({
rows: "2",
avatar: true,
loading: $data.hideTools,
title: false
}),
l: common_vendor.p({
height: "16"
}),
m: common_vendor.p({
border: false,
padding: "18px 6px"
})
}, {
n: common_vendor.sr("login", "5f22de14-11"),
o: common_vendor.o($options.reload),
p: common_vendor.p({
logo: _ctx.logo
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-5f22de14"], ["__file", "/Users/gxwebsoft/APP/gxtyzx-uniapp-cli/src/package/booking/merchant.vue"]]);
wx.createPage(MiniProgramPage);
+12
View File
@@ -0,0 +1,12 @@
{
"navigationBarTitleText": "订单核销",
"enablePullDownRefresh": false,
"usingComponents": {
"uni-grid-item": "../../uni_modules/uni-grid/components/uni-grid-item/uni-grid-item",
"uni-grid": "../../uni_modules/uni-grid/components/uni-grid/uni-grid",
"uv-skeleton": "../../uni_modules/uv-skeleton/components/uv-skeleton/uv-skeleton",
"uv-gap": "../../uni_modules/uv-gap/components/uv-gap/uv-gap",
"uni-card": "../../uni_modules/uni-card/components/uni-card/uni-card",
"ws-login": "../../uni_modules/ws-login/components/ws-login/ws-login"
}
}
+1
View File
@@ -0,0 +1 @@
<view class="container data-v-5f22de14"><view class="card-body data-v-5f22de14"><block wx:if="{{a}}"><uni-grid wx:if="{{d}}" class="data-v-5f22de14" u-s="{{['d']}}" bindchange="{{c}}" u-i="5f22de14-0" bind:__l="__l" u-p="{{d}}"><uni-grid-item wx:for="{{b}}" wx:for-item="item" wx:key="c" class="data-v-5f22de14" u-s="{{['d']}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}"><view class="merchant-card data-v-5f22de14" style="display:flex;flex-direction:column"><image src="{{item.a}}" mode="widthFix" class="merchant-image data-v-5f22de14"/><text class="merchant-name data-v-5f22de14">{{item.b}}</text></view></uni-grid-item></uni-grid></block><block wx:else><uni-card wx:if="{{m}}" class="data-v-5f22de14" u-s="{{['d']}}" u-i="5f22de14-2" bind:__l="__l" u-p="{{m}}"><uv-skeleton wx:if="{{e}}" class="data-v-5f22de14" u-i="5f22de14-3,5f22de14-2" bind:__l="__l" u-p="{{e}}"></uv-skeleton><uv-gap wx:if="{{f}}" class="data-v-5f22de14" u-i="5f22de14-4,5f22de14-2" bind:__l="__l" u-p="{{f}}"></uv-gap><uv-skeleton wx:if="{{g}}" class="data-v-5f22de14" u-i="5f22de14-5,5f22de14-2" bind:__l="__l" u-p="{{g}}"></uv-skeleton><uv-gap wx:if="{{h}}" class="data-v-5f22de14" u-i="5f22de14-6,5f22de14-2" bind:__l="__l" u-p="{{h}}"></uv-gap><uv-skeleton wx:if="{{i}}" class="data-v-5f22de14" u-i="5f22de14-7,5f22de14-2" bind:__l="__l" u-p="{{i}}"></uv-skeleton><uv-gap wx:if="{{j}}" class="data-v-5f22de14" u-i="5f22de14-8,5f22de14-2" bind:__l="__l" u-p="{{j}}"></uv-gap><uv-skeleton wx:if="{{k}}" class="data-v-5f22de14" u-i="5f22de14-9,5f22de14-2" bind:__l="__l" u-p="{{k}}"></uv-skeleton><uv-gap wx:if="{{l}}" class="data-v-5f22de14" u-i="5f22de14-10,5f22de14-2" bind:__l="__l" u-p="{{l}}"></uv-gap></uni-card></block></view></view><ws-login wx:if="{{p}}" class="r data-v-5f22de14" u-r="login" binddone="{{o}}" u-i="5f22de14-11" bind:__l="__l" u-p="{{p}}"/>
+215
View File
@@ -0,0 +1,215 @@
page {
/* background: url('https://oss.wsdns.cn/20240502/75fc744657544a38a32f83a825688286.png') no-repeat; */
background-size: 100%;
background-repeat: no-repeat;
background-color: #f0f2f5;
width: 750rpx;
overflow-x: hidden;
}
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.segmented.data-v-5f22de14 {
display: block;
justify-content: space-around;
text-align: center;
width: 200rpx;
margin: auto;
color: #ffffff;
}
.segmented .item.data-v-5f22de14 {
color: #666;
font-size: 26rpx;
padding: 0 12rpx;
}
.segmented .active.data-v-5f22de14 {
color: #333;
font-size: 30rpx;
font-weight: 500;
}
.user-oreder.data-v-5f22de14 {
display: flex;
padding: 16px 0;
}
.user-oreder .scroll-item.data-v-5f22de14 {
display: flex;
flex-direction: column;
align-items: center;
padding: 0 25rpx;
}
.user-oreder .scroll-item .scrool-item-text.data-v-5f22de14 {
white-space: nowrap;
}
.user-oreder .web-cell-content.data-v-5f22de14 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.user-oreder .web-text-center.data-v-5f22de14 {
text-align: center;
}
.menu-list.data-v-5f22de14 {
display: flex;
padding: 16px 0;
flex-wrap: wrap;
}
.menu-list .scroll-item.data-v-5f22de14 {
display: flex;
flex-direction: column;
align-items: center;
padding: 0 25rpx;
}
.menu-list .scroll-item .scrool-item-text.data-v-5f22de14 {
white-space: nowrap;
}
.menu-list .web-cell-content.data-v-5f22de14 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 10rpx 0;
}
.menu-list .web-text-center.data-v-5f22de14 {
text-align: center;
}
.menu-list .menu-title.data-v-5f22de14 {
white-space: nowrap;
font-size: 26rpx;
}
.card-title.data-v-5f22de14 {
width: 700rpx;
margin: 12rpx auto;
font-size: 34rpx;
font-weight: 500;
margin-top: 32rpx;
}
.merchant-card-title.data-v-5f22de14 {
width: 700rpx;
margin: 12rpx auto;
font-size: 40rpx;
font-weight: 500;
margin-top: 32rpx;
}
.card-body.data-v-5f22de14 {
width: 740rpx;
margin: auto;
}
.card-body .merchant-card.data-v-5f22de14 {
margin: 12rpx auto;
background: #ffffff;
border-radius: 10rpx;
border-color: slategrey;
border-radius: 16rpx;
}
.card-body .merchant-card .merchant-image.data-v-5f22de14 {
width: 200rpx;
border-radius: 16rpx 16rpx 0 0;
height: 140rpx !important;
}
.card-body .merchant-card .merchant-name.data-v-5f22de14 {
padding: 10rpx;
font-weight: 500;
font-size: 26rpx;
text-align: center;
}
.card-body .merchant-card .merchant-desc.data-v-5f22de14 {
width: 400rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.item-list.data-v-5f22de14 {
display: flex;
flex-wrap: wrap;
width: 720rpx;
margin: auto;
}
.item-list .item-bar.data-v-5f22de14 {
width: 138rpx;
height: 138rpx;
padding: 10rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background-color: #ffffff;
border-radius: 10rpx;
margin: 10rpx;
font-size: 26rpx;
}
.navigation.data-v-5f22de14 {
padding: 0 30rpx 0 30rpx;
}
.scroll-list.data-v-5f22de14 {
display: flex;
flex-direction: column;
}
.scroll-list__item.data-v-5f22de14 {
margin-right: 20px;
}
.scroll-list__item__image.data-v-5f22de14 {
width: 60px;
height: 60px;
border-radius: 4px;
}
.scroll-list__item__text.data-v-5f22de14 {
color: #808080;
text-align: center;
font-size: 12px;
margin-top: 5px;
}
.scroll-list__line.data-v-5f22de14 {
display: flex;
flex-direction: row;
margin-top: 10px;
}
.scroll-list__line__item.data-v-5f22de14 {
margin-right: 30px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.scroll-list__line__item__image.data-v-5f22de14 {
width: 61px;
height: 48px;
}
.scroll-list__line__item__text.data-v-5f22de14 {
margin-top: 5px;
color: #808080;
font-size: 12px;
text-align: center;
}
.scroll-list__line__item--no-margin-right.data-v-5f22de14 {
margin-right: 0;
}
.scroll-list__line__item__text.data-v-5f22de14 {
white-space: nowrap;
}