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

384 lines
8.2 KiB

9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 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="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" @click="$refs.seleteJobTimePopup.open()">
  15. {{ userInfo && userInfo.shop && userInfo.shop.jobTime ? '营业时间:'+userInfo.shop.jobTime : "请设置营业时间" }}
  16. </view>
  17. <!-- 往这里写 -->
  18. </view>
  19. <!-- <view class="vip">
  20. VIP1
  21. </view> -->
  22. <!-- <view class="tips">
  23. 今天是您来的的第32天
  24. </view> -->
  25. </view>
  26. <view class="headBtn" @click="headBtn">
  27. 角色切换
  28. </view>
  29. <view class="setting">
  30. <uv-icon name="setting" size="40rpx"></uv-icon>
  31. </view>
  32. </view>
  33. <!-- 水洗店 -->
  34. <view class="userShop" v-if="userShop">
  35. <userShopCommission />
  36. <view class="userList">
  37. <view class="title">
  38. 我的用户
  39. </view>
  40. <view class="list">
  41. <view class="item" @click="$utils.navigateTo('/index/order?uid=' + item.id)"
  42. v-for="(item, index) in userList" :key="index">
  43. <view class="name">
  44. 客户{{ item.name }}
  45. </view>
  46. <view class="num">
  47. 剩余水洗布{{ item.num }}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- 酒店 -->
  54. <view class="user" v-else>
  55. <view class="line">
  56. <view class="item">
  57. <view class="image">
  58. <image src="/static/image/center/1.png" mode=""></image>
  59. </view>
  60. <view class="">
  61. 余额 {{ userInfo.balance || 0 }}
  62. </view>
  63. </view>
  64. <view class="item">
  65. <view class="image">
  66. <image src="/static/image/center/4.png" mode=""></image>
  67. </view>
  68. <view class="">
  69. 押金{{ userInfo.deposit || 0 }}
  70. </view>
  71. </view>
  72. </view>
  73. <view class="line grid">
  74. <view class="title">
  75. 常用功能
  76. </view>
  77. <uv-grid :col="4" :border="false">
  78. <uv-grid-item @click="$utils.navigateTo('/pages_order/mine/address')">
  79. <image class="image" src="/static/image/center/7.png" mode=""></image>
  80. <text class="grid-text">地址管理</text>
  81. </uv-grid-item>
  82. <uv-grid-item @click="$utils.redirectTo('/index/order')">
  83. <image class="image" src="/static/image/center/8.png" mode=""></image>
  84. <text class="grid-text">订单管理</text>
  85. </uv-grid-item>
  86. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+0)">
  87. <image class="image" src="/static/image/center/7.png" mode=""></image>
  88. <text class="grid-text">退货</text>
  89. </uv-grid-item>
  90. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+1)">
  91. <image class="image" src="/static/image/center/5.png" mode=""></image>
  92. <text class="grid-text">换货</text>
  93. </uv-grid-item>
  94. </uv-grid>
  95. </view>
  96. <view class="line grid">
  97. <uv-grid :col="4" :border="false">
  98. <uv-grid-item @click="$refs.customerServicePopup.open()">
  99. <image class="image" src="/static/image/center/9.png" mode=""></image>
  100. <text class="grid-text">联系客服</text>
  101. </uv-grid-item>
  102. <uv-grid-item @click="$utils.navigateTo('/pages_order/mine/lease')">
  103. <image class="image" src="/static/image/center/6.png" mode=""></image>
  104. <text class="grid-text">我的租赁</text>
  105. </uv-grid-item>
  106. <uv-grid-item @click="$utils.redirectTo('/index/cart')">
  107. <image class="image" src="/static/image/center/7.png" mode=""></image>
  108. <text class="grid-text">租赁车</text>
  109. </uv-grid-item>
  110. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/applyLaundryStore')">
  111. <image class="image" src="/static/image/center/7.png" mode=""></image>
  112. <text class="grid-text">申请成为水洗店</text>
  113. </uv-grid-item>
  114. </uv-grid>
  115. </view>
  116. </view>
  117. <!-- 联系客服弹框 -->
  118. <customerServicePopup ref="customerServicePopup" />
  119. <!-- 设置营业时间 -->
  120. <seleteJobTimePopup ref="seleteJobTimePopup" />
  121. <tabber select="4" />
  122. </view>
  123. </template>
  124. <script>
  125. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  126. import seleteJobTimePopup from '@/components/userShop/seleteJobTime.vue'
  127. import tabber from '@/components/base/tabbar.vue'
  128. import {
  129. mapGetters,
  130. mapState,
  131. } from 'vuex'
  132. import userShopCommission from '@/components/userShop/userShopCommission.vue'
  133. export default {
  134. components: {
  135. tabber,
  136. userShopCommission,
  137. customerServicePopup,
  138. seleteJobTimePopup,
  139. },
  140. computed: {
  141. ...mapGetters(['userShop']),
  142. ...mapState(['userInfo']),
  143. },
  144. data() {
  145. return {
  146. userList: [],
  147. queryParams: {
  148. pageNo: 1,
  149. pageSize: 10,
  150. title: '',
  151. },
  152. total: 0,
  153. }
  154. },
  155. onShow() {
  156. this.$store.commit('getUserInfo')
  157. // 水洗店获取我的用户
  158. if (this.userShop) {
  159. this.getUserPage()
  160. }
  161. },
  162. //滚动到屏幕底部
  163. onReachBottom() {
  164. if (this.queryParams.pageSize < this.total) {
  165. this.queryParams.pageSize += 10
  166. // 水洗店获取我的用户
  167. if (this.userShop) {
  168. this.getUserPage()
  169. }
  170. }
  171. },
  172. methods: {
  173. headBtn() {
  174. let self = this
  175. uni.showModal({
  176. title: '演示切换角色之后的效果',
  177. success(res) {
  178. if (res.confirm) {
  179. self.$store.state.shop = !self.$store.state.shop
  180. }
  181. }
  182. })
  183. },
  184. // 获取客户数据
  185. getUserPage() {
  186. console.log(this.userInfo.nickName);
  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>