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

373 lines
8.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year 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'
  19. clearable :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"
  77. @click="submit">
  78. <button class='a'>{{titleList[titleIndex]}}</button>
  79. </view>
  80. <!-- tab -->
  81. <view class="bottomTab">
  82. <span :class="titleIndex==0 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  83. @click='changePage(0)'>注册账号</span>
  84. <span style="color: #9c9fa4">|</span>
  85. <span :class="titleIndex==1 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  86. @click='changePage(1)'>账号登录</span>
  87. <span style="color: #9c9fa4">|</span>
  88. <span :class="titleIndex==2 ? 'tabbarItemActive' : 'tabbarItemNoActive'"
  89. @click='changePage(2)'>忘记密码</span>
  90. </view>
  91. </view>
  92. <configPopup ref="popup"></configPopup>
  93. </view>
  94. </template>
  95. <script>
  96. import configPopup from '@/components/config/configPopup.vue';
  97. export default {
  98. components: {
  99. configPopup
  100. },
  101. onLoad(option) {
  102. this.titleIndex = option.index || 1
  103. },
  104. data() {
  105. return {
  106. titleIndex: 0,
  107. titleList: ['注册', '登录', '重置密码'],
  108. checkboxValue: [],
  109. form: {
  110. username: '19330214982',
  111. password: '123456',
  112. loginModel : 0,
  113. captcha : '',
  114. },
  115. form1: {
  116. userName: '',
  117. code: '',
  118. password1: '',
  119. password2: '',
  120. },
  121. tips: '获取验证码',
  122. seconds: 60,
  123. }
  124. },
  125. methods: {
  126. submit(){
  127. if(!this.checkboxValue.length){
  128. return uni.showToast({
  129. title: '请先同意隐私协议',
  130. icon:'none'
  131. })
  132. }
  133. if(this.$utils.verificationAll(this.form, {
  134. username: '请输入账号',
  135. password: '请输入密码',
  136. })){
  137. return
  138. }
  139. if(!this.$utils.verificationPhone(this.form.username)){
  140. return uni.showToast({
  141. title: '账号请输入合法的手机号',
  142. icon:'none'
  143. })
  144. }
  145. if(this.titleIndex == 0){
  146. // 注册
  147. this.$api('registerUser', this.form, res =>{
  148. if(res.code == 200){
  149. this.titleIndex = 1
  150. uni.showToast({
  151. title: '注册成功,请登录!',
  152. icon : 'none'
  153. })
  154. }
  155. })
  156. }else if(this.titleIndex == 1){
  157. // 登录
  158. this.$store.commit('login', this.form)
  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. uni.showLoading({
  173. title: '正在获取验证码'
  174. })
  175. this.$api('sendSms', {
  176. username: this.form1.userName,
  177. }, res => {
  178. if (res.code == 200) {
  179. uni.hideLoading();
  180. // 这里此提示会被this.start()方法中的提示覆盖
  181. uni.$uv.toast('验证码已发送');
  182. // 通知验证码组件内部开始倒计时
  183. this.$refs.code.start();
  184. }
  185. })
  186. } else {
  187. uni.$uv.toast('请勿重复发送');
  188. }
  189. },
  190. end() {
  191. // uni.$uv.toast('倒计时结束');
  192. },
  193. start() {
  194. // uni.$uv.toast('倒计时开始');
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. * {
  201. box-sizing: border-box;
  202. }
  203. .refundsOrExchange {
  204. background-color: #FFF;
  205. height: 100vh;
  206. .frame {
  207. background-color: #FFF;
  208. .loginRegister {
  209. display: flex;
  210. flex-direction: column;
  211. gap: 40rpx;
  212. .title {
  213. display: flex;
  214. justify-content: center;
  215. align-items: flex-end;
  216. height: 10vh;
  217. color: #000;
  218. font-size: 40rpx;
  219. font-weight: 700;
  220. }
  221. .userIamge {
  222. display: flex;
  223. justify-content: center;
  224. height: 10vh;
  225. >view:nth-of-type(1) {
  226. width: 25%;
  227. height: 100%;
  228. border-radius: 50%;
  229. overflow: hidden;
  230. }
  231. }
  232. .form {
  233. height: 12vh;
  234. >view:nth-of-type(1) {
  235. padding: 20rpx 100rpx;
  236. }
  237. >view:nth-of-type(2) {
  238. padding: 0 100rpx;
  239. }
  240. >view:nth-of-type(3) {
  241. display: flex;
  242. padding: 30rpx 100rpx 0 100rpx;
  243. font-size: 22rpx
  244. }
  245. }
  246. }
  247. .btn {
  248. // height: 5vh;
  249. display: flex;
  250. justify-content: center;
  251. margin: 90rpx 0 0 0;
  252. .a {
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. width: 70%;
  257. height: 80rpx;
  258. color: #FFF;
  259. background-color: $uni-color;
  260. box-shadow: 0 0 4rpx 4rpx rgba($uni-color, 0.2);
  261. border-radius: 100rpx;
  262. font-size: 30rpx;
  263. }
  264. }
  265. .bottomTab {
  266. display: flex;
  267. justify-content: space-between;
  268. height: 10vh;
  269. padding: 0 80rpx;
  270. margin-top: 30rpx;
  271. .tabbarItemActive {
  272. color: $uni-color;
  273. }
  274. .tabbarItemNoActive {
  275. color: #9c9fa4;
  276. }
  277. }
  278. .forgetPassword {
  279. padding: 100rpx 40rpx 0 40rpx;
  280. .title {
  281. display: flex;
  282. justify-content: center;
  283. align-items: flex-end;
  284. height: 10vh;
  285. color: #000;
  286. font-size: 40rpx;
  287. font-weight: 700;
  288. }
  289. .form1 {
  290. display: flex;
  291. flex-direction: column;
  292. gap: 30rpx;
  293. margin-top: 20rpx;
  294. padding: 20rpx 80rpx;
  295. .userName {
  296. // padding: 20rpx 100 rpx;
  297. }
  298. .code {
  299. display: flex;
  300. width: 100%;
  301. .left {
  302. width: 55%;
  303. }
  304. .right {
  305. width: 45%;
  306. height: 100%;
  307. >view:nth-of-type(1) {
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. width: 100%;
  312. }
  313. }
  314. }
  315. .password1 {}
  316. .password2 {}
  317. }
  318. }
  319. }
  320. }
  321. </style>