您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

interestsList.vue 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="content" style="padding: 20rpx;overflow: hidden;padding-bottom: 160rpx;">
  3. <rich-text :nodes="richText"></rich-text>
  4. </view>
  5. <view class="btn-wrap">
  6. <button type="default" class="button" @click="addInterestsList()">
  7. 下一步
  8. </button>
  9. </view>
  10. </template>
  11. <script setup lang="ts">
  12. import { onLoad} from "@dcloudio/uni-app";
  13. import { reactive, ref } from "vue";
  14. import { equityProductsInfo } from "@/utils/network/api.js";
  15. import { stringToJson } from "@/utils/network/encryption";
  16. import { request } from "@/utils/network/request";
  17. import { fileURL } from "@/datas/fileURL.js";
  18. import { msg, navTo } from "@/utils/utils";
  19. import { jump } from "@/datas/9901Jump.js";
  20. import {
  21. getOpenidApi
  22. } from "@/utils/network/api";
  23. import {
  24. getItem,
  25. setItem
  26. } from "@/utils/storage";
  27. const state = reactive({
  28. openid: "",
  29. equityId: "",
  30. id: "",
  31. clientFee: "",
  32. list: [], //权益数据
  33. choiceValue: [], //选择的权益数据的下标
  34. choiceValueComplete: [], //选择的权益数据的具体数据
  35. isValueCard: "",
  36. type: 0,
  37. userType: 0,
  38. promoteId: "", //产品id
  39. totalAmount: 0, //产品+权益产品金额
  40. changeCardType: "",//储值卡转记账卡选权益产品
  41. applyId: "",
  42. orderId: "",
  43. sysType: "",
  44. signAgencyId:"",
  45. })
  46. let richText = ref('')
  47. onLoad((option : any) => {
  48. console.log("option===", option)
  49. // #ifdef MP-ALIPAY
  50. state.sysType = 'ALI';
  51. // #endif
  52. // #ifdef MP-WEIXIN
  53. state.sysType = 'WECHAT';
  54. // #endif
  55. console.log("promoteId", option)
  56. state.clientFee = option.clientFee;
  57. state.equityId = option.equityId;
  58. state.userType = option.userType;
  59. state.type = option.type;
  60. state.isValueCard = option.isValueCard;
  61. state.promoteId = option.promoteId;
  62. state.totalAmount = option.fee;
  63. // 储值卡转记账卡传过来的参数
  64. state.changeCardType = option.changeCardType;
  65. state.applyId = option.applyId;
  66. state.orderId = option.orderId;
  67. getInfo();
  68. getOpenID();
  69. state.signAgencyId = option.signAgencyId;
  70. })
  71. const addInterestsList = () => {
  72. if(state.signAgencyId=="52010102041"){
  73. // jump("4","")
  74. uni.navigateTo({
  75. url:`plugin://issuer-plugin/login?wxOpenId=${getItem("QYorder").openid}&type=1`
  76. })
  77. }else{
  78. if (state.changeCardType == "1") {
  79. navTo(
  80. `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.promoteId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}`
  81. )
  82. } else {
  83. // 正常流程
  84. uni.redirectTo({
  85. url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}`,
  86. });
  87. }
  88. }
  89. }
  90. const getInfo = () => {
  91. const options = {
  92. type: 2,
  93. data: {
  94. "singleEquityId": state.equityId,
  95. },
  96. method: 'POST',
  97. showLoading: true,
  98. }
  99. request(equityProductsInfo, options).then((res) => {
  100. const data = stringToJson(res.bizContent);
  101. console.log("333333", data.productIntro)
  102. richText.value = data.productIntro
  103. })
  104. }
  105. //获取微信小程序openid
  106. const getOpenID = () => {
  107. // #ifdef MP-WEIXIN
  108. uni.login({
  109. provider: "weixin",
  110. success: function (e) {
  111. console.log(e);
  112. getOpenid(e.code);
  113. },
  114. });
  115. //#endif
  116. };
  117. const getOpenid = (code) => {
  118. const options = {
  119. type: 2,
  120. data: {
  121. "jsCode": code
  122. },
  123. method: "POST",
  124. showLoading: true,
  125. };
  126. // #ifdef MP-WEIXIN
  127. request(getOpenidApi, options).then((res) => {
  128. const result = stringToJson(res.bizContent);
  129. console.log("获取微信小程序openid", result);
  130. const openidData = stringToJson(result.data);
  131. state.openid = openidData.openid;
  132. setItem("QYorder", state);
  133. });
  134. // #endif
  135. }
  136. </script>
  137. <style scoped lang="scss">
  138. .btn-wrap {
  139. text-align: center;
  140. position: fixed;
  141. bottom: 40rpx;
  142. width: 90%;
  143. left: 5%;
  144. }
  145. .imageDefault {
  146. height: 40rpx;
  147. width: 40rpx;
  148. transform: rotate(270deg);
  149. margin-right: 12rpx;
  150. color: white;
  151. }
  152. .imageChange {
  153. height: 40rpx;
  154. width: 40rpx;
  155. transform: rotate(90deg);
  156. margin-right: 12rpx;
  157. color: white;
  158. }
  159. .item {
  160. width: 90%;
  161. margin: 20rpx auto;
  162. background-color: rgb(41, 199, 207);
  163. border-radius: 20rpx;
  164. padding: 20rpx;
  165. box-sizing: border-box;
  166. color: white;
  167. font-size: 32rpx;
  168. }
  169. .button {
  170. height: 80rpx;
  171. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  172. border-radius: 40rpx;
  173. font-size: 32rpx;
  174. font-weight: 400;
  175. color: #ffffff;
  176. line-height: 80rpx;
  177. }
  178. .item>.title {
  179. width: 100%;
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. }
  184. .children {
  185. margin-left: 50rpx;
  186. margin-top: 16rpx;
  187. }
  188. .children>view {
  189. height: 50rpx;
  190. line-height: 50rpx;
  191. }
  192. .show {
  193. display: inline-block;
  194. }
  195. .hide {
  196. display: none;
  197. }
  198. .ul-item {
  199. // padding: 5px 20rpx;
  200. padding-top: 20rpx;
  201. display: flex;
  202. align-items: center;
  203. .item-value {
  204. padding: 20rpx;
  205. position: absolute;
  206. display: flex;
  207. align-items: center;
  208. width: 80%;
  209. .content {
  210. width: 51%;
  211. .title {
  212. font-size: 32rpx;
  213. font-family: Microsoft YaHei;
  214. font-weight: 400;
  215. color: #ffffff;
  216. }
  217. .tip {
  218. font-size: 24rpx;
  219. font-family: Microsoft YaHei;
  220. font-weight: 400;
  221. color: #ffffff;
  222. }
  223. }
  224. }
  225. .icon-tip {
  226. width: 100rpx;
  227. height: 100rpx;
  228. }
  229. .content {
  230. margin-left: 40rpx;
  231. }
  232. }
  233. .money {
  234. color: white;
  235. }
  236. </style>