铝交易,微信公众号
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.

382 lines
8.4 KiB

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