风险测评小程序前端代码仓库
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.

346 lines
7.7 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month 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.account" 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;flex-wrap: wrap;">
  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='#fd5100'
  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. account: '13135294009',
  111. password: 'lzx123456',
  112. },
  113. form1: {
  114. userName: '',
  115. code: '',
  116. password1: '',
  117. password2: '',
  118. },
  119. tips: '获取验证码',
  120. seconds: 60,
  121. }
  122. },
  123. methods: {
  124. submit(){
  125. if(!this.checkboxValue.length){
  126. return uni.showToast({
  127. title: '请先同意隐私协议',
  128. icon:'none'
  129. })
  130. }
  131. if(this.$utils.verificationAll(this.form, {
  132. account: '请输入账号',
  133. password: '请输入密码',
  134. })){
  135. return
  136. }
  137. this.$store.commit('accountLogin', this.form)
  138. },
  139. // 切换页面
  140. changePage(index) {
  141. this.titleIndex = index
  142. },
  143. confirm() {
  144. },
  145. codeChange(text) {
  146. this.tips = text;
  147. },
  148. getCode() {
  149. if (this.$refs.code.canGetCode) {
  150. // 模拟向后端请求验证码
  151. uni.showLoading({
  152. title: '正在获取验证码'
  153. })
  154. setTimeout(() => {
  155. uni.hideLoading();
  156. // 这里此提示会被this.start()方法中的提示覆盖
  157. uni.$uv.toast('验证码已发送');
  158. // 通知验证码组件内部开始倒计时
  159. this.$refs.code.start();
  160. }, 2000);
  161. } else {
  162. uni.$uv.toast('请勿重复发送');
  163. }
  164. },
  165. end() {
  166. // uni.$uv.toast('倒计时结束');
  167. },
  168. start() {
  169. // uni.$uv.toast('倒计时开始');
  170. }
  171. }
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. * {
  176. box-sizing: border-box;
  177. }
  178. .refundsOrExchange {
  179. background-color: #FFF;
  180. height: 100vh;
  181. .frame {
  182. background-color: #FFF;
  183. .loginRegister {
  184. display: flex;
  185. flex-direction: column;
  186. gap: 40rpx;
  187. .title {
  188. display: flex;
  189. justify-content: center;
  190. align-items: flex-end;
  191. height: 10vh;
  192. color: #000;
  193. font-size: 40rpx;
  194. font-weight: 700;
  195. }
  196. .userIamge {
  197. display: flex;
  198. justify-content: center;
  199. height: 10vh;
  200. >view:nth-of-type(1) {
  201. width: 25%;
  202. height: 100%;
  203. border-radius: 50%;
  204. overflow: hidden;
  205. }
  206. }
  207. .form {
  208. line-height: 50rpx;
  209. >view:nth-of-type(1) {
  210. padding: 20rpx 100rpx;
  211. }
  212. >view:nth-of-type(2) {
  213. padding: 0 100rpx;
  214. }
  215. >view:nth-of-type(3) {
  216. display: flex;
  217. padding: 30rpx 100rpx 0 100rpx;
  218. font-size: 22rpx
  219. }
  220. }
  221. }
  222. .btn {
  223. // height: 5vh;
  224. display: flex;
  225. justify-content: center;
  226. margin: 90rpx 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: $uni-color;
  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. margin-top: 30rpx;
  246. .tabbarItemActive {
  247. color: $uni-color;
  248. }
  249. .tabbarItemNoActive {
  250. color: #9c9fa4;
  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. }
  294. }
  295. }
  296. </style>