This commit is contained in:
2024-11-01 14:15:56 +08:00
parent 0fc032aa8e
commit 06f6e29972
20 changed files with 3104 additions and 2715 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com
VITE_SERVER_URL=https://server.gxwebsoft.com/api
#VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
VITE_API_URL=https://modules.gxwebsoft.com/api
VITE_THINK_URL=https://gxtyzx-api.websoft.top/api
#VITE_SERVER_URL=http://127.0.0.1:9090/api
#VITE_API_URL=http://127.0.0.1:9099/api
VITE_THINK_URL=http://127.0.0.1:9099/api
#VITE_THINK_URL=http://127.0.0.1:9099/api
+10
View File
@@ -35,6 +35,16 @@ export async function listThinkCard(params?: ThinkCardParam) {
return Promise.reject(new Error(res.data.message));
}
export async function listUserThinkCard() {
const res = await request.post<ApiResult<ThinkCard[]>>(
THINK_API_URL + '/think/think-card/user-card'
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加
*/
+11 -1
View File
@@ -44,7 +44,7 @@ export async function addThinkOrder(data: ThinkOrder) {
data
);
if (res.data.code === 0) {
return res.data.message;
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -104,3 +104,13 @@ export async function getThinkOrder(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkOrderRepay(data: ThinkOrder) {
const res = await request.post<ApiResult<ThinkOrder>>(
THINK_API_URL + '/think/think-order/repay', data
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+73 -65
View File
@@ -1,115 +1,123 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkUsers, ThinkUsersParam } from './model';
import { THINK_API_URL } from '@/config/setting';
import type {ApiResult, PageResult} from '@/api';
import type {ThinkUsers, ThinkUsersParam} from './model';
import {THINK_API_URL} from '@/config/setting';
// 微信小程序登录
export async function loginByOpenId(data: any) {
const res = await request.post<ApiResult<ThinkUsers>>(THINK_API_URL + '/think/think-users/loginByOpenId', data);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
const res = await request.post<ApiResult<ThinkUsers>>(THINK_API_URL + '/think/think-users/loginByOpenId', data);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkUserInfo() {
const res = await request.post<ApiResult<ThinkUsers>>(THINK_API_URL + '/think/think-users/info');
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询
*/
export async function pageThinkUsers(params: ThinkUsersParam) {
const res = await request.get<ApiResult<PageResult<ThinkUsers>>>(
THINK_API_URL + '/think/think-users/page',
{
params
const res = await request.get<ApiResult<PageResult<ThinkUsers>>>(
THINK_API_URL + '/think/think-users/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.data.message));
}
/**
* 查询列表
*/
export async function listThinkUsers(params?: ThinkUsersParam) {
const res = await request.get<ApiResult<ThinkUsers[]>>(
THINK_API_URL + '/think/think-users',
{
params
const res = await request.get<ApiResult<ThinkUsers[]>>(
THINK_API_URL + '/think/think-users',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.data.message));
}
/**
* 添加
*/
export async function addThinkUsers(data: ThinkUsers) {
const res = await request.post<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
const res = await request.post<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改
*/
export async function updateThinkUsers(data: ThinkUsers) {
const res = await request.put<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
const res = await request.put<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除
*/
export async function removeThinkUsers(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除
*/
export async function removeBatchThinkUsers(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users/batch',
{
data
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-users/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询
*/
export async function getThinkUsers(id: number) {
const res = await request.get<ApiResult<ThinkUsers>>(
THINK_API_URL + '/think/think-users/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
const res = await request.get<ApiResult<ThinkUsers>>(
THINK_API_URL + '/think/think-users/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+10 -1
View File
@@ -44,7 +44,7 @@ export async function addThinkUsersVip(data: ThinkUsersVip) {
data
);
if (res.data.code === 0) {
return res.data.message;
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
@@ -104,3 +104,12 @@ export async function getThinkUsersVip(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
export async function thinkUsersVipRepay(data: any) {
const res = await request.post<ApiResult<ThinkUsersVip>>(
THINK_API_URL + '/think/think-users-vip/repay', data
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+10
View File
@@ -104,3 +104,13 @@ export async function getThinkVip(id: number) {
}
return Promise.reject(new Error(res.data.message));
}
export async function listThinkVipByGroup(data: ThinkVip) {
const res = await request.post<ApiResult<ThinkVip[]>>(
THINK_API_URL + '/think/think-vip/list-by-group', data
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+54 -95
View File
@@ -33,16 +33,16 @@
<template v-for="(item,index) in periodList" :key="index">
<view class="period-item">
<view class="period">{{ item.timePeriod }}</view>
<!-- <view class="field-list">-->
<!-- <template v-for="(field,index2) in item.fieldList" :key="index2">-->
<!-- <view class="field"-->
<!-- :class="isActive(field)"-->
<!-- @click="onField(field,item)">-->
<!-- <text class="field-name">{{ field.fieldName }}</text>-->
<!-- <text class="price">{{ item.price }}元</text>-->
<!-- </view>-->
<!-- </template>-->
<!-- </view>-->
<view class="field-list">
<template v-for="(field,index2) in fieldList" :key="index2">
<view class="field"
:class="isActive(field, item)"
@click="onField(field, item)">
<text class="field-name">{{ field.name }}</text>
<text class="price">{{ item.price }}元</text>
</view>
</template>
</view>
</view>
</template>
<!-- 排版样式备份 -->
@@ -78,7 +78,7 @@
:endVal="totalPrice"></uv-count-to>
</view>
<uv-button class="save-btn"
:disabled="orderInfo.length == 0"
:disabled="!selection.length"
:customStyle="{background: 'linear-gradient(to right, #70b915, #008e04)',borderRadius: '0 30px 30px 0',color: '#ffffff', border: 'none', padding: '22px 30px'}"
text="下一步" @click="save"></uv-button>
</view>
@@ -291,11 +291,11 @@ export default {
onType(e) {
const index = e.currentIndex
if (index === 0) {
this.type = 0;
this.type = 1;
this.isHalf = 0;
}
if (index === 1) {
this.type = 1;
this.type = 2;
this.isHalf = 1;
}
this.reload()
@@ -303,9 +303,9 @@ export default {
async getMerchant() {
this.merchant = await getThinkSite(this.merchantId)
},
async getFieldList(){
async getFieldList() {
if (!this.periodList.length) {
uni.showToast({
return uni.showToast({
title: '暂无可预订场地',
icon: 'none'
})
@@ -315,14 +315,14 @@ export default {
const timestamp = dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0]).unix()
periodVoList.push({
timestamp,
period: item.timePeriod
period: item.timePeriod,
id: item.id
})
})
const res = await listThinkFieldWithTimeList({
this.fieldList = await listThinkFieldWithTimeList({
sid: this.merchantId,
periodVoList
})
console.log(res)
},
getBookingPeriod() {
const {
@@ -379,9 +379,9 @@ export default {
closeCarInfo() {
this.$refs.popup.close()
},
onField(item, period) {
onField(field, item) {
// 已被预定
if (item.sold) {
if (field.sold) {
return
}
const app = this
@@ -390,7 +390,7 @@ export default {
// const p = this.periodList[i]
// 场地
// const f = this.fieldList[i2]
const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`)
const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${field.id}`)
const index = app.selection.findIndex(d => d.key === key)
if (index >= 0) {
app.selection.splice(index, 1)
@@ -402,80 +402,52 @@ export default {
})
return false
}
// 计算订单总金额
// let totalPrice = 0
// app.selection.map(d => {
// console.log(d);
// totalPrice = totalPrice + d.totalPrice
// })
const split = item.timePeriod.split('-')
// console.log('aaaaaaaaa',{
// key,
// merchantId: this.merchantId,
// merchantCode: this.merchantCode,
// fieldId: item.fieldId,
// fieldName: item.fieldName,
// price: item.price,
// merchantName: this.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} (${getWeek(this.week)}) ${item.timePeriod}`,
// });
const split = item.timePeriod.split(' - ')
const siteTime = field.periodVoList.find(d => d.period === item.timePeriod)
// 添加到购物车
const week = parseInt(this.week) === 7 ? 0 : this.week
app.selection.push({
key,
merchantId: this.merchantId,
merchantCode: merchant.merchantCode,
fieldId: item.fieldId,
fieldName: item.fieldName,
sid: this.merchantId,
fieldId: field.id,
fieldName: field.name,
price: item.price,
childrenPrice: period.childrenPrice,
childrenPrice: item.childrenPrice,
adultNum: 1,
childrenNum: 0,
merchantName: merchant.merchantName,
siteName: merchant.name,
isChildren: item.isChildren,
isHalf: this.type,
isHalf: this.isHalf,
type: this.type,
timePeriod: item.timePeriod,
periodId: item.periodId,
startTime: `${split[0].trim()}:00`,
startTime: dayjs(`${this.dateTime} ${split[0].trim()}`).unix(),
endTime: `${split[1].trim()}:00`,
orderCode: key,
siteTimeId: siteTime.id,
dateTime: `${this.dateTime}`,
comments: `${this.dateTime} (${getWeek(this.week)}) ${item.timePeriod}`,
comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`,
})
console.log(app.selection);
console.log('period: ', period);
// 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)
// 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 = new Date(`${this.dateTime} ${timeText}:00`).getTime()
return startTime / 1000 || 0;
},
isActive(item) {
const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`))
isActive(field, item) {
const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${field.id}`))
if (item.sold) {
if (item.isHalf === 1) {
return 'web-bg-warning'
@@ -486,30 +458,17 @@ export default {
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() {
const {
selection
} = this
uni.$uv.route({
url: '/package/booking/confirm'
uni.navigateTo({
url: '/package/booking/confirm',
success: (res) => {
res.eventChannel.emit('data', this.selection)
}
})
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -152,7 +152,7 @@ export default {
})
},
async getDuration() {
let url = `http://api.tianditu.gov.cn/drive?postStr={"orig":"${this.lng},${this.lat}","dest":"${this.merchant.lng},${this.merchant.lat}","style":"0"}&type=search&tk=71f234f251d4cb1feeb3c293a0f21709`
let url = `https://api.tianditu.gov.cn/drive?postStr={"orig":"${this.lng},${this.lat}","dest":"${this.merchant.lng},${this.merchant.lat}","style":"0"}&type=search&tk=71f234f251d4cb1feeb3c293a0f21709`
const res = await request.get(url)
const x2js = new X2js();
const {result} = x2js.xml2js(res.data)
File diff suppressed because it is too large Load Diff
+331 -361
View File
@@ -1,415 +1,385 @@
<template>
<view>
<view class="segmented">
<uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor" inActiveColor="#808080" @clickItem="onClickItem" />
</view>
<view class="card-list">
<block v-for="(item, index) in cardList" :key="index">
<view @click="openUrl('/package/card/checkout?cardId=' + item.cardId)" class="container" :style="{ background: `url(${item.image}) no-repeat center center`, backgroundSize: '100%', opacity: '0.85' }">
<view class="content web-cell">
<view class="merchant-avatar">
<uv-avatar :src="item.merchantAvatar" size="36" style="border: 3rpx solid #ffffff"></uv-avatar>
</view>
<view class="card-info web-cell-content">
<view class="title-bar">
<view class="web-text-heading" style="color: #ffffff; font-size: 17px; font-weight: 600;">{{ item.cardName }}</view>
<block v-if="item.cardCode == '月/年卡'">
<view class="desc web-text-heading" style="color: #ffffff;font-size: 14px;">{{ item.month }}个月</view>
</block>
<block v-if="item.cardCode == '次卡'">
<view class="desc web-text-heading" style="color: #ffffff;font-size: 14px;">{{ item.number }}次</view>
</block>
<block v-if="item.cardCode == '充值卡'">
<view class="desc web-text-heading" style="color: #ffffff;font-size: 14px;">{{ item.discount }}折</view>
</block>
</view>
<view class="price">
<text class="web-text-price">{{ `¥${item.price}` }}</text>
</view>
</view>
</view>
</view>
</block>
<block v-if="cardList.length == 0">
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
</block>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
</view>
</view>
<view>
<view class="segmented">
<uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor"
inActiveColor="#808080" @clickItem="onClickItem"/>
</view>
<view class="card-list">
<block v-for="(group, groupIndex) in cardList" :key="groupIndex">
<view class="flex flex-col justify-start items-start">
<view class="group-title">{{ group.siteNames }}</view>
<view @click="openUrl(`/package/card/checkout?cardId=${item.id}`)" class="container"
v-for="(item, index) in group.cardList" :key="index">
<view class="flex justify-between items-center w-100p p-20">
<view class="flex justify-start items-center text-28 font-bold w-100p">
<view class="web-text-heading">
{{ item.name }}
</view>
<view class="ml-10" v-if="item.type === 1">{{
item.term
}}年
</view>
<view class="ml-10" v-if="item.type === 3">{{
item.month
}}个月
</view>
<view v-if="item.type === 2" class="ml-10">
{{ item.count }}次
</view>
<view v-if="item.type === 4" class="ml-10">{{
item.discount
}}折
</view>
</view>
<view class="price">
<text class="web-text-price">{{ `¥${item.price}` }}</text>
</view>
</view>
<view class="text-25 text-gray p-20">
{{ item.info }}
</view>
</view>
</view>
</block>
<block v-if="cardList.length == 0">
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
</block>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
</view>
</template>
<script>
import * as Api from '@/api/booking/card';
import { pageWechatDeposit } from '@/api/shop/wechatDeposit';
import { getWeek, getKey } from '@/utils/common';
import {pageWechatDeposit} from '@/api/shop/wechatDeposit';
import {getWeek, getKey} from '@/utils/common';
import {listThinkVip, listThinkVipByGroup} from "@/api/think/thinkVip";
export default {
components: {},
data() {
return {
isRefresh: false,
isLogin: false,
userId: 0,
where: {
page: 1,
cardCode: '月/年卡',
sceneType: 'showCanBuyVipCard'
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['月/年卡', '次卡', '充值卡'],
cardList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
getWeek,
// 骨架屏
hideTools: true
};
},
onLoad(option) {
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
console.log('判断是否刷新: ', option);
if (option.isRefresh) {
this.isRefresh = true;
}
},
onShow(e) {
console.log('判断是否刷新: ', e);
// 判断是否登录
this.openLogin();
if (this.isRefresh) {
this.reload();
}
},
// 触底函数
onReachBottom() {
const app = this;
const { where } = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
reload() {
const app = this;
const { where, userId } = this;
if (userId == 0) {
app.openLogin();
return;
}
// where.userId = userId;
// uni.showLoading({
// title: '数据读取中.'
// });
app.loadMore = 'loading';
Api.pageCard(where)
.then((res) => {
const list = res.list.map((d) => {
return d;
});
if (app.cardList.length < res.count) {
app.cardList = app.cardList.concat(list);
app.canReset = true;
app.loadMore = 'no-more';
} else {
app.canReset = false;
app.loadMore = 'no-more';
}
// uni.hideLoading();
app.isRefresh = false;
app.hideTools = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
app.isRefresh = false;
app.hideTools = false;
});
},
onClickItem(e, text) {
const app = this;
const { where, userId } = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
// 全部
if (index == 0) {
where.cardCode = '月/年卡';
}
// 未支付
if (index == 1) {
where.cardCode = '次卡';
}
// 已支付
if (index == 2) {
where.cardCode = '充值卡';
}
components: {},
data() {
return {
isRefresh: false,
isLogin: false,
userId: 0,
where: {
page: 1,
cardCode: '月/年卡',
sceneType: 'showCanBuyVipCard',
type: 0
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['月/年卡', '次卡', '充值卡'],
cardList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
getWeek,
// 骨架屏
hideTools: true
};
},
onLoad(option) {
// 判断是否登录
this.openLogin();
// 加载数据
// this.reload();
this.getCardList()
console.log('判断是否刷新: ', option);
if (option.isRefresh) {
this.isRefresh = true;
}
},
onShow(e) {
console.log('判断是否刷新: ', e);
// 判断是否登录
this.openLogin();
if (this.isRefresh) {
// this.reload();
this.getCardList()
}
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
async getCardList() {
this.cardList = await listThinkVipByGroup({
type: this.where.type
})
},
reload() {
return;
const app = this;
const {where, userId} = this;
if (userId == 0) {
app.openLogin();
return;
}
// where.userId = userId;
// uni.showLoading({
// title: '数据读取中.'
// });
app.loadMore = 'loading';
Api.pageCard(where)
.then((res) => {
const list = res.list.map((d) => {
return d;
});
if (app.cardList.length < res.count) {
app.cardList = app.cardList.concat(list);
app.canReset = true;
app.loadMore = 'no-more';
} else {
app.canReset = false;
app.loadMore = 'no-more';
}
// uni.hideLoading();
app.isRefresh = false;
app.hideTools = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
app.isRefresh = false;
app.hideTools = false;
});
},
onClickItem({currentIndex}) {
this.where.page = 1;
this.cardList = [];
this.hideTools = true
this.reload();
},
openUrl(url) {
uni.navigateTo({
url
});
},
toPay(orderId) {
uni.navigateTo({
url: '/package/booking/confirm?id=' + orderId
});
},
closeOrder(item) {
uni.showModal({
title: '确定取消此订单?',
success(o) {
if (o.confirm) {
// Api.updateOrder({
// orderStatus: 2,
// orderId: item.orderId
// })
// .then((msg) => {
// uni.showToast({
// title: msg,
// icon: 'none'
// });
// item.orderStatus = 2;
// })
// .catch(() => {
// uni.showToast({
// title: '请检查您的网络.',
// icon: 'none'
// });
// uni.hideLoading();
// });
}
}
});
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
// 全部
if (currentIndex === 0) {
this.where.type = 0;
}
// 未支付
if (currentIndex === 1) {
this.where.type = 2;
}
// 已支付
if (currentIndex === 2) {
this.where.type = 4;
}
this.cardList = [];
this.hideTools = true
this.getCardList();
},
openUrl(url) {
uni.navigateTo({
url
});
},
toPay(orderId) {
uni.navigateTo({
url: '/package/booking/confirm?id=' + orderId
});
},
closeOrder(item) {
uni.showModal({
title: '确定取消此订单?',
success(o) {
if (o.confirm) {
// Api.updateOrder({
// orderStatus: 2,
// orderId: item.orderId
// })
// .then((msg) => {
// uni.showToast({
// title: msg,
// icon: 'none'
// });
// item.orderStatus = 2;
// })
// .catch(() => {
// uni.showToast({
// title: '请检查您的网络.',
// icon: 'none'
// });
// uni.hideLoading();
// });
}
}
});
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
.group-title {
margin: 20rpx;
padding-left: 20rpx;
border-left: 10px solid #19be6b;
font-size: 25rpx;
}
.segmented {
padding: 0 12rpx;
padding: 0 12rpx;
}
.content-text {
font-size: 14px;
color: #666;
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
flex: 1;
}
.card-list {
.container {
width: 700rpx;
height: 200rpx;
position: relative;
margin: 25rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 20rpx;
position: relative;
box-shadow: 0 0px 6px 0 rgba(0, 0, 0, 0.2);
// background: linear-gradient(to right, #70b915, #008e04);
color: #ffffff;
}
.container {
margin: 20rpx;
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
border-radius: 20rpx;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.2);
background-color: white;
width: calc(100% - 40rpx);
}
.container::before {
content: '';
display: block;
position: absolute;
border-radius: 20rpx;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000000;
// background: url('https://oss.wsdns.cn/20240528/cf37a247603f489ba23d7d2a53b8da39.jpeg') no-repeat center bottom;
background-size: 100%;
opacity: 0.25; /* 设置透明度 */
}
.container::before {
content: '';
display: block;
position: absolute;
border-radius: 20rpx;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.content {
position: relative;
z-index: 1;
width: 700rpx;
display: flex;
justify-content: space-between;
.merchant-avatar {
margin-left: 24rpx;
}
.card-info {
margin-left: 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
.title-bar {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
}
.web-text-price {
padding-right: 30rpx;
font-size: 36rpx;
color: #fecc66;
}
}
.card-bg {
}
}
.card-item {
width: 700rpx;
margin: 20rpx auto;
border-radius: 20rpx;
position: relative;
// box-shadow: 0 0px 6px 1px rgba($color: #a5a5a5, $alpha: 0.2);
}
// .card-item::before {
// content: ''; /* 伪元素需要内容,即使它是空的 */
// position: absolute;
// top: 0;
// right: 0;
// bottom: 0;
// left: 0;
// background: url('https://oss.wsdns.cn/20240528/d5680e18210544a49dfa79f250f1997d.jpeg');
// background-size: cover; /* 或其他你需要的背景大小 */
// opacity: 0.5; /* 设置透明度 */
// z-index: -1; /* 确保伪元素在内容之下 */
// }
.order-title {
padding: 20rpx 0;
.web-text-price {
padding-right: 30rpx;
font-size: 36rpx;
color: #fecc66;
}
.merchant-avatar {
margin-right: 12rpx;
}
.card-item {
width: 700rpx;
margin: 20rpx auto;
border-radius: 20rpx;
position: relative;
}
.card-name {
font-weight: 600;
}
.order-title {
padding: 20rpx 0;
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.merchant-avatar {
margin-right: 12rpx;
}
.order-body {
padding: 16px 0;
}
.card-name {
font-weight: 600;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
font-size: 12px;
color: #666;
margin-left: 5px;
}
.close {
top: 60rpx !important;
top: 60rpx !important;
}
.total-price {
display: flex;
flex-direction: column;
justify-content: flex-start;
font-size: 30rpx;
align-items: flex-start;
padding-left: 6rpx;
margin-left: 450rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
font-size: 30rpx;
align-items: flex-start;
padding-left: 6rpx;
margin-left: 450rpx;
.web-text-heading {
font-size: 30rpx !important;
}
.web-text-heading {
font-size: 30rpx !important;
}
}
</style>
+309 -333
View File
@@ -1,400 +1,376 @@
<template>
<view class="order" v-if="form.id">
<view class="qrcode" v-if="form.payStatus === 1 && form.orderStatus === 2">
<uv-image :src="`${IMG_URL}${form.qrcode}`" width="200" height="200" />
<!-- <uv-qrcode-->
<!-- ref="qrcode"-->
<!-- size="280rpx"-->
<!-- :options="{-->
<!-- data: form.orderNum,-->
<!-- foregroundImageSrc: form.merchantAvatar,-->
<!-- margin: 10,-->
<!-- foregroundImagePadding: 4,-->
<!-- foregroundImageHeight: 30,-->
<!-- foregroundImageWidth: 30,-->
<!-- foregroundImageBorderRadius: 4-->
<!-- }"-->
<!-- :value="`${h5_url}#/package/admin/order-scan?orderNo=${form.orderNum}`"-->
<!-- ></uv-qrcode>-->
<text class="web-text-secondary">核销码</text>
</view>
<uni-card title="预定信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
<uv-cell :title="`${form.siteName}`" :label="` `" :cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false" />
<block v-for="(item, index) in form.thinkOrderInfos" :key="index">
<uv-cell
:title="`${item.fieldName}`"
:label="`${item.dateTime}`"
:cellStyle="{ padding: '0', paddingBottom: '5px' }"
:value="`¥${item.price}`"
:border="item.isChildren === 1"
/>
<uv-cell :label="`成人票 ¥50`" :value="`x ${item.adultNum}`" v-if="item.isChildren === 1" :cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false" />
<uv-cell :label="`儿童票 ¥35`" :value="`x ${item.childrenNum}`" v-if="item.isChildren === 1" :cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false" />
</block>
</uv-cell-group>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="web-text-heading">合计:¥{{ form.totalPrice }}</view>
<view class="web-text-danger">实付:¥{{ form.payPrice }}</view>
</view>
</uni-card>
<block v-if="form.orderNum">
<uni-card :border="false" :is-shadow="false" :padding="0">
<view class="web-cell web-cell-align-top">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff', padding: '8px 0' }" :border="false">
<uv-cell :title="`姓名`" :value="`${form.name}`" :cellStyle="{ padding: '8px' }" />
<uv-cell :title="`手机号码`" :value="`${form.phone}`" :cellStyle="{ padding: '8px' }" />
<uv-cell :title="`订单号`" :value="`${form.id}`" :cellStyle="{ padding: '8px' }" />
<uv-cell :title="`订单编号`" :value="`${form.orderNum}`" :cellStyle="{ padding: '8px' }"" />
<uv-cell :title="`订单状态`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<view v-if="form.payStatus === 0">
<!-- <uv-count-down :time="form.timestamp" format="mm:ss"></uv-count-down> -->
<span style="color: #ff0000">未支付</span>
</view>
<view v-else>{{ orderStatus[form.orderStatus] }}</view>
</template>
</uv-cell>
<uv-cell :title="`下单时间`" :value="`${timeFormat(form.createTime,'yyyy-mm-dd hh:MM:ss')}`" :cellStyle="{ padding: '8px' }" />
<uv-cell :title="`支付方式`" :value="`${payType[form.payType]}`" :cellStyle="{ padding: '8px' }" />
<uv-cell :title="`优惠说明`" :value="`${form.desc ? form.desc : '无'}`" :cellStyle="{ padding: '8px' }" :border="false" />
</uv-cell-group>
</view>
</uni-card>
</block>
<uv-gap height="20"></uv-gap>
<view class="checkout-car" v-if="form.payStatus == 0">
<view class="car-total">
<text style="color: #ebcf00">¥</text>
<uv-count-to decimals="2" duration="30" color="#ebcf00" bold :endVal="form.payPrice"></uv-count-to>
</view>
<uv-button
class="save-btn"
:customStyle="{ background: 'linear-gradient(to right, #70b915, #008e04)', borderRadius: '0 30px 30px 0', color: '#ffffff', border: 'none', padding: '22px 30px' }"
text="去支付"
@click="navTo(`/package/booking/confirm?id=${form.orderId}`)"
></uv-button>
</view>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
</view>
<view class="order" v-if="form.id">
<view class="qrcode" v-if="form.payStatus === 1 && form.orderStatus === 2">
<uv-image :src="`${IMG_URL}${form.qrcode}`" width="200" height="200"/>
<text class="web-text-secondary">核销码</text>
</view>
<uni-card title="预定信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
<uv-cell :title="`${form.siteName}`" :label="` `" :cellStyle="{ padding: '0', paddingBottom: '5px' }"
:border="false"/>
<block v-for="(item, index) in form.thinkOrderInfos" :key="index">
<uv-cell
:title="`${item.fieldName}`"
:label="`${item.dateTime}`"
:cellStyle="{ padding: '0', paddingBottom: '5px' }"
:value="`¥${item.price}`"
:border="item.isChildren === 1"
/>
<uv-cell :label="`成人票 ¥50`" :value="`x ${item.adultNum}`" v-if="item.isChildren === 1"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
<uv-cell :label="`儿童票 ¥35`" :value="`x ${item.childrenNum}`" v-if="item.isChildren === 1"
:cellStyle="{ padding: '0', paddingBottom: '5px' }" :border="false"/>
</block>
</uv-cell-group>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="web-text-heading">合计:¥{{ form.totalPrice }}</view>
<view class="web-text-danger">实付:¥{{ form.payPrice }}</view>
</view>
</uni-card>
<block v-if="form.orderNum">
<uni-card :border="false" :is-shadow="false" :padding="0">
<view class="web-cell web-cell-align-top">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff', padding: '8px 0' }" :border="false">
<uv-cell :title="`姓名`" :value="`${form.name}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`手机号码`" :value="`${form.phone}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单号`" :value="`${form.id}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`订单编号`" :value="`${form.orderNum}`" :cellStyle="{ padding: '8px' }"
" />
<uv-cell :title="`订单状态`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<view v-if="form.payStatus === 2">
<!-- <uv-count-down :time="form.timestamp" format="mm:ss"></uv-count-down> -->
<span style="color: #ff0000">未支付</span>
</view>
<view v-else>{{ orderStatus[form.orderStatus] }}</view>
</template>
</uv-cell>
<uv-cell :title="`下单时间`" :value="`${timeFormat(form.createTime,'yyyy-mm-dd hh:MM:ss')}`"
:cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`支付方式`" :value="`${payType[form.payType]}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`优惠说明`" :value="`${form.desc ? form.desc : '无'}`" :cellStyle="{ padding: '8px' }"
:border="false"/>
</uv-cell-group>
</view>
</uni-card>
</block>
<uv-gap height="20"></uv-gap>
<view class="checkout-car" v-if="form.payStatus === 2">
<view class="car-total">
<text style="color: #ebcf00">¥</text>
<uv-count-to decimals="2" duration="30" color="#ebcf00" bold :endVal="form.totalPrice"></uv-count-to>
</view>
<uv-button
class="save-btn"
:customStyle="{ background: 'linear-gradient(to right, #70b915, #008e04)', borderRadius: '0 30px 30px 0', color: '#ffffff', border: 'none', padding: '22px 30px' }"
text="立即支付"
@click="openPay"
></uv-button>
</view>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
</template>
<script>
import * as OrderApi from '@/api/think/thinkOrder';
import { IMG_URL } from '@/config/setting';
import { pageThinkWechatDeposit } from '@/api/think/thinkWechatDeposit';
import {IMG_URL} from '@/config/setting';
import {pageThinkWechatDeposit} from '@/api/think/thinkWechatDeposit';
import UvImage from "@/uni_modules/uv-image/components/uv-image/uv-image.vue";
import {timeFormat} from "@/uni_modules/uv-ui-tools/libs/function";
import { copyText, openUrl } from '@/utils/common';
import {copyText, openUrl} from '@/utils/common';
import {thinkUsersVipRepay} from "@/api/think/thinkUsersVip";
import {thinkOrderRepay} from "@/api/think/thinkOrder";
export default {
components: {UvImage},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['全部订单', '未支付', '已支付', '已完成', '押金'],
orderStatus: ['未使用', '已完成', '已取消', '取消中', '退款申请中', '退款被拒绝', '退款成功', '客户端申请退款'],
payType: [
'余额支付',
'微信支付',
'会员卡支付',
'支付宝',
'现金',
'POS机',
'VIP月卡',
'VIP年卡',
'VIP次卡',
'IC月卡',
'IC年卡',
'IC次卡',
'免费',
'VIP充值卡',
'IC充值卡',
'积分支付',
'VIP季卡',
'IC季卡'
],
components: {UvImage},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['全部订单', '未支付', '已支付', '已完成', '押金'],
orderStatus: ['未使用', '已完成', '已取消', '取消中', '退款申请中', '退款被拒绝', '退款成功', '客户端申请退款'],
payType: [
'余额支付',
'微信支付',
'会员卡支付',
'支付宝',
'现金',
'POS机',
'VIP月卡',
'VIP年卡',
'VIP次卡',
'IC月卡',
'IC年卡',
'IC次卡',
'免费',
'VIP充值卡',
'IC充值卡',
'积分支付',
'VIP季卡',
'IC季卡'
],
IMG_URL,
orderList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
h5_url: '',
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text'
};
},
onLoad(option) {
this.orderId = option.id;
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
},
onShow() {
// 判断是否登录
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const { where } = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
orderList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
h5_url: '',
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text'
};
},
onLoad(option) {
this.orderId = option.id;
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
},
onShow() {
// 判断是否登录
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
timeFormat,
reload() {
const app = this;
const { where, userId, orderId } = this;
if (!uni.getStorageSync('user_id')) {
app.openLogin();
return;
}
where.uid = uni.getStorageSync('uid');
uni.showLoading({
title: '数据读取中.'
});
OrderApi.getThinkOrder(orderId).then((data) => {
console.log('data909090: ', data);
app.form = data;
reload() {
const app = this;
const {where, userId, orderId} = this;
if (!uni.getStorageSync('user_id')) {
app.openLogin();
return;
}
where.uid = uni.getStorageSync('uid');
uni.showLoading({
title: '数据读取中.'
});
OrderApi.getThinkOrder(orderId).then((data) => {
app.form = data;
// 页面标题
if (data.orderStatus === 1) {
uni.setNavigationBarTitle({
title: '订单详情(已完成)'
});
}
// 页面标题
if (data.orderStatus === 1) {
uni.setNavigationBarTitle({
title: '订单详情(已完成)'
});
}
uni.hideLoading();
});
uni.hideLoading();
});
// H5版网址
const h5_url = uni.getStorageSync('h5_url');
const tid = uni.getStorageSync('TenantId');
if (h5_url) {
app.h5_url = h5_url;
} else {
app.h5_url = `http://${tid}.h5.wsdns.cn`;
}
},
navTo(url) {
uni.navigateTo({
url
});
},
onCopyText(text){
copyText(text);
// H5版网址
const h5_url = uni.getStorageSync('h5_url');
const tid = uni.getStorageSync('TenantId');
if (h5_url) {
app.h5_url = h5_url;
} else {
app.h5_url = `http://${tid}.h5.wsdns.cn`;
}
},
onClickItem(e) {
const app = this;
const { where, userId } = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
if (userId == 0) {
app.openLogin();
return;
}
// 全部
if (index == 0) {
where.payStatus = undefined;
where.orderStatus = undefined;
}
// 未支付
if (index == 1) {
where.payStatus = 2;
}
// 已支付
if (index == 2) {
where.payStatus = 1;
}
// 已完成
if (index == 3) {
where.orderStatus = 1;
}
// 押金
if (index == 4) {
pageThinkWechatDeposit({
uid: uni.getStorageSync('uid')
}).then((res) => {
console.log('res: ', res);
app.orderList = res.list;
});
return false;
}
this.reload();
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
navTo(url) {
uni.navigateTo({
url
});
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
},
async openPay() {
const orderInfo = await thinkOrderRepay({id: this.orderId})
const _this = this
uni.requestPayment({
provider: orderInfo.provider, // 服务提供商
timeStamp: orderInfo.timeStamp, // 时间戳
nonceStr: orderInfo.nonceStr, // 随机字符串
package: orderInfo.package,
signType: orderInfo.signType, // 签名算法
paySign: orderInfo.paySign, // 签名
success: function (res) {
// 业务逻辑。。。
uni.showToast({
title: '支付成功',
icon: 'success'
});
setTimeout(function () {
_this.reload()
}, 1500);
},
fail: function (err) {
console.log('支付失败', err);
}
})
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
}
.content-text {
font-size: 14px;
color: #666;
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
flex: 1;
}
.order {
.order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
.order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-name {
// padding-left: 12rpx;
}
.merchant-name {
// padding-left: 12rpx;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
.web-text-heading {
font-size: 30rpx;
font-weight: 500;
}
.web-text-heading {
font-size: 30rpx;
font-weight: 500;
}
.web-text-danger {
font-size: 30rpx;
font-weight: 500;
}
.web-text-danger {
font-size: 30rpx;
font-weight: 500;
}
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
font-size: 12px;
color: #666;
margin-left: 5px;
}
.btn-status {
font-size: 30rpx;
display: flex;
font-size: 30rpx;
display: flex;
}
.close {
top: 60rpx !important;
top: 60rpx !important;
}
.qrcode {
margin-top: 30rpx;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
margin-top: 30rpx;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.checkout-car {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
.car-selected {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.car-selected {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.car-total {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
.car-total {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
.save-btn {
}
}
.save-btn {
}
}
}
</style>
+335
View File
@@ -0,0 +1,335 @@
<template>
<view v-if="orderInfo">
<uni-card title="会员卡信息" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff' }" :border="false">
<uv-cell :title="`${orderInfo.siteNames}`" :label="orderInfo.name" :cellStyle="{ padding: '0', paddingBottom: '5px' }"
:border="false"/>
</uv-cell-group>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="web-text-heading text-orange">合计:¥{{ orderInfo.price }}</view>
</view>
</uni-card>
<uni-card title="会员卡详情" :border="false" :is-shadow="false" :padding="0">
<view class="order-body web-cell web-cell-align-top">
<view>{{ orderInfo.info }}</view>
</view>
</uni-card>
<uni-card :border="false" :is-shadow="false" :padding="0">
<view class="web-cell web-cell-align-top">
<uv-cell-group :customStyle="{ backgroundColor: '#ffffff', padding: '8px 0' }" :border="false">
<uv-cell :title="`订单号`" :value="`${orderInfo.wechatOrder}`" :cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`支付状态`" :cellStyle="{ padding: '8px' }">
<template v-slot:value>
<view v-if="orderInfo.status === 0" class="text-25 text-red">已取消</view>
<view v-else-if="orderInfo.status === 1" class="text-25 text-green">已支付</view>
<view v-else-if="orderInfo.status === 2" class="text-25 text-gray">未支付</view>
<view v-else-if="orderInfo.status === 3" class="text-25 text-gray">已退款</view>
</template>
</uv-cell>
<uv-cell :title="`下单时间`" :value="`${timeFormat(orderInfo.createTime,'yyyy-mm-dd hh:MM:ss')}`"
:cellStyle="{ padding: '8px' }"/>
<uv-cell :title="`到期时间`" :value="`${timeFormat(orderInfo.expireTime,'yyyy-mm-dd hh:MM:ss')}`"
:cellStyle="{ padding: '8px' }"/>
</uv-cell-group>
</view>
</uni-card>
<uv-gap height="20"></uv-gap>
<view class="checkout-car" v-if="orderInfo.status === 2">
<view class="car-total">
<text style="color: #ebcf00">¥</text>
<uv-count-to decimals="2" duration="30" color="#ebcf00" bold :endVal="orderInfo.price"></uv-count-to>
</view>
<uv-button
class="save-btn"
:customStyle="{ background: 'linear-gradient(to right, #70b915, #008e04)', borderRadius: '0 30px 30px 0', color: '#ffffff',
border: 'none', padding: '22px 30px' }"
text="立即支付"
@click="openPay"
></uv-button>
</view>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
</template>
<script>
import UvImage from "@/uni_modules/uv-image/components/uv-image/uv-image.vue";
import {timeFormat} from "@/uni_modules/uv-ui-tools/libs/function";
import {getThinkUsersVip, thinkUsersVipRepay} from "@/api/think/thinkUsersVip";
export default {
components: {UvImage},
data() {
return {
isLogin: false,
orderId: 0,
userId: 0,
form: {},
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['全部订单', '未支付', '已支付', '已完成', '押金'],
orderStatus: ['未使用', '已完成', '已取消', '取消中', '退款申请中', '退款被拒绝', '退款成功', '客户端申请退款'],
payType: [
'余额支付',
'微信支付',
'会员卡支付',
'支付宝',
'现金',
'POS机',
'VIP月卡',
'VIP年卡',
'VIP次卡',
'IC月卡',
'IC年卡',
'IC次卡',
'免费',
'VIP充值卡',
'IC充值卡',
'积分支付',
'VIP季卡',
'IC季卡'
],
orderList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
h5_url: '',
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
orderInfo: null
};
},
onLoad(option) {
this.orderId = option.id;
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
},
onShow() {
// 判断是否登录
this.openLogin();
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
timeFormat,
async reload() {
const app = this;
const {where, userId, orderId} = this;
if (!uni.getStorageSync('user_id')) {
app.openLogin();
return;
}
uni.showLoading({
title: '数据读取中.'
});
this.orderInfo = await getThinkUsersVip(this.orderId).catch(({message}) => {
uni.hideLoading()
uni.showToast({
title: message,
icon: 'none'
});
setTimeout(() => {
uni.navigateBack()
}, 1500)
})
uni.hideLoading()
},
async openPay() {
const orderInfo = await thinkUsersVipRepay({id: this.orderId})
const _this = this
uni.requestPayment({
provider: orderInfo.provider, // 服务提供商
timeStamp: orderInfo.timeStamp, // 时间戳
nonceStr: orderInfo.nonceStr, // 随机字符串
package: orderInfo.package,
signType: orderInfo.signType, // 签名算法
paySign: orderInfo.paySign, // 签名
success: function (res) {
// 业务逻辑。。。
uni.showToast({
title: '支付成功',
icon: 'success'
});
setTimeout(function () {
_this.reload()
}, 1500);
},
fail: function (err) {
console.log('支付失败', err);
}
})
}
,
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 150px;
text-align: center;
}
.content-text {
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
}
.order {
.order-title {
padding: 20rpx 0;
border-bottom: 1px #eee solid;
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-name {
// padding-left: 12rpx;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0 10px;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
.web-text-heading {
font-size: 30rpx;
font-weight: 500;
}
.web-text-danger {
font-size: 30rpx;
font-weight: 500;
}
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
.close {
top: 60rpx !important;
}
.qrcode {
margin-top: 30rpx;
text-align: center;
align-items: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.checkout-car {
width: 700rpx;
left: 25rpx;
position: fixed;
bottom: 30rpx;
display: flex;
justify-content: space-between;
background-color: #000000;
border-radius: 100px;
align-items: center;
.car-selected {
color: #ccc;
display: flex;
align-items: center;
padding: 0 20rpx;
}
.car-total {
display: flex;
color: #ebcf00;
align-items: center;
padding-left: 40rpx;
.save-btn {
}
}
}
</style>
+381 -364
View File
@@ -1,423 +1,440 @@
<template>
<view>
<!-- <view class="segmented">
<uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor" inActiveColor="#808080" @clickItem="onClickItem" />
</view> -->
<view class="card-list">
<block v-if="!hideTools || cardList.length > 0">
<view
class="container"
v-for="(item, index) in cardList"
:key="index"
@click="openUrl('/package/user/card-detail?cardId=' + item.id)"
:style="{ background: `url(https://oss.wsdns.cn/20240920/5e3327e1ad97472e942c824ab1776f52.jpg?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90) no-repeat center center`, backgroundSize: '100%', opacity: '0.85' }"
>
<view class="content web-cell">
<!-- <view class="merchant-avatar">-->
<!-- <uv-avatar :src="item.merchantAvatar" size="36" style="border: 3rpx solid #ffffff"></uv-avatar>-->
<!-- </view>-->
<view class="card-info web-cell-content">
<view class="title-bar">
<view class="web-text-heading" style="color: #ffffff; font-size: 20px; font-weight: 600">{{ item.name }}</view>
<view>
<!-- <view class="segmented">
<uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor" inActiveColor="#808080" @clickItem="onClickItem" />
</view> -->
<view class="card-list">
<block v-if="!hideTools || cardList.length > 0">
<view
class="container"
v-for="(item, index) in cardList"
:key="index"
@click="openUrl('/package/user/card-detail?cardId=' + item.id)"
:style="{ background: `url(https://oss.wsdns.cn/20240920/5e3327e1ad97472e942c824ab1776f52.jpg?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90) no-repeat center center`, backgroundSize: '100%', opacity: '0.85' }"
>
<view class="content web-cell">
<!-- <view class="merchant-avatar">-->
<!-- <uv-avatar :src="item.merchantAvatar" size="36" style="border: 3rpx solid #ffffff"></uv-avatar>-->
<!-- </view>-->
<view class="card-info web-cell-content">
<view class="title-bar">
<view class="web-text-heading" style="color: #ffffff; font-size: 20px; font-weight: 600">{{
item.name
}}
</view>
<view class="desc py-3" style="text-align: left;">
{{ item.siteNames }}
</view>
<!-- <block v-if="item.type == 2">
<view class="desc web-text-heading" style="color: #ffffff; font-size: 14px">{{ item.month }}个月</view>
</block> -->
<block v-if="item.type == 2">
<view class="desc web-text-heading" style="color: #ffffff; font-size: 14px">剩余{{ item.number }}次</view>
</block>
<block v-if="item.type == 1 || item.type == 3 || item.type == 5">
<view class="desc web-text-heading" style="color: #ffffff; font-size: 14px">余额¥{{ item.remainingMoney }}</view>
</block>
</view>
<!-- <view class="price">
<text class="web-text-price">{{ `¥${item.price}` }}</text>
</view> -->
</view>
</view>
</view>
</block>
<block v-else>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
</block>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload" />
</view>
<view v-if="!hideTools && cardList.length == 0">
<uv-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png"></uv-empty>
</view>
</view>
<!-- <block v-if="item.type == 2">
<view class="desc web-text-heading" style="color: #ffffff; font-size: 14px">{{ item.month }}个月</view>
</block> -->
<view v-if="item.type === 2" class="desc web-text-heading" style="color: #ffffff; font-size: 14px">剩余{{
item.number
}}次
</view>
<view v-if="item.type === 5" class="desc web-text-heading" style="color: #ffffff; font-size: 14px">余额¥{{
item.remainingMoney
}}
</view>
<view class="desc web-text-heading" v-if="item.type === 1 || item.type === 3" style="color: #ffffff; font-size: 14px">
{{ dayjs(item.expireTime * 1000).format('YYYY-MM-DD HH:mm') }}过期
</view>
</view>
<!-- <view class="price">
<text class="web-text-price">{{ `¥${item.price}` }}</text>
</view> -->
</view>
</view>
</view>
</block>
<block v-else>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
<uni-card :border="false" :padding="'18px 6px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
</block>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
<view v-if="!hideTools && cardList.length == 0">
<uv-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png"></uv-empty>
</view>
</view>
</template>
<script>
import * as Api from '@/api/think/thinkUsersVip';
import { getWeek, getKey } from '@/utils/common';
import {getWeek, getKey} from '@/utils/common';
import dayjs from "dayjs";
export default {
components: {},
data() {
return {
isRefresh: false,
isLogin: false,
userId: 0,
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['月/年卡', '次卡', '充值卡'],
cardList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
getWeek,
// 骨架屏
hideTools: true
};
},
onLoad(option) {
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
console.log('判断是否刷新: ', option);
if (option.isRefresh) {
this.isRefresh = true;
}
},
onShow(e) {
console.log('判断是否刷新: ', e);
// 判断是否登录
this.openLogin();
if (this.isRefresh) {
this.reload();
}
},
// 触底函数
onReachBottom() {
const app = this;
const { where } = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
reload() {
const app = this;
const { where, userId } = this;
if (userId === 0) {
app.openLogin();
return;
}
where.uid = uni.getStorageSync('uid');
where.status = 1;
components: {},
data() {
return {
isRefresh: false,
isLogin: false,
userId: 0,
where: {
page: 1
},
canReset: false,
loadMore: 'more',
logo: '',
items: ['月/年卡', '次卡', '充值卡'],
cardList: [],
styles: [
{
value: 'button',
text: '按钮',
checked: true
},
{
value: 'text',
text: '文字'
}
],
colors: ['#333333', '#4cd964', '#dd524d'],
current: 0,
colorIndex: 0,
activeColor: '#108001',
styleType: 'text',
getWeek,
// 骨架屏
hideTools: true
};
},
onLoad(option) {
// 判断是否登录
this.openLogin();
// 加载数据
this.reload();
console.log('判断是否刷新: ', option);
if (option.isRefresh) {
this.isRefresh = true;
}
},
onShow(e) {
console.log('判断是否刷新: ', e);
// 判断是否登录
this.openLogin();
if (this.isRefresh) {
this.reload();
}
},
// 触底函数
onReachBottom() {
const app = this;
const {where} = this;
if (app.canReset) {
app.where.page = ++where.page;
app.reload();
}
},
methods: {
dayjs,
reload() {
const app = this;
const {where, userId} = this;
if (userId === 0) {
app.openLogin();
return;
}
where.uid = uni.getStorageSync('uid');
where.status = 1;
where.sceneType = 'myCardAll';
app.loadMore = 'loading';
Api.pageThinkUsersVip(where)
.then((res) => {
console.log('res: ', res);
const list = res.list.map((d) => {
return d;
});
if (app.cardList.length < res.count) {
app.cardList = app.cardList.concat(list);
app.canReset = true;
app.loadMore = 'no-more';
} else {
app.canReset = false;
app.hideTools = false;
app.loadMore = 'no-more';
}
// uni.hideLoading();
app.isRefresh = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
app.hideTools = false;
app.isRefresh = false;
});
},
onClickItem(e, text) {
const app = this;
const { where, userId } = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
// 全部
if (index == 0) {
where.cardCode = '月/年卡';
}
// 未支付
if (index == 1) {
where.cardCode = '次卡';
}
// 已支付
if (index == 2) {
where.cardCode = '充值卡';
}
app.loadMore = 'loading';
Api.pageThinkUsersVip(where)
.then((res) => {
console.log('res: ', res);
const list = res.list.map((d) => {
return d;
});
if (app.cardList.length < res.count) {
app.cardList = app.cardList.concat(list);
app.canReset = true;
app.loadMore = 'no-more';
} else {
app.canReset = false;
app.hideTools = false;
app.loadMore = 'no-more';
}
// uni.hideLoading();
app.isRefresh = false;
})
.catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
});
app.hideTools = false;
app.isRefresh = false;
});
},
onClickItem(e, text) {
const app = this;
const {where, userId} = this;
const index = e.currentIndex;
if (this.current !== e.currentIndex) {
this.current = e.currentIndex;
}
// 全部
if (index == 0) {
where.cardCode = '月/年卡';
}
// 未支付
if (index == 1) {
where.cardCode = '次卡';
}
// 已支付
if (index == 2) {
where.cardCode = '充值卡';
}
this.where.page = 1;
this.cardList = [];
this.hideTools = true;
this.reload();
},
openUrl(url) {
uni.navigateTo({
url
});
},
toPay(orderId) {
uni.navigateTo({
url: '/package/booking/confirm?id=' + orderId
});
},
closeOrder(item) {
uni.showModal({
title: '确定取消此订单?',
success(o) {
if (o.confirm) {
// Api.updateOrder({
// orderStatus: 2,
// orderId: item.orderId
// })
// .then((msg) => {
// uni.showToast({
// title: msg,
// icon: 'none'
// });
// item.orderStatus = 2;
// })
// .catch(() => {
// uni.showToast({
// title: '请检查您的网络.',
// icon: 'none'
// });
// uni.hideLoading();
// });
}
}
});
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
this.where.page = 1;
this.cardList = [];
this.hideTools = true;
this.reload();
},
openUrl(url) {
uni.navigateTo({
url
});
},
toPay(orderId) {
uni.navigateTo({
url: '/package/booking/confirm?id=' + orderId
});
},
closeOrder(item) {
uni.showModal({
title: '确定取消此订单?',
success(o) {
if (o.confirm) {
// Api.updateOrder({
// orderStatus: 2,
// orderId: item.orderId
// })
// .then((msg) => {
// uni.showToast({
// title: msg,
// icon: 'none'
// });
// item.orderStatus = 2;
// })
// .catch(() => {
// uni.showToast({
// title: '请检查您的网络.',
// icon: 'none'
// });
// uni.hideLoading();
// });
}
}
});
},
// 弹出登录提示框
async openLogin() {
this.userId = uni.getStorageSync('user_id');
if (!this.userId) {
this.$refs.login.open('bottom');
return false;
}
}
}
};
</script>
<style lang="scss">
.content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 380rpx;
text-align: center;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
height: 380rpx;
text-align: center;
}
.segmented {
padding: 0 12rpx;
padding: 0 12rpx;
}
.content-text {
font-size: 14px;
color: #666;
font-size: 14px;
color: #666;
}
.color-tag {
width: 25px;
height: 25px;
width: 25px;
height: 25px;
}
.uni-list {
flex: 1;
flex: 1;
}
.card-list {
.container {
width: 700rpx;
height: 380rpx;
position: relative;
margin: 25rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 20rpx;
box-shadow: 0 0px 6px 0 rgba(0, 0, 0, 0.2);
// background: linear-gradient(to right, #70b915, #008e04);
color: #ffffff;
}
.container {
width: 700rpx;
height: 380rpx;
position: relative;
margin: 25rpx auto;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 20rpx;
box-shadow: 0 0px 6px 0 rgba(0, 0, 0, 0.2);
// background: linear-gradient(to right, #70b915, #008e04);
color: #ffffff;
}
.container::before {
content: '';
display: block;
position: absolute;
border-radius: 20rpx;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000000;
// background: url('https://oss.wsdns.cn/20240528/cf37a247603f489ba23d7d2a53b8da39.jpeg') no-repeat center bottom;
background-size: 100%;
opacity: 0.25; /* 设置透明度 */
}
.container::before {
content: '';
display: block;
position: absolute;
border-radius: 20rpx;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #000000;
// background: url('https://oss.wsdns.cn/20240528/cf37a247603f489ba23d7d2a53b8da39.jpeg') no-repeat center bottom;
background-size: 100%;
opacity: 0.25; /* 设置透明度 */
}
.content {
position: relative;
z-index: 1;
width: 700rpx;
display: flex;
justify-content: space-between;
.merchant-avatar {
margin-left: 24rpx;
}
.card-info {
margin-left: 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
.title-bar {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
}
.web-text-price {
padding-right: 30rpx;
font-size: 36rpx;
color: #fecc66;
}
}
.card-bg {
}
}
.card-item {
width: 700rpx;
margin: 20rpx auto;
border-radius: 20rpx;
position: relative;
// box-shadow: 0 0px 6px 1px rgba($color: #a5a5a5, $alpha: 0.2);
}
// .card-item::before {
// content: ''; /* 伪元素需要内容,即使它是空的 */
// position: absolute;
// top: 0;
// right: 0;
// bottom: 0;
// left: 0;
// background: url('https://oss.wsdns.cn/20240528/d5680e18210544a49dfa79f250f1997d.jpeg');
// background-size: cover; /* 或其他你需要的背景大小 */
// opacity: 0.5; /* 设置透明度 */
// z-index: -1; /* 确保伪元素在内容之下 */
// }
.order-title {
padding: 20rpx 0;
.content {
position: relative;
z-index: 1;
width: 700rpx;
display: flex;
justify-content: space-between;
.merchant-avatar {
margin-right: 12rpx;
}
.merchant-avatar {
margin-left: 24rpx;
}
.card-name {
font-weight: 600;
}
.card-info {
margin-left: 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.title-bar {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
}
.order-body {
padding: 16px 0;
}
.web-text-price {
padding-right: 30rpx;
font-size: 36rpx;
color: #fecc66;
}
}
.card-bg {
}
}
.card-item {
width: 700rpx;
margin: 20rpx auto;
border-radius: 20rpx;
position: relative;
// box-shadow: 0 0px 6px 1px rgba($color: #a5a5a5, $alpha: 0.2);
}
// .card-item::before {
// content: ''; /* 伪元素需要内容,即使它是空的 */
// position: absolute;
// top: 0;
// right: 0;
// bottom: 0;
// left: 0;
// background: url('https://oss.wsdns.cn/20240528/d5680e18210544a49dfa79f250f1997d.jpeg');
// background-size: cover; /* 或其他你需要的背景大小 */
// opacity: 0.5; /* 设置透明度 */
// z-index: -1; /* 确保伪元素在内容之下 */
// }
.order-title {
padding: 20rpx 0;
.merchant-avatar {
margin-right: 12rpx;
}
.card-name {
font-weight: 600;
}
.btn-status {
font-size: 30rpx;
display: flex;
}
}
.order-body {
padding: 16px 0;
}
}
.ele-flex {
display: flex;
justify-content: space-between;
display: flex;
justify-content: space-between;
}
.card-actions {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
height: 45px;
border-top: 1px #eee solid;
}
.card-actions-item {
display: flex;
flex-direction: row;
align-items: center;
display: flex;
flex-direction: row;
align-items: center;
}
.card-actions-item-text {
font-size: 12px;
color: #666;
margin-left: 5px;
font-size: 12px;
color: #666;
margin-left: 5px;
}
.close {
top: 60rpx !important;
top: 60rpx !important;
}
.total-price {
display: flex;
flex-direction: column;
justify-content: flex-start;
font-size: 30rpx;
align-items: flex-start;
padding-left: 6rpx;
margin-left: 450rpx;
display: flex;
flex-direction: column;
justify-content: flex-start;
font-size: 30rpx;
align-items: flex-start;
padding-left: 6rpx;
margin-left: 450rpx;
.web-text-heading {
font-size: 30rpx !important;
}
.web-text-heading {
font-size: 30rpx !important;
}
}
</style>
+9 -3
View File
@@ -106,11 +106,12 @@
const app = this
// 当前登录用户信息
const userInfo = await userStore.fetchUserInfo();
this.userInfo = userInfo
if (Object.keys(userInfo).length > 0) {
app.isLogin = true
app.form = userInfo
// 获取用户副表信息
UserApi.getThinkUsers(uni.getStorageSync('uid')).then(data => {
UserApi.getThinkUsers(userInfo.uid).then(data => {
if (data) {
app.form = Object.assign({}, app.form, data);
}
@@ -159,8 +160,13 @@
})
return false
}
UserApi.updateThinkUsers(this.form).then(res => {
const formData = {
id: this.form.id,
idcard: this.form.idcard,
truename: this.form.truename,
userId: this.userInfo.userId
}
UserApi.updateThinkUsers(formData).then(res => {
uni.showToast({
title: '保存成功',
icon: 'success'
+6
View File
@@ -284,6 +284,12 @@
"navigationBarTitleText": "订单详情"
}
},
{
"path": "order/vipDetail",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "course/index",
"style": {
+30 -30
View File
@@ -34,36 +34,36 @@
</block>
</block>
<view class="card-title web-text-heading">热门项目</view>
<block v-if="itemList.length > 0">
<view class="item-list">
<uni-grid :column="5" :highlight="true" :showBorder="false" @change="onItem">
<uni-grid-item v-for="(item, index) in itemList" :index="index" :key="index">
<view
class="grid-item-box"
style="
background-color: #ffffff;
margin: 10rpx;
border-radius: 10rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 5rem;
"
>
<uv-avatar :src="item.image" :size="27" shape="square" fontSize="16" randomBgColor></uv-avatar>
<text class="text">{{ item.name }}</text>
</view>
</uni-grid-item>
</uni-grid>
</view>
</block>
<block v-else>
<uni-card :border="false" :padding="'12px 4px'">
<uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>
</uni-card>
</block>
<!-- <view class="card-title web-text-heading">热门项目</view>-->
<!-- <block v-if="itemList.length > 0">-->
<!-- <view class="item-list">-->
<!-- <uni-grid :column="5" :highlight="true" :showBorder="false" @change="onItem">-->
<!-- <uni-grid-item v-for="(item, index) in itemList" :index="index" :key="index">-->
<!-- <view-->
<!-- class="grid-item-box"-->
<!-- style="-->
<!-- background-color: #ffffff;-->
<!-- margin: 10rpx;-->
<!-- border-radius: 10rpx;-->
<!-- display: flex;-->
<!-- flex-direction: column;-->
<!-- justify-content: center;-->
<!-- align-items: center;-->
<!-- height: 5rem;-->
<!-- "-->
<!-- >-->
<!-- <uv-avatar :src="item.image" :size="27" shape="square" fontSize="16" randomBgColor></uv-avatar>-->
<!-- <text class="text">{{ item.name }}</text>-->
<!-- </view>-->
<!-- </uni-grid-item>-->
<!-- </uni-grid>-->
<!-- </view>-->
<!-- </block>-->
<!-- <block v-else>-->
<!-- <uni-card :border="false" :padding="'12px 4px'">-->
<!-- <uv-skeleton rows="2" avatar :loading="hideTools" :title="false"></uv-skeleton>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- 商户列表 -->
<view class="card-title web-text-heading">场地预定</view>
+275 -116
View File
@@ -1,21 +1,38 @@
<template>
<view>
<view class="segmented">
<uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor"
inActiveColor="#808080" @clickItem="onClickItem"/>
</view>
<!-- <view class="segmented">-->
<!-- <uni-segmented-control :current="current" :values="items" :styleType="styleType" :activeColor="activeColor"-->
<!-- inActiveColor="#808080" @clickItem="onClickItem"/>-->
<!-- </view>-->
<uv-sticky>
<view class="flex justify-center items-center p-10">
<view class="flex-2 mx-15 flex justify-center" @click="openOrderTypePicker">
<uv-icon name="arrow-down" :label="orderTypeStr" label-pos="left"/>
</view>
<view class="flex-2 mx-15 flex justify-center" @click="openOrderStatusPicker">
<uv-icon name="arrow-down" :label="orderStatusStr" label-pos="left"/>
</view>
<view class="flex-1 mx-15 flex justify-center" @click="reset">
<text class="text-24 text-blue">重置</text>
</view>
</view>
</uv-sticky>
<view class="order">
<block v-if="orderList.length > 0">
<block v-for="(item,index) in orderList" :key="index">
<uni-card :border="false" :is-shadow="false" :padding="0">
<template v-slot:title>
<div class="order-title web-cell">
<view class="web-cell web-cell-content">
<view class="merchant-avatar">
<uv-avatar :src="item.merchantAvatar" size="24"></uv-avatar>
</view>
<view class="web-cell web-cell-content" v-if="orderType === 0">
<text class="merchant-name">{{ item.siteName }}</text>
</view>
<view class="web-cell web-cell-content flex justify-between items-center" v-if="orderType === 1">
<text class="merchant-name">{{ item.siteNames }}</text>
<text class="text-25 text-red" v-if="item.status === 2">待支付</text>
<text class="text-25 text-green" v-else-if="item.status === 1">已支付</text>
<text class="text-25 text-gray" v-else-if="item.status === 3">已退款</text>
<text class="text-25 text-gray" v-else-if="item.status === 0">已取消</text>
</view>
<block v-if="item.orderStatus === 3">
<text class="btn-status web-text-secondary">已取消</text>
</block>
@@ -32,70 +49,93 @@
</div>
</template>
<view class="order-body web-cell web-cell-align-top">
<view class="web-cell-content">
<uv-cell-group :customStyle="{backgroundColor: '#ffffff'}" :border="false">
<view class="web-cell-content" @click="toDetail(item.id)">
<uv-cell-group :customStyle="{backgroundColor: '#ffffff'}" :border="false" v-if="orderType === 0">
<block v-for="(sub,subIndex) in item.thinkOrderInfos" :key="subIndex">
<uv-cell :title="`${item.siteName} - ${sub.fieldName}`" :label="`${sub.dateTime}`"
:cellStyle="{padding: '0', paddingBottom: '5px'}" :border="false"
@click="openUrl(`/package/order/detail?id=${item.id}`)"/>
:cellStyle="{padding: '0', paddingBottom: '5px'}" :border="false"/>
</block>
</uv-cell-group>
<view class="total-price">
<uv-cell-group :customStyle="{backgroundColor: '#ffffff'}" :border="false" v-else-if="orderType === 1">
<uv-cell :title="item.name"
:cellStyle="{padding: '0', paddingBottom: '5px'}" :border="false">
</uv-cell>
</uv-cell-group>
<view class="total-price" v-if="orderType === 0">
<view class="web-text-heading">合计:¥{{ item.totalPrice }}</view>
<view class="web-text-heading" style="font-weight: 500;">
实付:¥{{ item.payPrice }}
</view>
</view>
<view class="total-price" v-else-if="orderType === 1">
<view class="web-text-heading">合计:¥{{ item.price }}</view>
</view>
</view>
</view>
<view slot="actions" class="card-actions">
<view class="card-actions-item" v-if="item.payStatus === 2 && item.orderStatus === 2">
<button class="mini-btn" size="mini" @click="closeOrder(item)"
style="margin-right: 20rpx;">{{ item.payStatus }}取消订单{{item.orderStatus}}
</button>
<button class="mini-btn" type="primary" size="mini"
@click="toPay(item.orderId)">去支付
</button>
</view>
<view class="card-actions-item" v-if="item.payStatus == 1">
<button class="mini-btn" size="mini" v-if="item.isOpen === 2" @click="onInvoice(item.orderId)">
申请开票
</button>
<button class="mini-btn" size="mini" v-else @click="showInvoice(item.id)">查看发票</button>
</view>
<template v-if="orderType === 0">
<view class="card-actions-item" v-if="item.payStatus === 2 && item.orderStatus === 2">
<button class="mini-btn" size="mini" @click="closeOrder(item)"
style="margin-right: 20rpx;">取消订单
</button>
<button class="mini-btn" type="primary" size="mini"
@click="openPayOrder(item.id)">立即支付
</button>
</view>
<view class="card-actions-item" v-if="item.payStatus == 1">
<button class="mini-btn" size="mini" v-if="item.isOpen === 2" @click="onInvoice(item.orderId)">
申请开票
</button>
<button class="mini-btn" size="mini" v-else @click="showInvoice(item.id)">查看发票</button>
</view>
</template>
<template v-else-if="orderType === 1">
<view class="card-actions-item" v-if="item.status === 2">
<button class="mini-btn" size="mini" @click="closeVipOrder(item)"
style="margin-right: 20rpx;">取消订单
</button>
<button class="mini-btn" type="primary" size="mini"
@click="openPay(item.id)">立即支付
</button>
</view>
<view class="card-actions-item" v-if="item.status === 1">
<button class="mini-btn" size="mini" v-if="item.isInvoice === 2" @click="onInvoice(item.id)">
申请开票
</button>
<button class="mini-btn" size="mini" v-else @click="showInvoice(item.id)">查看发票</button>
</view>
</template>
</view>
</uni-card>
</block>
</block>
<!-- <block v-if="orderList.length === 0 && loadMore != 'no-more'">-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- </block>-->
<!-- <block v-if="orderList.length === 0 && loadMore != 'no-more'">-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- <uni-card :border="false" :padding="'18px 6px'">-->
<!-- <uv-skeleton rows="3" avatar :loading="hideTools" :title="false">-->
<!-- </uv-skeleton>-->
<!-- <uv-gap height="16"></uv-gap>-->
<!-- </uni-card>-->
<!-- </block>-->
<uv-empty :show="orderList.length === 0" mode="order" class="none"
icon="https://cdn.uviewui.com/uview/empty/car.png"></uv-empty>
<uni-load-more v-if="orderList.length > 0" :status="loadMore"></uni-load-more>
<!-- 登录组件 -->
<ws-login ref="login" :logo="logo" @done="reload"/>
</view>
<uv-picker ref="orderTypePicker" :columns="[orderTypeList]" keyName="label" @confirm="confirmOrderType"/>
<uv-picker ref="orderStatusPicker" :columns="[orderStatusList]" keyName="label" @confirm="confirmOrderStatus"/>
</view>
</template>
@@ -108,6 +148,9 @@ import {
getWeek,
getKey
} from '@/utils/common';
import {pageThinkOrder, thinkOrderRepay} from "@/api/think/thinkOrder";
import {pageThinkUsersVip, thinkUsersVipRepay, updateThinkUsersVip} from "@/api/think/thinkUsersVip";
import {pageThinkDeposit} from "@/api/think/thinkDeposit";
export default {
components: {},
@@ -142,17 +185,45 @@ export default {
styleType: 'text',
getWeek,
// 骨架屏
hideTools: true
hideTools: true,
orderTypeStr: '订场订单',
orderType: 0,
orderTypeList: [
{
label: '订场订单',
value: 0
},
{
label: '会员卡订单',
value: 1
},
{
label: '押金',
value: 2
},
],
orderStatusList: [
{
label: '未支付',
value: 2
},
{
label: '已支付',
value: 1
}
],
orderStatusStr: '全部状态',
orderStatus: null,
}
},
async onLoad(option) {
this.userId = await uni.getStorageSync('user_id')
// 加载数据
await this.reload()
// if(option.isRefresh){
// this.isRefresh = true
// }
},
// async onLoad(option) {
// this.userId = await uni.getStorageSync('user_id')
// // 加载数据
// await this.reload()
// // if(option.isRefresh){
// // this.isRefresh = true
// // }
// },
async onShow(e) {
this.userId = await uni.getStorageSync('user_id')
await this.reload()
@@ -163,60 +234,72 @@ export default {
const {
where
} = this
console.log(app.canReset)
if (app.canReset) {
app.where.page = ++where.page;
app.reload()
app.where.page += 1;
app.getOrderList()
}
},
methods: {
async reload() {
const app = this
const { where } = this
const uid = uni.getStorageSync('uid')
if (!uid) {
app.orderList = [];
app.loadMore = 'no-more'
return;
openOrderTypePicker() {
this.$refs.orderTypePicker.open()
},
openOrderStatusPicker() {
this.$refs.orderStatusPicker.open()
},
confirmOrderType({value}) {
this.orderType = value[0].value
this.orderTypeStr = value[0].label
this.reload()
},
confirmOrderStatus({value}) {
if (this.orderType === 0) {
this.where.payStatus = value[0].value
} else if (this.orderType === 1) {
this.where.status = value[0].value
} else if (this.orderType === 2) {
this.where.status = value[0].value
}
this.orderStatus = value[0].value
this.orderStatusStr = value[0].label
this.reload()
},
async reload() {
this.loadMore = 'loading'
this.where.page = 1
this.orderList = []
this.$refs.orderTypePicker.close()
await this.getOrderList()
},
async getOrderList() {
let res
if (this.orderType === 0) res = await pageThinkOrder(this.where)
else if (this.orderType === 1) res = await pageThinkUsersVip(this.where)
else if (this.orderType === 2) res = await pageThinkDeposit(this.where)
if (this.orderList.length < res.count) {
this.orderList = this.orderList.concat(res.list)
this.canReset = true
this.loadMore = 'no-more'
} else {
this.canReset = false;
this.loadMore = 'no-more'
}
where.uid = uid;
app.loadMore = 'loading'
OrderApi.pageThinkOrder(where).then(res => {
const list = res.list.map(d => {
return d;
});
if (app.orderList.length < res.count) {
app.orderList = app.orderList.concat(list)
app.canReset = true
app.loadMore = 'no-more'
} else {
app.canReset = false;
app.loadMore = 'no-more'
}
uni.hideLoading()
app.isRefresh = false
}).catch(() => {
uni.showToast({
title: '请检查您的网络.',
icon: 'none'
})
uni.hideLoading()
app.isRefresh = false
})
},
async onClickItem(e) {
const app = this
this.uid = await uni.getStorageSync('uid')
// this.uid = await uni.getStorageSync('uid')
const {
where,
uid
// uid
} = this
if (app.uid === 0 || !app.uid) {
console.log(app.uid,'>>>>>>>2',app.uid)
app.orderList = [];
app.loadMore = 'no-more'
return;
}
// if (app.uid === 0 || !app.uid) {
// console.log(app.uid, '>>>>>>>2', app.uid)
// app.orderList = [];
// app.loadMore = 'no-more'
// return;
// }
const index = e.currentIndex
if (this.current !== e.currentIndex) {
@@ -243,18 +326,18 @@ export default {
where.orderStatus = 1;
}
// 押金
if (index === 4) {
pageThinkWechatDeposit({
uid: uni.getStorageSync('user_id')
}).then(res => {
app.orderList = res.list;
if (res.count === 0) {
app.loadMore = 'no-more'
}
uni.hideLoading()
})
return false
}
// if (index === 4) {
// pageThinkWechatDeposit({
// uid: uni.getStorageSync('user_id')
// }).then(res => {
// app.orderList = res.list;
// if (res.count === 0) {
// app.loadMore = 'no-more'
// }
// uni.hideLoading()
// })
// return false
// }
this.where.page = 1;
this.orderList = [];
this.reload()
@@ -312,6 +395,82 @@ export default {
uni.navigateTo({
url: `/package/user/invoice-show?id=${id}`
})
},
async closeVipOrder({id}) {
await updateThinkUsersVip({id, status: 0})
await uni.showToast({
title: '取消成功',
icon: 'none'
})
await this.reload()
},
toDetail(id) {
let url
if (this.orderType === 0) url = `/package/order/detail?id=${id}`
else if (this.orderType === 1) url = `/package/order/vipDetail?id=${id}`
else if (this.orderType === 2) url = `/package/order/detail?id=${id}`
uni.navigateTo({url})
},
async openPay(id) {
const orderInfo = await thinkUsersVipRepay({id})
const _this = this
uni.requestPayment({
provider: orderInfo.provider, // 服务提供商
timeStamp: orderInfo.timeStamp, // 时间戳
nonceStr: orderInfo.nonceStr, // 随机字符串
package: orderInfo.package,
signType: orderInfo.signType, // 签名算法
paySign: orderInfo.paySign, // 签名
success: function (res) {
// 业务逻辑。。。
uni.showToast({
title: '支付成功',
icon: 'success'
});
setTimeout(function () {
_this.reload()
}, 1500);
},
fail: function (err) {
console.log('支付失败', err);
}
})
},
async openPayOrder(id) {
const orderInfo = await thinkOrderRepay({id})
const _this = this
uni.requestPayment({
provider: orderInfo.provider, // 服务提供商
timeStamp: orderInfo.timeStamp, // 时间戳
nonceStr: orderInfo.nonceStr, // 随机字符串
package: orderInfo.package,
signType: orderInfo.signType, // 签名算法
paySign: orderInfo.paySign, // 签名
success: function (res) {
// 业务逻辑。。。
uni.showToast({
title: '支付成功',
icon: 'success'
});
setTimeout(function () {
_this.reload()
}, 1500);
},
fail: function (err) {
console.log('支付失败', err);
}
})
},
reset(){
this.where = {
page: 1
}
this.orderList = []
this.orderType = 0
this.orderTypeStr = '订场订单'
this.orderStatus = null
this.orderStatusStr = '全部状态'
this.reload()
}
}
}
@@ -24,7 +24,7 @@
</template>
<template v-else>
<button class="btn-normal" type="primary" open-type="getPhoneNumber"
@getphonenumber="handelMpWeixinMobileLogin($event)" @click="clickPhoneNumber">
@getphonenumber="handelMpWeixinMobileLogin($event)">
<view class="wechat-auth-container">
<text class="title">手机号快捷登录</text>
</view>
@@ -68,16 +68,17 @@
@click.stop="navTo('/package/article/detail?articleId=501')">《广西体育中心预定条款》
</text>
<text
class="link"
@click.stop="navTo('/package/article/detail?articleId=502')">《用户服务协议和隐私政策》
class="link"
@click.stop="navTo('/package/article/detail?articleId=502')">《用户服务协议和隐私政策》
</text>
</view>
</view>
</view>
<view class="close text-gray-800" @click="closeLogin">
<uv-icon name="close-circle" size="30"></uv-icon>
</view>
</view>
<view class="close-wrap text-gray-800" @click="closeLogin">
<uv-icon name="close-circle" size="30"></uv-icon>
</view>
</view>
</uni-popup>
@@ -92,6 +93,7 @@ import {
storeToRefs
} from 'pinia';
import {updateUsers} from "@/api/shop/users";
import {addThinkUsers} from "@/api/think/thinkUsers";
const mpStore = useMpStore();
const cartStore = useCartStore();
@@ -239,12 +241,17 @@ export default {
detail
} = e;
const app = this
uni.showLoading({
title: '登录中'
})
if (detail.errMsg != 'getPhoneNumber:ok') {
console.log('微信授权获取手机号失败', detail.errMsg)
uni.hideLoading()
return false
}
if (detail.errMsg == 'getPhoneNumber:ok') {
app.isLoading = true
const authCode = await this.getCode()
Api.loginMpWxMobile({
code: detail.code,
encryptedData: detail.encryptedData,
@@ -252,8 +259,11 @@ export default {
isParty: app.isParty,
partyData: app.partyData,
refereeId: Number(uni.getStorageSync('refereeId')),
comments: uni.getStorageSync('DelistingQrcode') ? '脱单邮局' : null
comments: uni.getStorageSync('DelistingQrcode') ? '脱单邮局' : null,
authCode
}).then(res => {
uni.hideLoading()
console.log('res', res)
if (res.access_token) {
uni.showToast({
title: '登录成功',
@@ -262,33 +272,33 @@ export default {
cartStore.isLogin = true
uni.setStorageSync('access_token', res.access_token)
uni.setStorageSync('user_id', res.user.userId)
uni.setStorageSync('phone',res.user.phone)
if(!uni.getStorageSync('phone')){
const phone = res.user.phone;
console.log('授权手机号码一键登录>>>',phone)
updateUsers({
id: uni.getStorageSync('uid'),
phone: phone
}).then(res => {
uni.setStorageSync('phone',phone)
}).finally(() => {
})
}
uni.setStorageSync('phone', res.user.phone)
const phone = res.user.phone;
console.log('授权手机号码一键登录>>>', phone)
addThinkUsers({
phone: phone,
openId: res.user.openid,
userId: res.user.userId,
}).then(res => {
uni.setStorageSync('phone', phone)
}).finally(() => {
})
setTimeout(() => {
this.$refs.login.close()
this.$emit('done', res)
}, 500)
}
})
.catch(err => {
uni.showToast({
title: '登录失败',
icon: 'none'
})
console.log('err: ', err);
})
.finally(e => {
.catch(err => {
uni.hideLoading()
uni.showToast({
title: '登录失败',
icon: 'none'
})
console.log('err: ', err);
})
.finally(e => {
})
}
},
getCode() {
@@ -365,6 +375,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
.center {
@@ -420,10 +431,10 @@ export default {
}
}
.close {
width: 750rpx;
position:fixed;
bottom: 100rpx;
.close-wrap {
position: absolute;
left: 30rpx;
top: 30rpx;
text-align: center;
display: flex;
justify-content: center;
@@ -14,9 +14,6 @@
<view class="userid">
<view class="text">{{ data.mobile }}</view>
</view>
<view class="flex flex-col justify-center items-center" @click="scan">
<uv-icon name="scan" size="58rpx" label="提货扫码" label-pos="bottom" label-size="24rpx" space="0"/>
</view>
</view>
<view class="nickname-box" v-else>
<view class="nickname">点击登录</view>