手机银行版本试运行环境更新前提交一次代码
This commit is contained in:
parent
2d92c6594c
commit
7ff654ab22
|
@ -1,7 +1,7 @@
|
|||
|
||||
NODE_ENV = 'production'
|
||||
# 邮储奶茶活动(正式环境)
|
||||
VITE_BASE_URL = 'https://milk.api.cdlsxd.cn'
|
||||
VITE_BASE_URL = 'https://tea.cdlsxd.cn'
|
||||
VITE_YCNC_MERCH_CODE = '100510102303326'
|
||||
|
||||
# 邮储音视频活动(生产环境)
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<route lang="json5" type="page">
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '商品详情',
|
||||
navigationBarBackgroundColor:'#FFF',
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "商品详情",
|
||||
navigationBarBackgroundColor: "#FFF",
|
||||
},
|
||||
}
|
||||
</route>
|
||||
|
@ -20,9 +20,7 @@
|
|||
<text class="ori">{{ detailObj.show_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc" v-html="detailObj.description">
|
||||
|
||||
</view>
|
||||
<view class="desc" v-html="detailObj.description"> </view>
|
||||
<!-- <view class="desc">
|
||||
<div class="big">购买须知</div>
|
||||
<div class="small">【有效期】</div>
|
||||
|
@ -33,57 +31,62 @@
|
|||
</view>
|
||||
</scroll-view>
|
||||
<view class="pay-container">
|
||||
<view class="pay-btn" @click="toPay">
|
||||
立即支付
|
||||
</view>
|
||||
<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 { getQueryString } from '../../utils/utils'
|
||||
import { onMounted, reactive, ref, unref } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { queryDetail, goPay, login } from "../../api/ycnc";
|
||||
import { getQueryString } from "../../utils/utils";
|
||||
|
||||
const id = ref('')
|
||||
const id = ref("");
|
||||
|
||||
const detailObj = reactive({})
|
||||
const detailObj = reactive({});
|
||||
|
||||
onLoad((options) => {
|
||||
const { product_id } = options;
|
||||
id.value = product_id
|
||||
})
|
||||
id.value = product_id;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getDetail()
|
||||
})
|
||||
const token = getQueryString("token") || uni.getStorageSync("token");
|
||||
uni.setStorageSync("token", token);
|
||||
getDetail();
|
||||
});
|
||||
|
||||
const getDetail = () => {
|
||||
const params = {
|
||||
product_id:unref(id)
|
||||
}
|
||||
queryDetail({params}).then(res => {
|
||||
Object.assign(detailObj,res)
|
||||
})
|
||||
}
|
||||
product_id: unref(id),
|
||||
};
|
||||
queryDetail({ params }).then((res) => {
|
||||
Object.assign(detailObj, res);
|
||||
});
|
||||
};
|
||||
|
||||
const toPay = async () => {
|
||||
const token = getQueryString('token') || uni.getStorageSync('token');
|
||||
uni.setStorageSync('token',token)
|
||||
const tempBackUrl = getQueryString("backUrl");
|
||||
const backUrl = tempBackUrl
|
||||
? encodeURIComponent(tempBackUrl)
|
||||
: uni.getStorageSync("backUrl");
|
||||
const params = {
|
||||
product_id:unref(id)
|
||||
}
|
||||
goPay({params}).then(res => {
|
||||
product_id: unref(id),
|
||||
backUrl: backUrl,
|
||||
};
|
||||
goPay({ params })
|
||||
.then((res) => {
|
||||
const { order_no, notify_url, sign, plain_text, pay_url } = res;
|
||||
window.location.replace(pay_url)
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
window.location.replace(pay_url);
|
||||
})
|
||||
}
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
<style lang="scss" scoped>
|
||||
.banner {
|
||||
width: 100%;
|
||||
height: 600rpx;
|
||||
|
@ -106,13 +109,13 @@
|
|||
.price {
|
||||
font-weight: 700;
|
||||
font-size: 28rpx;
|
||||
color: #EA0000;
|
||||
color: #ea0000;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
.ori {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #A5A5A5;
|
||||
color: #a5a5a5;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +128,7 @@
|
|||
&:deep(.big-title) {
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #3D3D3D;
|
||||
color: #3d3d3d;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
&:deep(.small-area) {
|
||||
|
@ -140,14 +143,14 @@
|
|||
&:deep(.small-content) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #4D4D4D;
|
||||
color: #4d4d4d;
|
||||
line-height: 1.6;
|
||||
}
|
||||
//新版
|
||||
&:deep(.big) {
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #3D3D3D;
|
||||
color: #3d3d3d;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
&:deep(.small) {
|
||||
|
@ -159,7 +162,7 @@
|
|||
&:deep(.prog) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #4D4D4D;
|
||||
color: #4d4d4d;
|
||||
margin-bottom: 16rpx;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
@ -172,14 +175,14 @@
|
|||
.pay-btn {
|
||||
width: 600rpx;
|
||||
height: 88rpx;
|
||||
background: #EA0000;
|
||||
background: #ea0000;
|
||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
margin: 25rpx auto;
|
||||
}
|
||||
</style>
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<template>
|
||||
<scroll-view scroll-y class="page-wrapper">
|
||||
<view class="nav-btn" @click="toOrder">我的订单</view>
|
||||
<view class="nav-btn" @click="toOrder">我的订单(测试)</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" />
|
||||
|
@ -40,8 +40,10 @@ const goDetail = (productData) => {
|
|||
|
||||
const pay = (productData) => {
|
||||
const { ProductId, voucherAmount, brandFlag } = productData;
|
||||
const backUrl = encodeURIComponent(getQueryString("backUrl"));
|
||||
const params = {
|
||||
product_id: ProductId,
|
||||
backUrl: backUrl,
|
||||
};
|
||||
goPay({ params })
|
||||
.then((res) => {
|
||||
|
@ -64,6 +66,12 @@ const toOrder = () => {
|
|||
});
|
||||
};
|
||||
|
||||
// function utf8ToBase64(str) {
|
||||
// return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => {
|
||||
// return String.fromCharCode('0x' + p1);
|
||||
// }));
|
||||
// }
|
||||
|
||||
onMounted(async () => {
|
||||
queryProducts();
|
||||
console.log(
|
||||
|
@ -71,7 +79,9 @@ onMounted(async () => {
|
|||
getQueryParams(window.location.href)
|
||||
);
|
||||
const token = getQueryString("token");
|
||||
const backUrl = getQueryString("backUrl");
|
||||
uni.setStorageSync("token", token);
|
||||
uni.setStorageSync("backUrl", encodeURIComponent(backUrl));
|
||||
});
|
||||
|
||||
function handleData(arg, args) {
|
||||
|
|
|
@ -59,7 +59,7 @@ import {
|
|||
} from "../../api/ycnc";
|
||||
import { onMounted, ref, unref, reactive, computed } from "vue";
|
||||
import { tabs } from "./config";
|
||||
import { deepClone } from "../../utils/utils";
|
||||
import { deepClone, getQueryString } from "../../utils/utils";
|
||||
const message = useMessage();
|
||||
const pageSize = 10;
|
||||
const activeName = ref(0);
|
||||
|
@ -71,9 +71,14 @@ const replace = ref(false);
|
|||
//获取订单列表
|
||||
const queryOrderList = () => {
|
||||
const activeTab = unref(activeName);
|
||||
const tempBackUrl = getQueryString("backUrl");
|
||||
const backUrl = tempBackUrl
|
||||
? encodeURIComponent(tempBackUrl)
|
||||
: uni.getStorageSync("backUrl");
|
||||
const params = {
|
||||
page: unref(page),
|
||||
pageSize: pageSize,
|
||||
backUrl: backUrl,
|
||||
...(activeTab !== 0 && { state: activeTab }),
|
||||
};
|
||||
getOrderList({ params })
|
||||
|
@ -176,6 +181,12 @@ function refund(orderData) {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
const token = getQueryString("token") || uni.getStorageSync("token");
|
||||
const _tempBackUrl = getQueryString("backUrl");
|
||||
uni.setStorageSync("token", token);
|
||||
if (_tempBackUrl) {
|
||||
uni.setStorageSync("backUrl", encodeURIComponent(_tempBackUrl));
|
||||
}
|
||||
queryOrderList();
|
||||
});
|
||||
|
||||
|
|
|
@ -191,14 +191,13 @@ async function pay(orderData) {
|
|||
window.location.replace(pay_url);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// getDetail()
|
||||
});
|
||||
|
||||
const getDetail = () => {
|
||||
const tempBackUrl = getQueryString('backUrl')
|
||||
const backUrl = tempBackUrl ? encodeURIComponent(tempBackUrl) : uni.getStorageSync('backUrl')
|
||||
const params = {
|
||||
order_id: unref(id),
|
||||
order_no: unref(orderNo),
|
||||
backUrl:backUrl,
|
||||
};
|
||||
pageType.value = 1;
|
||||
queryOrderDetail({ params }).then((res) => {
|
||||
|
|
|
@ -1,9 +1,31 @@
|
|||
//获取url后面拼接的参数
|
||||
export const getQueryString = (name) => {
|
||||
let urlStr = window.location.href.split('?')[1]
|
||||
const urlSearchParams = new URLSearchParams(urlStr)
|
||||
const result = Object.fromEntries(urlSearchParams.entries())
|
||||
return name ? result[name] : result
|
||||
export const getQueryString = (paramName) => {
|
||||
// let urlStr = window.location.href.split('?')[1]
|
||||
// const urlSearchParams = new URLSearchParams(urlStr)
|
||||
// const result = Object.fromEntries(urlSearchParams.entries())
|
||||
// return paramName ? result[paramName] : result
|
||||
|
||||
// 如果未传入 URL,则使用当前页面的 URL
|
||||
const targetUrl = window.location.href;
|
||||
// 解析 URL 中的查询字符串部分
|
||||
const queryString = targetUrl.split('?')[1];
|
||||
|
||||
// 如果没有查询字符串,直接返回空对象或 null
|
||||
if (!queryString) return paramName ? null : {};
|
||||
|
||||
// 处理查询字符串中的每个参数
|
||||
const params = queryString.split('&').reduce((acc, pair) => {
|
||||
const [key, value] = pair.split('=').map(decodeURIComponent);
|
||||
if (acc[key] !== undefined) {
|
||||
acc[key] = Array.isArray(acc[key]) ? [...acc[key], value] : [acc[key], value];
|
||||
} else {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
// 如果指定了参数名,则返回对应值,否则返回整个参数对象
|
||||
return paramName ? params[paramName] || null : params;
|
||||
}
|
||||
|
||||
//是否iOS设备
|
||||
|
|
Loading…
Reference in New Issue