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

363 lines
8.1 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
  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: 'h',
  111. password: 'l',
  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.titleIndex == 0){
  140. // 注册
  141. this.$api('registerUser', this.form, res =>{
  142. if(res.code == 200){
  143. this.titleIndex = 1
  144. uni.showToast({
  145. title: '注册成功,请登录!',
  146. icon : 'none'
  147. })
  148. }
  149. })
  150. }else if(this.titleIndex == 1){
  151. // 登录
  152. this.$store.commit('login', this.form)
  153. }
  154. },
  155. // 切换页面
  156. changePage(index) {
  157. this.titleIndex = index
  158. },
  159. confirm() {
  160. },
  161. codeChange(text) {
  162. this.tips = text;
  163. },
  164. getCode() {
  165. if (this.$refs.code.canGetCode) {
  166. // 模拟向后端请求验证码
  167. uni.showLoading({
  168. title: '正在获取验证码'
  169. })
  170. setTimeout(() => {
  171. uni.hideLoading();
  172. // 这里此提示会被this.start()方法中的提示覆盖
  173. uni.$uv.toast('验证码已发送');
  174. // 通知验证码组件内部开始倒计时
  175. this.$refs.code.start();
  176. }, 2000);
  177. } else {
  178. uni.$uv.toast('请勿重复发送');
  179. }
  180. },
  181. end() {
  182. // uni.$uv.toast('倒计时结束');
  183. },
  184. start() {
  185. // uni.$uv.toast('倒计时开始');
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. * {
  192. box-sizing: border-box;
  193. }
  194. .refundsOrExchange {
  195. background-color: #FFF;
  196. height: 100vh;
  197. .frame {
  198. background-color: #FFF;
  199. .loginRegister {
  200. display: flex;
  201. flex-direction: column;
  202. gap: 40rpx;
  203. .title {
  204. display: flex;
  205. justify-content: center;
  206. align-items: flex-end;
  207. height: 10vh;
  208. color: #000;
  209. font-size: 40rpx;
  210. font-weight: 700;
  211. }
  212. .userIamge {
  213. display: flex;
  214. justify-content: center;
  215. height: 10vh;
  216. >view:nth-of-type(1) {
  217. width: 25%;
  218. height: 100%;
  219. border-radius: 50%;
  220. overflow: hidden;
  221. }
  222. }
  223. .form {
  224. height: 12vh;
  225. >view:nth-of-type(1) {
  226. padding: 20rpx 100rpx;
  227. }
  228. >view:nth-of-type(2) {
  229. padding: 0 100rpx;
  230. }
  231. >view:nth-of-type(3) {
  232. display: flex;
  233. padding: 30rpx 100rpx 0 100rpx;
  234. font-size: 22rpx
  235. }
  236. }
  237. }
  238. .btn {
  239. // height: 5vh;
  240. display: flex;
  241. justify-content: center;
  242. margin: 90rpx 0 0 0;
  243. .a {
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. width: 70%;
  248. height: 80rpx;
  249. color: #FFF;
  250. background-color: $uni-color;
  251. box-shadow: 0 0 4rpx 4rpx rgba($uni-color, 0.2);
  252. border-radius: 100rpx;
  253. font-size: 30rpx;
  254. }
  255. }
  256. .bottomTab {
  257. display: flex;
  258. justify-content: space-between;
  259. height: 10vh;
  260. padding: 0 80rpx;
  261. margin-top: 30rpx;
  262. .tabbarItemActive {
  263. color: $uni-color;
  264. }
  265. .tabbarItemNoActive {
  266. color: #9c9fa4;
  267. }
  268. }
  269. .forgetPassword {
  270. padding: 100rpx 40rpx 0 40rpx;
  271. .title {
  272. display: flex;
  273. justify-content: center;
  274. align-items: flex-end;
  275. height: 10vh;
  276. color: #000;
  277. font-size: 40rpx;
  278. font-weight: 700;
  279. }
  280. .form1 {
  281. display: flex;
  282. flex-direction: column;
  283. gap: 30rpx;
  284. margin-top: 20rpx;
  285. padding: 20rpx 80rpx;
  286. .userName {
  287. // padding: 20rpx 100 rpx;
  288. }
  289. .code {
  290. display: flex;
  291. width: 100%;
  292. .left {
  293. width: 55%;
  294. }
  295. .right {
  296. width: 45%;
  297. height: 100%;
  298. >view:nth-of-type(1) {
  299. display: flex;
  300. justify-content: center;
  301. align-items: center;
  302. width: 100%;
  303. }
  304. }
  305. }
  306. .password1 {}
  307. .password2 {}
  308. }
  309. }
  310. }
  311. }
  312. </style>