documentaryDialog.vue 3.9 KB

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