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

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