瑶都万能墙
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.

387 lines
8.7 KiB

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