邮储奶茶更新了一个版本,提交一次代码
This commit is contained in:
parent
273a23a53c
commit
0e381014dc
|
@ -1,10 +1,9 @@
|
||||||
|
|
||||||
NODE_ENV = 'production'
|
NODE_ENV = 'production'
|
||||||
# 邮储奶茶活动(正式环境)
|
# 邮储奶茶活动(正式环境)
|
||||||
# VITE_BASE_URL = 'https://milk.api.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'
|
VITE_YCNC_MERCH_CODE = '100510102303326'
|
||||||
|
|
||||||
|
# 邮储音视频活动(生产环境)
|
||||||
|
# VITE_BASE_URL = 'https://mv.h5.cdlsxd.cn'
|
||||||
|
# VITE_YCNC_MERCH_CODE = '100510102303326'
|
||||||
|
|
|
@ -4,8 +4,8 @@ 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']
|
pagesInclude:['ycnc']
|
||||||
}
|
}
|
||||||
const { pages, pagesInclude } = config
|
const { pages, pagesInclude } = config
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,25 @@
|
||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
{
|
{
|
||||||
"path": "pages/ycysp/home",
|
"path": "pages/ycnc/index",
|
||||||
"type": "home",
|
"type": "home",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTitleText": "音视频专区",
|
"navigationBarTitleText": "奶茶活动",
|
||||||
"navigationBarBackgroundColor": "#FFF"
|
"navigationBarBackgroundColor": "#FFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/ycysp/order",
|
"path": "pages/ycnc/detail",
|
||||||
|
"type": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "商品详情",
|
||||||
|
"navigationBarBackgroundColor": "#FFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/ycnc/order",
|
||||||
"type": "page",
|
"type": "page",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
|
@ -19,22 +28,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/ycysp/orderDetail",
|
"path": "pages/ycnc/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": {
|
||||||
|
|
|
@ -120,20 +120,20 @@
|
||||||
async function pay(orderData){
|
async function pay(orderData){
|
||||||
console.log(orderData);
|
console.log(orderData);
|
||||||
const {order_no,notify_url,price,brand,sign,plain_text,id} = orderData;
|
const {order_no,notify_url,price,brand,sign,plain_text,id} = orderData;
|
||||||
const params = {
|
// const params = {
|
||||||
order_id:id,
|
// order_id:id,
|
||||||
order_no: order_no
|
// order_no: order_no
|
||||||
}
|
// }
|
||||||
const res = await queryOrderDetail({params})
|
// const res = await queryOrderDetail({params})
|
||||||
if(res.third_status === '03'){
|
// if(res.third_status === '03'){
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '当前订单已支付成功,无需再支付~',
|
// title: '当前订单已支付成功,无需再支付~',
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
});
|
// });
|
||||||
replace.value = true;
|
// replace.value = true;
|
||||||
queryOrderList()
|
// queryOrderList()
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
const {payFunc} = usePay();
|
const {payFunc} = usePay();
|
||||||
payFunc({order_no,notify_url,TranAmt:price,MerName:brand,sign,plain_text})
|
payFunc({order_no,notify_url,TranAmt:price,MerName:brand,sign,plain_text})
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,11 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onShow, onHide, onUnload } from '@dcloudio/uni-app';
|
import { onShow, onHide, onUnload } from '@dcloudio/uni-app';
|
||||||
import { onMounted, reactive, ref, unref } from 'vue';
|
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 { getQueryString } from '../../utils/utils'
|
||||||
import usePay from './hooks/usePay';
|
import usePay from './hooks/usePay';
|
||||||
|
import useCode from './hooks/useCode';
|
||||||
|
const authCode = ref('');
|
||||||
const id = ref('');
|
const id = ref('');
|
||||||
const orderNo = ref('');
|
const orderNo = ref('');
|
||||||
const orderDetail = reactive({});
|
const orderDetail = reactive({});
|
||||||
|
@ -58,14 +60,17 @@ const pageType = ref(0)
|
||||||
let timer = undefined
|
let timer = undefined
|
||||||
|
|
||||||
// 用onshow 解决h5页面被缓存的问题
|
// 用onshow 解决h5页面被缓存的问题
|
||||||
onShow(() => {
|
onShow(async () => {
|
||||||
const url = window.location.href
|
const token = window.localStorage.getItem('token') || '';
|
||||||
console.log('url-->', url);
|
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_id = getQueryString('order_id')
|
||||||
const order_no = getQueryString('order_no')
|
const order_no = getQueryString('order_no')
|
||||||
const isPayBack = getQueryString('isPayBack')
|
const isPayBack = getQueryString('isPayBack')
|
||||||
console.log(order_id, order_no);
|
|
||||||
console.log('isPayBack', isPayBack);
|
|
||||||
if (!order_id && !order_no) return
|
if (!order_id && !order_no) return
|
||||||
id.value = order_id
|
id.value = order_id
|
||||||
orderNo.value = order_no;
|
orderNo.value = order_no;
|
||||||
|
@ -159,19 +164,19 @@ const goRefund = () => {
|
||||||
async function pay(orderData) {
|
async function pay(orderData) {
|
||||||
console.log(orderData);
|
console.log(orderData);
|
||||||
const { order_no, notify_url, price,brand,sign,plain_text,id } = orderData;
|
const { order_no, notify_url, price,brand,sign,plain_text,id } = orderData;
|
||||||
const params = {
|
// const params = {
|
||||||
order_id:id,
|
// order_id:id,
|
||||||
order_no: order_no
|
// order_no: order_no
|
||||||
}
|
// }
|
||||||
const res = await queryOrderDetail({params})
|
// const res = await queryOrderDetail({params})
|
||||||
if(res.third_status === '03'){
|
// if(res.third_status === '03'){
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '当前订单已支付成功,无需再支付~',
|
// title: '当前订单已支付成功,无需再支付~',
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
});
|
// });
|
||||||
getDetail()
|
// getDetail()
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
const { payFunc } = usePay();
|
const { payFunc } = usePay();
|
||||||
payFunc({ order_no, notify_url, TranAmt: price,MerName:brand,sign,plain_text })
|
payFunc({ order_no, notify_url, TranAmt: price,MerName:brand,sign,plain_text })
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
.banner-container {
|
.banner-container {
|
||||||
height: 338rpx;
|
height: 338rpx;
|
||||||
padding: 36rpx 20rpx 0 4rpx;
|
padding: 32rpx 20rpx 0;
|
||||||
background: url("@/static/ycysp/banner-bg.webp") no-repeat;
|
background: url("@/static/ycysp/banner-bg.webp") no-repeat;
|
||||||
background-size: 100% auto;
|
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 |
|
@ -1,10 +1,10 @@
|
||||||
//邮储银行(奶茶)专用的
|
//邮储银行(奶茶)专用的
|
||||||
// import useCode from "../pages/ycnc/hooks/useCode";
|
import useCode from "../pages/ycnc/hooks/useCode";
|
||||||
// import {login} from '../api/ycnc'
|
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 +16,15 @@ 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
|
...options,
|
||||||
header: {
|
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',
|
responseType: 'json',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
|
@ -48,13 +48,13 @@ 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)
|
||||||
// })
|
// })
|
||||||
|
//邮储奶茶
|
||||||
|
http(options).then(_res => {
|
||||||
|
resolve(_res)
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
uni.hideLoading().then(() => {
|
uni.hideLoading().then(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
// Generated by vite-plugin-uni-pages
|
// Generated by vite-plugin-uni-pages
|
||||||
|
|
||||||
interface NavigateToOptions {
|
interface NavigateToOptions {
|
||||||
url: "/pages/ycysp/home" |
|
url: "/pages/ycnc/index" |
|
||||||
"/pages/ycysp/order" |
|
"/pages/ycnc/detail" |
|
||||||
"/pages/ycysp/orderDetail" |
|
"/pages/ycnc/order" |
|
||||||
"/pages/ycysp/pay";
|
"/pages/ycnc/orderDetail";
|
||||||
}
|
}
|
||||||
interface RedirectToOptions extends NavigateToOptions {}
|
interface RedirectToOptions extends NavigateToOptions {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue