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

451 lines
9.6 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
8 months ago
8 months ago
8 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
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
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
8 months ago
9 months ago
8 months ago
9 months ago
8 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="headImage" mode="aspectFill"></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. {{ username }}
  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" @click="$utils.navigateTo('/pages_order/mine/updateUserInfo')">
  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. username(){
  164. return this.userInfo.shop
  165. && this.userInfo.shop.name
  166. || this.userInfo.nickName
  167. || '用户昵称'
  168. },
  169. headImage(){
  170. return this.userInfo.shop
  171. && this.userInfo.shop.pic
  172. || this.userInfo.headImage
  173. || '/static/image/center/3.png'
  174. },
  175. },
  176. data() {
  177. return {
  178. userList: [],
  179. queryParams: {
  180. pageNo: 1,
  181. pageSize: 10,
  182. title: '',
  183. },
  184. total: 0,
  185. }
  186. },
  187. onShow() {
  188. this.$store.commit('getUserInfo')
  189. // 水洗店获取我的用户
  190. if (this.userShop) {
  191. this.getUserPage()
  192. }
  193. },
  194. //滚动到屏幕底部
  195. onReachBottom() {
  196. if (this.queryParams.pageSize < this.total) {
  197. this.queryParams.pageSize += 10
  198. // 水洗店获取我的用户
  199. if (this.userShop) {
  200. this.getUserPage()
  201. }
  202. }
  203. },
  204. methods: {
  205. headBtn() {
  206. let self = this
  207. uni.showModal({
  208. title: '演示切换角色之后的效果',
  209. success(res) {
  210. if (res.confirm) {
  211. self.$store.state.shop = !self.$store.state.shop
  212. }
  213. }
  214. })
  215. },
  216. // 获取客户数据
  217. getUserPage() {
  218. console.log(this.userInfo.nickName);
  219. this.$api('getMyUserPage', this.queryParams, res => {
  220. uni.stopPullDownRefresh()
  221. if (res.code == 200) {
  222. this.userList = res.result.records
  223. this.total = res.result.total
  224. }
  225. })
  226. },
  227. //设置营业时间
  228. setJobTime() {
  229. },
  230. logout(){
  231. this.$store.commit('logout')
  232. },
  233. //绑定微信
  234. bindWx() {
  235. // uni.showModal({
  236. // title: '确认囊袋吗',
  237. // success(r) {
  238. // if(r.confirm){
  239. // }
  240. // }
  241. // })
  242. let self = this
  243. uni.login({
  244. success(res) {
  245. if(res.errMsg != "login:ok"){
  246. return
  247. }
  248. self.$api('bindWx', {
  249. code : res.code,
  250. }, res => {
  251. if (res.code == 200) {
  252. self.$store.commit('getUserInfo')
  253. }
  254. })
  255. }
  256. })
  257. },
  258. }
  259. }
  260. </script>
  261. <style scoped lang="scss">
  262. .page {}
  263. image {
  264. width: 100%;
  265. height: 100%;
  266. }
  267. .head {
  268. display: flex;
  269. background-color: #fff;
  270. padding: 40rpx 20rpx;
  271. align-items: center;
  272. position: relative;
  273. .headImage {
  274. width: 120rpx;
  275. height: 120rpx;
  276. // background-image: url(/static/image/center/3.png);
  277. background-size: 100% 100%;
  278. overflow: hidden;
  279. border-radius: 50%;
  280. margin-right: 40rpx;
  281. }
  282. .info {
  283. display: flex;
  284. flex-direction: column;
  285. justify-content: space-between;
  286. gap: 10rpx;
  287. font-size: 28rpx;
  288. .vip {
  289. background-color: #FCCC92;
  290. color: #FA6239;
  291. width: 100rpx;
  292. display: flex;
  293. justify-content: center;
  294. align-items: center;
  295. height: 40rpx;
  296. border-radius: 20rpx;
  297. margin-top: 20rpx;
  298. }
  299. .name {
  300. font-size: 36rpx;
  301. }
  302. .jobTime {
  303. font-size: 24rpx;
  304. }
  305. .tips {
  306. font-size: 26rpx;
  307. color: #ABABAB;
  308. }
  309. }
  310. .headBtn {
  311. margin-left: auto;
  312. padding: 15rpx 20rpx;
  313. background-color: $uni-color;
  314. color: #fff;
  315. border-radius: 20rpx;
  316. // margin-top: 50rpx;
  317. }
  318. .setting {
  319. position: absolute;
  320. right: 50rpx;
  321. top: 50rpx;
  322. margin-left: 20rpx;
  323. }
  324. }
  325. .userShop {
  326. .userList {
  327. .title {
  328. font-size: 32rpx;
  329. font-weight: 900;
  330. padding: 20rpx;
  331. }
  332. .list {
  333. display: flex;
  334. flex-wrap: wrap;
  335. .item {
  336. width: 270rpx;
  337. margin: 20rpx;
  338. display: flex;
  339. flex-direction: column;
  340. padding: 40rpx 30rpx;
  341. background-color: #fff;
  342. border-radius: 30rpx;
  343. line-height: 60rpx;
  344. .name {}
  345. .num {
  346. color: $uni-color;
  347. font-weight: 600;
  348. font-size: 28rpx;
  349. }
  350. }
  351. }
  352. }
  353. }
  354. .user {
  355. }
  356. .line {
  357. display: flex;
  358. background-color: #fff;
  359. margin-top: 20rpx;
  360. padding: 20rpx 0;
  361. .item {
  362. flex: 1;
  363. display: flex;
  364. justify-content: center;
  365. align-items: center;
  366. padding: 20rpx 0;
  367. &:nth-child(1) {
  368. border-right: 1px solid #00000013;
  369. }
  370. .image {
  371. width: 100rpx;
  372. height: 70rpx;
  373. margin-right: 20rpx;
  374. }
  375. }
  376. }
  377. .grid {
  378. flex-direction: column;
  379. font-size: 26rpx;
  380. padding: 20rpx;
  381. .title {
  382. margin-bottom: 30rpx;
  383. font-size: 28rpx;
  384. font-weight: 600;
  385. }
  386. .image {
  387. width: 70rpx;
  388. height: 70rpx;
  389. margin-bottom: 10rpx;
  390. }
  391. text {
  392. text-align: center;
  393. width: 120rpx;
  394. }
  395. }
  396. </style>