index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="client-mine">
  3. <view class="mine-bg">
  4. <u--image src="/static/pages/mine/mine-bg.png" width="100%" height="550rpx"></u--image>
  5. </view>
  6. <view class="mine-main">
  7. <page-navbar :hasBack="false" bgColor="transparent" title="我的"></page-navbar>
  8. <view class="fl-flex fl-align-center fl-justify-between">
  9. <view class="fl-flex fl-align-center">
  10. <u-avatar :src="avatar" size="50" @click="handlerReviewImg" />
  11. <view class="f-s-36 u-font-600 u-m-l-30"> {{ nickname }} </view>
  12. </view>
  13. <u--image
  14. src="/static/pages/mine/mine_setting.png"
  15. width="48rpx"
  16. height="48rpx"
  17. @tap="$Router.push('/PageMine/setting/index')"
  18. ></u--image>
  19. </view>
  20. <view class="mine-collect">
  21. <view v-for="(item, index) in collectList" :key="index" class="fl-flex">
  22. <view class="collect-list" @click="handleRouter(item)">
  23. <u--image
  24. :src="`/static/pages/mine/${item.name}.png`"
  25. width="32rpx"
  26. height="32rpx"
  27. ></u--image>
  28. <view class="u-m-t-16 f-s-24 text-primary">{{ item.title }}</view>
  29. </view>
  30. <text class="collect-line" v-show="index === 3 ? false : true"></text>
  31. </view>
  32. </view>
  33. <!-- 订单 -->
  34. <base-card padding="30rpx 10rpx" marginBottom="24rpx">
  35. <view class="fl-flex fl-justify-around">
  36. <view
  37. v-for="(item, index) in oderList"
  38. :key="index"
  39. class="fl-flex fl-flex-direction fl-align-center"
  40. @tap="handleOrder(listItem)"
  41. >
  42. <u--image
  43. src="/static/pages/mine/all-order.png"
  44. width="48rpx"
  45. height="48rpx"
  46. ></u--image>
  47. <view class="u-m-t-20 f-s-34 text-primary">{{ item.title }}</view>
  48. </view>
  49. </view>
  50. </base-card>
  51. <!-- 钱包 -->
  52. <base-card padding="0rpx" marginBottom="24rpx">
  53. <view class="fl-flex fl-justify-between mine-wallet fl-align-center">
  54. <view class="f-s-32 u-font-600 text-primary u-m-b-16">我的钱包</view>
  55. <u-icon name="arrow-right" color="#616570" size="16" @click="handlerWallet"></u-icon>
  56. </view>
  57. <view class="wallet-data fl-flex fl-justify-between fl-align-center">
  58. <view class="fl-flex" v-for="(item, index) in incomeList" :key="index">
  59. <view>
  60. <view class="fl-flex f-s-28" style="color: #ea0000">
  61. <view v-show="index === 3 ? false : true">¥</view>
  62. <view>{{ item.num }}</view>
  63. </view>
  64. <view class="f-s-28 u-m-t-12 text-primary">{{ item.title }}</view>
  65. </view>
  66. <text class="wallet-line" v-show="index === 3 ? false : true"></text>
  67. </view>
  68. </view>
  69. </base-card>
  70. <base-card padding="0rpx" marginBottom="24rpx">
  71. <u-cell-group v-for="(item, index) in LinkList" :key="index" :border="false">
  72. <u-cell :title="item.title" @click="handleCell(item)" isLink :border="index !== 5">
  73. <view slot="icon" class="u-m-r-10">
  74. <u--image
  75. :src="`/static/pages/mine/${item.icon}.png`"
  76. width="38rpx"
  77. height="38rpx"
  78. ></u--image>
  79. </view>
  80. </u-cell>
  81. </u-cell-group>
  82. </base-card>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. import { mapGetters } from 'vuex';
  88. import { collectList, LinkList, oderList } from './data';
  89. import { getMerchantAuthData } from '@/api/merchant/merchantAuth';
  90. export default {
  91. data() {
  92. return {
  93. collectList,
  94. LinkList,
  95. oderList,
  96. incomeList: [
  97. {
  98. num: '12.00',
  99. title: '总收益',
  100. },
  101. {
  102. num: '10.00',
  103. title: '本月收益',
  104. },
  105. {
  106. num: '9.00',
  107. title: '本周收益',
  108. },
  109. {
  110. num: '0.00',
  111. title: '可提现',
  112. },
  113. ],
  114. };
  115. },
  116. computed: {
  117. ...mapGetters(['userId', 'gender', 'avatar', 'nickname']),
  118. },
  119. methods: {
  120. handleRouter(item) {
  121. if (item.title === '积分') {
  122. this.$u.toast('该功能暂未开发,尽情期待!');
  123. } else {
  124. uni.navigateTo({
  125. url: item.url,
  126. });
  127. }
  128. },
  129. /* 订单 */
  130. handleOrder(item) {
  131. this.$store.commit('order/GET_ORDER_TYPE', item);
  132. uni.navigateTo({
  133. url: `/PageMine/orderModules/index`,
  134. });
  135. },
  136. /* 钱包 */
  137. handlerWallet() {
  138. uni.navigateTo({
  139. url: '/PageMine/profit/index',
  140. });
  141. },
  142. handleCell(item) {
  143. console.log(item);
  144. if (item.title === '我的店铺') {
  145. this.getMerchantAuthInfo();
  146. } else {
  147. uni.navigateTo({
  148. url: item.url,
  149. });
  150. }
  151. },
  152. // 点击预览图片
  153. handlerReviewImg() {
  154. uni.previewImage({
  155. urls: [this.avatar],
  156. });
  157. },
  158. async getMerchantAuthInfo() {
  159. let res = await getMerchantAuthData();
  160. if (res.code === 'OK' && res.data) {
  161. this.$store.dispatch('SwitchIdentity', 'MERCHANT');
  162. this.merchantInfo = Object.assign(
  163. {},
  164. {
  165. ...res.data,
  166. mobileNumber: res.data.mobileNumber,
  167. },
  168. );
  169. this.$store.commit('SET_MERCHANTINFO', res.data);
  170. if (res.data.reviewStatus == 2) {
  171. uni.navigateTo({
  172. url: 'pageMerchant/mineModule/openStoreAppealDetail',
  173. });
  174. } else if (res.data.reviewStatus == 1) {
  175. uni.navigateTo({
  176. url: '/pageMerchant/index',
  177. });
  178. }
  179. } else {
  180. uni.navigateTo({
  181. url: '/pageMerchant/mineModule/certification/storeInformation',
  182. });
  183. }
  184. },
  185. },
  186. };
  187. </script>
  188. <style lang="scss" scoped>
  189. .client-mine {
  190. height: 100%;
  191. position: relative;
  192. .mine-bg {
  193. position: absolute;
  194. left: 0;
  195. bottom: 0;
  196. right: 0;
  197. top: 0;
  198. z-index: -99;
  199. }
  200. .mine-main {
  201. padding: 0 32rpx;
  202. .mine-collect {
  203. height: 146rpx;
  204. margin: 12rpx 0;
  205. padding: 0 32rpx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: space-around;
  209. box-sizing: border-box;
  210. .collect-list {
  211. display: flex;
  212. flex-direction: column;
  213. align-items: center;
  214. }
  215. .collect-line {
  216. height: 40rpx;
  217. width: 1rpx;
  218. background-color: #d8d8d8;
  219. margin-left: 60rpx;
  220. margin-top: 20rpx;
  221. }
  222. }
  223. .mine-wallet {
  224. padding: 16rpx 16rpx 10rpx 16rpx;
  225. box-sizing: border-box;
  226. border-bottom: 1rpx solid #d8d8d8;
  227. }
  228. .wallet-data {
  229. padding: 32rpx 42rpx;
  230. }
  231. .wallet-line {
  232. height: 60rpx;
  233. width: 1rpx;
  234. background-color: #d8d8d8;
  235. margin-left: 40rpx;
  236. margin-top: 16rpx;
  237. }
  238. }
  239. }
  240. ::v-deep .u-cell__title-text {
  241. line-height: 60rpx !important;
  242. }
  243. </style>