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

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