DepositCheckConfirmPopup.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :showFooters="true" :showClose="false"
  3. :title="t('Home.page_customer.item2')" @close="cancel" >
  4. <view class="popup-content">
  5. <view class="info-section">
  6. <cwg-label-line-value :label="t('Custom.Deposit.Title1')" :value="loginDoc" v-if="loginDoc" />
  7. <cwg-label-line-value :label="t('Custom.Deposit.Title2')"
  8. :value="locale == 'cn' ? channelData.name : channelData.enName" v-if="channelData.code" />
  9. <cwg-label-line-value :label="t('news_add_field.Label.Title4')" :value="selectCodes" v-if="code" />
  10. <cwg-label-line-value :label="t('Custom.Deposit.Title3')" :value="params.amount + ' ' + channelData.currency"
  11. v-if="params.amount" />
  12. <cwg-label-line-value :label="t('Label.Name')" :value="userName" v-if="channelData.confirmName" />
  13. </view>
  14. <view class="form-section" v-if="(channelData.confirmAreaCode || channelData.confirmPhone)">
  15. <uni-forms ref="formRef" :model="formData" :rules="rules" label-position="top">
  16. <uni-forms-item :label="t('placeholder.phone')"
  17. v-if="channelData.confirmAreaCode && channelData.confirmPhone">
  18. <view class="phone-input-group">
  19. <view class="area-code-input">
  20. <input type="text" v-model="formData.confirmAreaCode" placeholder="+86" />
  21. </view>
  22. <view class="phone-separator">-</view>
  23. <view class="phone-input">
  24. <input type="tel" v-model="formData.confirmPhone" placeholder="{{ t('placeholder.phone') }}" />
  25. </view>
  26. </view>
  27. </uni-forms-item>
  28. <uni-forms-item :label="t('placeholder.phone')" v-else-if="channelData.confirmPhone">
  29. <input type="tel" v-model="formData.confirmPhone" placeholder="{{ t('placeholder.phone') }}" />
  30. </uni-forms-item>
  31. <uni-forms-item :label="t('placeholder.phone')" v-else-if="channelData.confirmAreaCode">
  32. <input type="text" v-model="formData.confirmAreaCode" placeholder="{{ t('placeholder.phone') }}" />
  33. </uni-forms-item>
  34. </uni-forms>
  35. </view>
  36. <view class="merchant-info">
  37. <view v-if="locale === 'cn'">
  38. <view>商户:CWG Markets Ltd</view>
  39. <view>指定独立代表和/或分销商</view>
  40. <view>注册地址:瓦努阿图,波特维拉,Govant大厦,Kumul公路1276号,1楼</view>
  41. <view>CWG Markets Ltd 负责与本网站相关的营销、分销和客户支持服务。</view>
  42. </view>
  43. <!-- Traditional Chinese -->
  44. <view v-else-if="locale === 'zhHant'">
  45. <view>商戶:CWG Markets Ltd</view>
  46. <view>指定獨立代表和/或分銷商</view>
  47. <view>註冊地址:瓦努阿圖,波特維拉,Govant大廈,Kumul公路1276號,1樓</view>
  48. <view>CWG Markets Ltd 負責與本網站相關的行銷、分銷和客戶支援服務。</view>
  49. </view>
  50. <!-- English -->
  51. <view v-else-if="locale === 'en'">
  52. <view>Merchant: CWG Markets Ltd</view>
  53. <view>Appointed Independent Representative and/or Distributor</view>
  54. <view>Registered Address: 1276 Kumul Highway, Govant Building, 1st Floor, Port Vila, Vanuatu</view>
  55. <view>CWG Markets Ltd is responsible for marketing, distribution, and customer support services related to
  56. this
  57. website.</view>
  58. </view>
  59. <!-- Vietnamese -->
  60. <view v-else-if="locale === 'vn'">
  61. <view>Người bán: CWG Markets Ltd</view>
  62. <view>Đại diện độc lập được bổ nhiệm và/hoặc nhà phân phối</view>
  63. <view>Địa chỉ đăng ký: 1276 Kumul Highway, Tòa nhà Govant, Tầng 1, Port Vila, Vanuatu</view>
  64. <view>CWG Markets Ltd chịu trách nhiệm về tiếp thị, phân phối và dịch vụ hỗ trợ khách hàng liên quan đến trang
  65. web này.</view>
  66. </view>
  67. <!-- Thai -->
  68. <view v-else-if="locale === 'th'">
  69. <view>พาณิชย์: CWG Markets Ltd</view>
  70. <view>ตัวแทนอิสระและ/หรือตัวแทนจำหน่ายที่ได้รับการแต่งตั้ง</view>
  71. <view>ที่อยู่ที่จดทะเบียน: 1276 Kumul Highway, Govant Building, ชั้น 1, Port Vila, Vanuatu</view>
  72. <view>CWG Markets Ltd รับผิดชอบการตลาด การจัดจำหน่าย และบริการสนับสนุนลูกค้าที่เกี่ยวข้องกับเว็บไซต์นี้</view>
  73. </view>
  74. <!-- Arabic -->
  75. <view v-else-if="locale === 'ar'">
  76. <view>التاجر: CWG Markets Ltd</view>
  77. <view>الممثل المستقل المعين و/أو الموزع</view>
  78. <view>العنوان المسجل: 1276 كوميول هايوي، مبنى جوفانت، الطابق الأول، بورت فيلا، فانواتو</view>
  79. <view>تتحمل شركة CWG Markets Ltd مسؤولية التسويق والتوزيع وخدمات دعم العملاء المتعلقة بهذا الموقع.</view>
  80. </view>
  81. <!-- German -->
  82. <view v-else-if="locale === 'de'">
  83. <view>Händler: CWG Markets Ltd</view>
  84. <view>Bestellter unabhängiger Vertreter und/oder Distributor</view>
  85. <view>Registrierte Adresse: 1276 Kumul Highway, Govant Building, 1. Etage, Port Vila, Vanuatu</view>
  86. <view>CWG Markets Ltd ist verantwortlich für Marketing, Vertrieb und Kundenservice im Zusammenhang mit dieser
  87. Website.</view>
  88. </view>
  89. <!-- Spanish -->
  90. <view v-else-if="locale === 'es'">
  91. <view>Comerciante: CWG Markets Ltd</view>
  92. <view>Representante independiente y/o distribuidor designado</view>
  93. <view>Dirección registrada: 1276 Kumul Highway, Govant Building, 1er Piso, Port Vila, Vanuatu</view>
  94. <view>CWG Markets Ltd es responsable de marketing, distribución y servicios de atención al cliente
  95. relacionados
  96. con este sitio web.</view>
  97. </view>
  98. <!-- Indonesian -->
  99. <view v-else-if="locale === 'id'">
  100. <view>Pedagang: CWG Markets Ltd</view>
  101. <view>Perwakilan Independen yang Ditunjuk dan/atau Distributor</view>
  102. <view>Alamat Terdaftar: 1276 Kumul Highway, Gedung Govant, Lantai 1, Port Vila, Vanuatu</view>
  103. <view>CWG Markets Ltd bertanggung jawab atas pemasaran, distribusi, dan layanan dukungan pelanggan terkait
  104. dengan situs web ini.</view>
  105. </view>
  106. <!-- Malaysian -->
  107. <view v-else-if="locale === 'ms'">
  108. <view>Pedagang: CWG Markets Ltd</view>
  109. <view>Wakil Bebas yang Ditetapkan dan/atau Pengedar</view>
  110. <view>Alamat Didaftarkan: 1276 Kumul Highway, Bangunan Govant, Tingkat 1, Port Vila, Vanuatu</view>
  111. <view>CWG Markets Ltd bertanggungjawab ke atas pemasaran, pengedaran, dan perkhidmatan sokongan pelanggan yang
  112. berkaitan dengan laman web ini.</view>
  113. </view>
  114. <!-- Korean -->
  115. <view v-else-if="locale === 'ko'">
  116. <view>상인: CWG Markets Ltd</view>
  117. <view>지정된 독립 대표자 및/또는 유통업체</view>
  118. <view>등록된 주소: 1276 Kumul Highway, Govant Building, 1층, Port Vila, Vanuatu</view>
  119. <view>CWG Markets Ltd는 이 웹사이트와 관련된 마케팅, 배급 및 고객 지원 서비스를 담당합니다.</view>
  120. </view>
  121. <!-- Brazilian Portuguese -->
  122. <view v-else-if="locale === 'pt'">
  123. <view>Mercante: CWG Markets Ltd</view>
  124. <view>Representante Independente nomeado e/ou Distribuidor</view>
  125. <view>Endereço Registrado: 1276 Kumul Highway, Govant Building, 1º Andar, Port Vila, Vanuatu</view>
  126. <view>CWG Markets Ltd é responsável pelo marketing, distribuição e serviços de atendimento ao cliente
  127. relacionados a este site.</view>
  128. </view>
  129. <!-- Persian -->
  130. <view v-else-if="locale === 'fa'">
  131. <view>تاجر: CWG Markets Ltd</view>
  132. <view>نماینده مستقل و/یا توزیع‌کننده منصوب</view>
  133. <view>آدرس ثبت‌شده: 1276 Kumul Highway, ساختمان Govant, طبقه اول، Port Vila، وانواتو</view>
  134. <view>CWG Markets Ltd مسئول بازاریابی، توزیع و خدمات پشتیبانی مشتریان مرتبط با این وب‌سایت است.</view>
  135. </view>
  136. <!-- Turkish -->
  137. <view v-else-if="locale === 'tr'">
  138. <view>Tüccar: CWG Markets Ltd</view>
  139. <view>Atanmış Bağımsız Temsilci ve/veya Distribütör</view>
  140. <view>Kayıtlı Adres: 1276 Kumul Highway, Govant Building, 1. Kat, Port Vila, Vanuatu</view>
  141. <view>CWG Markets Ltd, bu web sitesiyle ilgili pazarlama, dağıtım ve müşteri destek hizmetlerinden sorumludur.
  142. </view>
  143. </view>
  144. <!-- Fallback to English -->
  145. <view v-else>
  146. <view>Merchant: CWG Markets Ltd</view>
  147. <view>Appointed Independent Representative and/or Distributor</view>
  148. <view>Registered Address: 1276 Kumul Highway, Govant Building, 1st Floor, Port Vila, Vanuatu</view>
  149. <view>CWG Markets Ltd is responsible for marketing, distribution, and customer support services related to
  150. this
  151. website.</view>
  152. </view>
  153. </view>
  154. </view>
  155. <template #footer>
  156. <button @click="cancel">{{ t('Btn.Cancel') }}</button>
  157. <button type="primary" @click="submit">{{ t('Btn.Confirm') }}</button>
  158. </template>
  159. </cwg-popup>
  160. </template>
  161. <script setup>
  162. import { ref, computed, watch } from 'vue';
  163. import { useI18n } from 'vue-i18n';
  164. const props = defineProps({
  165. visible: { type: Boolean, default: false },
  166. loginDoc: String,
  167. channelData: Object,
  168. code: String,
  169. selectCodes: String,
  170. params: Object,
  171. userName: String,
  172. // 其他可能需要的 props
  173. });
  174. const emit = defineEmits(['update:visible', 'confirm', 'cancel']);
  175. const { t, locale } = useI18n();
  176. const visible = computed({
  177. get: () => props.visible,
  178. set: (val) => emit('update:visible', val)
  179. });
  180. const formData = ref({
  181. confirmAreaCode: '',
  182. confirmPhone: ''
  183. });
  184. const rules = computed(() => ({
  185. confirmAreaCode: {
  186. rules: [
  187. {
  188. required: true,
  189. errorMessage: t('vaildate.select.empty')
  190. }
  191. ]
  192. },
  193. confirmPhone: {
  194. rules: [
  195. {
  196. required: true,
  197. errorMessage: t('vaildate.select.empty')
  198. },
  199. {
  200. pattern: /^1[3-9]\d{9}$/,
  201. errorMessage: t('vaildate.phone.format')
  202. }
  203. ]
  204. }
  205. }));
  206. const formRef = ref(null);
  207. watch(locale, () => {
  208. formRef.value?.clearValidate()
  209. })
  210. const cancel = () => {
  211. visible.value = false;
  212. emit('cancel');
  213. };
  214. const submit = async () => {
  215. if (formRef.value) {
  216. try {
  217. await formRef.value.validate();
  218. visible.value = false;
  219. emit('confirm', formData.value);
  220. } catch (error) {
  221. console.error('Form validation failed:', error);
  222. }
  223. } else {
  224. visible.value = false;
  225. emit('confirm', formData.value);
  226. }
  227. };
  228. </script>
  229. <style lang="scss" scoped>
  230. @import "@/uni.scss";
  231. .popup-content {
  232. .info-section {
  233. margin-bottom: px2rpx(24);
  234. padding: px2rpx(20);
  235. background-color: #f8f9fa;
  236. border-radius: px2rpx(8);
  237. border: 1px solid #e9ecef;
  238. :deep(.cwg-label-line-value) {
  239. margin-bottom: px2rpx(12);
  240. &:last-child {
  241. margin-bottom: 0;
  242. }
  243. }
  244. }
  245. .form-section {
  246. margin-bottom: px2rpx(24);
  247. padding: px2rpx(20);
  248. background-color: #ffffff;
  249. border-radius: px2rpx(8);
  250. border: 1px solid #e9ecef;
  251. :deep(.uni-forms) {
  252. width: 100%;
  253. :deep(.uni-forms-item) {
  254. margin-bottom: px2rpx(16);
  255. :deep(.uni-forms-item__label) {
  256. font-size: px2rpx(14);
  257. color: #606266;
  258. margin-bottom: px2rpx(8);
  259. }
  260. :deep(.uni-forms-item__error) {
  261. font-size: px2rpx(12);
  262. color: #f56c6c;
  263. margin-top: px2rpx(4);
  264. }
  265. }
  266. }
  267. .phone-input-group {
  268. display: flex;
  269. align-items: center;
  270. gap: px2rpx(12);
  271. .area-code-input {
  272. flex: 0 0 px2rpx(100);
  273. input {
  274. width: 100%;
  275. height: px2rpx(40);
  276. padding: 0 px2rpx(12);
  277. border: 1px solid #dcdfe6;
  278. border-radius: px2rpx(4);
  279. font-size: px2rpx(14);
  280. transition: border-color 0.3s;
  281. &:focus {
  282. outline: none;
  283. border-color: #409eff;
  284. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  285. }
  286. }
  287. }
  288. .phone-separator {
  289. font-size: px2rpx(16);
  290. color: #909399;
  291. user-select: none;
  292. }
  293. .phone-input {
  294. flex: 1;
  295. input {
  296. width: 100%;
  297. height: px2rpx(40);
  298. padding: 0 px2rpx(12);
  299. border: 1px solid #dcdfe6;
  300. border-radius: px2rpx(4);
  301. font-size: px2rpx(14);
  302. transition: border-color 0.3s;
  303. &:focus {
  304. outline: none;
  305. border-color: #409eff;
  306. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  307. }
  308. }
  309. }
  310. }
  311. input {
  312. width: 100%;
  313. height: px2rpx(40);
  314. padding: 0 px2rpx(12);
  315. border: 1px solid #dcdfe6;
  316. border-radius: px2rpx(4);
  317. font-size: px2rpx(14);
  318. transition: border-color 0.3s;
  319. &:focus {
  320. outline: none;
  321. border-color: #409eff;
  322. box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  323. }
  324. }
  325. }
  326. .merchant-info {
  327. padding: px2rpx(16);
  328. background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
  329. border-radius: px2rpx(8);
  330. font-size: px2rpx(13);
  331. line-height: 1.6;
  332. text-align: left;
  333. color: #606266;
  334. view {
  335. margin-bottom: px2rpx(8);
  336. &:last-child {
  337. margin-bottom: 0;
  338. }
  339. }
  340. }
  341. }
  342. @media (max-width: 768px) {
  343. .popup-content {
  344. .info-section,
  345. .form-section {
  346. padding: px2rpx(16);
  347. }
  348. .form-section {
  349. .phone-input-group {
  350. gap: px2rpx(8);
  351. .area-code-input {
  352. flex: 0 0 px2rpx(80);
  353. }
  354. input {
  355. height: px2rpx(36);
  356. font-size: px2rpx(13);
  357. }
  358. }
  359. }
  360. .merchant-info {
  361. padding: px2rpx(12);
  362. font-size: px2rpx(12);
  363. }
  364. }
  365. }
  366. </style>