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

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