IbInfo.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <view class="IbInfo">
  3. <cwg-popup ref="dialogApplyIb" type="center" :title="t('Home.msg.ibTitle')" showFooterLine
  4. :cancelText="t('Btn.Cancel')" :confirmText="confirmText" @close="closeIb" @confirm="confirmIb" :slot-name="'agree'">
  5. <view class="dia-content" v-if="ibStatus.status == 0">
  6. <view
  7. class="content"
  8. style="height: 400px; line-height: 1.5; text-align: left"
  9. id="Agreement"
  10. >
  11. <view class="title">{{ t('CWGMarketsLtdPARTNERSAgreement.title1') }}</view>
  12. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item0') }}</view>
  13. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item01') }}</view>
  14. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item02') }}</view>
  15. <view class="ul">
  16. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item03') }}</view>
  17. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item04') }}</view>
  18. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item05') }}</view>
  19. </view>
  20. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item1') }}</view>
  21. <view class="ul">
  22. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item11') }}</view>
  23. </view>
  24. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item2') }}</view>
  25. <view class="ul">
  26. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item21') }}</view>
  27. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item22') }}</view>
  28. <view class='ul-li'>
  29. <view class="ul">
  30. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item221') }}</view>
  31. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item222') }}</view>
  32. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item223') }}</view>
  33. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item224') }}</view>
  34. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item225') }}</view>
  35. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item226') }}</view>
  36. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item227') }}</view>
  37. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item228') }}</view>
  38. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item229') }}</view>
  39. </view>
  40. </view>
  41. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item23') }}</view>
  42. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item24') }}</view>
  43. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item25') }}</view>
  44. <view class='ul-li'>
  45. <view class="ul">
  46. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item251') }}</view>
  47. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item252') }}</view>
  48. </view>
  49. </view>
  50. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item26') }}</view>
  51. </view>
  52. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item3') }}</view>
  53. <view class="ul">
  54. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item31') }}</view>
  55. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item32') }}</view>
  56. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item33') }}</view>
  57. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item34') }}</view>
  58. <view class='ul-li'>
  59. <view class="ul">
  60. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item341') }}</view>
  61. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item342') }}</view>
  62. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item343') }}</view>
  63. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item344') }}</view>
  64. </view>
  65. </view>
  66. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item35') }}</view>
  67. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item36') }}</view>
  68. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item37') }}</view>
  69. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item38') }}</view>
  70. </view>
  71. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item4') }}</view>
  72. <view class="ul">
  73. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item41') }}</view>
  74. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item42') }}</view>
  75. </view>
  76. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item5') }}</view>
  77. <view class="ul">
  78. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item51') }}</view>
  79. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item52') }}</view>
  80. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item53') }}</view>
  81. </view>
  82. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item6') }}</view>
  83. <view class="ul">
  84. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item61') }}</view>
  85. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item62') }}</view>
  86. </view>
  87. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item7') }}</view>
  88. <view class="ul">
  89. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item71') }}</view>
  90. <view class='ul-li'>
  91. <view class="ul">
  92. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item711') }}</view>
  93. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item712') }}</view>
  94. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item713') }}</view>
  95. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item714') }}</view>
  96. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item715') }}</view>
  97. </view>
  98. </view>
  99. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item72') }}</view>
  100. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item73') }}</view>
  101. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item74') }}</view>
  102. </view>
  103. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item8') }}</view>
  104. <view class="ul">
  105. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item81') }}</view>
  106. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item82') }}</view>
  107. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item83') }}</view>
  108. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item84') }}</view>
  109. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item85') }}</view>
  110. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item86') }}</view>
  111. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item87') }}</view>
  112. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item88') }}</view>
  113. <view class='ul-li'>{{ t('CWGMarketsLtdPARTNERSAgreement.item89') }}</view>
  114. </view>
  115. <view class="tit">{{ t('CWGMarketsLtdPARTNERSAgreement.item9') }}</view>
  116. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item91') }}</view>
  117. <view class="title">{{ t('CWGMarketsLtdPARTNERSAgreement.title2') }}</view>
  118. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item101') }}</view>
  119. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item102') }}</view>
  120. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item103') }}</view>
  121. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item104') }}</view>
  122. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item105') }}</view>
  123. <view class="p">{{ t('CWGMarketsLtdPARTNERSAgreement.item106') }}</view>
  124. </view>
  125. </view>
  126. <view class="dia-content" v-if="ibStatus.status == 1">
  127. <view
  128. class="content"
  129. style="
  130. display: flex;
  131. justify-content: center;
  132. align-content: center;
  133. flex-wrap: wrap;
  134. font-size: 20px;
  135. height: 150px;
  136. "
  137. >
  138. <view style="width: 100%; margin: 15px 0; font-size: 16px">
  139. <i class="el-icon-loading" style="font-size: 32px"></i>
  140. </view>
  141. <view style="width: 100%; margin: 15px 0; font-size: 14px">
  142. <span>{{ t('ApplicationDialog.ibStatus') }}</span>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="dia-content" v-if="ibStatus.status == 3">
  147. <view
  148. class="content"
  149. style="
  150. display: flex;
  151. justify-content: center;
  152. align-content: center;
  153. flex-wrap: wrap;
  154. font-size: 14px;
  155. height: 150px;
  156. "
  157. >
  158. <view
  159. style="width: 100%; margin: 15px 0; font-weight: bold"
  160. >{{ t('ApplicationDialog.ibRefused') }}
  161. </view>
  162. <view style="width: 100%; margin: 15px 0; font-size: 14px">
  163. <span>{{ t('ApplicationDialog.ibDes') }}</span>
  164. <span v-if="reasons[ibStatus.approveDesc]">{{
  165. lang == 'cn'
  166. ? reasons[ibStatus.approveDesc].content
  167. : reasons[ibStatus.approveDesc].enContent
  168. }}</span>
  169. <span v-else>{{ ibStatus.approveDesc || '--' }}</span>
  170. </view>
  171. </view>
  172. </view>
  173. <template #agree>
  174. <view v-if="ibStatus.status == 0">
  175. <view class="agree" >
  176. <checkbox-group :value="ibAgree" @change="onAgreeChange">
  177. <label class="checkbox">
  178. <checkbox value="1" :checked="!!ibAgree"/>
  179. <text class="crm-cursor" style="text-decoration: underline;">{{
  180. t('Home.msg.Agree1') }}</text>
  181. </label>
  182. </checkbox-group>
  183. </view>
  184. </view>
  185. </template>
  186. </cwg-popup>
  187. </view>
  188. </template>
  189. <script setup lang="ts">
  190. import { computed, ref, onMounted, emit } from 'vue'
  191. import { useI18n } from 'vue-i18n'
  192. import useUserStore from '@/stores/use-user-store'
  193. import useRouter from '@/hooks/useRouter'
  194. import useRoute from '@/hooks/useRoute'
  195. import { personalApi } from '@/service/personal'
  196. import Config from '@/config'
  197. import { customApi } from '@/service/custom'
  198. import { useStorage } from '@vueuse/core'
  199. const { Code } = Config
  200. const router = useRouter()
  201. const route = useRoute()
  202. const { userInfo,saveUserInfo } = useUserStore()
  203. const { t } = useI18n()
  204. const dialogCheckStatus = ref('')
  205. const dialogCheck = ref()
  206. const dialogApplyIb = ref()
  207. const ibStatus = ref({})
  208. const lang = useStorage('lang')
  209. const reasons = ref({})
  210. const ibAgree = ref('')
  211. const customInfo = computed(() => {
  212. return userInfo.customInfo
  213. })
  214. const emit = defineEmits(['confirm', 'close'])
  215. const confirmText = computed(() => {
  216. return ibStatus.value.status == 3 ? t('Btn.AgainApply') : t('Btn.Confirm')
  217. })
  218. const getLogin = async () => {
  219. let res = await personalApi.CustomLoginInfo()
  220. if (res.code == Code.StatusOK) {
  221. dialogCheckStatus.value = res.data.customInfo.applyRealStatus
  222. if (
  223. res.data.customInfo.status == 2 &&
  224. res.data.customInfo.applyRealStatus == 2
  225. ) {
  226. applyIbStatus()
  227. } else {
  228. // applyIbStatus()
  229. // dialogAuthCheck.value = false;
  230. // dialogCheck.value.open()
  231. }
  232. } else {
  233. uni.showToast({
  234. title: t('Msg.SystemError'),
  235. icon: 'none',
  236. })
  237. }
  238. }
  239. //获取原因列表
  240. const searchReasons = async () => {
  241. let res = await customApi.reasonsRefusalList({ type: nviewl })
  242. if (res.code == Code.StatusOK) {
  243. if (res.data == nviewl) {
  244. reasons.value = {}
  245. } else {
  246. reasons.value = res.data
  247. }
  248. } else {
  249. uni.showToast({
  250. title: res.msg,
  251. icon: 'none',
  252. })
  253. }
  254. }
  255. const closeIb = async () => {
  256. dialogApplyIb.value.close()
  257. }
  258. const onAgreeChange = async (value) => {
  259. ibAgree.value = (value?.detail?.value.length) || ''
  260. }
  261. // 确认按钮
  262. const confirmIb = async () => {
  263. const status = ibStatus.value.status
  264. if (status == 0) {
  265. applyIb()
  266. }else if (status == 1) {
  267. dialogApplyIb.value.close()
  268. emit('close')
  269. }else if (status == 3) {
  270. ibStatus.value.status = 0
  271. }
  272. }
  273. const getLoginInfo = async () => {
  274. let res = await customApi.CustomLoginInfo();
  275. if (res.code == Code.StatusOK) {
  276. saveUserInfo(res.data)
  277. } else {
  278. uni.showToast({title: t('Msg.SystemError'),
  279. icon: 'none'})
  280. }
  281. }
  282. // 申请ib
  283. const applyIb = async () => {
  284. console.log(ibAgree.value)
  285. if (!ibAgree.value) {
  286. uni.showToast({title: t("Msg.Read"),icon: 'none'})
  287. return
  288. }
  289. let res = await customApi.customApplyIb()
  290. if (res.code == Code.StatusOK) {
  291. uni.showToast({title: t("Msg.Success"),icon: 'none'})
  292. getLoginInfo();
  293. dialogApplyIb.value.close()
  294. emit('confirm')
  295. // reload();
  296. }
  297. }
  298. //判断申请ib状态
  299. const applyIbStatus = async () => {
  300. let res = await customApi.customApplyIbStatus({})
  301. if (res.code == Code.StatusOK) {
  302. ibStatus.value = { ...res.data }
  303. if (ibStatus.value.status == 0) {
  304. dialogApplyIb.value.open()
  305. } else if (ibStatus.value.status == 1) {
  306. dialogApplyIb.value.open()
  307. } else if (ibStatus.value.status == 2) {
  308. } else if (ibStatus.value.status == 3) {
  309. searchReasons()
  310. dialogApplyIb.value.open()
  311. }
  312. } else {
  313. uni.showToast({
  314. title: res.msg,
  315. icon: 'none',
  316. })
  317. }
  318. }
  319. onMounted(() => {
  320. // 进入ib相关页面时,请求
  321. // if (route.path.indexOf('pages/ib/') !== -1) {
  322. // getLogin()
  323. // }
  324. // dialogApplyIb.value.open()
  325. })
  326. // 暴露方法给父组件
  327. defineExpose({
  328. getInfo: getLogin,
  329. open: () => popupRef.value?.open()
  330. })
  331. </script>
  332. <style scoped lang="scss">
  333. @import "@/uni.scss";
  334. #Agreement {
  335. p,
  336. ul,
  337. li {
  338. line-height: 1.8;
  339. font-size: 14px;
  340. padding: 2px 0;
  341. text-indent: 25px;
  342. }
  343. ul ul {
  344. box-sizing: border-box;
  345. padding-left: 25px;
  346. }
  347. .title {
  348. text-align: center;
  349. font-size: 16px;
  350. font-weight: bold;
  351. text-indent: 0;
  352. color: #EB3F57;
  353. }
  354. .p,.ul-li,.ul{
  355. line-height: 1.8;
  356. font-size: 14px;
  357. padding: 2px 0;
  358. text-indent: 25px;
  359. }
  360. .ul .ul{
  361. box-sizing: border-box;
  362. padding-left: 25px;
  363. }
  364. .tit {
  365. font-weight: bold;
  366. text-indent: 0;
  367. }
  368. }
  369. .agree {
  370. margin: px2rpx(24) 0;
  371. display: flex;
  372. align-items: flex-start;
  373. .checkbox {
  374. display: flex;
  375. align-items: flex-start;
  376. gap: px2rpx(8);
  377. :deep(uni-checkbox .uni-checkbox-input) {
  378. border-radius: px2rpx(4);
  379. width: px2rpx(18);
  380. height: px2rpx(18);
  381. }
  382. text {
  383. font-size: px2rpx(13);
  384. color: var(--color-zinc-500);
  385. line-height: 1.5;
  386. }
  387. }
  388. }
  389. </style>