update
This commit is contained in:
parent
c3911e17a9
commit
328d8a2f2c
@ -27,9 +27,9 @@
|
|||||||
<view class="rateText">兑换比例 {{ exchangeRate }}:1</view>
|
<view class="rateText">兑换比例 {{ exchangeRate }}:1</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 平台积分显示 -->
|
<!-- 彩云驿积分显示 -->
|
||||||
<view class="resultBox">
|
<view class="resultBox">
|
||||||
<view class="resultLabel">平台积分</view>
|
<view class="resultLabel">彩云驿积分</view>
|
||||||
<view class="resultValue">{{ platformPoints }}</view>
|
<view class="resultValue">{{ platformPoints }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -89,17 +89,13 @@ export default {
|
|||||||
return {
|
return {
|
||||||
userPoints: 0, // 用户当前ETC积分
|
userPoints: 0, // 用户当前ETC积分
|
||||||
etcPoints: '', // 用户输入的ETC积分
|
etcPoints: '', // 用户输入的ETC积分
|
||||||
platformPoints: 0, // 计算后的平台积分
|
platformPoints: 0, // 计算后的彩云驿积分
|
||||||
exchangeRate: 20, // 兑换比例 10:1
|
exchangeRate: 1, // 兑换比例 1:1
|
||||||
|
|
||||||
// 兑换规则
|
// 兑换规则
|
||||||
rules: [
|
rules: [
|
||||||
'1个ETC积分可兑换0.1个平台积分',
|
'1个ETC积分可兑换1个彩云驿积分',
|
||||||
'单次最低兑换100 ETC积分',
|
|
||||||
'兑换后的积分将在24小时内到账',
|
|
||||||
'兑换的积分可用于商城购物抵扣',
|
|
||||||
'兑换后不可撤销,请谨慎操作',
|
'兑换后不可撤销,请谨慎操作',
|
||||||
'积分有效期为兑换后12个月'
|
|
||||||
],
|
],
|
||||||
|
|
||||||
// 积分商品列表(示例数据)
|
// 积分商品列表(示例数据)
|
||||||
@ -147,6 +143,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 获取用户积分
|
// 获取用户积分
|
||||||
async getUserPoints() {
|
async getUserPoints() {
|
||||||
|
uni.showLoading({
|
||||||
|
title: "获取积分中..."
|
||||||
|
})
|
||||||
const req = {
|
const req = {
|
||||||
mobile: this.user.MEMBERSHIP_MOBILEPHONE,
|
mobile: this.user.MEMBERSHIP_MOBILEPHONE,
|
||||||
outUserId: this.user.MEMBERSHIP_ID,
|
outUserId: this.user.MEMBERSHIP_ID,
|
||||||
@ -154,9 +153,11 @@ export default {
|
|||||||
}
|
}
|
||||||
const data = await this.$api.$post('/MemberApi/ThirdInterface/GetYTSLMemberPoint', req)
|
const data = await this.$api.$post('/MemberApi/ThirdInterface/GetYTSLMemberPoint', req)
|
||||||
console.log('datadatadatadata321', data);
|
console.log('datadatadatadata321', data);
|
||||||
|
uni.hideLoading()
|
||||||
if (data.Result_Code === 100) {
|
if (data.Result_Code === 100) {
|
||||||
let res = data.Result_Data
|
let res = data.Result_Data
|
||||||
|
console.log('resresresres', res);
|
||||||
|
this.userPoints = res.balance
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: data.Result_Desc,
|
title: data.Result_Desc,
|
||||||
@ -169,7 +170,7 @@ export default {
|
|||||||
handleCalculate(e) {
|
handleCalculate(e) {
|
||||||
const value = e.detail.value;
|
const value = e.detail.value;
|
||||||
if (value && !isNaN(value)) {
|
if (value && !isNaN(value)) {
|
||||||
// 按照兑换比例计算平台积分
|
// 按照兑换比例计算彩云驿积分
|
||||||
this.platformPoints = Math.floor(Number(value) / this.exchangeRate);
|
this.platformPoints = Math.floor(Number(value) / this.exchangeRate);
|
||||||
} else {
|
} else {
|
||||||
this.platformPoints = 0;
|
this.platformPoints = 0;
|
||||||
@ -178,18 +179,24 @@ export default {
|
|||||||
|
|
||||||
// 执行兑换
|
// 执行兑换
|
||||||
handleExchange() {
|
handleExchange() {
|
||||||
if (!this.etcPoints || this.etcPoints <= 0) { uni.showToast({ title: '请输入兑换积分', icon: 'none' }); return; } if
|
// if (!this.etcPoints || this.etcPoints <= 0) { uni.showToast({ title: '请输入兑换积分', icon: 'none' }); return; } if
|
||||||
(Number(this.etcPoints) > this.userPoints) {
|
// (Number(this.etcPoints) > this.userPoints) {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: 'ETC积分不足',
|
||||||
|
// icon: 'none'
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
if (this.etcPoints > this.userPoints) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: 'ETC积分不足',
|
title: 'ETC积分不足',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认兑换',
|
title: '确认兑换',
|
||||||
content: `确定使用${this.etcPoints}个ETC积分兑换${this.platformPoints}个平台积分吗?`,
|
content: `确定使用${this.etcPoints}个ETC积分兑换${this.platformPoints}个彩云驿积分吗?`,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.doExchange();
|
this.doExchange();
|
||||||
@ -202,16 +209,36 @@ export default {
|
|||||||
async doExchange() {
|
async doExchange() {
|
||||||
uni.showLoading({ title: '兑换中...' });
|
uni.showLoading({ title: '兑换中...' });
|
||||||
|
|
||||||
|
// 创建一个时间的订单
|
||||||
|
// let time = this.$moment.now().format("YYYYMMDDHHmmss")
|
||||||
|
let time = this.$moment.now().format("YYYY")
|
||||||
|
console.log('platformPointsplatformPoints', this.platformPoints);
|
||||||
|
|
||||||
|
|
||||||
const req = {
|
const req = {
|
||||||
orderno: "",
|
orderno: `535001-${time}-${new Date().getTime()}`,
|
||||||
outUserId: this.user.MEMBERSHIP_ID,
|
outUserId: this.user.MEMBERSHIP_ID,
|
||||||
changePoint: this.platformPoints,
|
changePoint: this.platformPoints,
|
||||||
memo: "积分兑换",
|
memo: "积分兑换",
|
||||||
type: "encryption"
|
type: "encryption"
|
||||||
}
|
}
|
||||||
|
console.log('reqreq', JSON.parse(JSON.stringify(req)));
|
||||||
|
|
||||||
const data = await this.$api.$post('/MemberApi/ThirdInterface/ChangeYTSLMemberPoint', req)
|
const data = await this.$api.$post('/MemberApi/ThirdInterface/ChangeYTSLMemberPoint', req)
|
||||||
console.log('datadatadatadata321', data);
|
console.log('datadatadatadata321', data);
|
||||||
|
if (data.Result_Code === 100) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '兑换成功',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
this.etcPoints = ''
|
||||||
|
this.getUserPoints();
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: data.Result_Desc,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 跳转到商品详情
|
// 跳转到商品详情
|
||||||
@ -292,19 +319,19 @@ export default {
|
|||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
|
||||||
padding: 40rpx 32rpx;
|
padding: 24rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.boxTitle {
|
.boxTitle {
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeContent {
|
.exchangeContent {
|
||||||
.inputBox {
|
.inputBox {
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
.inputLabel {
|
.inputLabel {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@ -314,11 +341,11 @@ export default {
|
|||||||
|
|
||||||
.inputField {
|
.inputField {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 68rpx;
|
||||||
background: #F7F8FA;
|
background: #F7F8FA;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
@ -329,7 +356,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 12rpx;
|
||||||
|
|
||||||
.exchangeIcon {
|
.exchangeIcon {
|
||||||
width: 48rpx;
|
width: 48rpx;
|
||||||
@ -338,7 +365,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.rateText {
|
.rateText {
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
color: #667EEA;
|
color: #667EEA;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
@ -353,11 +380,11 @@ export default {
|
|||||||
|
|
||||||
.resultValue {
|
.resultValue {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 68rpx;
|
||||||
background: #F7F8FA;
|
background: #F7F8FA;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
font-size: 40rpx;
|
font-size: 28rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #667EEA;
|
color: #667EEA;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -369,14 +396,14 @@ export default {
|
|||||||
|
|
||||||
.exchangeBtn {
|
.exchangeBtn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 68rpx;
|
||||||
background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
|
background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 400;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
|
|
||||||
@ -392,13 +419,13 @@ export default {
|
|||||||
margin: 0 32rpx 24rpx;
|
margin: 0 32rpx 24rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 24rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.boxTitle {
|
.boxTitle {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
@ -432,7 +459,7 @@ export default {
|
|||||||
|
|
||||||
.ruleText {
|
.ruleText {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 28rpx;
|
font-size: 24rpx;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
@ -446,7 +473,7 @@ export default {
|
|||||||
margin: 0 32rpx;
|
margin: 0 32rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
padding: 32rpx;
|
padding: 24rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
|
||||||
@ -454,7 +481,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 32rpx;
|
font-size: 28rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -12306,6 +12306,9 @@ var posMember = 'https://eshangtech.com:18900/MemberApi';
|
|||||||
// let javaUrl = `https://admin.es.eshangtech.com/platform`
|
// let javaUrl = `https://admin.es.eshangtech.com/platform`
|
||||||
// let javaUrl = `http://111.229.213.193:18071`
|
// let javaUrl = `http://111.229.213.193:18071`
|
||||||
var javaUrl = "https://java.es.eshangtech.com:443";
|
var javaUrl = "https://java.es.eshangtech.com:443";
|
||||||
|
|
||||||
|
// pos的请求路径
|
||||||
|
var posUrl = "https://pos.eshangtech.com";
|
||||||
var zzyLocal = "https://eshangtech.com:18900/MemberApi";
|
var zzyLocal = "https://eshangtech.com:18900/MemberApi";
|
||||||
// let javaUrl = `http://10.104.1.175:8070/platform`
|
// let javaUrl = `http://10.104.1.175:8070/platform`
|
||||||
|
|
||||||
|
|||||||
@ -9,11 +9,11 @@
|
|||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"name": "pages/complaints/addComplaints",
|
"name": "pages/pointsRedemption/index",
|
||||||
"pathName": "pages/complaints/index",
|
"pathName": "pages/pointsRedemption/index",
|
||||||
"query": "",
|
"query": "",
|
||||||
"scene": null,
|
"launchMode": "default",
|
||||||
"launchMode": "default"
|
"scene": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pages/pointsRedemption/index",
|
"name": "pages/pointsRedemption/index",
|
||||||
|
|||||||
@ -20,6 +20,9 @@ let posMember = 'https://eshangtech.com:18900/MemberApi'
|
|||||||
// let javaUrl = `http://111.229.213.193:18071`
|
// let javaUrl = `http://111.229.213.193:18071`
|
||||||
let javaUrl = `https://java.es.eshangtech.com:443`
|
let javaUrl = `https://java.es.eshangtech.com:443`
|
||||||
|
|
||||||
|
// pos的请求路径
|
||||||
|
let posUrl = `https://pos.eshangtech.com`
|
||||||
|
|
||||||
let zzyLocal = `https://eshangtech.com:18900/MemberApi`
|
let zzyLocal = `https://eshangtech.com:18900/MemberApi`
|
||||||
// let javaUrl = `http://10.104.1.175:8070/platform`
|
// let javaUrl = `http://10.104.1.175:8070/platform`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user