邮储奶茶更新了一个版本,提交一次代码

This commit is contained in:
xiaogang 2025-02-14 11:11:02 +08:00
parent 273a23a53c
commit 0e381014dc
10 changed files with 76 additions and 72 deletions

View File

@ -1,10 +1,9 @@
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://milk.api.cdlsxd.cn'
VITE_YCNC_MERCH_CODE = '100510102303326'
# 邮储音视频活动(生产环境)
# VITE_BASE_URL = 'https://mv.h5.cdlsxd.cn'
# VITE_YCNC_MERCH_CODE = '100510102303326'

View File

@ -4,8 +4,8 @@ import path from 'path'
const config = {
pages:'./src/pages',
pagesInclude:['ycysp/home.vue','ycysp/pay.vue','ycysp/order.vue','ycysp/orderDetail.vue',]
// pagesInclude:['ycnc']
// pagesInclude:['ycysp/home.vue','ycysp/pay.vue','ycysp/order.vue','ycysp/orderDetail.vue',]
pagesInclude:['ycnc']
}
const { pages, pagesInclude } = config

View File

@ -1,16 +1,25 @@
{
"pages": [
{
"path": "pages/ycysp/home",
"path": "pages/ycnc/index",
"type": "home",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "音视频专区",
"navigationBarTitleText": "奶茶活动",
"navigationBarBackgroundColor": "#FFF"
}
},
{
"path": "pages/ycysp/order",
"path": "pages/ycnc/detail",
"type": "page",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "商品详情",
"navigationBarBackgroundColor": "#FFF"
}
},
{
"path": "pages/ycnc/order",
"type": "page",
"style": {
"navigationStyle": "custom",
@ -19,22 +28,13 @@
}
},
{
"path": "pages/ycysp/orderDetail",
"path": "pages/ycnc/orderDetail",
"type": "page",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "订单详情",
"navigationBarBackgroundColor": "#FFF"
}
},
{
"path": "pages/ycysp/pay",
"type": "page",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "支付确认",
"navigationBarBackgroundColor": "#FFF"
}
}
],
"globalStyle": {

View File

@ -120,20 +120,20 @@
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 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})
}

View File

@ -48,9 +48,11 @@
<script setup>
import { onShow, onHide, onUnload } from '@dcloudio/uni-app';
import { onMounted, reactive, ref, unref } from 'vue';
import { queryOrderDetail, refundOrder, queryOrderState } from '../../api/ycnc';
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({});
@ -58,14 +60,17 @@ const pageType = ref(0)
let timer = undefined
// onshow h5
onShow(() => {
const url = window.location.href
console.log('url-->', url);
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')
console.log(order_id, order_no);
console.log('isPayBack', isPayBack);
if (!order_id && !order_no) return
id.value = order_id
orderNo.value = order_no;
@ -159,19 +164,19 @@ const goRefund = () => {
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 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 })
}

View File

@ -265,7 +265,7 @@ onMounted(async () => {
.banner-container {
height: 338rpx;
padding: 36rpx 20rpx 0 4rpx;
padding: 32rpx 20rpx 0;
background: url("@/static/ycysp/banner-bg.webp") no-repeat;
background-size: 100% auto;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,10 +1,10 @@
//邮储银行(奶茶)专用的
// import useCode from "../pages/ycnc/hooks/useCode";
// import {login} from '../api/ycnc'
import useCode from "../pages/ycnc/hooks/useCode";
import {login} from '../api/ycnc'
//邮储银行(音视频)专用的
import useCode from "../pages/ycysp/hooks/useCode";
import {login} from '../api/ycysp'
// import useCode from "../pages/ycysp/hooks/useCode";
// import {login} from '../api/ycysp'
//邮储音视频baseURL专用
const baseURL = '/ycav'
@ -16,15 +16,15 @@ function http(options) {
});
return new Promise((resolve, reject) => {
//邮储音视频添加前缀
const newOptions = {...options,url:baseURL + options.url}
// const newOptions = {...options,url:baseURL + options.url}
uni.request({
...newOptions,
// ...options
// ...newOptions,
...options,
header: {
//邮储音视频
'content-type': 'application/json',
// 'content-type': 'application/json',
//邮储奶茶
// 'content-type': 'application/x-www-form-urlencoded',
'content-type': 'application/x-www-form-urlencoded',
},
responseType: 'json',
success: async (res) => {
@ -48,13 +48,13 @@ function http(options) {
const {token} = await login({params});
window.localStorage.setItem('token',token);
//邮储音视频专用的
http(newOptions).then(_res => {
resolve(_res)
})
//邮储奶茶
// http(options).then(_res => {
// http(newOptions).then(_res => {
// resolve(_res)
// })
//邮储奶茶
http(options).then(_res => {
resolve(_res)
})
}else{
uni.hideLoading().then(() => {
uni.showToast({

8
uni-pages.d.ts vendored
View File

@ -4,10 +4,10 @@
// Generated by vite-plugin-uni-pages
interface NavigateToOptions {
url: "/pages/ycysp/home" |
"/pages/ycysp/order" |
"/pages/ycysp/orderDetail" |
"/pages/ycysp/pay";
url: "/pages/ycnc/index" |
"/pages/ycnc/detail" |
"/pages/ycnc/order" |
"/pages/ycnc/orderDetail";
}
interface RedirectToOptions extends NavigateToOptions {}