123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <!-- <navBar title="产品详情"></navBar>
- <navBgCar></navBgCar> -->
- <view class="content-wrap">
- <view class="ul-item">
- <image style="width: 100%; height: 170rpx; background-color: #eeeeee"
- :src="`${$imgUrl}applyCard/product-bg.png`"></image>
- <view class="item-value">
- <image class="icon-tip" :src="`${$imgUrl}applyCard/wechat.png`"></image>
- <view class="content">
- <view class="title"> 微信车主服务 </view>
- <view style="margin-top: 15rpx" class="tip"> 先通行后付费! </view>
- </view>
- <view class="price">
- ¥<text style="font-size: 40rpx">99</text>.00
- </view>
- </view>
- </view>
-
- <view class="card-box">
- <view class="title"> 基础服务 </view>
- <view class="item-box">
- <view class=""> ETC设备与卡片 </view>
- <view class=""> 设备质保一年 </view>
- <view class=""> 开具通行费发票 </view>
- <view class=""> 高速通行9.5折 </view>
- </view>
- </view>
-
- <view class="radio">
- <view class="title"> 推荐加购权益 </view>
-
- <view class="radio-item">
- <image :src="`${$imgUrl}card-bg.png`" mode=""></image>
- <view class="radio-box">
- <view class="radio-box-left">
- <view class="icon">
- <image :src="`${$imgUrl}park.png`" mode=""></image>
- </view>
-
- <view class="content">
- <view class=""> 64元停车券 </view>
- <text>¥44.00</text>
- </view>
- </view>
- <view class="choose-item" @click="flag = 1">
- <view class="active" v-if="flag == 1"> </view>
- </view>
- </view>
- </view>
-
- <view class="radio-item">
- <image :src="`${$imgUrl}card-bg.png`" mode=""></image>
- <view class="radio-box">
- <view class="radio-box-left">
- <view class="icon">
- <image :src="`${$imgUrl}car1.png`" mode=""></image>
- </view>
-
- <view class="content">
- <view class=""> 10次洗车券 </view>
- <text>¥44.00</text>
- </view>
- </view>
- <view class="choose-item" @click="flag = 2">
- <view class="active" v-if="flag == 2"> </view>
- </view>
- </view>
- </view>
-
- <view class="more-btn">
- 查看更多<u-icon name="arrow-down"></u-icon>
- </view>
- </view>
-
- <view class="value-wrapper">
- <view class="flex">
- <view class="title"> 产品金额 </view>
- <view class="value">
- {{ "¥" + state.clientFee }}
- </view>
- </view>
- <view class="flex">
- <view class="title"> 加购权益 </view>
- <view class="value"> ¥0.00 </view>
- </view>
- <view class="flex">
- <view class="title"> 运费 </view>
- <view class="value"> ¥0.00 </view>
- </view>
- <view class="flex">
- <view class="title"> 优惠券 </view>
- <view class="value"> 暂无优惠券 </view>
- </view>
- <view class="flex">
- <view class="title"> 积分兑换 </view>
- <view class="value"> 暂无积分 </view>
- </view>
- <view class="flex">
- <view class="title"> 实付款 </view>
- <view class="money">
- {{ "¥" + state.clientFee }}
- </view>
- </view>
- </view>
- <view class="footer">
- <u-radio-group v-model="value">
- <u-radio shape="square">
- 阅读并同意<text>《用户授权协议》</text><text>《XXX隐私协议》</text>
- </u-radio>
- </u-radio-group>
- </view>
-
- <view class="action">
- <button type="default" class="button" @click="savaHandle()">
- {{ "确认办理:¥" + state.clientFee }}
- </button>
- </view>
- </view>
- </template>
-
- <script setup lang="ts">
- import { onLoad, onShow } from "@dcloudio/uni-app";
- import { reactive, ref } from "vue";
- import { etcQueryProduct, getOpenidApi } 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 navBgCar from "./components/nav-bg-car5";
- // import navBar from "../../components/nav-bar/nav-bar2.vue"
-
- import { getItem, StorageKeys } from "@/utils/storage.ts";
- import {
- checkOrderStatus,
- wechatAppID,
- wechatPayConfigId,
- wechatSecret,
- } from "@/utils/network/api";
- import { confirm, msg } from "@/utils/utils";
- const imgURL = `${fileURL}image/`;
-
- const flag = ref(1);
-
- const savaHandle = () => {
- uni.redirectTo({
- url: "/subpackage/after-sale/to-bookkeeping-card/result",
- });
- };
-
- //获取微信小程序openid
- const getOpenID = () => {
- uni.login({
- provider: "weixin",
- success: function (e) {
- getOpenid(e.code)
- },
- });
- };
- const getOpenid = (code) => {
- const options = {
- type: 2,
- data: {
- "jsCode": code
- },
- method: "POST",
- showLoading: true,
- };
- // #ifdef MP-WEIXIN
- request(getOpenidApi, options).then((res) => {
- const result = stringToJson(res.bizContent);
- console.log("获取微信小程序openid", result);
- const openidData = stringToJson(result.data);
- state.openid = openidData.openid
- });
- // #endif
- }
- //支付成功改变订单状态
- const checkOrder = () => {
- const options = {
- type: 2,
- data: {
- orderId: state.orderId,
- payConfigId: wechatPayConfigId,
- },
- method: "POST",
- showLoading: true,
- };
-
- request(checkOrderStatus, options).then((res) => {
- msg("支付成功!");
-
- var pages = getCurrentPages().length;
- uni.navigateBack({
- delta: pages,
- });
- });
- };
- onLoad((option : any) => {
- state.orderId = option.orderId;
- state.clientFee = option.clientFee / 100;
- getOpenID();
- });
-
- const state = reactive({
- openid: "",
- orderId: "",
- clientFee: undefined,
- });
- </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;
- }
- }
-
- .footer {
- margin-top: 45rpx;
-
- text {
- color: #00b38b;
- }
- }
-
- .value-wrapper {
- margin-top: 40rpx;
- padding: 0rpx 30rpx;
- border-bottom: 1rpx solid #dcdcdc;
-
- .flex {
- padding: 20rpx 0rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .title {
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #777777;
- line-height: 28rpx;
- }
-
- .value {
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 28rpx;
- }
-
- .money {
- font-size: 36rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #00b38b;
- line-height: 36rpx;
- }
- }
- }
-
- .content-wrap {
- position: relative;
- padding: 0rpx 30rpx;
-
- .ul-item {
- padding: 5px 0rpx;
- display: flex;
- align-items: center;
-
- .item-value {
- padding: 20rpx;
- position: absolute;
- display: flex;
- align-items: center;
- justify-content: space-around;
-
- .content {
- .title {
- font-size: 32rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
-
- .tip {
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
- }
-
- .price {
- margin-left: 180rpx;
- font-size: 25rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ffffff;
- }
- }
-
- .icon-tip {
- width: 100rpx;
- height: 100rpx;
- }
-
- .content {
- margin-left: 40rpx;
- }
- }
-
- .card-box {
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- margin: 30rpx 0;
- }
-
- .item-box {
- display: flex;
- flex-wrap: wrap;
-
- view {
- background: #c1ffed;
- border: 1px solid #00b38b;
- border-radius: 30rpx;
- padding: 5rpx 15rpx;
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #019977;
- margin: 20rpx 30rpx;
- margin-top: 0;
- }
- }
- }
-
- .radio {
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- margin: 30rpx 0;
- }
-
- .more-btn {
- text-align: center;
- margin-top: 30rpx;
- border-bottom: 1rpx solid #dcdcdc;
- padding-bottom: 30rpx;
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- }
-
- .radio-item {
- width: 100%;
- height: 150rpx;
- position: relative;
-
- image {
- width: 100%;
- height: 100%;
- position: absolute;
- z-index: -1;
- }
-
- .radio-box {
- // width: 100%;
- // height: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx;
- margin: 30rpx 0;
-
- .radio-box-left {
- display: flex;
-
- .icon {
- width: 88rpx;
- height: 88rpx;
- background: #89fcdb;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- image {
- width: 48rpx;
- height: 48rpx;
- z-index: 1;
- }
- }
-
- .content {
- margin-left: 64rpx;
-
- view {
- font-size: 28rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- margin-bottom: 10rpx;
- }
-
- text {
- font-size: 36rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- }
- }
- }
-
- .choose-item {
- width: 44rpx;
- height: 44rpx;
- border: 2px solid #00b38b;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .active {
- width: 34rpx;
- height: 34rpx;
- background: #00b38b;
- border-radius: 50%;
- }
- }
- }
- }
- }
- }
- </style>
|