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