123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <template>
- <view class="content" style="padding: 20rpx;overflow: hidden;padding-bottom: 160rpx;">
- <rich-text :nodes="richText"></rich-text>
- </view>
- <view class="btn-wrap">
- <button type="default" class="button" @click="addInterestsList()">
- 下一步
- </button>
- </view>
- </template>
-
- <script setup lang="ts">
- import { onLoad } from "@dcloudio/uni-app";
- import { reactive, ref } from "vue";
- import { requestNew } from "@/utils/network/request";
- import { navTo } from "@/utils/utils";
- import { jump } from "@/datas/9901Jump.js";
- import {
- singleEquityDetail, getOpenId
- } from "@/utils/network/api";
- import {
- setItem
- } from "@/utils/storage";
- import { deviceType } from "@/utils/network/difference";
- const state = reactive({
- openid: "",
- equityId: "",
- id: "",
- clientFee: "",
- list: [], //权益数据
- choiceValue: [], //选择的权益数据的下标
- choiceValueComplete: [], //选择的权益数据的具体数据
- isValueCard: "",
- vanType: 0,
- userType: 0,
- totalAmount: 0, //产品+权益产品金额
- changeCardType: "",//储值卡转记账卡选权益产品
- applyId: "",
- orderId: "",
- sysType: "",
- signAgencyId: "",
- productId: "",//产品编号
- cardType: ""
- })
-
- let richText = ref('')
- onLoad((option : any) => {
- console.log("option===", option)
- // #ifdef MP-ALIPAY
- state.sysType = 'ALI';
- // #endif
- // #ifdef MP-WEIXIN
- state.sysType = 'WECHAT';
- // #endif
- console.log("promoteId", option)
- state.clientFee = option.clientFee;
- state.equityId = option.equityId;
- state.userType = option.userType;
- state.vanType = option.vanType;
- state.isValueCard = option.isValueCard;
- state.cardType = option.cardType;
- state.productId = option.productId;
- state.totalAmount = option.fee;
- // 储值卡转记账卡传过来的参数
- state.changeCardType = option.changeCardType;
- state.applyId = option.applyId;
- state.orderId = option.orderId;
- getInfo();
- getOpenID();
- state.signAgencyId = option.signAgencyId;
- })
- const addInterestsList = () => {
- console.log("state.signAgencyId", state.signAgencyId, deviceType)
- if (state.signAgencyId === deviceType && false) {
- let obj = {
- type: state.vanType,
- userType: state.userType,
- promoteId: state.productId
- }
- const params = encodeURIComponent(JSON.stringify(obj))
- jump("15", params)
- } else {
- if (state.changeCardType == "1") {
- navTo(
- `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.productId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}`
- )
- } else {
- // 正常流程
- uni.navigateTo({
- url: `/subpackage/orders/essential-information?userType=${state.userType}&vanType=${state.vanType}&isValueCard=${state.isValueCard}&cardType=${state.cardType}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&productId=${state.productId}`,
- });
- }
- }
-
- }
-
- const getInfo = () => {
- const options = {
- type: 2,
- data: {
- "singleEquityId": state.equityId,
- },
- method: 'POST',
- showLoading: true,
- }
- requestNew(singleEquityDetail, options).then((res) => {
- const data = res;
- console.log("333333", data.productIntro)
- richText.value = data.productIntro
- })
- }
- //获取微信小程序openid
- const getOpenID = () => {
- // #ifdef MP-WEIXIN
- uni.login({
- provider: "weixin",
- success: function (e) {
- console.log(e);
- getOpenid(e.code);
- },
- });
- //#endif
- };
- const getOpenid = (code) => {
- const options = {
- type: 2,
- data: {
- "jsCode": code
- },
- method: "POST",
- showLoading: true,
- };
- // #ifdef MP-WEIXIN
- requestNew(getOpenId, options).then((res) => {
- const result = res;
- console.log("获取微信小程序openid", result);
- const openidData = result.data;
- state.openid = openidData.openid;
- setItem("QYorder", state);
- });
- // #endif
- }
- </script>
-
- <style scoped lang="scss">
- .btn-wrap {
- text-align: center;
- position: fixed;
- bottom: 40rpx;
- width: 100%;
- left: 0;
- }
-
- .imageDefault {
- height: 40rpx;
- width: 40rpx;
- transform: rotate(270deg);
- margin-right: 12rpx;
- color: white;
- }
-
- .imageChange {
- height: 40rpx;
- width: 40rpx;
- transform: rotate(90deg);
- margin-right: 12rpx;
- color: white;
- }
-
- .item {
- width: 90%;
- margin: 20rpx auto;
- background-color: rgb(41, 199, 207);
- border-radius: 20rpx;
- padding: 20rpx;
- box-sizing: border-box;
- color: white;
- font-size: 32rpx;
-
- }
-
- .button {
- height: 88rpx;
- background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
- border-radius: 44rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 88rpx;
- width: 660rpx;
- margin: 0 auto;
- ;
- }
-
- .item>.title {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
-
- .children {
- margin-left: 50rpx;
- margin-top: 16rpx;
- }
-
- .children>view {
- height: 50rpx;
- line-height: 50rpx;
- }
-
- .show {
- display: inline-block;
- }
-
- .hide {
- display: none;
- }
-
- .ul-item {
- // padding: 5px 20rpx;
- padding-top: 20rpx;
- display: flex;
- align-items: center;
-
- .item-value {
- padding: 20rpx;
- position: absolute;
- display: flex;
- align-items: center;
- width: 80%;
-
- .content {
- width: 51%;
-
- .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;
- }
- }
- }
-
- .icon-tip {
- width: 100rpx;
- height: 100rpx;
- }
-
- .content {
- margin-left: 40rpx;
- }
- }
-
- .money {
- color: white;
- }
- </style>
|