酒店桌布为微信小程序
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.

400 lines
9.0 KiB

  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. import bottomBtn from "../../components/bottom/bottomBtn.vue"
  108. export default {
  109. components: {
  110. bottomBtn
  111. },
  112. onLoad(option) {
  113. this.titleIndex = option.index
  114. this.title = option.index == 0 ? '注册' : option.index == 1 ? '登录' : '忘记密码'
  115. this.btnText = option.index == 0 ? '注册' : option.index == 1 ? '登录' : '重置密码'
  116. },
  117. data() {
  118. return {
  119. titleIndex: 0,
  120. titleList: ['注册账号', '账号密码登录', '重置密码'],
  121. checkboxValue: ['apple'],
  122. form: {
  123. userName: '',
  124. password: '',
  125. checkboxValue: 'apple',
  126. },
  127. form1: {
  128. userName: '',
  129. code: '',
  130. password1: '',
  131. password2: '',
  132. },
  133. bottomBtnStyle: {
  134. color: '#FFF',
  135. backgroundColor: '#fd5100',
  136. fontSize: '34rpx',
  137. width: '400rpx',
  138. height: '80rpx',
  139. borderRadius: '100rpx',
  140. bottom: '42%'
  141. },
  142. title: "", //标题
  143. btnText: "", //按钮文字,
  144. tips: '获取验证码',
  145. seconds: 60,
  146. }
  147. },
  148. methods: {
  149. // 切换页面
  150. changePage(index) {
  151. this.titleIndex = index
  152. this.title = index == 0 ? '注册' : index == 1 ? '登录' : '忘记密码'
  153. this.btnText = index == 0 ? '注册' : index == 1 ? '登录' : '重置密码'
  154. },
  155. confirm() {
  156. },
  157. codeChange(text) {
  158. this.tips = text;
  159. },
  160. getCode() {
  161. if (this.$refs.code.canGetCode) {
  162. // 模拟向后端请求验证码
  163. uni.showLoading({
  164. title: '正在获取验证码'
  165. })
  166. setTimeout(() => {
  167. uni.hideLoading();
  168. // 这里此提示会被this.start()方法中的提示覆盖
  169. uni.$uv.toast('验证码已发送');
  170. // 通知验证码组件内部开始倒计时
  171. this.$refs.code.start();
  172. }, 2000);
  173. } else {
  174. uni.$uv.toast('请勿重复发送');
  175. }
  176. },
  177. end() {
  178. // uni.$uv.toast('倒计时结束');
  179. },
  180. start() {
  181. // uni.$uv.toast('倒计时开始');
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. * {
  188. box-sizing: border-box;
  189. }
  190. .refundsOrExchange {
  191. background-color: #FFF;
  192. height: 100vh;
  193. .frame {
  194. background-color: #FFF;
  195. .loginRegister {
  196. display: flex;
  197. flex-direction: column;
  198. gap: 40rpx;
  199. .title {
  200. display: flex;
  201. justify-content: center;
  202. align-items: flex-end;
  203. height: 10vh;
  204. color: #000;
  205. font-size: 40rpx;
  206. font-weight: 700;
  207. }
  208. .userIamge {
  209. display: flex;
  210. justify-content: center;
  211. height: 10vh;
  212. >view:nth-of-type(1) {
  213. width: 25%;
  214. height: 100%;
  215. border-radius: 50%;
  216. overflow: hidden;
  217. }
  218. }
  219. .form {
  220. height: 12vh;
  221. >view:nth-of-type(1) {
  222. padding: 20rpx 100rpx;
  223. }
  224. >view:nth-of-type(2) {
  225. padding: 0 100rpx;
  226. }
  227. >view:nth-of-type(3) {
  228. display: flex;
  229. padding: 30rpx 100rpx 0 100rpx;
  230. font-size: 22rpx
  231. }
  232. }
  233. .btn {
  234. // height: 5vh;
  235. display: flex;
  236. justify-content: center;
  237. margin: 50rpx 0 0 0;
  238. .a {
  239. display: flex;
  240. justify-content: center;
  241. align-items: center;
  242. width: 70%;
  243. height: 80rpx;
  244. color: #FFF;
  245. background-color: #fd5100;
  246. border: 1px solid red;
  247. border-radius: 100rpx;
  248. font-size: 30rpx;
  249. }
  250. }
  251. .bottomTab {
  252. display: flex;
  253. justify-content: space-between;
  254. height: 10vh;
  255. padding: 0 80rpx;
  256. .tabbarItemActive {
  257. color: #fd5100;
  258. }
  259. .tabbarItemNoActive {
  260. color: #9c9fa4;
  261. }
  262. }
  263. }
  264. .forgetPassword {
  265. padding: 100rpx 40rpx 0 40rpx;
  266. .title {
  267. display: flex;
  268. justify-content: center;
  269. align-items: flex-end;
  270. height: 10vh;
  271. color: #000;
  272. font-size: 40rpx;
  273. font-weight: 700;
  274. }
  275. .form1 {
  276. display: flex;
  277. flex-direction: column;
  278. gap: 30rpx;
  279. margin-top: 20rpx;
  280. padding: 20rpx 80rpx;
  281. .userName {
  282. // padding: 20rpx 100 rpx;
  283. }
  284. .code {
  285. display: flex;
  286. width: 100%;
  287. .left {
  288. width: 55%;
  289. }
  290. .right {
  291. width: 45%;
  292. height: 100%;
  293. >view:nth-of-type(1) {
  294. display: flex;
  295. justify-content: center;
  296. align-items: center;
  297. width: 100%;
  298. }
  299. }
  300. }
  301. .password1 {}
  302. .password2 {}
  303. }
  304. .btn {
  305. // height: 5vh;
  306. display: flex;
  307. justify-content: center;
  308. margin: 30rpx 0 0 0;
  309. .a {
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. width: 70%;
  314. height: 80rpx;
  315. color: #FFF;
  316. background-color: #fd5100;
  317. border: 1px solid red;
  318. border-radius: 100rpx;
  319. font-size: 30rpx;
  320. }
  321. }
  322. .bottomTab {
  323. display: flex;
  324. justify-content: space-between;
  325. margin: 50rpx 0 0 0;
  326. padding: 0 80rpx;
  327. .tabbarItemActive {
  328. color: #fd5100;
  329. }
  330. .tabbarItemNoActive {
  331. color: #9c9fa4;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. </style>