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 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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="getUserinfo()">
  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 { requestNew } from "@/utils/network/request";
  15. import { navTo } from "@/utils/utils";
  16. import { jump } from "@/datas/9901Jump.js";
  17. import {
  18. singleEquityDetail, getOpenId, getUserMsg
  19. } from "@/utils/network/api";
  20. import {
  21. getItem,
  22. setItem
  23. } from "@/utils/storage";
  24. import { deviceType } from "@/utils/network/difference";
  25. const state = reactive({
  26. openid: "",
  27. equityId: "",
  28. id: "",
  29. clientFee: "",
  30. list: [], //权益数据
  31. choiceValue: [], //选择的权益数据的下标
  32. choiceValueComplete: [], //选择的权益数据的具体数据
  33. isValueCard: "",
  34. vanType: 0,
  35. userType: 0,
  36. totalAmount: 0, //产品+权益产品金额
  37. changeCardType: "",//储值卡转记账卡选权益产品
  38. applyId: "",
  39. orderId: "",
  40. sysType: "",
  41. signAgencyId: "",
  42. productId: "",//产品编号
  43. cardType: "",
  44. productIntro: "",
  45. })
  46. const 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.vanType = option.vanType;
  60. state.isValueCard = option.isValueCard;
  61. state.cardType = option.cardType;
  62. state.productId = option.productId;
  63. state.totalAmount = option.fee;
  64. state.productIntro = option.productIntro;
  65. // richText.value = JSON.parse(option.productIntro);
  66. // console.log(richText.value, "rich-text");
  67. // 储值卡转记账卡传过来的参数
  68. state.changeCardType = option.changeCardType;
  69. state.applyId = option.applyId;
  70. state.orderId = option.orderId;
  71. getInfo();
  72. getOpenID();
  73. state.signAgencyId = option.signAgencyId;
  74. })
  75. const getUserinfo = () => {
  76. const options = {
  77. type: 2,
  78. data: { openId: getItem('openId') },
  79. method: "POST",
  80. showLoading: true,
  81. };
  82. requestNew(getUserMsg, options).then((res) => {
  83. const data = res;
  84. console.log(data, "用户信息"); //|| !data.userNegImgUrl || !data.userPosImgUrl
  85. if (!data.userIdNum || !data.userNegImgUrl || !data.userPosImgUrl) {
  86. uni.showModal({
  87. title: "请先完成实名认证",
  88. icon: "none",
  89. duration: 2000,
  90. success: () => {
  91. setTimeout(() => {
  92. uni.navigateTo({
  93. url: "/subpackage/personal-center/real-name-authentication",
  94. });
  95. }, 2000);
  96. },
  97. });
  98. } else {
  99. addInterestsList();
  100. }
  101. });
  102. }
  103. const addInterestsList = () => {
  104. console.log("state.signAgencyId", state.signAgencyId, deviceType)
  105. if (state.signAgencyId === deviceType) {
  106. let obj = {
  107. type: state.vanType,
  108. userType: state.userType,
  109. promoteId: state.productId
  110. }
  111. const params = encodeURIComponent(JSON.stringify(obj))
  112. jump("15", params)
  113. } else {
  114. if (state.changeCardType == "1") {
  115. navTo(
  116. `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.productId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}`
  117. )
  118. } else {
  119. // 正常流程
  120. navTo(
  121. `/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}`,
  122. );
  123. }
  124. }
  125. }
  126. const getInfo = () => {
  127. const options = {
  128. type: 2,
  129. data: {
  130. // "singleEquityId": state.equityId,
  131. "releaseId": state.productId,
  132. },
  133. method: 'POST',
  134. showLoading: true,
  135. }
  136. requestNew("/iaw/issue/product/pageDetail", options).then((res) => {
  137. const data = res;
  138. console.log("333333", data.productIntro)
  139. richText.value = data.productIntro
  140. })
  141. }
  142. //获取微信小程序openid
  143. const getOpenID = () => {
  144. // #ifdef MP-WEIXIN
  145. uni.login({
  146. provider: "weixin",
  147. success: function (e) {
  148. console.log(e);
  149. getOpenid(e.code);
  150. },
  151. });
  152. //#endif
  153. };
  154. const getOpenid = (code) => {
  155. const options = {
  156. type: 2,
  157. data: {
  158. "jsCode": code
  159. },
  160. method: "POST",
  161. showLoading: true,
  162. };
  163. // #ifdef MP-WEIXIN
  164. requestNew(getOpenId, options).then((res) => {
  165. const result = res;
  166. setItem("wxOpenid", result.openid);
  167. });
  168. // #endif
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .btn-wrap {
  173. text-align: center;
  174. position: fixed;
  175. bottom: 40rpx;
  176. width: 100%;
  177. left: 0;
  178. }
  179. .imageDefault {
  180. height: 40rpx;
  181. width: 40rpx;
  182. transform: rotate(270deg);
  183. margin-right: 12rpx;
  184. color: white;
  185. }
  186. .imageChange {
  187. height: 40rpx;
  188. width: 40rpx;
  189. transform: rotate(90deg);
  190. margin-right: 12rpx;
  191. color: white;
  192. }
  193. .item {
  194. width: 90%;
  195. margin: 20rpx auto;
  196. background-color: rgb(41, 199, 207);
  197. border-radius: 20rpx;
  198. padding: 20rpx;
  199. box-sizing: border-box;
  200. color: white;
  201. font-size: 32rpx;
  202. }
  203. .button {
  204. height: 88rpx;
  205. background: radial-gradient(at 0% 0%, #01243A 0%, #004576 100%);
  206. border-radius: 44rpx;
  207. font-size: 32rpx;
  208. font-weight: 400;
  209. color: #ffffff;
  210. line-height: 88rpx;
  211. width: 660rpx;
  212. margin: 0 auto;
  213. }
  214. .item>.title {
  215. width: 100%;
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. }
  220. .children {
  221. margin-left: 50rpx;
  222. margin-top: 16rpx;
  223. }
  224. .children>view {
  225. height: 50rpx;
  226. line-height: 50rpx;
  227. }
  228. .show {
  229. display: inline-block;
  230. }
  231. .hide {
  232. display: none;
  233. }
  234. .ul-item {
  235. padding-top: 20rpx;
  236. display: flex;
  237. align-items: center;
  238. .item-value {
  239. padding: 20rpx;
  240. position: absolute;
  241. display: flex;
  242. align-items: center;
  243. width: 80%;
  244. .content {
  245. width: 51%;
  246. .title {
  247. font-size: 32rpx;
  248. font-family: Microsoft YaHei;
  249. font-weight: 400;
  250. color: #ffffff;
  251. }
  252. .tip {
  253. font-size: 24rpx;
  254. font-family: Microsoft YaHei;
  255. font-weight: 400;
  256. color: #ffffff;
  257. }
  258. }
  259. }
  260. .icon-tip {
  261. width: 100rpx;
  262. height: 100rpx;
  263. }
  264. .content {
  265. margin-left: 40rpx;
  266. }
  267. }
  268. .money {
  269. color: white;
  270. }
  271. </style>