商城类、订单类uniapp模板,多角色
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.

352 lines
6.8 KiB

5 months ago
2 months ago
5 months ago
2 months ago
5 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" />
  4. <view class="head">
  5. <view class="headImage">
  6. <image src="" mode=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. 倾心.
  11. </view>
  12. <!-- <view class="vip">
  13. VIP1
  14. </view> -->
  15. <view class="tips">
  16. 今天是您来的的第32天
  17. </view>
  18. </view>
  19. <!-- <view class="headBtn" @click="headBtn">
  20. 角色切换
  21. </view> -->
  22. <view class="setting">
  23. <uv-icon name="setting" size="40rpx"></uv-icon>
  24. </view>
  25. </view>
  26. <!-- 水洗店 -->
  27. <view class="userShop" v-if="userShop">
  28. <userShopCommission />
  29. <view class="userList">
  30. <view class="title">
  31. 我的用户
  32. </view>
  33. <view class="list">
  34. <view class="item" v-for="(item, index) in 20" :key="index">
  35. <view class="name">
  36. 客户王生
  37. </view>
  38. <view class="num">
  39. 剩余水洗布198
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 酒店 -->
  46. <view class="user" v-else>
  47. <view class="line">
  48. <view class="item">
  49. <view class="image">
  50. <image src="/static/image/center/1.png" mode=""></image>
  51. </view>
  52. <view class="">
  53. 余额3000
  54. </view>
  55. </view>
  56. <view class="item">
  57. <view class="image">
  58. <image src="/static/image/center/4.png" mode=""></image>
  59. </view>
  60. <view class="">
  61. 押金30000
  62. </view>
  63. </view>
  64. </view>
  65. <view class="line grid">
  66. <view class="title">
  67. 常用功能
  68. </view>
  69. <uv-grid :col="4" :border="false">
  70. <uv-grid-item @click="$utils.navigateTo('/pages_order/mine/address')">
  71. <image class="image" src="/static/image/center/7.png" mode=""></image>
  72. <text class="grid-text">地址管理</text>
  73. </uv-grid-item>
  74. <uv-grid-item @click="$utils.redirectTo('/index/order')">
  75. <image class="image" src="/static/image/center/8.png" mode=""></image>
  76. <text class="grid-text">订单管理</text>
  77. </uv-grid-item>
  78. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+0)">
  79. <image class="image" src="/static/image/center/5.png" mode=""></image>
  80. <text class="grid-text">换货</text>
  81. </uv-grid-item>
  82. <uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+1)">
  83. <image class="image" src="/static/image/center/7.png" mode=""></image>
  84. <text class="grid-text">退货</text>
  85. </uv-grid-item>
  86. </uv-grid>
  87. </view>
  88. <view class="line grid">
  89. <uv-grid :col="4" :border="false">
  90. <uv-grid-item @click="contactUs">
  91. <image class="image" src="/static/image/center/9.png" mode=""></image>
  92. <text class="grid-text">联系客服</text>
  93. </uv-grid-item>
  94. <uv-grid-item>
  95. <image class="image" src="/static/image/center/6.png" mode=""></image>
  96. <text class="grid-text">我的租赁</text>
  97. </uv-grid-item>
  98. <uv-grid-item @click="$utils.redirectTo('/index/cart')">
  99. <image class="image" src="/static/image/center/7.png" mode=""></image>
  100. <text class="grid-text">租赁车</text>
  101. </uv-grid-item>
  102. <uv-grid-item
  103. @click="$utils.navigateTo('/pages_order/auth/loginAndRegisterAndForgetPassword?index='+2)">
  104. <image class="image" src="/static/image/center/7.png" mode=""></image>
  105. <text class="grid-text">申请成为水洗店</text>
  106. </uv-grid-item>
  107. </uv-grid>
  108. </view>
  109. </view>
  110. <tabber select="4" />
  111. </view>
  112. </template>
  113. <script>
  114. import tabber from '@/components/base/tabbar.vue'
  115. import {
  116. mapGetters
  117. } from 'vuex'
  118. import userShopCommission from '@/components/userShop/userShopCommission.vue'
  119. export default {
  120. components: {
  121. tabber,
  122. userShopCommission,
  123. },
  124. computed: {
  125. ...mapGetters(['userShop']),
  126. },
  127. data() {
  128. return {
  129. }
  130. },
  131. methods: {
  132. headBtn() {
  133. let self = this
  134. uni.showModal({
  135. title: '演示切换角色之后的效果',
  136. success(res) {
  137. if (res.confirm) {
  138. self.$store.state.shop = !self.$store.state.shop
  139. }
  140. }
  141. })
  142. },
  143. }
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .page {
  148. .warp {
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. height: 100%;
  153. }
  154. .rect {
  155. width: 600rpx;
  156. height: 300rpx;
  157. background-color: #fff;
  158. border-radius: 20rpx;
  159. overflow: hidden;
  160. .title {
  161. padding: 10rpx 0 0 15rpx;
  162. background-color: #fd5100;
  163. color: #FFF;
  164. text-align: left;
  165. width: 100%;
  166. height: 18%;
  167. font-size: 36rpx;
  168. }
  169. .center {
  170. height: 40%;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. font-size: 36rpx;
  175. }
  176. .bottom {
  177. display: flex;
  178. justify-content: center;
  179. gap: 50rpx;
  180. }
  181. }
  182. }
  183. image {
  184. width: 100%;
  185. height: 100%;
  186. }
  187. .head {
  188. display: flex;
  189. background-color: #fff;
  190. padding: 40rpx 20rpx;
  191. align-items: center;
  192. position: relative;
  193. .headImage {
  194. width: 120rpx;
  195. height: 120rpx;
  196. background-image: url(/static/image/center/3.png);
  197. background-size: 100% 100%;
  198. overflow: hidden;
  199. border-radius: 50%;
  200. margin-right: 40rpx;
  201. }
  202. .info {
  203. font-size: 28rpx;
  204. .vip {
  205. background-color: #FCCC92;
  206. color: #FA6239;
  207. width: 100rpx;
  208. display: flex;
  209. justify-content: center;
  210. align-items: center;
  211. height: 40rpx;
  212. border-radius: 20rpx;
  213. margin-top: 20rpx;
  214. }
  215. .name {
  216. font-size: 32rpx;
  217. }
  218. .tips {
  219. font-size: 26rpx;
  220. color: #ABABAB;
  221. }
  222. }
  223. .headBtn {
  224. margin-left: auto;
  225. padding: 15rpx 20rpx;
  226. background-color: $uni-color;
  227. color: #fff;
  228. border-radius: 20rpx;
  229. margin-top: 50rpx;
  230. }
  231. .setting {
  232. position: absolute;
  233. right: 50rpx;
  234. top: 50rpx;
  235. }
  236. }
  237. .userShop {
  238. .userList {
  239. .title {
  240. font-size: 32rpx;
  241. font-weight: 900;
  242. padding: 20rpx;
  243. }
  244. .list {
  245. display: flex;
  246. flex-wrap: wrap;
  247. .item {
  248. width: 270rpx;
  249. margin: 20rpx;
  250. display: flex;
  251. flex-direction: column;
  252. padding: 40rpx 30rpx;
  253. background-color: #fff;
  254. border-radius: 30rpx;
  255. line-height: 60rpx;
  256. .name {}
  257. .num {
  258. color: $uni-color;
  259. font-weight: 600;
  260. font-size: 28rpx;
  261. }
  262. }
  263. }
  264. }
  265. }
  266. .user {
  267. .line {
  268. display: flex;
  269. background-color: #fff;
  270. margin-top: 20rpx;
  271. padding: 20rpx 0;
  272. .item {
  273. flex: 1;
  274. display: flex;
  275. justify-content: center;
  276. align-items: center;
  277. padding: 20rpx 0;
  278. &:nth-child(1) {
  279. border-right: 1px solid #00000013;
  280. }
  281. .image {
  282. width: 100rpx;
  283. height: 70rpx;
  284. margin-right: 20rpx;
  285. }
  286. }
  287. }
  288. .grid {
  289. flex-direction: column;
  290. font-size: 26rpx;
  291. padding: 20rpx;
  292. .title {
  293. margin-bottom: 30rpx;
  294. font-size: 28rpx;
  295. font-weight: 600;
  296. }
  297. .image {
  298. width: 70rpx;
  299. height: 70rpx;
  300. margin-bottom: 10rpx;
  301. }
  302. text {
  303. text-align: center;
  304. width: 120rpx;
  305. }
  306. }
  307. }
  308. </style>