商城类、订单类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.

419 lines
8.3 KiB

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. <!-- 联系客服弹框 -->
  111. <uv-overlay :show="show" @click="show = false">
  112. <view class="warp">
  113. <view class="rect" @tap.stop>
  114. <view class="title">联系客服</view>
  115. <view class="center">确定拨打客服电话?</view>
  116. <view class="bottom">
  117. <view>
  118. <uv-button type="info" shape="circle" text="取消" :custom-style="customStyle1"
  119. @click="cancle"></uv-button>
  120. </view>
  121. <view>
  122. <uv-button type="info" shape="circle" text="确定" :custom-style="customStyle2"
  123. @click="confirm"></uv-button>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </uv-overlay>
  129. <tabber select="4" />
  130. </view>
  131. </template>
  132. <script>
  133. import tabber from '@/components/base/tabbar.vue'
  134. import {
  135. mapGetters
  136. } from 'vuex'
  137. import userShopCommission from '@/components/userShop/userShopCommission.vue'
  138. export default {
  139. components: {
  140. tabber,
  141. userShopCommission,
  142. },
  143. computed: {
  144. ...mapGetters(['userShop']),
  145. customStyle1() {
  146. return {
  147. height: '60rpx',
  148. background: '#FFF',
  149. color: '#000000',
  150. fontSize: '36rpx',
  151. borderRadius: '40rpx', //圆角
  152. // nvue中必须是下方的写法
  153. 'border-top-right-radius': '40rpx',
  154. 'border-bottom-left-radius': '40rpx',
  155. 'border-bottom-right-radius': '40rpx',
  156. 'width': '150rpx',
  157. }
  158. },
  159. customStyle2() {
  160. return {
  161. height: '60rpx',
  162. background: '#fd5100',
  163. color: '#FFF',
  164. fontSize: '34px',
  165. borderRadius: '40rpx', //圆角
  166. // nvue中必须是下方的写法
  167. 'border-top-right-radius': '40rpx',
  168. 'border-bottom-left-radius': '40rpx',
  169. 'border-bottom-right-radius': '40rpx',
  170. 'width': '150rpx',
  171. }
  172. }
  173. },
  174. data() {
  175. return {
  176. show: false,
  177. }
  178. },
  179. methods: {
  180. headBtn() {
  181. let self = this
  182. uni.showModal({
  183. title: '演示切换角色之后的效果',
  184. success(res) {
  185. if (res.confirm) {
  186. self.$store.state.shop = !self.$store.state.shop
  187. }
  188. }
  189. })
  190. },
  191. // 联系客服按钮回调
  192. contactUs() {
  193. this.show = true
  194. },
  195. confirm() {
  196. this.show = false
  197. },
  198. cancle() {
  199. this.show = false
  200. },
  201. }
  202. }
  203. </script>
  204. <style scoped lang="scss">
  205. .page {
  206. .warp {
  207. display: flex;
  208. align-items: center;
  209. justify-content: center;
  210. height: 100%;
  211. }
  212. .rect {
  213. width: 600rpx;
  214. height: 300rpx;
  215. background-color: #fff;
  216. border-radius: 20rpx;
  217. overflow: hidden;
  218. .title {
  219. padding: 10rpx 0 0 15rpx;
  220. background-color: #fd5100;
  221. color: #FFF;
  222. text-align: left;
  223. width: 100%;
  224. height: 18%;
  225. font-size: 36rpx;
  226. }
  227. .center {
  228. height: 40%;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. font-size: 36rpx;
  233. }
  234. .bottom {
  235. display: flex;
  236. justify-content: center;
  237. gap: 50rpx;
  238. }
  239. }
  240. }
  241. image {
  242. width: 100%;
  243. height: 100%;
  244. }
  245. .head {
  246. display: flex;
  247. background-color: #fff;
  248. padding: 40rpx 20rpx;
  249. align-items: center;
  250. position: relative;
  251. .headImage {
  252. width: 120rpx;
  253. height: 120rpx;
  254. background-image: url(/static/image/center/3.png);
  255. background-size: 100% 100%;
  256. overflow: hidden;
  257. border-radius: 50%;
  258. margin-right: 40rpx;
  259. }
  260. .info {
  261. font-size: 28rpx;
  262. .vip {
  263. background-color: #FCCC92;
  264. color: #FA6239;
  265. width: 100rpx;
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. height: 40rpx;
  270. border-radius: 20rpx;
  271. margin-top: 20rpx;
  272. }
  273. .name {
  274. font-size: 32rpx;
  275. }
  276. .tips {
  277. font-size: 26rpx;
  278. color: #ABABAB;
  279. }
  280. }
  281. .headBtn {
  282. margin-left: auto;
  283. padding: 15rpx 20rpx;
  284. background-color: $uni-color;
  285. color: #fff;
  286. border-radius: 20rpx;
  287. margin-top: 50rpx;
  288. }
  289. .setting {
  290. position: absolute;
  291. right: 50rpx;
  292. top: 50rpx;
  293. }
  294. }
  295. .userShop {
  296. .userList {
  297. .title {
  298. font-size: 32rpx;
  299. font-weight: 900;
  300. padding: 20rpx;
  301. }
  302. .list {
  303. display: flex;
  304. flex-wrap: wrap;
  305. .item {
  306. width: 270rpx;
  307. margin: 20rpx;
  308. display: flex;
  309. flex-direction: column;
  310. padding: 40rpx 30rpx;
  311. background-color: #fff;
  312. border-radius: 30rpx;
  313. line-height: 60rpx;
  314. .name {}
  315. .num {
  316. color: $uni-color;
  317. font-weight: 600;
  318. font-size: 28rpx;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. .user {
  325. .line {
  326. display: flex;
  327. background-color: #fff;
  328. margin-top: 20rpx;
  329. padding: 20rpx 0;
  330. .item {
  331. flex: 1;
  332. display: flex;
  333. justify-content: center;
  334. align-items: center;
  335. padding: 20rpx 0;
  336. &:nth-child(1) {
  337. border-right: 1px solid #00000013;
  338. }
  339. .image {
  340. width: 100rpx;
  341. height: 70rpx;
  342. margin-right: 20rpx;
  343. }
  344. }
  345. }
  346. .grid {
  347. flex-direction: column;
  348. font-size: 26rpx;
  349. padding: 20rpx;
  350. .title {
  351. margin-bottom: 30rpx;
  352. font-size: 28rpx;
  353. font-weight: 600;
  354. }
  355. .image {
  356. width: 70rpx;
  357. height: 70rpx;
  358. margin-bottom: 10rpx;
  359. }
  360. text {
  361. text-align: center;
  362. width: 120rpx;
  363. }
  364. }
  365. }
  366. </style>