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

interestsList.vue 5.5KB

1年前
1年前
1年前
1年前
11 个月前
1年前
1年前
11 个月前
1年前
1年前
1年前
11 个月前
1年前
11 个月前
11 个月前
11 个月前
11 个月前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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 { msg, navTo } from "@/utils/utils";
  18. import { jump } from "@/datas/9901Jump.js";
  19. import {
  20. getOpenidApi
  21. } from "@/utils/network/api";
  22. import {
  23. getItem,
  24. setItem
  25. } from "@/utils/storage";
  26. import { deviceType } from "@/utils/network/difference";
  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. console.log("state.signAgencyId",state.signAgencyId,deviceType)
  73. if(state.signAgencyId==deviceType){
  74. let obj={
  75. type:state.type,
  76. userType:state.userType,
  77. promoteId:state.promoteId
  78. }
  79. const params = encodeURIComponent(JSON.stringify(obj))
  80. jump("15",params)
  81. }else{
  82. if (state.changeCardType == "1") {
  83. navTo(
  84. `/subpackage/after-sale/to-bookkeeping-card/mailing_information?orderId=${state.orderId}&&applyId=${state.applyId}&&productId=${state.promoteId}&&totalAmount=${state.totalAmount}&&equityId=${state.equityId}`
  85. )
  86. } else {
  87. // 正常流程
  88. uni.redirectTo({
  89. url: `/subpackage/orders/essential-information?promoteId=${getItem("promoteId")}&userType=${state.userType}&type=${state.type}&isValueCard=${state.isValueCard}&totalAmount=${state.totalAmount}&equityId=${state.equityId}`,
  90. });
  91. }
  92. }
  93. }
  94. const getInfo = () => {
  95. const options = {
  96. type: 2,
  97. data: {
  98. "singleEquityId": state.equityId,
  99. },
  100. method: 'POST',
  101. showLoading: true,
  102. }
  103. request(equityProductsInfo, options).then((res) => {
  104. const data = stringToJson(res.bizContent);
  105. console.log("333333", data.productIntro)
  106. richText.value = data.productIntro
  107. })
  108. }
  109. //获取微信小程序openid
  110. const getOpenID = () => {
  111. // #ifdef MP-WEIXIN
  112. uni.login({
  113. provider: "weixin",
  114. success: function (e) {
  115. console.log(e);
  116. getOpenid(e.code);
  117. },
  118. });
  119. //#endif
  120. };
  121. const getOpenid = (code) => {
  122. const options = {
  123. type: 2,
  124. data: {
  125. "jsCode": code
  126. },
  127. method: "POST",
  128. showLoading: true,
  129. };
  130. // #ifdef MP-WEIXIN
  131. request(getOpenidApi, options).then((res) => {
  132. const result = stringToJson(res.bizContent);
  133. console.log("获取微信小程序openid", result);
  134. const openidData = stringToJson(result.data);
  135. state.openid = openidData.openid;
  136. setItem("QYorder", state);
  137. });
  138. // #endif
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .btn-wrap {
  143. text-align: center;
  144. position: fixed;
  145. bottom: 40rpx;
  146. width: 90%;
  147. left: 5%;
  148. }
  149. .imageDefault {
  150. height: 40rpx;
  151. width: 40rpx;
  152. transform: rotate(270deg);
  153. margin-right: 12rpx;
  154. color: white;
  155. }
  156. .imageChange {
  157. height: 40rpx;
  158. width: 40rpx;
  159. transform: rotate(90deg);
  160. margin-right: 12rpx;
  161. color: white;
  162. }
  163. .item {
  164. width: 90%;
  165. margin: 20rpx auto;
  166. background-color: rgb(41, 199, 207);
  167. border-radius: 20rpx;
  168. padding: 20rpx;
  169. box-sizing: border-box;
  170. color: white;
  171. font-size: 32rpx;
  172. }
  173. .button {
  174. height: 80rpx;
  175. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  176. border-radius: 40rpx;
  177. font-size: 32rpx;
  178. font-weight: 400;
  179. color: #ffffff;
  180. line-height: 80rpx;
  181. }
  182. .item>.title {
  183. width: 100%;
  184. display: flex;
  185. justify-content: space-between;
  186. align-items: center;
  187. }
  188. .children {
  189. margin-left: 50rpx;
  190. margin-top: 16rpx;
  191. }
  192. .children>view {
  193. height: 50rpx;
  194. line-height: 50rpx;
  195. }
  196. .show {
  197. display: inline-block;
  198. }
  199. .hide {
  200. display: none;
  201. }
  202. .ul-item {
  203. // padding: 5px 20rpx;
  204. padding-top: 20rpx;
  205. display: flex;
  206. align-items: center;
  207. .item-value {
  208. padding: 20rpx;
  209. position: absolute;
  210. display: flex;
  211. align-items: center;
  212. width: 80%;
  213. .content {
  214. width: 51%;
  215. .title {
  216. font-size: 32rpx;
  217. font-family: Microsoft YaHei;
  218. font-weight: 400;
  219. color: #ffffff;
  220. }
  221. .tip {
  222. font-size: 24rpx;
  223. font-family: Microsoft YaHei;
  224. font-weight: 400;
  225. color: #ffffff;
  226. }
  227. }
  228. }
  229. .icon-tip {
  230. width: 100rpx;
  231. height: 100rpx;
  232. }
  233. .content {
  234. margin-left: 40rpx;
  235. }
  236. }
  237. .money {
  238. color: white;
  239. }
  240. </style>