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

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