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

353 lines
7.2 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" />
  4. <view class="head">
  5. <view class="headImage">
  6. <image src="" mode=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. {{ userInfo.nickName || '微信用户' }}
  11. </view>
  12. <!-- <view class="vip">
  13. VIP1
  14. </view> -->
  15. <!-- <view class="tips">
  16. 今天是您来的的第32天
  17. </view> -->
  18. </view>
  19. <view class="headBtn" @click="headBtn">
  20. 角色切换
  21. </view>
  22. <view class="setting">
  23. <uv-icon name="setting" size="40rpx"></uv-icon>
  24. </view>
  25. </view>
  26. <!-- 水洗店 -->
  27. <view class="userShop" v-if="userShop">
  28. <userShopCommission />
  29. <view class="userList">
  30. <view class="title">
  31. 我的用户
  32. </view>
  33. <view class="list">
  34. <view class="item" v-for="(item, index) in 20" :key="index">
  35. <view class="name">
  36. 客户王生
  37. </view>
  38. <view class="num">
  39. 剩余水洗布198
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 酒店 -->
  46. <view class="user" v-else>
  47. <view class="line">
  48. <view class="item">
  49. <view class="image">
  50. <image src="/static/image/center/1.png" mode=""></image>
  51. </view>
  52. <view class="">
  53. 余额 {{ userInfo.balance || 0 }}
  54. </view>
  55. </view>
  56. <view class="item">
  57. <view class="image">
  58. <image src="/static/image/center/4.png" mode=""></image>
  59. </view>
  60. <view class="">
  61. 押金{{ userInfo.deposit || 0 }}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="line grid">
  66. <view class="title">
  67. 常用功能
  68. </view>
  69. <uv-grid :col="4" :border="false">
  70. <uv-grid-item @click="$utils.navigateTo('/pages_order/mine/address')">
  71. <image class="image" src="/static/image/center/7.png" mode=""></image>
  72. <text class="grid-text">地址管理</text>
  73. </uv-grid-item>
  74. <uv-grid-item @click="$utils.redirectTo('/index/order')">
  75. <image class="image" src="/static/image/center/8.png" mode=""></image>
  76. <text class="grid-text">订单管理</text>
  77. </uv-grid-item>
  78. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+0)">
  79. <image class="image" src="/static/image/center/5.png" mode=""></image>
  80. <text class="grid-text">换货</text>
  81. </uv-grid-item>
  82. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+1)">
  83. <image class="image" src="/static/image/center/7.png" mode=""></image>
  84. <text class="grid-text">退货</text>
  85. </uv-grid-item>
  86. </uv-grid>
  87. </view>
  88. <view class="line grid">
  89. <uv-grid :col="4" :border="false">
  90. <uv-grid-item @click="$refs.customerServicePopup.open()">
  91. <image class="image" src="/static/image/center/9.png" mode=""></image>
  92. <text class="grid-text">联系客服</text>
  93. </uv-grid-item>
  94. <uv-grid-item @click="$utils.navigateTo('/pages_order/mine/lease')">
  95. <image class="image" src="/static/image/center/6.png" mode=""></image>
  96. <text class="grid-text">我的租赁</text>
  97. </uv-grid-item>
  98. <uv-grid-item @click="$utils.redirectTo('/index/cart')">
  99. <image class="image" src="/static/image/center/7.png" mode=""></image>
  100. <text class="grid-text">租赁车</text>
  101. </uv-grid-item>
  102. <uv-grid-item
  103. @click="$utils.navigateTo('/pages_order/order/applyLaundryStore')">
  104. <image class="image" src="/static/image/center/7.png" mode=""></image>
  105. <text class="grid-text">申请成为水洗店</text>
  106. </uv-grid-item>
  107. </uv-grid>
  108. </view>
  109. </view>
  110. <customerServicePopup ref="customerServicePopup"/>
  111. <tabber select="4" />
  112. </view>
  113. </template>
  114. <script>
  115. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  116. import tabber from '@/components/base/tabbar.vue'
  117. import {
  118. mapGetters,
  119. mapState,
  120. } from 'vuex'
  121. import userShopCommission from '@/components/userShop/userShopCommission.vue'
  122. export default {
  123. components: {
  124. tabber,
  125. userShopCommission,
  126. customerServicePopup,
  127. },
  128. computed: {
  129. ...mapGetters(['userShop']),
  130. ...mapState(['userInfo']),
  131. },
  132. data() {
  133. return {
  134. userList : [],
  135. queryParams: {
  136. pageNo: 1,
  137. pageSize: 10,
  138. title: '',
  139. },
  140. total : 0,
  141. }
  142. },
  143. onShow() {
  144. this.$store.commit('getUserInfo')
  145. // 水洗店获取我的用户
  146. if(this.userShop){
  147. this.getUserPage()
  148. }
  149. },
  150. //滚动到屏幕底部
  151. onReachBottom() {
  152. if(this.queryParams.pageSize < this.productList.total){
  153. this.queryParams.pageSize += 10
  154. // 水洗店获取我的用户
  155. if(this.userShop){
  156. this.getUserPage()
  157. }
  158. }
  159. },
  160. methods: {
  161. headBtn() {
  162. let self = this
  163. uni.showModal({
  164. title: '演示切换角色之后的效果',
  165. success(res) {
  166. if (res.confirm) {
  167. self.$store.state.shop = !self.$store.state.shop
  168. }
  169. }
  170. })
  171. },
  172. // 获取客户数据
  173. getUserPage(){
  174. this.$api('getMyUserPage', this.queryParams, res => {
  175. uni.stopPullDownRefresh()
  176. if(res.code == 200){
  177. this.userList = res.result
  178. console.log("===getUserPage==");
  179. }
  180. })
  181. },
  182. }
  183. }
  184. </script>
  185. <style scoped lang="scss">
  186. .page {
  187. }
  188. image {
  189. width: 100%;
  190. height: 100%;
  191. }
  192. .head {
  193. display: flex;
  194. background-color: #fff;
  195. padding: 40rpx 20rpx;
  196. align-items: center;
  197. position: relative;
  198. .headImage {
  199. width: 120rpx;
  200. height: 120rpx;
  201. background-image: url(/static/image/center/3.png);
  202. background-size: 100% 100%;
  203. overflow: hidden;
  204. border-radius: 50%;
  205. margin-right: 40rpx;
  206. }
  207. .info {
  208. font-size: 28rpx;
  209. .vip {
  210. background-color: #FCCC92;
  211. color: #FA6239;
  212. width: 100rpx;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. height: 40rpx;
  217. border-radius: 20rpx;
  218. margin-top: 20rpx;
  219. }
  220. .name {
  221. font-size: 32rpx;
  222. }
  223. .tips {
  224. font-size: 26rpx;
  225. color: #ABABAB;
  226. }
  227. }
  228. .headBtn {
  229. margin-left: auto;
  230. padding: 15rpx 20rpx;
  231. background-color: $uni-color;
  232. color: #fff;
  233. border-radius: 20rpx;
  234. margin-top: 50rpx;
  235. }
  236. .setting {
  237. position: absolute;
  238. right: 50rpx;
  239. top: 50rpx;
  240. }
  241. }
  242. .userShop {
  243. .userList {
  244. .title {
  245. font-size: 32rpx;
  246. font-weight: 900;
  247. padding: 20rpx;
  248. }
  249. .list {
  250. display: flex;
  251. flex-wrap: wrap;
  252. .item {
  253. width: 270rpx;
  254. margin: 20rpx;
  255. display: flex;
  256. flex-direction: column;
  257. padding: 40rpx 30rpx;
  258. background-color: #fff;
  259. border-radius: 30rpx;
  260. line-height: 60rpx;
  261. .name {}
  262. .num {
  263. color: $uni-color;
  264. font-weight: 600;
  265. font-size: 28rpx;
  266. }
  267. }
  268. }
  269. }
  270. }
  271. .user {
  272. .line {
  273. display: flex;
  274. background-color: #fff;
  275. margin-top: 20rpx;
  276. padding: 20rpx 0;
  277. .item {
  278. flex: 1;
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. padding: 20rpx 0;
  283. &:nth-child(1) {
  284. border-right: 1px solid #00000013;
  285. }
  286. .image {
  287. width: 100rpx;
  288. height: 70rpx;
  289. margin-right: 20rpx;
  290. }
  291. }
  292. }
  293. .grid {
  294. flex-direction: column;
  295. font-size: 26rpx;
  296. padding: 20rpx;
  297. .title {
  298. margin-bottom: 30rpx;
  299. font-size: 28rpx;
  300. font-weight: 600;
  301. }
  302. .image {
  303. width: 70rpx;
  304. height: 70rpx;
  305. margin-bottom: 10rpx;
  306. }
  307. text {
  308. text-align: center;
  309. width: 120rpx;
  310. }
  311. }
  312. }
  313. </style>