DepositCheckConfirmPopup.vue 14 KB

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