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

447 lines
9.6 KiB

10 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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="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.navigateTo('/pages_order/mine/coupon')">
  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. logout(){
  228. this.$store.commit('logout')
  229. },
  230. //绑定微信
  231. bindWx() {
  232. // uni.showModal({
  233. // title: '确认囊袋吗',
  234. // success(r) {
  235. // if(r.confirm){
  236. // }
  237. // }
  238. // })
  239. let self = this
  240. uni.login({
  241. success(res) {
  242. if(res.errMsg != "login:ok"){
  243. return
  244. }
  245. self.$api('bindWx', {
  246. code : res.code,
  247. }, res => {
  248. if (res.code == 200) {
  249. self.$store.commit('getUserInfo')
  250. }
  251. })
  252. }
  253. })
  254. },
  255. }
  256. }
  257. </script>
  258. <style scoped lang="scss">
  259. .page {}
  260. image {
  261. width: 100%;
  262. height: 100%;
  263. }
  264. .head {
  265. display: flex;
  266. background-color: #fff;
  267. padding: 40rpx 20rpx;
  268. align-items: center;
  269. position: relative;
  270. .headImage {
  271. width: 120rpx;
  272. height: 120rpx;
  273. // background-image: url(/static/image/center/3.png);
  274. background-size: 100% 100%;
  275. overflow: hidden;
  276. border-radius: 50%;
  277. margin-right: 40rpx;
  278. }
  279. .info {
  280. display: flex;
  281. flex-direction: column;
  282. justify-content: space-between;
  283. gap: 10rpx;
  284. font-size: 28rpx;
  285. .vip {
  286. background-color: #FCCC92;
  287. color: #FA6239;
  288. width: 100rpx;
  289. display: flex;
  290. justify-content: center;
  291. align-items: center;
  292. height: 40rpx;
  293. border-radius: 20rpx;
  294. margin-top: 20rpx;
  295. }
  296. .name {
  297. font-size: 36rpx;
  298. }
  299. .jobTime {
  300. font-size: 24rpx;
  301. }
  302. .tips {
  303. font-size: 26rpx;
  304. color: #ABABAB;
  305. }
  306. }
  307. .headBtn {
  308. margin-left: auto;
  309. padding: 15rpx 20rpx;
  310. background-color: $uni-color;
  311. color: #fff;
  312. border-radius: 20rpx;
  313. // margin-top: 50rpx;
  314. }
  315. .setting {
  316. position: absolute;
  317. right: 50rpx;
  318. top: 50rpx;
  319. margin-left: 20rpx;
  320. }
  321. }
  322. .userShop {
  323. .userList {
  324. .title {
  325. font-size: 32rpx;
  326. font-weight: 900;
  327. padding: 20rpx;
  328. }
  329. .list {
  330. display: flex;
  331. flex-wrap: wrap;
  332. .item {
  333. width: 270rpx;
  334. margin: 20rpx;
  335. display: flex;
  336. flex-direction: column;
  337. padding: 40rpx 30rpx;
  338. background-color: #fff;
  339. border-radius: 30rpx;
  340. line-height: 60rpx;
  341. .name {}
  342. .num {
  343. color: $uni-color;
  344. font-weight: 600;
  345. font-size: 28rpx;
  346. }
  347. }
  348. }
  349. }
  350. }
  351. .user {
  352. }
  353. .line {
  354. display: flex;
  355. background-color: #fff;
  356. margin-top: 20rpx;
  357. padding: 20rpx 0;
  358. .item {
  359. flex: 1;
  360. display: flex;
  361. justify-content: center;
  362. align-items: center;
  363. padding: 20rpx 0;
  364. &:nth-child(1) {
  365. border-right: 1px solid #00000013;
  366. }
  367. .image {
  368. width: 100rpx;
  369. height: 70rpx;
  370. margin-right: 20rpx;
  371. }
  372. }
  373. }
  374. .grid {
  375. flex-direction: column;
  376. font-size: 26rpx;
  377. padding: 20rpx;
  378. .title {
  379. margin-bottom: 30rpx;
  380. font-size: 28rpx;
  381. font-weight: 600;
  382. }
  383. .image {
  384. width: 70rpx;
  385. height: 70rpx;
  386. margin-bottom: 10rpx;
  387. }
  388. text {
  389. text-align: center;
  390. width: 120rpx;
  391. }
  392. }
  393. </style>