Sfoglia il codice sorgente

[Feature]提交代码

yxb
杨毅 2 anni fa
parent
commit
d5e04f0ce6
4 ha cambiato i file con 205 aggiunte e 185 eliminazioni
  1. 2
    1
      App.vue
  2. 2
    1
      applyCard/choice-product.vue
  3. 200
    182
      applyCard/sign-up.vue
  4. 1
    1
      utils/network/api.js

+ 2
- 1
App.vue Vedi File

@@ -6,7 +6,8 @@
etcQYAction
} from "@/utils/network/api.js"
import {
msg
msg,
} from "./utils/utils";
import {
getItem

+ 2
- 1
applyCard/choice-product.vue Vedi File

@@ -61,9 +61,10 @@
setItem('clientFee', val.clientFee)
setItem("productId", val.id)
uni.navigateTo({
url: `/applyCard/release-products?orderId=${state.orderId}`,
url: `/applyCard/release-products?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
});
} else {
uni.navigateTo({
url: `/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${val.clientFee}&&id=${val.id}`,
});

+ 200
- 182
applyCard/sign-up.vue Vedi File

@@ -1,183 +1,201 @@
<template>
<image style="
margin-top: 20rpx;
width: 100%;
height: 240rpx;
background-color: #eeeeee;
" :src="`${$imgUrl}applyCard/car-service.png`"></image>
<view class="title"> 微信车主服务 </view>
<view class="value">
<view class="content_1">
微信车主服务是微信支付为车主用户提供的安全便捷的智慧服务
</view>
<view class="content_2">
本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过微信车主服务从你的微信支付账户扣除
</view>
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
</button>
</view>
</template>

<script setup lang="ts">
import {
onLoad,
onShow
} from "@dcloudio/uni-app";
import {
reactive
} from "vue";
import {
etcQYAction
} from "@/utils/network/api.js";
import {
request
} from "@/utils/network/request.js";

import {
stringToJson
} from "@/utils/network/encryption";
import {
fileURL
} from "@/datas/fileURL.js";
import navBar from "../components/nav-bar/nav-bar2.vue";
import navBgCar from "./components/nav-bg-car4";
import {
setItem
} from "@/utils/storage";
import {
msg
} from "@/utils/utils";
import {
checkOrderStatus,
orderPay,
wechatAppID,
wechatPayConfigId,
wechatSecret,
} from "@/utils/network/api";
const imgURL = `${fileURL}image/`;

const state = reactive({
openid: "",
orderId: "",
});
onLoad((option: any) => {
getOpenID();
state.orderId = option.orderId;
// setItem("QYorderId",option.orderId+'')
});

//获取微信小程序openid
const getOpenID = () => {
uni.login({
provider: "weixin",
success: function(e) {
wx.request({
url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
success: (res: any) => {
state.openid = res.data.openid;
setItem("QYorder",state)
console.log(res);
},
});
},
});
};

const savaHandle = () => {
var data = {
orderId: state.orderId,
subOpenId: state.openid,
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
request(etcQYAction, options).then((res) => {
const data = stringToJson(res.bizContent);
console.log(data);
uni.navigateToMiniProgram({
appId: 'wxbcad394b3d99dac9',
path: 'pages/route/index',
extraData: {
appid: 'wxcb1388c809fe25a9',
sub_appid: 'wx008c60533388527a',
mch_id: '1500877591',
sub_mch_id: '1622652848',
nonce_str: data.nonceStr,
sign_type: 'HMAC-SHA256',
trade_scene: 'HIGHWAY',
plate_number: data.plateNumber,
sub_openid: data.subOpenId,
sign: data.sign,
},
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);
// 未成功跳转到车主小程序
},
});
});
};
</script>

<style lang="scss" scoped>
.action {
margin-top: 40rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-bottom: 30rpx;

.button {
height: 80rpx;
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: #ffffff;
line-height: 80rpx;
}
}

.title {
text-align: center;
margin-top: 15rpx;
font-size: 36rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
line-height: 36rpx;
}

.value {
padding: 0rpx 60rpx;
}

.content_1 {
margin-top: 60rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}

.content_2 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}
<template>
<image style="
margin-top: 20rpx;
width: 100%;
height: 240rpx;
background-color: #eeeeee;
" :src="`${$imgUrl}applyCard/car-service.png`"></image>
<view class="title"> 微信车主服务 </view>
<view class="value">
<view class="content_1">
微信车主服务是微信支付为车主用户提供的安全便捷的智慧服务
</view>
<view class="content_2">
本次将为贵州黔通智联科技股份有限公司开启免密支付服务,后续相关的费用将通过微信车主服务从你的微信支付账户扣除
</view>
</view>
<view class="action">
<button type="default" class="button" @click="savaHandle()">
开通服务
</button>
</view>
</template>
<script setup lang="ts">
import {
onLoad,
onShow
} from "@dcloudio/uni-app";
import {
reactive
} from "vue";
import {
etcQYAction
} from "@/utils/network/api.js";
import {
request
} from "@/utils/network/request.js";
import {
stringToJson
} from "@/utils/network/encryption";
import {
fileURL
} from "@/datas/fileURL.js";
import navBar from "../components/nav-bar/nav-bar2.vue";
import navBgCar from "./components/nav-bg-car4";
import {
setItem
} from "@/utils/storage";
import {
msg
} from "@/utils/utils";
import {
checkOrderStatus,
orderPay,
wechatAppID,
wechatPayConfigId,
wechatSecret,
} from "@/utils/network/api";
const imgURL = `${fileURL}image/`;
const state = reactive({
openid: "",
orderId: "",
id: '',
clientFee: ''
});
onLoad((option: any) => {
getOpenID();
state.orderId = option.orderId;
state.clientFee = option.clientFee;
state.id = option.id;
// setItem("QYorderId",option.orderId+'')
});
//获取微信小程序openid
const getOpenID = () => {
uni.login({
provider: "weixin",
success: function(e) {
wx.request({
url: `https://api.weixin.qq.com/sns/jscode2session?appid=${wechatAppID}&secret=${wechatSecret}&js_code=${e.code}&grant_type=authorization_code`,
success: (res: any) => {
state.openid = res.data.openid;
setItem("QYorder", state)
console.log(res);
},
});
},
});
};
const savaHandle = () => {
var data = {
orderId: state.orderId,
subOpenId: state.openid,
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
request(etcQYAction, options).then((res) => {
const data = stringToJson(res.bizContent);
console.log(data);
if (data.userState === 'UNAUTHORIZED') {
uni.navigateToMiniProgram({
appId: 'wxbcad394b3d99dac9',
path: 'pages/route/index',
extraData: {
appid: 'wxcb1388c809fe25a9',
sub_appid: 'wx008c60533388527a',
mch_id: '1500877591',
sub_mch_id: '1622652848',
nonce_str: data.nonceStr,
sign_type: 'HMAC-SHA256',
trade_scene: 'HIGHWAY',
plate_number: data.plateNumber,
sub_openid: data.subOpenId,
sign: data.sign,
},
success(res) {
console.log(res);
},
complete(res) {
console.log(res);
},
fail(res) {
console.log(res);
// 未成功跳转到车主小程序
},
});
} else if (data.userState === 'NORMAL') {
uni.navigateTo({
url: `/applyCard/product-detail?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}`,
});
} else if (data.userState === 'PAUSED') {
msg('已暂停车主服务')
return;
} else if (data.userState === 'OVERDUE') {
msg('用户已开通车主服务,但欠费状态。提示用户还款,请跳转到车主服务')
return;
}
});
};
</script>
<style lang="scss" scoped>
.action {
margin-top: 40rpx;
padding-left: 20rpx;
padding-right: 20rpx;
padding-bottom: 30rpx;
.button {
height: 80rpx;
background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 400;
color: #ffffff;
line-height: 80rpx;
}
}
.title {
text-align: center;
margin-top: 15rpx;
font-size: 36rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
line-height: 36rpx;
}
.value {
padding: 0rpx 60rpx;
}
.content_1 {
margin-top: 60rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}
.content_2 {
margin-top: 50rpx;
font-size: 30rpx;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
line-height: 58rpx;
}
</style>

+ 1
- 1
utils/network/api.js Vedi File

@@ -98,6 +98,6 @@ export const cardCzApply = "810";//储值卡充值一申请
export const cardCzPay = "811";//储值卡充值一获取支付 (充值申请)
export const cardCzPayResult = "812";//储值卡充值-查询支付结果
export const cardCzPayResultCheck = "814";//储值卡充值-获取已支付未圈存的充值单(充值检测)
export const cardCzQC = "815";//储值卡充值-圈存(消费)
export const cardCzXFCheck = "815";//储值卡充值-圈存(消费)
export const quanXf = "71";//圈存修复V (写指令)
export const quanConfirm = "72";//圈存确认

Loading…
Annulla
Salva