铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

512 lines
12 KiB

6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="refundsOrExchange">
  3. <navbar :title="titleList[titleIndex]" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <!-- 注册 -->
  6. <view class='forgetPassword' v-if='titleIndex == 0'>
  7. <!-- 标题 -->
  8. <view class="title">{{titleList[titleIndex]}}</view>
  9. <!-- 表单 -->
  10. <view class="form1">
  11. <view class="userName">
  12. <uv-input v-model="form1.username" placeholder="请输入手机号" border="surround" shape='circle'
  13. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  14. </view>
  15. <view class="code">
  16. <view class="left">
  17. <uv-input v-model="form1.captcha" placeholder="请输入验证码" border="surround" shape='circle'
  18. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  19. </view>
  20. <view class="right">
  21. <view>
  22. <uv-toast ref="toast"></uv-toast>
  23. <uv-code :seconds="seconds" @end="end" @start="start" ref="code"
  24. @change="codeChange"></uv-code>
  25. <uv-button @tap="getCode" iconSize='10rpx' color='#1f1c39'
  26. shape='circle'>{{tips}}</uv-button>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="password1">
  31. <uv-input v-model="form1.password" placeholder="设置您的新密码(6到50个字符)" password clearable
  32. border="surround" shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  33. </view>
  34. <view class="password2">
  35. <uv-input v-model="form1.newPassword" placeholder="重新确认密码" password clearable border="surround"
  36. shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  37. </view>
  38. </view>
  39. <view>
  40. <uv-checkbox-group v-model="checkboxValue" shape="circle">
  41. <view class="content">
  42. <view style="display: flex;">
  43. <uv-checkbox size="30rpx" :name="1"></uv-checkbox>
  44. 请你阅读并同意我们的<span style="color: #fd5100"
  45. @click="$refs.popup.open('getPrivacyPolicy')">隐私条款</span><span
  46. style="color: #fd5100"
  47. @click="$refs.popup.open('getUserAgreement')">服务协议</span>
  48. </view>
  49. </view>
  50. </uv-checkbox-group>
  51. </view>
  52. </view>
  53. <!-- 登录 -->
  54. <view class="loginRegister" v-if='titleIndex==1'>
  55. <!-- 标题 -->
  56. <view class="title">{{titleList[titleIndex]}}</view>
  57. <!-- 头像 -->
  58. <view class="userIamge">
  59. <view>
  60. <img src="/static/image/center/11.svg" alt="" style="width: 100%;height: 100%;">
  61. </view>
  62. </view>
  63. <!-- 用户名&密码&隐私条款 -->
  64. <view class="form">
  65. <view>
  66. <uv-input v-model="form.username" placeholder="请输入账号" border="surround" shape='circle' clearable
  67. :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  68. </view>
  69. <view>
  70. <uv-input v-model="form.password" password placeholder="请输入密码" border="surround" shape='circle'
  71. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  72. </view>
  73. <view>
  74. <uv-checkbox-group v-model="checkboxValue" shape="circle">
  75. <view class="content">
  76. <view style="display: flex;">
  77. <uv-checkbox size="30rpx" :name="1"></uv-checkbox>
  78. 请你阅读并同意我们的<span style="color: #fd5100"
  79. @click="$refs.popup.open('getPrivacyPolicy')">隐私条款</span><span
  80. style="color: #fd5100"
  81. @click="$refs.popup.open('getUserAgreement')">服务协议</span>
  82. </view>
  83. </view>
  84. </uv-checkbox-group>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 忘记密码 -->
  89. <view class='forgetPassword' v-if='titleIndex == 2'>
  90. <!-- 标题 -->
  91. <view class="title">{{titleList[titleIndex]}}</view>
  92. <!-- 表单 -->
  93. <view class="form1">
  94. <view class="userName">
  95. <uv-input v-model="form1.username" placeholder="请输入手机号" border="surround" shape='circle'
  96. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  97. </view>
  98. <view class="code">
  99. <view class="left">
  100. <uv-input v-model="form1.captcha" placeholder="请输入验证码" border="surround" shape='circle'
  101. clearable :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  102. </view>
  103. <view class="right">
  104. <view>
  105. <uv-toast ref="toast"></uv-toast>
  106. <uv-code :seconds="seconds" @end="end" @start="start" ref="code"
  107. @change="codeChange"></uv-code>
  108. <uv-button @tap="getCode" iconSize='10rpx' color='#1f1c39'
  109. shape='circle'>{{tips}}</uv-button>
  110. </view>
  111. </view>
  112. </view>
  113. <view class="password1">
  114. <uv-input v-model="form1.password" placeholder="设置您的新密码(6到50个字符)" password clearable
  115. border="surround" shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  116. </view>
  117. <view class="password2">
  118. <uv-input v-model="form1.newPassword" placeholder="重新确认密码" password clearable border="surround"
  119. shape='circle' :customStyle="{ backgroundColor: '#f6f6f6'}"></uv-input>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 按钮 -->
  124. <view class="btn" @click="submit">
  125. <button class='a'>{{titleList[titleIndex]}}</button>
  126. </view>
  127. <!-- tab -->
  128. <view class="bottomTab">
  129. <span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  130. @click='changePage(0)'>注册账号</span>
  131. <span style="color: #9c9fa4">|</span>
  132. <span :class="titleIndex==1 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  133. @click='changePage(1)'>账号登录</span>
  134. <span style="color: #9c9fa4">|</span>
  135. <span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  136. @click='changePage(2)'>忘记密码</span>
  137. </view>
  138. </view>
  139. <configPopup ref="popup"></configPopup>
  140. </view>
  141. </template>
  142. <script>
  143. import configPopup from '@/components/config/configPopup.vue';
  144. export default {
  145. components: {
  146. configPopup
  147. },
  148. onLoad(option) {
  149. this.titleIndex = option.index || 1
  150. },
  151. data() {
  152. return {
  153. titleIndex: 0,
  154. titleList: ['注册', '登录', '重置密码'],
  155. checkboxValue: [],
  156. form: {
  157. username: '19330214982',
  158. password: '1234567',
  159. loginModel: 0,
  160. captcha: '',
  161. },
  162. form1: {
  163. username: '',
  164. captcha: '',
  165. password: '',
  166. newPassword: '',
  167. },
  168. tips: '获取验证码',
  169. seconds: 60,
  170. }
  171. },
  172. methods: {
  173. submit() {
  174. if (!this.checkboxValue.length && this.titleIndex != 2) {
  175. return uni.showToast({
  176. title: '请先同意隐私协议',
  177. icon: 'none'
  178. })
  179. }
  180. if (this.titleIndex == 0) {
  181. // 注册
  182. this.register()
  183. } else if (this.titleIndex == 1) {
  184. // 登录
  185. this.login()
  186. } else {
  187. // 忘记密码
  188. this.updatePassword()
  189. }
  190. },
  191. // 登录
  192. login(){
  193. if (this.$utils.verificationAll(this.form, {
  194. username: '请输入账号',
  195. password: '请输入密码',
  196. })) {
  197. return
  198. }
  199. if (!this.$utils.verificationPhone(this.form.username)) {
  200. return uni.showToast({
  201. title: '请输入合法的手机号',
  202. icon: 'none'
  203. })
  204. }
  205. // 登录
  206. this.$store.commit('login', this.form)
  207. },
  208. // 注册
  209. register(){
  210. if (this.$utils.verificationAll(this.form1, {
  211. username: '请输入账号',
  212. captcha : '请输入验证码',
  213. password: '请输入密码',
  214. newPassword: '请确认密码',
  215. })) {
  216. return
  217. }
  218. if (!this.$utils.verificationPhone(this.form1.username)) {
  219. return uni.showToast({
  220. title: '请输入合法的手机号',
  221. icon: 'none'
  222. })
  223. }
  224. if (this.form1.password != this.form1.newPassword) {
  225. return uni.showToast({
  226. title: '密码与确认密码不一致',
  227. icon: 'none'
  228. })
  229. }
  230. this.$api('registerUser', this.form1, res => {
  231. this.form1 = {}
  232. if (res.code == 200) {
  233. this.titleIndex = 1
  234. uni.showToast({
  235. title: '注册成功,请登录!',
  236. icon: 'none'
  237. })
  238. }
  239. })
  240. },
  241. updatePassword(){
  242. if (this.$utils.verificationAll(this.form1, {
  243. username: '请输入账号',
  244. captcha : '请输入验证码',
  245. password: '请输入新密码',
  246. newPassword: '请确认密码',
  247. })) {
  248. return
  249. }
  250. if (!this.$utils.verificationPhone(this.form1.username)) {
  251. return uni.showToast({
  252. title: '请输入合法的手机号',
  253. icon: 'none'
  254. })
  255. }
  256. if (this.form1.password != this.form1.newPassword) {
  257. return uni.showToast({
  258. title: '密码与确认密码不一致',
  259. icon: 'none'
  260. })
  261. }
  262. this.$api('newPassword', this.form1, res => {
  263. this.form1 = {}
  264. if (res.code == 200) {
  265. this.titleIndex = 1
  266. uni.showToast({
  267. title: '修改成功,请登录!',
  268. icon: 'none'
  269. })
  270. }
  271. })
  272. },
  273. // 切换页面
  274. changePage(index) {
  275. this.titleIndex = index
  276. },
  277. confirm() {
  278. },
  279. codeChange(text) {
  280. this.tips = text;
  281. },
  282. getCode() {
  283. if (this.$refs.code.canGetCode) {
  284. if (!this.$utils.verificationPhone(this.form1.username)) {
  285. return uni.showToast({
  286. title: '请输入合法的手机号',
  287. icon: 'none'
  288. })
  289. }
  290. uni.showLoading({
  291. title: '正在获取验证码'
  292. })
  293. this.$api('sendSms', {
  294. username: this.form1.username,
  295. }, res => {
  296. if (res.code == 200) {
  297. uni.hideLoading();
  298. // 这里此提示会被this.start()方法中的提示覆盖
  299. uni.$uv.toast('验证码已发送');
  300. // 通知验证码组件内部开始倒计时
  301. this.$refs.code.start();
  302. }
  303. })
  304. } else {
  305. uni.$uv.toast('请勿重复发送');
  306. }
  307. },
  308. end() {
  309. // uni.$uv.toast('倒计时结束');
  310. },
  311. start() {
  312. // uni.$uv.toast('倒计时开始');
  313. }
  314. }
  315. }
  316. </script>
  317. <style lang="scss" scoped>
  318. * {
  319. box-sizing: border-box;
  320. }
  321. .content{
  322. font-size: 22rpx;
  323. margin: 0 auto;
  324. }
  325. .refundsOrExchange {
  326. background-color: #FFF;
  327. height: 100vh;
  328. .frame {
  329. background-color: #FFF;
  330. .loginRegister {
  331. display: flex;
  332. flex-direction: column;
  333. gap: 40rpx;
  334. padding-bottom: 50rpx;
  335. .title {
  336. display: flex;
  337. justify-content: center;
  338. align-items: flex-end;
  339. height: 10vh;
  340. color: #000;
  341. font-size: 40rpx;
  342. font-weight: 700;
  343. }
  344. .userIamge {
  345. display: flex;
  346. justify-content: center;
  347. height: 10vh;
  348. >view:nth-of-type(1) {
  349. width: 25%;
  350. height: 100%;
  351. border-radius: 50%;
  352. overflow: hidden;
  353. }
  354. }
  355. .form {
  356. height: 12vh;
  357. >view:nth-of-type(1) {
  358. padding: 20rpx 100rpx;
  359. }
  360. >view:nth-of-type(2) {
  361. padding: 0 100rpx;
  362. }
  363. >view:nth-of-type(3) {
  364. display: flex;
  365. padding: 30rpx 100rpx 0 100rpx;
  366. font-size: 22rpx;
  367. }
  368. }
  369. }
  370. .btn {
  371. // height: 5vh;
  372. display: flex;
  373. justify-content: center;
  374. margin: 90rpx 0 0 0;
  375. .a {
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. width: 70%;
  380. height: 80rpx;
  381. color: #FFF;
  382. background-color: $uni-color;
  383. box-shadow: 0 0 4rpx 4rpx rgba($uni-color, 0.2);
  384. border-radius: 100rpx;
  385. font-size: 30rpx;
  386. }
  387. }
  388. .bottomTab {
  389. display: flex;
  390. justify-content: space-between;
  391. height: 10vh;
  392. padding: 0 80rpx;
  393. margin-top: 30rpx;
  394. .tabbarItemActive {
  395. color: $uni-color;
  396. }
  397. .tabbarItemNoActive {
  398. color: #9c9fa4;
  399. }
  400. }
  401. .forgetPassword {
  402. padding: 100rpx 40rpx 0 40rpx;
  403. .title {
  404. display: flex;
  405. justify-content: center;
  406. align-items: flex-end;
  407. height: 10vh;
  408. color: #000;
  409. font-size: 40rpx;
  410. font-weight: 700;
  411. }
  412. .form1 {
  413. display: flex;
  414. flex-direction: column;
  415. gap: 30rpx;
  416. margin-top: 20rpx;
  417. padding: 20rpx 80rpx;
  418. .userName {
  419. // padding: 20rpx 100 rpx;
  420. }
  421. .code {
  422. display: flex;
  423. width: 100%;
  424. .left {
  425. width: 55%;
  426. }
  427. .right {
  428. width: 45%;
  429. height: 100%;
  430. >view:nth-of-type(1) {
  431. display: flex;
  432. justify-content: center;
  433. align-items: center;
  434. width: 100%;
  435. }
  436. }
  437. }
  438. .password1 {}
  439. .password2 {}
  440. }
  441. }
  442. }
  443. }
  444. </style>