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

366 lines
8.2 KiB

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