You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interestsList.vue 5.2KB

hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 11 meses
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 11 meses
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
hace 1 año
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. })
  45. let richText = ref('')
  46. onLoad((option : any) => {
  47. console.log("option===", option)
  48. // #ifdef MP-ALIPAY
  49. state.sysType = 'ALI';
  50. // #endif
  51. // #ifdef MP-WEIXIN
  52. state.sysType = 'WECHAT';
  53. // #endif
  54. console.log("promoteId", option)
  55. state.clientFee = option.clientFee;
  56. state.equityId = option.equityId;
  57. state.userType = option.userType;
  58. state.type = option.type;
  59. state.isValueCard = option.isValueCard;
  60. state.promoteId = option.promoteId;
  61. state.totalAmount = option.fee;
  62. // 储值卡转记账卡传过来的参数
  63. state.changeCardType = option.changeCardType;
  64. state.applyId = option.applyId;
  65. state.orderId = option.orderId;
  66. getInfo();
  67. getOpenID();
  68. })
  69. const addInterestsList = () => {
  70. // if(state.aa){
  71. // jump("4","")
  72. // }else{
  73. if (state.changeCardType == "1") {
  74. navTo(
  75. `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.promoteId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}`
  76. )
  77. } else {
  78. // 正常流程
  79. uni.redirectTo({
  80. url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}`,
  81. });
  82. }
  83. // }
  84. }
  85. const getInfo = () => {
  86. const options = {
  87. type: 2,
  88. data: {
  89. "singleEquityId": state.equityId,
  90. },
  91. method: 'POST',
  92. showLoading: true,
  93. }
  94. request(equityProductsInfo, options).then((res) => {
  95. const data = stringToJson(res.bizContent);
  96. console.log("333333", data.productIntro)
  97. richText.value = data.productIntro
  98. })
  99. }
  100. //获取微信小程序openid
  101. const getOpenID = () => {
  102. // #ifdef MP-WEIXIN
  103. uni.login({
  104. provider: "weixin",
  105. success: function (e) {
  106. console.log(e);
  107. getOpenid(e.code);
  108. },
  109. });
  110. //#endif
  111. };
  112. const getOpenid = (code) => {
  113. const options = {
  114. type: 2,
  115. data: {
  116. "jsCode": code
  117. },
  118. method: "POST",
  119. showLoading: true,
  120. };
  121. // #ifdef MP-WEIXIN
  122. request(getOpenidApi, options).then((res) => {
  123. const result = stringToJson(res.bizContent);
  124. console.log("获取微信小程序openid", result);
  125. const openidData = stringToJson(result.data);
  126. state.openid = openidData.openid;
  127. setItem("QYorder", state);
  128. });
  129. // #endif
  130. }
  131. </script>
  132. <style scoped lang="scss">
  133. .btn-wrap {
  134. text-align: center;
  135. position: fixed;
  136. bottom: 40rpx;
  137. width: 90%;
  138. left: 5%;
  139. }
  140. .imageDefault {
  141. height: 40rpx;
  142. width: 40rpx;
  143. transform: rotate(270deg);
  144. margin-right: 12rpx;
  145. color: white;
  146. }
  147. .imageChange {
  148. height: 40rpx;
  149. width: 40rpx;
  150. transform: rotate(90deg);
  151. margin-right: 12rpx;
  152. color: white;
  153. }
  154. .item {
  155. width: 90%;
  156. margin: 20rpx auto;
  157. background-color: rgb(41, 199, 207);
  158. border-radius: 20rpx;
  159. padding: 20rpx;
  160. box-sizing: border-box;
  161. color: white;
  162. font-size: 32rpx;
  163. }
  164. .button {
  165. height: 80rpx;
  166. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  167. border-radius: 40rpx;
  168. font-size: 32rpx;
  169. font-weight: 400;
  170. color: #ffffff;
  171. line-height: 80rpx;
  172. }
  173. .item>.title {
  174. width: 100%;
  175. display: flex;
  176. justify-content: space-between;
  177. align-items: center;
  178. }
  179. .children {
  180. margin-left: 50rpx;
  181. margin-top: 16rpx;
  182. }
  183. .children>view {
  184. height: 50rpx;
  185. line-height: 50rpx;
  186. }
  187. .show {
  188. display: inline-block;
  189. }
  190. .hide {
  191. display: none;
  192. }
  193. .ul-item {
  194. // padding: 5px 20rpx;
  195. padding-top: 20rpx;
  196. display: flex;
  197. align-items: center;
  198. .item-value {
  199. padding: 20rpx;
  200. position: absolute;
  201. display: flex;
  202. align-items: center;
  203. width: 80%;
  204. .content {
  205. width: 51%;
  206. .title {
  207. font-size: 32rpx;
  208. font-family: Microsoft YaHei;
  209. font-weight: 400;
  210. color: #ffffff;
  211. }
  212. .tip {
  213. font-size: 24rpx;
  214. font-family: Microsoft YaHei;
  215. font-weight: 400;
  216. color: #ffffff;
  217. }
  218. }
  219. }
  220. .icon-tip {
  221. width: 100rpx;
  222. height: 100rpx;
  223. }
  224. .content {
  225. margin-left: 40rpx;
  226. }
  227. }
  228. .money {
  229. color: white;
  230. }
  231. </style>