index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view class="mine">
  3. <!-- 状态栏占位 -->
  4. <!-- <view class="mine__nav" :style="{ height: statusBarHeight + 'px' }" /> -->
  5. <view class="mine__nav" style="height: 80rpx" />
  6. <view class="mine__person">
  7. <!-- <view class="mine__person--icon">
  8. <u-icon name="setting" color="#fff" size="22" @click="handlerSkipSetting"/>
  9. <u-icon name="chat" color="#fffb" size="22" />
  10. </view> -->
  11. <view class="mine__person--info">
  12. <image src="@/static/QR57a.jpg" style="width: 140rpx; height: 140rpx; border-radius: 50%" />
  13. <view class="userName">
  14. <view> yizhiyang的鲜花店(云岩区店)</view>
  15. <text> +8618285564342</text>
  16. </view>
  17. <view
  18. class="status"
  19. :style="{ 'background-color': getStatusColor(state) }"
  20. @click="changeStatust(state)"
  21. >
  22. <view style="margin-right: 6rpx">{{ stateName }}</view>
  23. <u-icon name="play-right-fill" color="#fff" size="12" />
  24. </view>
  25. </view>
  26. </view>
  27. <view class="mine__main">
  28. <view class="mine__main--purse">
  29. <view class="wallet">
  30. <view class="wallet--title">我的钱包</view>
  31. <view class="wallet--more">
  32. <text>查看钱包余额</text>
  33. <u-icon name="arrow-right" color="#333" size="14" />
  34. </view>
  35. </view>
  36. <view class="walletInfo">
  37. <view v-for="index in 4" :key="index">
  38. <view class="text-title">借钱(元)</view>
  39. <view class="text-data">
  40. 30
  41. <text style="font-size: 24rpx; margin-left: 5rpx">万</text>
  42. </view>
  43. <view class="text-info">最高可用</view>
  44. </view>
  45. </view>
  46. <view class="shortcut">
  47. <view style="display: flex">
  48. <view>快捷支付</view>
  49. <view style="margin: 0 20rpx">|</view>
  50. <view>一银升级银行卡用于麦付</view>
  51. </view>
  52. <u-icon name="arrow-right" color="#fff" size="14" />
  53. </view>
  54. </view>
  55. <view class="mine__main--setting">
  56. <template v-for="item in list1">
  57. <u-cell size="large" :border="false" :title="item.name" isLink :url="item.url">
  58. <image slot="icon" src="@/static/tools.jpg" style="width: 60rpx; height: 60rpx" />
  59. </u-cell>
  60. </template>
  61. </view>
  62. <view class="mine__main--setting">
  63. <template v-for="item in list2" @click="tap(item)">
  64. <u-cell size="large" :border="false" @tap="" :title="item.name" isLink :url="item.url">
  65. <image slot="icon" src="@/static/tools.jpg" style="width: 60rpx; height: 60rpx" />
  66. </u-cell>
  67. </template>
  68. </view>
  69. </view>
  70. <tabbar currentTab="merchantMine" />
  71. <!-- 营业状态选择弹框 -->
  72. <u-picker
  73. :show="show"
  74. :columns="columns"
  75. @cancel="cancel"
  76. @confirm="confirm"
  77. keyName="label"
  78. ></u-picker>
  79. </view>
  80. </template>
  81. <script>
  82. export default {
  83. data() {
  84. return {
  85. statusBarHeight: 0,
  86. state: 1,
  87. stateName: '营业中',
  88. show: false,
  89. columns: [
  90. [
  91. {
  92. label: '营业中',
  93. id: 1,
  94. },
  95. {
  96. label: '维护中',
  97. id: 2,
  98. },
  99. {
  100. label: '停业中',
  101. id: 3,
  102. },
  103. ],
  104. ],
  105. list1: [
  106. // {
  107. // id: '1',
  108. // name: '门店环境',
  109. // url: '',
  110. // },
  111. {
  112. id: '2',
  113. name: '我要开店',
  114. url: '/pages/merchant/mine/openStore/index',
  115. },
  116. {
  117. id: '3',
  118. name: '资质信息',
  119. url: '/pages/merchant/mine/openStore/openStoreAppealDetail',
  120. },
  121. ],
  122. list2: [
  123. {
  124. id: '1',
  125. name: '帮助中心',
  126. url: '',
  127. },
  128. {
  129. id: '2',
  130. name: '设置',
  131. url: '/pages/merchant/mine/setting/index',
  132. },
  133. ],
  134. };
  135. },
  136. onLoad() {
  137. // this.getHeight();
  138. },
  139. methods: {
  140. tap(item) {
  141. console.log('item', item);
  142. },
  143. changeStatust() {
  144. this.show = true;
  145. },
  146. cancel() {
  147. this.show = false;
  148. },
  149. confirm(val) {
  150. this.state = val.value[0].id;
  151. this.stateName = val.value[0].label;
  152. this.show = false;
  153. },
  154. getStatusColor(state) {
  155. if (state === 1) {
  156. return '#19be6b';
  157. } else if (state === 2) {
  158. return '#ff9900';
  159. } else if (state === 3) {
  160. return '#909399';
  161. } else {
  162. return '';
  163. }
  164. },
  165. // 点击跳转到设置
  166. handlerSkipSetting() {
  167. uni.navigateTo({
  168. url: '/pages/merchant/mine/setting/index',
  169. });
  170. },
  171. //计算导航栏总高度
  172. getHeight() {
  173. // 获取系统信息
  174. const systemInfo = uni.getSystemInfoSync();
  175. // 胶囊按钮位置信息
  176. const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  177. // 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
  178. this.statusBarHeight =
  179. (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 +
  180. menuButtonInfo.height +
  181. systemInfo.statusBarHeight;
  182. },
  183. },
  184. };
  185. </script>
  186. <style lang="scss" scoped>
  187. .mine {
  188. min-height: calc(100vh - 80rpx);
  189. box-sizing: border-box;
  190. &__nav {
  191. background-color: $uni-bg-color-primary;
  192. }
  193. &__person {
  194. height: 200rpx;
  195. padding: $uni-bg-padding-sm;
  196. background-color: $uni-bg-color-primary;
  197. position: relative;
  198. &--icon {
  199. display: flex;
  200. justify-content: space-between;
  201. }
  202. &--info {
  203. color: #fff;
  204. display: flex;
  205. margin-top: 20rpx;
  206. .userName {
  207. width: 400rpx;
  208. font-size: 34rpx;
  209. margin: 10rpx 0 0 16rpx;
  210. > text {
  211. font-size: 26rpx;
  212. }
  213. }
  214. .status {
  215. display: flex;
  216. position: absolute;
  217. bottom: 80rpx;
  218. padding-left: 20rpx;
  219. right: 0;
  220. width: 150rpx;
  221. height: 60rpx;
  222. font-size: 25rpx;
  223. align-items: center;
  224. justify-content: center;
  225. box-sizing: border-box;
  226. border-radius: 30rpx 0 0 30rpx;
  227. background-color: rgba(255, 255, 255, 0.3);
  228. }
  229. }
  230. }
  231. &__main {
  232. padding: $uni-bg-padding-sm;
  233. &--purse {
  234. background-color: $uni-bg-color;
  235. padding: $uni-bg-padding-sm;
  236. border-radius: $uni-border-radius-base;
  237. .wallet {
  238. display: flex;
  239. justify-content: space-between;
  240. font-size: 28rpx;
  241. &--title {
  242. color: #000;
  243. font-size: 36rpx;
  244. font-weight: 700;
  245. }
  246. &--more {
  247. color: #333;
  248. display: flex;
  249. justify-content: center;
  250. align-items: center;
  251. }
  252. }
  253. .walletInfo {
  254. margin: 40rpx 0;
  255. color: #333;
  256. display: flex;
  257. text-align: center;
  258. justify-content: space-around;
  259. }
  260. .shortcut {
  261. height: 70rpx;
  262. padding: 0 20rpx;
  263. color: #fff;
  264. font-size: 28rpx;
  265. display: flex;
  266. align-items: center;
  267. justify-content: space-between;
  268. background-color: $uni-bg-color-primary;
  269. border-radius: $uni-border-radius-sm;
  270. }
  271. }
  272. &--setting {
  273. margin: 20rpx 0;
  274. background-color: $uni-bg-color;
  275. padding: $uni-bg-padding-sm;
  276. border-radius: $uni-border-radius-base;
  277. }
  278. }
  279. }
  280. .text-title {
  281. font-size: 34rpx;
  282. }
  283. .text-data {
  284. font-size: 40rpx;
  285. margin: 15rpx 0;
  286. font-weight: 700;
  287. }
  288. .text-info {
  289. font-size: 24rpx;
  290. }
  291. </style>