新增邮储音视频的分支
|
@ -1,5 +1,4 @@
|
||||||
NODE_ENV = 'development'
|
NODE_ENV = 'development'
|
||||||
# 邮储奶茶活动
|
|
||||||
VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
|
||||||
# 邮储音视频
|
# 邮储音视频
|
||||||
# VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn/ycav'
|
VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn/ycav'
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
|
|
||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
# 邮储奶茶活动(正式环境)
|
|
||||||
VITE_BASE_URL = 'https://milk.api.cdlsxd.cn'
|
|
||||||
VITE_YCNC_MERCH_CODE = '100510102303326'
|
|
||||||
|
|
||||||
# 邮储音视频活动(生产环境)
|
# 邮储音视频活动(生产环境)
|
||||||
# VITE_BASE_URL = 'https://mv.h5.cdlsxd.cn'
|
VITE_BASE_URL = 'https://mv.h5.cdlsxd.cn'
|
||||||
# VITE_YCNC_MERCH_CODE = '100510102303326'
|
VITE_YCNC_MERCH_CODE = '100510102303326'
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
NODE_ENV = 'test'
|
NODE_ENV = 'test'
|
||||||
|
|
||||||
# 邮储奶茶活动(测试环境)
|
|
||||||
VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
|
||||||
VITE_YCNC_MERCH_CODE = '100310100018908'
|
|
||||||
|
|
||||||
|
|
||||||
# 邮储音视频活动(测试环境)
|
# 邮储音视频活动(测试环境)
|
||||||
# VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn'
|
VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn'
|
||||||
# VITE_YCNC_MERCH_CODE = '100310100018908'
|
VITE_YCNC_MERCH_CODE = '100310100018908'
|
|
@ -4,8 +4,7 @@ import path from 'path'
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pages:'./src/pages',
|
pages:'./src/pages',
|
||||||
// pagesInclude:['ycysp/home.vue','ycysp/pay.vue','ycysp/order.vue','ycysp/orderDetail.vue',]
|
pagesInclude:['ycysp/home.vue','ycysp/pay.vue','ycysp/order.vue','ycysp/orderDetail.vue',]
|
||||||
pagesInclude:['ycnc']
|
|
||||||
}
|
}
|
||||||
const { pages, pagesInclude } = config
|
const { pages, pagesInclude } = config
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
import http from "../utils/http";
|
|
||||||
|
|
||||||
export const login = (params) => http({
|
|
||||||
url:'/v1/xy/login',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getProduceList = (params) => http({
|
|
||||||
url:'/v1/auth/activity',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const goBuy = (params) => http({
|
|
||||||
url:'/v1/auth/order/buy',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getTicketList = (params) => http({
|
|
||||||
url:'/v1/auth/order/list',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const queryOrder = (params) => http({
|
|
||||||
url:'/v1/auth/order/query',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
import http from "../utils/http";
|
|
||||||
|
|
||||||
|
|
||||||
export const login = (params) => http({
|
|
||||||
url:'/api/v1/UnionLogin',
|
|
||||||
method:'POST',
|
|
||||||
noToken:true,
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getProductList = (params) => http({
|
|
||||||
url:'/api/v1/VoucherList',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const queryDetail = (params) => http({
|
|
||||||
url:'/api/v1/product/detail',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getOrderList = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/list',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const goPay = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/create',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const queryOrderDetail = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/query',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const deleteOrder = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/delete',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
export const refundOrder = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/refund',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//查询订单状态,主要针对短连接
|
|
||||||
export const queryOrderState = (params) => http({
|
|
||||||
url:'/api/v1/auth/order/state',
|
|
||||||
method:'POST',
|
|
||||||
...params
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,25 +1,16 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
{
|
||||||
"path": "pages/ycnc/index",
|
"path": "pages/ycysp/home",
|
||||||
"type": "home",
|
"type": "home",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "奶茶活动",
|
"navigationBarTitleText": "音视频专区",
|
||||||
"navigationBarBackgroundColor": "#FFF"
|
"navigationBarBackgroundColor": "#FFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/ycnc/detail",
|
"path": "pages/ycysp/order",
|
||||||
"type": "page",
|
|
||||||
"style": {
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"navigationBarTitleText": "商品详情",
|
|
||||||
"navigationBarBackgroundColor": "#FFF"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/ycnc/order",
|
|
||||||
"type": "page",
|
"type": "page",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
@ -28,13 +19,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/ycnc/orderDetail",
|
"path": "pages/ycysp/orderDetail",
|
||||||
"type": "page",
|
"type": "page",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "订单详情",
|
"navigationBarTitleText": "订单详情",
|
||||||
"navigationBarBackgroundColor": "#FFF"
|
"navigationBarBackgroundColor": "#FFF"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/ycysp/pay",
|
||||||
|
"type": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "支付确认",
|
||||||
|
"navigationBarBackgroundColor": "#FFF"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="product-container">
|
|
||||||
<view class="product-tips">
|
|
||||||
支付享立减1元
|
|
||||||
</view>
|
|
||||||
<view class="product-price display">
|
|
||||||
<view class="price">
|
|
||||||
¥<text>{{detail.price}}</text>/{{detail.brand}}
|
|
||||||
</view>
|
|
||||||
<view class="ori">
|
|
||||||
原价{{detail.show_price}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="product-type display">
|
|
||||||
{{detail.name}}
|
|
||||||
</view>
|
|
||||||
<view class="product-btn" @click="$emit('buy-event',detail)">
|
|
||||||
立即购买
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
detail:{
|
|
||||||
type:Object,
|
|
||||||
require:true,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.product-container{
|
|
||||||
width:292rpx;
|
|
||||||
height:318rpx;
|
|
||||||
background: url('../../../static/xyyk/bg-product.png') no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
margin-top:30rpx;
|
|
||||||
.product-tips{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #B05619;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-left:40rpx;
|
|
||||||
}
|
|
||||||
.display{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.product-price{
|
|
||||||
color: #FD613F;
|
|
||||||
.price{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 40rpx;
|
|
||||||
text{
|
|
||||||
font-weight:bold;
|
|
||||||
font-size: 60rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ori{
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #E18B72;
|
|
||||||
font-weight:400;
|
|
||||||
text-decoration-line: line-through;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.product-type{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
margin-top:40rpx;
|
|
||||||
}
|
|
||||||
.product-btn{
|
|
||||||
width: 218rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
background: linear-gradient( 90deg, #FFD888 0%, #FFE39E 100%);
|
|
||||||
border-radius: 30rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #A83203;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 60rpx;
|
|
||||||
margin:16rpx auto 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,80 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="ticket-container">
|
|
||||||
<view class="ticket-type">{{detail.product_name}}</view>
|
|
||||||
<view class="ticket-content">
|
|
||||||
<image src="../../../static/xyyk/icon-ticket.png" mode=""></image>
|
|
||||||
<view class="ticket-name">{{detail.product_name}}</view>
|
|
||||||
<view class="ticket-btn" @click="$emit('view-event',detail)">
|
|
||||||
立即查看
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
detail:{
|
|
||||||
type:Object,
|
|
||||||
require:true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.ticket-container{
|
|
||||||
width: 694rpx;
|
|
||||||
height: 240rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #1A1A1A;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding:32rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-top:32rpx;
|
|
||||||
.ticket-type{
|
|
||||||
width:100%;
|
|
||||||
height:32rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #1A1A1A;
|
|
||||||
line-height: 32rpx;
|
|
||||||
}
|
|
||||||
.ticket-content{
|
|
||||||
height:92rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
image{
|
|
||||||
width:92rpx;
|
|
||||||
height:92rpx;
|
|
||||||
margin-right: 22rpx;
|
|
||||||
}
|
|
||||||
.ticket-name{
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
width:50%;
|
|
||||||
overflow: hidden; /* 隐藏溢出内容 */
|
|
||||||
text-overflow: ellipsis; /* 当文本溢出时显示省略号 */
|
|
||||||
white-space: nowrap; /* 禁止文本换行 */
|
|
||||||
}
|
|
||||||
.ticket-btn{
|
|
||||||
position: absolute;
|
|
||||||
right:0;
|
|
||||||
width: 150rpx;
|
|
||||||
height: 54rpx;
|
|
||||||
background: #47A5FF;
|
|
||||||
border-radius: 27rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
text-align: center;
|
|
||||||
line-height:54rpx ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,241 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="container">
|
|
||||||
<image class="title" src="../../static/xyyk/bg-title.png" mode="widthFix"></image>
|
|
||||||
<view class="tips">
|
|
||||||
支付享立减1元
|
|
||||||
</view>
|
|
||||||
<view class="tickets" @click="toTickets">
|
|
||||||
我的券包
|
|
||||||
</view>
|
|
||||||
<view class="bottom-banner">
|
|
||||||
<view class="banner-title">
|
|
||||||
兑换商品列表
|
|
||||||
</view>
|
|
||||||
<view class="banner-tips">
|
|
||||||
<view>兴业优酷半价购送周卡</view>
|
|
||||||
<view><text class="line"></text>支付享立减1元<text class="line"></text></view>
|
|
||||||
</view>
|
|
||||||
<scroll-view class="banner-content" scroll-y>
|
|
||||||
<view class="banner-container">
|
|
||||||
<view v-for="(item,index) in products" :key="item.id">
|
|
||||||
<ProductItem :detail="item" @buy-event="handleBuy"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<uni-popup ref="popupRef" type="center" :is-mask-click="false" :mask-click="false">
|
|
||||||
<view class="popup-content">
|
|
||||||
<view class="popup-title">购买{{payResult ? '成功' : '失败'}}</view>
|
|
||||||
<view class="popup-tips" v-if="payResult">恭喜购买成功,请稍后查看结果</view>
|
|
||||||
<view class="popup-tips" v-else>支付失败了</view>
|
|
||||||
<view class="btn" @click="closePopup">
|
|
||||||
确定
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, ref } from 'vue';
|
|
||||||
import ProductItem from './components/product-item';
|
|
||||||
import {getQueryString} from '../../utils/utils';
|
|
||||||
import {login,getProduceList,goBuy,queryOrder} from '../../api/xyyk';
|
|
||||||
const popupRef = ref(null);
|
|
||||||
const products = ref([]);
|
|
||||||
const payResult = ref(false);
|
|
||||||
const orderNo = "SN202406131136518803"
|
|
||||||
const code = 'MDQ4MDM2ZWYwNzUxYmMwYmM3YTk4ZjdmNjEzZWNmOGNjZDk0OGQ5ZjM0NjY1NjY1NDMyYjY2MzVmNjkwZTE5MjU1MTdhOTc1MDkzOGVhMWJhNDE5YWVlMjQ5NGMwZjFmMTg4NzgyZDBiN2UyOGYwZDFjNzIzOGIzOTQ1ZGRiMWU0M2FiNjhjOTRlZjEyODE1MmM5NjIyMTQzZTBhYmQzZGFiOTRjM2ZhNTNlYTVlYTRiOGY0ZTIxZjFkN2I4ZjFlYzBmODQ1NzlmYTY2MDJmMmViZDIxMzc4ZDMwMmM1OGExZTZiMTQ1N2Y0MjY5NWJlNDRhZWU5YzE5OTViMmQ1MjAxNWY5NWM4ZTQ0OGI2NGEyZDI5MTkyNWNkZjA0YWIwZjFlZGE3MGJmZjk3YzViZTYwNTYzZDgxMjk2YmE5MWE4ZDQ0ZDZiZGY3MmJlMzdmN2NmMjI3YjU5NmQwNmMwYWM4MmZkYjc5MTk0MmRlNzE0NWU3ZmYxMGNkNjhmN2RhODMwMzU3NGUzMTM0ZGU3OTc1NWIwNDM0ODBmMjdlMzliZDEwZjViNWI4OTE1N2RhN2EzNmU5ZGNmZjQ3NzhiYjBhOGFmOTNlNTM2M2NiNmIzY2UwODJjZDU5NzFjMTVmZGI2ZA=='
|
|
||||||
|
|
||||||
onMounted(()=>{
|
|
||||||
//页面连接中带code代表第一次进入页面,带订单号代表支付回调回来进入页面
|
|
||||||
const code = getQueryString('code');
|
|
||||||
const orderNo = getQueryString('order_no');
|
|
||||||
// if(code){
|
|
||||||
// getProductConfig()
|
|
||||||
// }else if(orderNo){
|
|
||||||
// queryOrderStatus()
|
|
||||||
// }
|
|
||||||
getProductConfig()
|
|
||||||
})
|
|
||||||
|
|
||||||
const getProductConfig = async () => {
|
|
||||||
const params = {data:code}
|
|
||||||
const resData = await login({params})
|
|
||||||
uni.setStorageSync('token',resData.token);
|
|
||||||
const productConfig = await getProduceList();
|
|
||||||
const {name,description,product} = productConfig;
|
|
||||||
products.value = product;
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryOrderStatus = () => {
|
|
||||||
const params = {
|
|
||||||
order_no:orderNo
|
|
||||||
}
|
|
||||||
queryOrder({params}).then(res => {
|
|
||||||
const {state} = res
|
|
||||||
payResult.value = state == '2' ? true : false;
|
|
||||||
popupRef.value.open()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleBuy = (item) => {
|
|
||||||
const {id} = item;
|
|
||||||
const params = {product_id:id}
|
|
||||||
goBuy({params}).then(res => {
|
|
||||||
const {payToken,payOrderId,mchtOrderId} = res;
|
|
||||||
window.location.href = payToken;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const toTickets = () => {
|
|
||||||
uni.navigateTo({url:'/pages/xyyk/tickets'})
|
|
||||||
}
|
|
||||||
|
|
||||||
const closePopup = () => {
|
|
||||||
popupRef.value.close()
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.container{
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
width:100vw;
|
|
||||||
height:100vh;
|
|
||||||
background: url('../../static/xyyk/bg.png') no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
.title{
|
|
||||||
width:640rpx;
|
|
||||||
margin: 32rpx auto 0;
|
|
||||||
}
|
|
||||||
.tips{
|
|
||||||
width: 215rpx;
|
|
||||||
height: 42rpx;
|
|
||||||
background: linear-gradient( 90deg, #E5F5FF 0%, #FFFEFF 100%);
|
|
||||||
border-radius: 21rpx;
|
|
||||||
margin-top:16rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #00A5EB;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 42rpx;
|
|
||||||
}
|
|
||||||
.tickets{
|
|
||||||
position: fixed;
|
|
||||||
right:0;
|
|
||||||
top:150rpx;
|
|
||||||
width: 102rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
background: linear-gradient( 90deg, #E7F6FF 0%, #FEFEFF 100%);
|
|
||||||
border-radius: 52rpx 0px 0px 52rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #00A5EB;
|
|
||||||
line-height: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 28rpx;
|
|
||||||
}
|
|
||||||
.bottom-banner{
|
|
||||||
position: absolute;
|
|
||||||
bottom:10rpx;
|
|
||||||
width:730rpx;
|
|
||||||
height:620rpx;
|
|
||||||
background: url('../../static/xyyk/bg-banner.png') no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.banner-title{
|
|
||||||
width:350rpx;
|
|
||||||
height:78rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 78rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
margin:0 auto;
|
|
||||||
padding-left:50rpx;
|
|
||||||
}
|
|
||||||
.banner-tips{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
margin-top:30rpx;
|
|
||||||
.line{
|
|
||||||
display: block;
|
|
||||||
width: 40rpx;
|
|
||||||
height: 0;
|
|
||||||
border: 1rpx solid #3F85BC;
|
|
||||||
&:first-child{
|
|
||||||
margin-right:14rpx;
|
|
||||||
}
|
|
||||||
&:last-child{
|
|
||||||
margin-left:14rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
> :first-child{
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #135BC3;
|
|
||||||
}
|
|
||||||
> :last-child{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #3F85BC;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.banner-content{
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding:0 60rpx 40rpx;
|
|
||||||
flex:1;
|
|
||||||
overflow: auto;
|
|
||||||
.banner-container{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.popup-content{
|
|
||||||
width:578rpx;
|
|
||||||
height:700rpx;
|
|
||||||
background: url("../../static/xyyk/bg-popup.png") no-repeat;
|
|
||||||
background-size:100% 700rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-top:290rpx;
|
|
||||||
.popup-title{
|
|
||||||
font-weight:700;
|
|
||||||
color:#111B1F;
|
|
||||||
font-size:60rpx;
|
|
||||||
margin-top:24rpx;
|
|
||||||
}
|
|
||||||
.popup-tips{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #00A5EB;
|
|
||||||
margin-top:34rpx;
|
|
||||||
opacity: .6;
|
|
||||||
}
|
|
||||||
.btn{
|
|
||||||
width: 236rpx;
|
|
||||||
height: 72rpx;
|
|
||||||
background: linear-gradient( 180deg, #57C3FB 7%, #2D98F7 100%);
|
|
||||||
border-radius: 36rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 72rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
margin-top:100rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,66 +0,0 @@
|
||||||
<template>
|
|
||||||
<scroll-view scroll-y="true" class="container" @scrolltolower="getNextPage">
|
|
||||||
<view class="wrapper">
|
|
||||||
<view v-for="(item,index) in list" :key="item.id">
|
|
||||||
<TicketItem :detail="item" @view-event="handleView"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { onMounted , ref, unref } from 'vue';
|
|
||||||
import TicketItem from './components/ticket-item';
|
|
||||||
import {getTicketList} from '../../api/xyyk';
|
|
||||||
|
|
||||||
const page = ref(1);
|
|
||||||
const pageSize = 10;
|
|
||||||
const total = ref(0);
|
|
||||||
const list = ref([]);
|
|
||||||
|
|
||||||
onMounted(()=> {
|
|
||||||
const params = {
|
|
||||||
page:unref(page),
|
|
||||||
pageSize:unref(pageSize)
|
|
||||||
}
|
|
||||||
getTicketList({params}).then(res => {
|
|
||||||
const {count,data} = res
|
|
||||||
total.value = count;
|
|
||||||
list.value = data;
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const isLastPage = () => unref(page) === Math.ceil(unref(total) / pageSize)
|
|
||||||
|
|
||||||
const getNextPage = () => {
|
|
||||||
if(isLastPage()){
|
|
||||||
console.log('已经是最后一页');
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
const params = {
|
|
||||||
page:unref(page) + 1,
|
|
||||||
pageSize:unref(pageSize),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleView = (item) => {
|
|
||||||
const {voucher_link} = item
|
|
||||||
console.log(item)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.container{
|
|
||||||
width:100vw;
|
|
||||||
height:100vh;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
overflow-y: auto;
|
|
||||||
.wrapper{
|
|
||||||
width:100%;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom:32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,59 +0,0 @@
|
||||||
<template>
|
|
||||||
<scroll-view scroll-y class="pro-container box-border" :style="{backgroundImage: 'url('+config[brandName]?.src+')',height:`${config[brandName].height}rpx`}">
|
|
||||||
<view class="pro-wrapper flex flex-wrap">
|
|
||||||
<view v-for="(item,index) in products" :key="index" class="product-container">
|
|
||||||
<ProductItem :detail="item" :index="index"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import ProductItem from './product-item'
|
|
||||||
import config from '../config'
|
|
||||||
const props = defineProps({
|
|
||||||
products:{
|
|
||||||
type:Array,
|
|
||||||
required: true,
|
|
||||||
default:() => ([])
|
|
||||||
},
|
|
||||||
brandName:{
|
|
||||||
type:String,
|
|
||||||
required:true,
|
|
||||||
default:''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.pro-container{
|
|
||||||
width:780rpx;
|
|
||||||
padding: 136rpx 60rpx 72rpx;
|
|
||||||
// margin-bottom: -24rpx;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: contain;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.pro-wrapper{
|
|
||||||
.product-container{
|
|
||||||
width: calc((100% - 40rpx) / 3);
|
|
||||||
margin-right: 20rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
// view:nth-child(3n) > .pro-item-wrapper{
|
|
||||||
// margin-right:0 !important;
|
|
||||||
// }
|
|
||||||
view:nth-child(3n) {
|
|
||||||
margin-right:0 !important;
|
|
||||||
}
|
|
||||||
// view:nth-child(3n+1):nth-last-child(-n+3) > .pro-item-wrapper,
|
|
||||||
// view:nth-child(3n+1):nth-last-child(-n+3)~view > .pro-item-wrapper{
|
|
||||||
// margin-bottom: 0 !important;
|
|
||||||
// }
|
|
||||||
view:nth-child(3n+1):nth-last-child(-n+3),
|
|
||||||
view:nth-child(3n+1):nth-last-child(-n+3)~view{
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,178 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="order-item-wrapper flex flex-col box-border" @click="goDetail">
|
|
||||||
<view class="nav-info flex flex-justify-between" >
|
|
||||||
<view>订单编号:{{ detail.order_no }}</view>
|
|
||||||
<view :style="{color:stateColor[detail.state] || ''}">{{ stateConfig[detail.state] }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="order-info">
|
|
||||||
<view class="content flex">
|
|
||||||
<image
|
|
||||||
:src="detail.main_image"
|
|
||||||
class="pro-img"
|
|
||||||
/>
|
|
||||||
<view class="flex flex-1 flex-col">
|
|
||||||
<view class="flex flex-justify-between name info-item">
|
|
||||||
<view class="text-over">{{ detail.product_name }}</view>
|
|
||||||
<view class="amount"><text>¥</text>{{ detail.price }}<text>元</text></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex flex-justify-between num">
|
|
||||||
<view>数量</view>
|
|
||||||
<view>x1</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="time">下单时间:{{ detail.create_time }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="btns flex flex-justify-end">
|
|
||||||
<view class="btn del" @click="goDel">删除订单</view>
|
|
||||||
<view class="btn pay" v-if="[1].includes(detail.state)" @click="goPay">立即付款</view>
|
|
||||||
<view class="btn view" v-if="[3].includes(detail.state) && !!detail.voucher_link" @click="goPwd">查看卡券</view>
|
|
||||||
<view class="btn pay" @click="goRefund" v-if="[4].includes(detail.state)">申请退款</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { stateConfig, stateColor } from '../config';
|
|
||||||
const props = defineProps({
|
|
||||||
detail:{
|
|
||||||
type:Object,
|
|
||||||
required: true,
|
|
||||||
default:() => ({})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const emits = defineEmits(['pay-event','detail-event','pwd-event','del-event'])
|
|
||||||
|
|
||||||
function goPay(e){
|
|
||||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
emits('pay-event', props.detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function goDetail(e){
|
|
||||||
emits('detail-event', props.detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
function goPwd(e){
|
|
||||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
emits('pwd-event', props.detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
function goDel(e){
|
|
||||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
emits('del-event', props.detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
function goRefund(e){
|
|
||||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
emits('refund-event', props.detail);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.order-item-wrapper{
|
|
||||||
width: 702rpx;
|
|
||||||
// height: 386rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
padding:24rpx;
|
|
||||||
margin:24rpx 0 16rpx;
|
|
||||||
}
|
|
||||||
.nav-info{
|
|
||||||
font-size:22rpx;
|
|
||||||
font-weight:400;
|
|
||||||
:first-child{
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
:last-child{
|
|
||||||
color: #787878;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.order-info{
|
|
||||||
margin-top:24rpx;
|
|
||||||
.content{
|
|
||||||
margin-bottom:24rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
.pro-img{
|
|
||||||
display: block;
|
|
||||||
width:90rpx;
|
|
||||||
height:90rpx;
|
|
||||||
margin-right:34rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.time{
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #6C6C6C;
|
|
||||||
}
|
|
||||||
.info-item{
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom:12rpx;
|
|
||||||
}
|
|
||||||
.text-over{
|
|
||||||
max-width:80%;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
.amount{
|
|
||||||
color: #333333;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size:24rpx;
|
|
||||||
text:nth-child(1){
|
|
||||||
font-size:20rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
text:nth-child(2){
|
|
||||||
font-size:22rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #333333;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
.num{
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #9E9E9E;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btns{
|
|
||||||
border-top: 1rpx solid #F0E1E1;
|
|
||||||
padding:36rpx 0 12rpx;
|
|
||||||
margin-top:24rpx;
|
|
||||||
.btn{
|
|
||||||
width: 168rpx;
|
|
||||||
height: 64rpx;
|
|
||||||
border-radius: 68rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-left:48rpx;
|
|
||||||
}
|
|
||||||
.del{
|
|
||||||
color: #545454;
|
|
||||||
border: 2rpx solid #B9C8C7;
|
|
||||||
}
|
|
||||||
.pay{
|
|
||||||
color: #FFFFFF;
|
|
||||||
background: #EA0000;
|
|
||||||
}
|
|
||||||
.view{
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 68rpx;
|
|
||||||
border: 2rpx solid #EA0000;
|
|
||||||
color:#EA0000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,131 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="pro-item-wrapper flex flex-col box-border flex-justify-between" @click="toDetail">
|
|
||||||
<view class="img-container">
|
|
||||||
<image
|
|
||||||
:src="detail?.voucherIcon"
|
|
||||||
mode="scaleToFill"
|
|
||||||
class="img"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view class="bottom-container">
|
|
||||||
<view class="brand">{{ config[detail.brandFlag].name}}</view>
|
|
||||||
<view class="name">{{ detail.voucherTitle }}</view>
|
|
||||||
<view class="flex flex-justify-between flex-items-end">
|
|
||||||
<view class="price">{{ detail.voucherAmount }}<text>元</text>
|
|
||||||
</view>
|
|
||||||
<view class="ori">{{ detail.voucherOriginalPrice }}</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn flex flex-justify-center flex-items-center">
|
|
||||||
<view class="btn-content flex flex-justify-center flex-items-center" @click="goBuy">点击购买</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { inject } from 'vue';
|
|
||||||
import config from '../config'
|
|
||||||
const { handleBuy, goDetail } = inject('custom-events')
|
|
||||||
const props = defineProps({
|
|
||||||
detail:{
|
|
||||||
type:Object,
|
|
||||||
required: true,
|
|
||||||
default:() => ({})
|
|
||||||
},
|
|
||||||
index:{
|
|
||||||
type:Number,
|
|
||||||
required:true,
|
|
||||||
default:0,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const goBuy = (e) => {
|
|
||||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
handleBuy(props.detail)
|
|
||||||
}
|
|
||||||
const toDetail = () => {
|
|
||||||
goDetail(props.detail)
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.pro-item-wrapper{
|
|
||||||
// width:206rpx;
|
|
||||||
width:100%;
|
|
||||||
height:370rpx;
|
|
||||||
background: url('/static/ycnc/bg-product.png') no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
padding: 6rpx 6rpx 10rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.bottom-container{
|
|
||||||
overflow: hidden;
|
|
||||||
flex:1;
|
|
||||||
padding: 18rpx 8rpx 0;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
// justify-content: space-between;
|
|
||||||
}
|
|
||||||
.brand{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #887F6E;
|
|
||||||
}
|
|
||||||
.img-container{
|
|
||||||
width:100%;
|
|
||||||
height:150rpx !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 18rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
.img{
|
|
||||||
width:100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.name{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #3B2609;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin:10rpx 0 6rpx;
|
|
||||||
}
|
|
||||||
.price{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #F71924;
|
|
||||||
text{
|
|
||||||
font-size: 18rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ori{
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #888365;
|
|
||||||
text-decoration: line-through;
|
|
||||||
text{
|
|
||||||
font-size: 16rpx;
|
|
||||||
// text-decoration: line-through;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btn{
|
|
||||||
width: 166rpx;
|
|
||||||
height: 56rpx;
|
|
||||||
background: linear-gradient( 180deg, #FFF8EA 0%, #FFD9BC 100%);
|
|
||||||
box-shadow: 0rpx 1 2rpx 0rpx #FAD5A8;
|
|
||||||
border-radius: 28rpx;
|
|
||||||
margin-top:20rpx;
|
|
||||||
.btn-content {
|
|
||||||
width: 158rpx;
|
|
||||||
height: 48rpx;
|
|
||||||
background: linear-gradient( 180deg, #FB3E3A 0%, #F01617 100%);
|
|
||||||
border-radius: 24rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,94 +0,0 @@
|
||||||
import MX from '/static/ycnc/bg-mxbc.png'
|
|
||||||
import BW from '/static/ycnc/bg-bwcj.png'
|
|
||||||
import NX from '/static/ycnc/bg-nxdc.png'
|
|
||||||
import CoCo from '/static/ycnc/bg-coco.png'
|
|
||||||
import CBD from '/static/ycnc/bg-cbd.png'
|
|
||||||
import GM from '/static/ycnc/bg-gm.png'
|
|
||||||
import SYSXC from '/static/ycnc/bg-sysxc.png'
|
|
||||||
// import CYYS from '/static/ycnc/bg-cyys.png'
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
"MX":{
|
|
||||||
name:'蜜雪冰城',
|
|
||||||
src:MX,
|
|
||||||
height:974,
|
|
||||||
order:1
|
|
||||||
},
|
|
||||||
"BW":{
|
|
||||||
name:'霸王茶姬',
|
|
||||||
src:BW,
|
|
||||||
height:974,
|
|
||||||
order:2
|
|
||||||
},
|
|
||||||
"NX":{
|
|
||||||
name:'奈雪的茶',
|
|
||||||
src:NX,
|
|
||||||
height:584,
|
|
||||||
order:5
|
|
||||||
},
|
|
||||||
"CoCo":{
|
|
||||||
name:'CoCo',
|
|
||||||
src:CoCo,
|
|
||||||
height:584,
|
|
||||||
order:6
|
|
||||||
},
|
|
||||||
"CBD":{
|
|
||||||
name:'茶百道',
|
|
||||||
src:CBD,
|
|
||||||
height:584,
|
|
||||||
order:7
|
|
||||||
},
|
|
||||||
"YCGM":{
|
|
||||||
name:'古茗',
|
|
||||||
src:GM,
|
|
||||||
height:584,
|
|
||||||
order:3,
|
|
||||||
},
|
|
||||||
"YCSY":{
|
|
||||||
name:'书亦烧仙草',
|
|
||||||
src:SYSXC,
|
|
||||||
height:584,
|
|
||||||
order:4
|
|
||||||
},
|
|
||||||
// "CYYS":{
|
|
||||||
// name:'茶颜悦色',
|
|
||||||
// src:CYYS,
|
|
||||||
// height:974,
|
|
||||||
// },
|
|
||||||
}
|
|
||||||
|
|
||||||
export const stateConfig = {
|
|
||||||
1: '待支付',
|
|
||||||
2: '已支付',
|
|
||||||
3: '充值完成',
|
|
||||||
4: '充值异常',
|
|
||||||
5: '订单核销',
|
|
||||||
6: '退款中',
|
|
||||||
7: '退款完成',
|
|
||||||
8: '退款失败' ,
|
|
||||||
9: '订单取消'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const stateColor = {
|
|
||||||
2: '#FF8400',
|
|
||||||
7: '#FF0000',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const tabs = [{
|
|
||||||
tabName:'全部订单',
|
|
||||||
state:0,
|
|
||||||
},{
|
|
||||||
tabName:'待付款',
|
|
||||||
state:1,
|
|
||||||
},{
|
|
||||||
tabName:'处理中',
|
|
||||||
state:2,
|
|
||||||
},{
|
|
||||||
tabName:'已完成',
|
|
||||||
state:3,
|
|
||||||
},{
|
|
||||||
tabName:"已退款",
|
|
||||||
state:7
|
|
||||||
}]
|
|
||||||
|
|
||||||
export default config
|
|
|
@ -1,216 +0,0 @@
|
||||||
<route lang="json5" type="page">
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
navigationStyle: 'custom',
|
|
||||||
navigationBarTitleText: '商品详情',
|
|
||||||
navigationBarBackgroundColor:'#FFF',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<view class="w-full h-full flex flex-col">
|
|
||||||
<scroll-view scroll-y class="w-full h-full overflow-y-auto flex-1">
|
|
||||||
<view class="container">
|
|
||||||
<image class="banner" :src="detailObj.main_image" @click="testEvent"></image>
|
|
||||||
<view class="detail flex flex-col flex-justify-between">
|
|
||||||
<view class="proname">{{ detailObj.name }}</view>
|
|
||||||
<view class="num">
|
|
||||||
<text class="price">¥{{ detailObj.price }}</text>
|
|
||||||
<text class="ori">{{ detailObj.show_price }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="desc" v-html="detailObj.description">
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<!-- <view class="desc">
|
|
||||||
<div class="big">购买须知</div>
|
|
||||||
<div class="small">【有效期】</div>
|
|
||||||
<p class="prog">
|
|
||||||
代金券到账后,10天有效,逾期视为自动放弃,不退不补。
|
|
||||||
</p>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="pay-container">
|
|
||||||
<view class="pay-btn" @click="toPay">
|
|
||||||
立即支付
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, reactive, ref, unref } from 'vue';
|
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
|
||||||
import { queryDetail, goPay, login } from '../../api/ycnc';
|
|
||||||
import usePay from './hooks/usePay';
|
|
||||||
import useCode from './hooks/useCode';
|
|
||||||
|
|
||||||
const id = ref('')
|
|
||||||
const authCode = ref('');
|
|
||||||
|
|
||||||
const detailObj = reactive({})
|
|
||||||
|
|
||||||
onLoad((options) => {
|
|
||||||
const {product_id} = options;
|
|
||||||
id.value = product_id
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getDetail()
|
|
||||||
})
|
|
||||||
|
|
||||||
const getDetail = () => {
|
|
||||||
const params = {
|
|
||||||
product_id:unref(id)
|
|
||||||
}
|
|
||||||
queryDetail({params}).then(res => {
|
|
||||||
Object.assign(detailObj,res)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const toPay = async () => {
|
|
||||||
const token = window.localStorage.getItem('token') || '';
|
|
||||||
if(!token){
|
|
||||||
const code = await useCode();
|
|
||||||
authCode.value = code
|
|
||||||
const {token} = await login({params:{code:unref(authCode)}});
|
|
||||||
window.localStorage.setItem('token',token);
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
product_id:unref(id)
|
|
||||||
}
|
|
||||||
goPay({params}).then(res => {
|
|
||||||
const {order_no,notify_url,sign,plain_text} = res;
|
|
||||||
const {payFunc} = usePay();
|
|
||||||
payFunc({order_no,notify_url,TranAmt:detailObj.price,MerName:detailObj.brand,sign,plain_text})
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var clickCount = 0
|
|
||||||
var timer = null
|
|
||||||
const testEvent = () => {
|
|
||||||
if (clickCount < 6) {
|
|
||||||
clickCount++
|
|
||||||
console.log(`Clicked ${clickCount} times`)
|
|
||||||
|
|
||||||
// 如果是第一次点击,则开始计时
|
|
||||||
if (clickCount === 1) {
|
|
||||||
timer = setTimeout(() => {
|
|
||||||
clickCount = 0 // 重置点击计数
|
|
||||||
}, 2000)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果点击次数达到6次,则清除计时器并重置状态
|
|
||||||
if (clickCount >= 6) {
|
|
||||||
clearTimeout(timer)
|
|
||||||
clickCount = 0 // 重置点击计数
|
|
||||||
window.location.href = 'https://22233.cn/AAALM4HwLrAfdSCx'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
|
||||||
.banner{
|
|
||||||
width: 100%;
|
|
||||||
height:600rpx;
|
|
||||||
display: block;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.detail{
|
|
||||||
width: 694rpx;
|
|
||||||
// height: 138rpx;
|
|
||||||
border-bottom: 2rpx solid rgba(0,0,0,0.04);
|
|
||||||
margin: 0 auto;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding:25rpx 0;
|
|
||||||
.proname{
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
.price{
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #EA0000;
|
|
||||||
margin-right:18rpx;
|
|
||||||
}
|
|
||||||
.ori{
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #A5A5A5;
|
|
||||||
text-decoration: line-through;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.desc{
|
|
||||||
width: 694rpx;
|
|
||||||
margin:0 auto;
|
|
||||||
padding-top:44rpx;
|
|
||||||
padding-bottom:24rpx;
|
|
||||||
//旧版
|
|
||||||
&:deep(.big-title) {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #3D3D3D;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
&:deep(.small-area) {
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
&:deep(.small-title){
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
&:deep(.small-content){
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #4D4D4D;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
//新版
|
|
||||||
&:deep(.big){
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #3D3D3D;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
&:deep(.small){
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
}
|
|
||||||
&:deep(.prog){
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #4D4D4D;
|
|
||||||
margin-bottom:16rpx;
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.pay-container{
|
|
||||||
width:100%;
|
|
||||||
height:138rpx;
|
|
||||||
border-top:1px solid rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
.pay-btn{
|
|
||||||
width: 600rpx;
|
|
||||||
height: 88rpx;
|
|
||||||
background: #EA0000;
|
|
||||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
margin:25rpx auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,29 +0,0 @@
|
||||||
import md5 from 'js-md5';
|
|
||||||
export default function useCode(){
|
|
||||||
return new Promise((resolve,reject) => {
|
|
||||||
const authCallback = (params) => {
|
|
||||||
console.log('authCallback-use',params);
|
|
||||||
const {code} = params
|
|
||||||
resolve(code)
|
|
||||||
}
|
|
||||||
const getNewAuthorization = () => {
|
|
||||||
let appId = import.meta.env.VITE_YCNC_APPID;
|
|
||||||
let time = Date.now().toString();
|
|
||||||
let secret = import.meta.env.VITE_YCNC_SECRET;
|
|
||||||
let signBefore = appId + time + secret;
|
|
||||||
let sign = md5(signBefore);//普通md5
|
|
||||||
let param = {
|
|
||||||
appId: appId,
|
|
||||||
sign: sign,
|
|
||||||
time: time,
|
|
||||||
tran_code: "157",
|
|
||||||
fn: "authCallback",
|
|
||||||
needBind: ""
|
|
||||||
};
|
|
||||||
console.log('auth-param157-use',param);
|
|
||||||
Fw.device.api.getNewAuthorization(param)
|
|
||||||
};
|
|
||||||
window.authCallback = authCallback;
|
|
||||||
getNewAuthorization()
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
import dayjs from "dayjs";
|
|
||||||
import md5 from 'js-md5';
|
|
||||||
const handleParams = (obj) => Object.entries(obj).reduce((total,curr) => {
|
|
||||||
if(!total){
|
|
||||||
total += `${curr[0]}=${curr[1]}`
|
|
||||||
}else{
|
|
||||||
total += `|${curr[0]}=${curr[1]}`
|
|
||||||
}
|
|
||||||
return total
|
|
||||||
},'')
|
|
||||||
|
|
||||||
|
|
||||||
export default function usePay(){
|
|
||||||
const payFunc = (args) => {
|
|
||||||
const {order_no,notify_url,TranAmt,MerName,sign,plain_text} = args;
|
|
||||||
const MercCode = import.meta.env.VITE_YCNC_MERCH_CODE
|
|
||||||
const tranAmt = Number(TranAmt).toFixed(2)
|
|
||||||
// const plainText = handleParams({MercCode,TranAmt:tranAmt,TermSsn:order_no})
|
|
||||||
const Plain = {
|
|
||||||
MercUrl:notify_url,
|
|
||||||
TranAmt:tranAmt,
|
|
||||||
TermSsn:order_no,
|
|
||||||
BackLink:encodeURIComponent(`${window.location.origin}/#/pages/ycnc/orderDetail?order_no=${order_no}&isPayBack=true`),
|
|
||||||
psbcmcc:'LSXD',
|
|
||||||
TxnDt:dayjs(Date.now()).format('YYYY-MM-DD'),
|
|
||||||
MercCode:MercCode,
|
|
||||||
IsIntegral:'1',
|
|
||||||
MerName:MerName,
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
Plain:handleParams(Plain),
|
|
||||||
plainText:plain_text,
|
|
||||||
sign:sign,
|
|
||||||
Signature: '',
|
|
||||||
}
|
|
||||||
console.log('handCodePay-plain',Plain);
|
|
||||||
console.log('handCodePay-params',params);
|
|
||||||
Fw.device.api.handCodePay(params);
|
|
||||||
}
|
|
||||||
return {payFunc}
|
|
||||||
}
|
|
|
@ -1,145 +0,0 @@
|
||||||
<route lang="json5" type="home">
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
navigationStyle: 'custom',
|
|
||||||
navigationBarTitleText: '奶茶活动',
|
|
||||||
navigationBarBackgroundColor:'#FFF',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<scroll-view scroll-y class="page-wrapper">
|
|
||||||
<view class="nav-btn" @click="toOrder">我的订单</view>
|
|
||||||
<!-- <view style="opacity: 0;width: 100%;height:200rpx;position:absolute;top:230rpx" @click="test"></view> -->
|
|
||||||
<view class="wrapper flex flex-col flex-items-center box-border">
|
|
||||||
<view v-for="(item,key) in productList" :key="key">
|
|
||||||
<brand :products="item" :brandName="key"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import brand from './components/brand';
|
|
||||||
import { getProductList, goPay, login } from '../../api/ycnc'
|
|
||||||
import { onMounted, ref, provide, unref } from 'vue';
|
|
||||||
// import { getQueryString , isIOS, isAndroid } from '../../utils/utils';
|
|
||||||
import useCode from './hooks/useCode';
|
|
||||||
import usePay from './hooks/usePay';
|
|
||||||
import config from './config';
|
|
||||||
const productList = ref([]);
|
|
||||||
const authCode = ref('');
|
|
||||||
|
|
||||||
const handleBuy = (productData) => {
|
|
||||||
pay(productData)
|
|
||||||
}
|
|
||||||
|
|
||||||
const goDetail = (productData) => {
|
|
||||||
const {ProductId} = productData
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pages/ycnc/detail?product_id=${ProductId}`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const pay = (productData) => {
|
|
||||||
const {ProductId,voucherAmount,brandFlag} = productData
|
|
||||||
console.log('商品数据',productData);
|
|
||||||
const params = {
|
|
||||||
product_id:ProductId
|
|
||||||
}
|
|
||||||
goPay({params}).then(res => {
|
|
||||||
const {order_no,notify_url,sign,plain_text} = res;
|
|
||||||
const {payFunc} = usePay();
|
|
||||||
payFunc({order_no,notify_url,TranAmt:voucherAmount,MerName:config[brandFlag].name,sign,plain_text})
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
provide('custom-events',{
|
|
||||||
handleBuy,
|
|
||||||
goDetail
|
|
||||||
})
|
|
||||||
|
|
||||||
const toOrder = () => {
|
|
||||||
uni.navigateTo({
|
|
||||||
url:'/pages/ycnc/order'
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(async ()=>{
|
|
||||||
queryProducts();
|
|
||||||
const token = window.localStorage.getItem('token') || '';
|
|
||||||
if(!token){
|
|
||||||
const code = await useCode();
|
|
||||||
authCode.value = code
|
|
||||||
const {token} = await login({params:{code:unref(authCode)}});
|
|
||||||
window.localStorage.setItem('token',token);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleData(arg,args){
|
|
||||||
return arg.reduce((total,current) =>{
|
|
||||||
const flag = current.brandFlag;
|
|
||||||
const flagData = args.filter(item => item.brandFlag === flag)
|
|
||||||
if(Array.isArray(total[flag])){
|
|
||||||
total[flag].push(...flagData)
|
|
||||||
}else{
|
|
||||||
total[flag] = [...flagData]
|
|
||||||
}
|
|
||||||
return total
|
|
||||||
},{})
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询品牌,商品接口
|
|
||||||
const queryProducts = () => {
|
|
||||||
const params = {GID:'4894651'}
|
|
||||||
getProductList({params}).then(res => {
|
|
||||||
const {milkList,
|
|
||||||
milkVoucherList} = res
|
|
||||||
const sortMilkList = milkList.sort((a,b)=>{
|
|
||||||
const orderA = config[a.brandFlag] ? config[a.brandFlag].order : Infinity;
|
|
||||||
const orderB = config[b.brandFlag] ? config[b.brandFlag].order : Infinity;
|
|
||||||
return orderA - orderB
|
|
||||||
})
|
|
||||||
productList.value = handleData(sortMilkList,milkVoucherList);
|
|
||||||
}).catch(err=>{
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang='scss'>
|
|
||||||
.page-wrapper{
|
|
||||||
// width: 100vw;
|
|
||||||
// height: 100vh;
|
|
||||||
width:100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.nav-btn{
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top:42rpx;
|
|
||||||
width: 42rpx;
|
|
||||||
height: 132rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 16rpx 0rpx 0rpx 16rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #4BB8FF;
|
|
||||||
writing-mode: vertical-lr;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.wrapper{
|
|
||||||
width:100%;
|
|
||||||
min-height:100vh;
|
|
||||||
background: url('/static/ycnc/bg.png') no-repeat;
|
|
||||||
background-size:cover;
|
|
||||||
padding-top:730rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,279 +0,0 @@
|
||||||
<route lang="json5" type="page">
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
navigationStyle: 'custom',
|
|
||||||
navigationBarTitleText: '我的订单',
|
|
||||||
navigationBarBackgroundColor:'#FFF',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<wd-tabs color="#333" inactiveColor="#888" @click="handleClick">
|
|
||||||
<block v-for="item in tabs" :key="item.state">
|
|
||||||
<wd-tab :title="item.tabName" :name="item.state">
|
|
||||||
<scroll-view scroll-y class="page-wrapper" @scrolltolower="queryNext">
|
|
||||||
<!-- <view class="order-wrapper flex flex-col flex-items-center" v-if="Array.isArray(list[item.state]) && list[item.state].length > 0"> -->
|
|
||||||
<!-- <view v-for="(ele,index) in list[item.state]" :key="`${ele.id}-${item.state}`">
|
|
||||||
<OrderItem :detail="ele" @pay-event="pay" @detail-event="viewDetail" @pwd-event="viewPwd"/>
|
|
||||||
</view> -->
|
|
||||||
<view class="order-wrapper flex flex-col flex-items-center" v-if="Array.isArray(list) && list.length > 0">
|
|
||||||
<view v-for="(ele,index) in list" :key="`${ele.id}-${item.state}`">
|
|
||||||
<OrderItem
|
|
||||||
:detail="ele"
|
|
||||||
@pay-event="pay"
|
|
||||||
@detail-event="viewDetail"
|
|
||||||
@pwd-event="viewPwd"
|
|
||||||
@del-event="removeOrder"
|
|
||||||
@refund-event="refund"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view class="no-more" v-if="isLastPage">没有更多了~</view>
|
|
||||||
</view>
|
|
||||||
<view class="no-data" v-else>
|
|
||||||
<image
|
|
||||||
src="/static/ycnc/bg-nodata.png"
|
|
||||||
mode="scaleToFill"
|
|
||||||
class="no-img"
|
|
||||||
/>
|
|
||||||
<text class="no-text">暂无订单,快去下单吧~</text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</wd-tab>
|
|
||||||
</block>
|
|
||||||
</wd-tabs>
|
|
||||||
<wd-message-box />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { useMessage } from 'wot-design-uni'
|
|
||||||
import OrderItem from './components/order-item';
|
|
||||||
import usePay from './hooks/usePay';
|
|
||||||
import { getOrderList,deleteOrder,refundOrder,queryOrderDetail } from '../../api/ycnc';
|
|
||||||
import { onMounted, ref, unref,reactive,computed } from 'vue';
|
|
||||||
import { tabs } from './config';
|
|
||||||
import {deepClone} from '../../utils/utils'
|
|
||||||
const message = useMessage()
|
|
||||||
const pageSize = 10;
|
|
||||||
const activeName = ref(0);
|
|
||||||
const total = ref(0);
|
|
||||||
const page = ref(1);
|
|
||||||
const list = ref([]);
|
|
||||||
const replace = ref(false);
|
|
||||||
//页码
|
|
||||||
// const enumPage = tabs.reduce((prev,cur) => {
|
|
||||||
// prev[cur.state] = 1
|
|
||||||
// return prev
|
|
||||||
// },{})
|
|
||||||
// const page = ref(enumPage)
|
|
||||||
// //总数
|
|
||||||
// const enumObj = tabs.reduce((prev,cur) => {
|
|
||||||
// prev[cur.state] = 0
|
|
||||||
// return prev
|
|
||||||
// },{})
|
|
||||||
// const total = reactive(enumObj);
|
|
||||||
//数据列表
|
|
||||||
// const enumOrder = tabs.reduce((prev,cur) => {
|
|
||||||
// prev[cur.state] = []
|
|
||||||
// return prev
|
|
||||||
// },{})
|
|
||||||
// const list = reactive(enumOrder)
|
|
||||||
|
|
||||||
//获取订单列表
|
|
||||||
const queryOrderList = () => {
|
|
||||||
const activeTab = unref(activeName);
|
|
||||||
const params = {
|
|
||||||
page:unref(page),
|
|
||||||
pageSize:pageSize,
|
|
||||||
...(activeTab !== 0 && {state:activeTab})
|
|
||||||
}
|
|
||||||
getOrderList({params}).then(res => {
|
|
||||||
const {count,data} = res
|
|
||||||
total.value = count
|
|
||||||
// Object.assign(list,{[activeTab]:[...list[activeTab],...data]})
|
|
||||||
if(replace.value){
|
|
||||||
const prevPage = page.value - 1;
|
|
||||||
const prevList = list.value.slice(0, prevPage * pageSize);
|
|
||||||
list.value = [...prevList,...data];
|
|
||||||
}else{
|
|
||||||
list.value = [...list.value,...data]
|
|
||||||
}
|
|
||||||
replace.value = false
|
|
||||||
}).catch(err => {
|
|
||||||
total.value = 0;
|
|
||||||
// Object.assign(list,{[activeTab]:[]})
|
|
||||||
list.value = []
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleClick({index, name}){
|
|
||||||
page.value = 1;
|
|
||||||
total.value = 0;
|
|
||||||
// Object.assign(list,{[name]:[]})
|
|
||||||
list.value = [];
|
|
||||||
activeName.value = name;
|
|
||||||
// name代表状态值
|
|
||||||
queryOrderList()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async function pay(orderData){
|
|
||||||
console.log(orderData);
|
|
||||||
const {order_no,notify_url,price,brand,sign,plain_text,id} = orderData;
|
|
||||||
// const params = {
|
|
||||||
// order_id:id,
|
|
||||||
// order_no: order_no
|
|
||||||
// }
|
|
||||||
// const res = await queryOrderDetail({params})
|
|
||||||
// if(res.third_status === '03'){
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '当前订单已支付成功,无需再支付~',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
// replace.value = true;
|
|
||||||
// queryOrderList()
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
const {payFunc} = usePay();
|
|
||||||
payFunc({order_no,notify_url,TranAmt:price,MerName:brand,sign,plain_text})
|
|
||||||
}
|
|
||||||
|
|
||||||
function viewDetail(orderData){
|
|
||||||
const {id,order_no} = orderData;
|
|
||||||
uni.navigateTo({
|
|
||||||
url:`/pages/ycnc/orderDetail?order_id=${id}&order_no=${order_no}`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function viewPwd(orderData){
|
|
||||||
const {voucher_link} = orderData
|
|
||||||
if(voucher_link){
|
|
||||||
console.log('跳转外部链接--->',voucher_link);
|
|
||||||
window.location.href = voucher_link
|
|
||||||
}else{
|
|
||||||
console.error(`${voucher_link}无有效值`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeOrder(orderData){
|
|
||||||
message
|
|
||||||
.confirm({
|
|
||||||
msg: '删除订单后无法恢复,确认继续吗?',
|
|
||||||
title: '提示'
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
const {id} = orderData
|
|
||||||
const params = {order_id:id}
|
|
||||||
deleteOrder({params}).then(res => {
|
|
||||||
replace.value = true;
|
|
||||||
queryOrderList()
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
console.log('点击了取消按钮')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function refund(orderData){
|
|
||||||
const {id} = orderData
|
|
||||||
if(!id){
|
|
||||||
uni.showToast({
|
|
||||||
icon:'none',
|
|
||||||
title: '无有效的订单id',
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const params = {order_id:id}
|
|
||||||
refundOrder({params}).then(res => {
|
|
||||||
uni.showToast({
|
|
||||||
icon:'success',
|
|
||||||
title: '退款成功',
|
|
||||||
});
|
|
||||||
replace.value = true;
|
|
||||||
queryOrderList();
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(()=>{
|
|
||||||
queryOrderList()
|
|
||||||
})
|
|
||||||
|
|
||||||
const isLastPage = computed(()=>{
|
|
||||||
return unref(page) === Math.ceil(unref(total) / pageSize)
|
|
||||||
})
|
|
||||||
|
|
||||||
function queryNext(){
|
|
||||||
if(unref(isLastPage)){
|
|
||||||
console.error('已经是最后一页');
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
page.value = page.value + 1
|
|
||||||
queryOrderList()
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
|
||||||
.page-wrapper{
|
|
||||||
width:100%;
|
|
||||||
// height: 100%;
|
|
||||||
height: calc(100vh - 42rpx);
|
|
||||||
overflow-y: auto;
|
|
||||||
background: #FAFBFD;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding-bottom:30rpx
|
|
||||||
}
|
|
||||||
.order-wrapper{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
.no-more{
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 18rpx;
|
|
||||||
color: #999999;
|
|
||||||
height:146rpx;
|
|
||||||
padding: 28rpx 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
.no-data{
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
.no-img{
|
|
||||||
width:446rpx;
|
|
||||||
height: 446rpx;
|
|
||||||
}
|
|
||||||
.no-text{
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* 修改标签页下划线颜色*/
|
|
||||||
// :deep(.wd-button.is-primary){
|
|
||||||
// background: #EA0000;
|
|
||||||
// }
|
|
||||||
:deep(.wd-tabs__line) {
|
|
||||||
background: #EA0000;
|
|
||||||
}
|
|
||||||
:deep(.wd-tabs){
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height:100%;
|
|
||||||
}
|
|
||||||
:deep(.wd-tab__body){
|
|
||||||
height:calc(100vh - 42rpx);
|
|
||||||
}
|
|
||||||
:deep(.wd-tabs__container){
|
|
||||||
flex:1;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,311 +0,0 @@
|
||||||
<route lang="json5" type="page">
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
navigationStyle: 'custom',
|
|
||||||
navigationBarTitleText: '订单详情',
|
|
||||||
navigationBarBackgroundColor:'#FFF',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<view class="w-full h-full flex flex-col flex-items-center page">
|
|
||||||
<view class="wrapper" v-if="pageType === 1">
|
|
||||||
<view class="pro-info">
|
|
||||||
<view class="title">订单详情</view>
|
|
||||||
<view class="content flex">
|
|
||||||
<image class="pro-img" :src="orderDetail.main_image" />
|
|
||||||
<view class="flex flex-1 flex-col">
|
|
||||||
<view class="flex flex-justify-between name" style="margin-bottom:12rpx">
|
|
||||||
<view class="text-over">{{ orderDetail.product_name }}</view>
|
|
||||||
<view class="amount"><text>¥</text>{{ orderDetail.price }}<text>元</text></view>
|
|
||||||
</view>
|
|
||||||
<view class="flex flex-justify-between num">
|
|
||||||
<view>数量</view>
|
|
||||||
<view>x1</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="order-info">
|
|
||||||
<view class="info-item">订单编号:{{ orderDetail.order_no }}</view>
|
|
||||||
<view class="info-item" v-if="!!orderDetail.exchange_time && ![9].includes(orderDetail.state)">支付时间:{{
|
|
||||||
orderDetail.exchange_time }}</view>
|
|
||||||
<view class="info-item">下单时间:{{ orderDetail.create_time }}</view>
|
|
||||||
<view class="info-item" style="margin-bottom: 24rpx;">订单金额:{{ orderDetail.price }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btns" v-if="pageType === 1">
|
|
||||||
<view class="btn pwd" @click="viewPwd(orderDetail)"
|
|
||||||
v-if="[3].includes(orderDetail.state) && orderDetail.voucher_link">查看卡券</view>
|
|
||||||
<view class="btn pwd" @click="pay(orderDetail)" v-if="[1].includes(orderDetail.state)">立即付款</view>
|
|
||||||
<view class="btn pwd" v-if="[4].includes(orderDetail.state)" @click="goRefund">申请退款</view>
|
|
||||||
<view class="btn back" @click="backIndex">返回首页</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { onShow, onHide, onUnload } from '@dcloudio/uni-app';
|
|
||||||
import { onMounted, reactive, ref, unref } from 'vue';
|
|
||||||
import { queryOrderDetail, refundOrder, queryOrderState,login } from '../../api/ycnc';
|
|
||||||
import { getQueryString } from '../../utils/utils'
|
|
||||||
import usePay from './hooks/usePay';
|
|
||||||
import useCode from './hooks/useCode';
|
|
||||||
const authCode = ref('');
|
|
||||||
const id = ref('');
|
|
||||||
const orderNo = ref('');
|
|
||||||
const orderDetail = reactive({});
|
|
||||||
const pageType = ref(0)
|
|
||||||
let timer = undefined
|
|
||||||
|
|
||||||
// 用onshow 解决h5页面被缓存的问题
|
|
||||||
onShow(async () => {
|
|
||||||
const token = window.localStorage.getItem('token') || '';
|
|
||||||
if(!token){
|
|
||||||
const code = await useCode();
|
|
||||||
authCode.value = code
|
|
||||||
const {token} = await login({params:{code:unref(authCode)}});
|
|
||||||
window.localStorage.setItem('token',token);
|
|
||||||
}
|
|
||||||
const order_id = getQueryString('order_id')
|
|
||||||
const order_no = getQueryString('order_no')
|
|
||||||
const isPayBack = getQueryString('isPayBack')
|
|
||||||
if (!order_id && !order_no) return
|
|
||||||
id.value = order_id
|
|
||||||
orderNo.value = order_no;
|
|
||||||
if (isPayBack) {
|
|
||||||
queryEvent()
|
|
||||||
} else {
|
|
||||||
getDetail();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
onHide(() => {
|
|
||||||
timer && clearInterval(timer)
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnload(() => {
|
|
||||||
timer && clearInterval(timer)
|
|
||||||
})
|
|
||||||
|
|
||||||
const backIndex = () => {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/ycnc/index`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const timerEvent = () => {
|
|
||||||
timer && clearInterval(timer)
|
|
||||||
uni.showLoading({
|
|
||||||
title: "加载中",
|
|
||||||
mask: true,
|
|
||||||
});
|
|
||||||
timer = setInterval(()=>{
|
|
||||||
queryEvent()
|
|
||||||
}, 2500)
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryEvent = () => {
|
|
||||||
uni.hideLoading()
|
|
||||||
const params = {
|
|
||||||
order_id: unref(id),
|
|
||||||
order_no: unref(orderNo)
|
|
||||||
}
|
|
||||||
queryOrderState({ params }).then(res => {
|
|
||||||
const { state, voucher_link } = res
|
|
||||||
if([3].includes(state)){
|
|
||||||
if(voucher_link){
|
|
||||||
timer && clearInterval(timer)
|
|
||||||
window.location.replace(voucher_link)
|
|
||||||
}else{
|
|
||||||
timerEvent()
|
|
||||||
}
|
|
||||||
}else if([1,2].includes(state)){
|
|
||||||
timerEvent()
|
|
||||||
}else{
|
|
||||||
timer && clearInterval(timer)
|
|
||||||
getDetail()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const viewPwd = (detailData) => {
|
|
||||||
const { voucher_link } = detailData
|
|
||||||
if (voucher_link) {
|
|
||||||
console.log(`跳转外部链接-->${voucher_link}`);
|
|
||||||
window.location.href = voucher_link
|
|
||||||
} else {
|
|
||||||
console.error(`voucher_link无有效值`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const goRefund = () => {
|
|
||||||
const { id } = orderDetail
|
|
||||||
if (!id) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '无有效的订单id',
|
|
||||||
});
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const params = { order_id: id }
|
|
||||||
refundOrder({ params }).then(res => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'success',
|
|
||||||
title: '退款成功',
|
|
||||||
});
|
|
||||||
getDetail();
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function pay(orderData) {
|
|
||||||
console.log(orderData);
|
|
||||||
const { order_no, notify_url, price,brand,sign,plain_text,id } = orderData;
|
|
||||||
// const params = {
|
|
||||||
// order_id:id,
|
|
||||||
// order_no: order_no
|
|
||||||
// }
|
|
||||||
// const res = await queryOrderDetail({params})
|
|
||||||
// if(res.third_status === '03'){
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '当前订单已支付成功,无需再支付~',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
// getDetail()
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
const { payFunc } = usePay();
|
|
||||||
payFunc({ order_no, notify_url, TranAmt: price,MerName:brand,sign,plain_text })
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// getDetail()
|
|
||||||
})
|
|
||||||
|
|
||||||
const getDetail = () => {
|
|
||||||
const params = {
|
|
||||||
order_id: unref(id),
|
|
||||||
order_no: unref(orderNo)
|
|
||||||
}
|
|
||||||
pageType.value = 1
|
|
||||||
queryOrderDetail({ params }).then(res => {
|
|
||||||
Object.assign(orderDetail, res)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.page {
|
|
||||||
background-color: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
width: 702rpx;
|
|
||||||
height: 486rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 32rpx 24rpx;
|
|
||||||
|
|
||||||
.pro-info {
|
|
||||||
border-bottom: 1rpx solid #F0E1E1;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-bottom: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
margin-bottom: 24rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
.pro-img {
|
|
||||||
display: block;
|
|
||||||
width: 90rpx;
|
|
||||||
height: 90rpx;
|
|
||||||
margin-right: 34rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-over {
|
|
||||||
max-width: 80%;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #333333;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amount {
|
|
||||||
color: #333333;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
|
|
||||||
text:nth-child(1) {
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
text:nth-child(2) {
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #9E9E9E;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.order-info {
|
|
||||||
border-bottom: 1rpx solid #F0E1E1;
|
|
||||||
|
|
||||||
.info-item {
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 22rpx;
|
|
||||||
color: #6C6C6C;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btns {
|
|
||||||
margin-top: 146rpx;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 312rpx;
|
|
||||||
height: 76rpx;
|
|
||||||
border-radius: 38rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pwd {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
background: #EA0000;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back {
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #B9C8C7;
|
|
||||||
border: 2rpx solid #B9C8C7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 268 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 377 KiB |
|
@ -1,10 +1,7 @@
|
||||||
//邮储银行(奶茶)专用的
|
|
||||||
import useCode from "../pages/ycnc/hooks/useCode";
|
|
||||||
import {login} from '../api/ycnc'
|
|
||||||
|
|
||||||
//邮储银行(音视频)专用的
|
//邮储银行(音视频)专用的
|
||||||
// import useCode from "../pages/ycysp/hooks/useCode";
|
import useCode from "../pages/ycysp/hooks/useCode";
|
||||||
// import {login} from '../api/ycysp'
|
import {login} from '../api/ycysp'
|
||||||
|
|
||||||
//邮储音视频baseURL专用
|
//邮储音视频baseURL专用
|
||||||
const baseURL = '/ycav'
|
const baseURL = '/ycav'
|
||||||
|
@ -16,15 +13,12 @@ function http(options) {
|
||||||
});
|
});
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
//邮储音视频添加前缀
|
//邮储音视频添加前缀
|
||||||
// const newOptions = {...options,url:baseURL + options.url}
|
const newOptions = {...options,url:baseURL + options.url}
|
||||||
uni.request({
|
uni.request({
|
||||||
// ...newOptions,
|
...newOptions,
|
||||||
...options,
|
|
||||||
header: {
|
header: {
|
||||||
//邮储音视频
|
//邮储音视频
|
||||||
// 'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
//邮储奶茶
|
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
|
||||||
},
|
},
|
||||||
responseType: 'json',
|
responseType: 'json',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
|
@ -48,11 +42,7 @@ function http(options) {
|
||||||
const {token} = await login({params});
|
const {token} = await login({params});
|
||||||
window.localStorage.setItem('token',token);
|
window.localStorage.setItem('token',token);
|
||||||
//邮储音视频专用的
|
//邮储音视频专用的
|
||||||
// http(newOptions).then(_res => {
|
http(newOptions).then(_res => {
|
||||||
// resolve(_res)
|
|
||||||
// })
|
|
||||||
//邮储奶茶
|
|
||||||
http(options).then(_res => {
|
|
||||||
resolve(_res)
|
resolve(_res)
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
// Generated by vite-plugin-uni-pages
|
// Generated by vite-plugin-uni-pages
|
||||||
|
|
||||||
interface NavigateToOptions {
|
interface NavigateToOptions {
|
||||||
url: "/pages/ycnc/index" |
|
url: "/pages/ycysp/home" |
|
||||||
"/pages/ycnc/detail" |
|
"/pages/ycysp/order" |
|
||||||
"/pages/ycnc/order" |
|
"/pages/ycysp/orderDetail" |
|
||||||
"/pages/ycnc/orderDetail";
|
"/pages/ycysp/pay";
|
||||||
}
|
}
|
||||||
interface RedirectToOptions extends NavigateToOptions {}
|
interface RedirectToOptions extends NavigateToOptions {}
|
||||||
|
|
||||||
|
|