documentaryDialog.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <cwg-popup :title="t('Documentary.AgentBackground.item1')" :visible="visible" @close="closeDia" @confirm="confirmDia">
  3. <view class="dialog-content">
  4. <uni-forms :model="formData" labelWidth="200" label-position="top" class="crm-form">
  5. <uni-forms-item label="CID">
  6. <uni-easyinput disabled :clearable="false" v-model="formData.cId"
  7. :placeholder="t('placeholder.input')" />
  8. </uni-forms-item>
  9. <uni-forms-item :label="t('Documentary.AgentBackground.item2')">
  10. <cwg-combox v-model:value="formData.permissionDisplay" :options="[
  11. {
  12. text: t('Documentary.AgentBackground.item16'),
  13. value: 1,
  14. },
  15. {
  16. text: t('Documentary.AgentBackground.item15'),
  17. value: 2,
  18. },
  19. ]" />
  20. </uni-forms-item>
  21. <uni-forms-item class="agree">
  22. <checkbox-group v-model="formData.agree" @change="onAgreeChange">
  23. <label class="checkbox">
  24. <checkbox value="1" />
  25. <view style="display: inline">
  26. <text class="crm-cursor" >{{t('Documentary.AgentBackground.item3') }}</text>
  27. <a v-if="['cn', 'zhHant'].indexOf(lang) != -1" style="color: #4497ff" href="pdf/CopyTradeUserAgreementcn.pdf" target="_blank" >{{t('Documentary.AgentBackground.item4')}}</a>
  28. <a
  29. style="color: #4497ff"
  30. href="pdf/CopyTradeUserAgreement.pdf"
  31. target="_blank"
  32. v-else
  33. >
  34. {{t('Documentary.AgentBackground.item4')}}
  35. </a>
  36. </view>
  37. </label>
  38. </checkbox-group>
  39. </uni-forms-item>
  40. <uni-forms-item class="prompt" :label="t('Drawer.Label.TemplatePrompt')">
  41. <view>
  42. <text>{{t('Documentary.AgentBackground.item5')}}</text>
  43. </view>
  44. </uni-forms-item>
  45. </uni-forms>
  46. </view>
  47. </cwg-popup>
  48. </template>
  49. <script setup lang="ts">
  50. import { ref, reactive, computed, onMounted, onUnmounted, watch } from 'vue'
  51. import { onLoad } from '@dcloudio/uni-app'
  52. import { useI18n } from 'vue-i18n' // uni-app 中已集成,但需配置
  53. import { customApi } from '@/service/custom'
  54. import { financialApi } from '@/service/financial'
  55. import Config from '@/config/index'
  56. import PaymentMethodsList from './components/PaymentMethodsList.vue'
  57. import { ibApi } from '@/service/ib'
  58. import useUserStore from '@/stores/use-user-store'
  59. import { lang } from '@/composables/config'
  60. const props = defineProps({
  61. // 是否显示弹窗
  62. visible: {
  63. type: Boolean,
  64. default: false,
  65. },
  66. // 详情formData
  67. detail: { type: Object, default: () => ({}) },
  68. })
  69. const { Code, Host80 } = Config
  70. const { t } = useI18n()
  71. const formData = ref({
  72. cId: '',
  73. permissionDisplay: '',
  74. agree: '',
  75. })
  76. const emit = defineEmits(['close','confirm'])
  77. onMounted(() => {
  78. console.log(props.visible)
  79. })
  80. watch(() => props.detail, (val) => {
  81. if (val){
  82. formData.value = val
  83. }
  84. })
  85. const onAgreeChange = (e) => {
  86. console.log(e)
  87. formData.value.agree = e.detail.value.length > 0
  88. }
  89. const closeDia = () => {
  90. emit('close')
  91. }
  92. const confirmDia = async () => {
  93. console.log(formData.value)
  94. // emit('close')
  95. const res = await ibApi.customUpdateFollowPermissionDisplay({
  96. id: formData.value.id,
  97. permissionDisplay: formData.value.permissionDisplay,
  98. })
  99. if (res.Code = Code.StatusOK) {
  100. emit('confirm')
  101. uni.showToast({
  102. title:t("Msg.Success"),
  103. icon: 'none'
  104. })
  105. }else {
  106. uni.showToast({
  107. title:res.msg,
  108. icon: 'none'
  109. })
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. @import "@/uni.scss";
  115. .crm-form {
  116. :deep(.uni-forms-item) {
  117. margin-bottom: px2rpx(16);
  118. }
  119. :deep(.uni-easyinput__content) {
  120. border: none !important;
  121. background-color: var(--color-zinc-100) !important;
  122. }
  123. }
  124. </style>