mine.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="mine">
  3. <!-- 状态栏占位 -->
  4. <view class="mine__nav" :style="{ height: 77 + 'px' }" />
  5. <view class="mine__person">
  6. <view class="mine__person--info">
  7. <view @click="$Router.push('/pageMerchant/mineModule/personalInfo')">
  8. <image :src="merchantInfo.merchant.logo" style="width: 140rpx; height: 140rpx; border-radius: 50%"
  9. v-if="merchantInfo.merchant.logo" />
  10. <image src="@/static/QR57a.jpg" style="width: 140rpx; height: 140rpx; border-radius: 50%" v-else />
  11. </view>
  12. <view class="userName">
  13. <view>
  14. <view v-if="merchantInfo.storeName"> {{ merchantInfo.storeName }}</view>
  15. <view v-else> 微信用户</view>
  16. </view>
  17. <view>
  18. <view v-if="merchantInfo.mobileNumber" class="text">
  19. +86 {{ merchantInfo.mobileNumber }}
  20. </view>
  21. <view v-else class="text">
  22. <text style="color: #f6bf3f"> 您当前还未认证,</text>
  23. <text @click="$Router.push('/pageMerchant/mineModule/certification/index')">
  24. 去认证>
  25. </text>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="status" :style="{ 'background-color': getStatusColor(state) }" @click="show = true">
  30. <view style="margin-right: 6rpx">{{ stateName }}</view>
  31. <u-icon name="play-right-fill" color="#fff" size="12" />
  32. </view>
  33. </view>
  34. </view>
  35. <view class="mine__main">
  36. <view class="mine__main--purse" @click="toMyPurse">
  37. <view class="wallet">
  38. <view class="wallet--title">我的钱包</view>
  39. <view class="wallet--more">
  40. <text>查看钱包余额</text>
  41. <u-icon name="arrow-right" color="#333" size="14" />
  42. </view>
  43. </view>
  44. <view class="walletInfo">
  45. <view v-for="item,index in incomeList" :key="index">
  46. <view class="text-title">{{item.title}}</view>
  47. <view class="text-data">¥{{item.num}}</view>
  48. <!-- <view class="text-info">最高可用</view> -->
  49. </view>
  50. </view>
  51. <!-- <view class="shortcut">
  52. <view style="display: flex">
  53. <view>快捷支付</view>
  54. <view style="margin: 0 20rpx">|</view>
  55. <view>一银升级银行卡用于麦付</view>
  56. </view>
  57. <u-icon name="arrow-right" color="#fff" size="14" />
  58. </view> -->
  59. </view>
  60. <view class="mine__main--setting">
  61. <template v-for="item in list1">
  62. <u-cell size="large" :border="false" :key="item.name" :title="item.name" isLink :url="item.url">
  63. <image slot="icon" src="@/static/tools.jpg" style="width: 60rpx; height: 60rpx" />
  64. </u-cell>
  65. </template>
  66. </view>
  67. <view class="mine__main--setting">
  68. <template v-for="item in list2">
  69. <u-cell size="large" :border="false" :key="item.name" :title="item.name" isLink :url="item.url">
  70. <image slot="icon" src="@/static/tools.jpg" style="width: 60rpx; height: 60rpx" />
  71. </u-cell>
  72. </template>
  73. </view>
  74. </view>
  75. <!-- 营业状态选择弹框 -->
  76. <u-picker :show="show" :columns="columns" @cancel="cancel" @confirm="confirm" keyName="label"></u-picker>
  77. <!-- 商家认证的弹框 -->
  78. <u-modal :show="showAut" :title="title" :content="content" :confirmText="'开始认证'" :cancelText="'返回用户端'"
  79. :showCancelButton="true" @confirm="confirmSwitch" @cancel="showAut = false"></u-modal>
  80. <!-- <tabbar currentTab="merchantMine" /> -->
  81. </view>
  82. </template>
  83. <script>
  84. import {
  85. getMerchantAuthData
  86. } from '@/api/merchant/merchantAuth';
  87. import {
  88. updateBusinessStatus
  89. } from '@/api/merchant/mine';
  90. import {
  91. phoneEncryption
  92. } from '@/utils/tools';
  93. export default {
  94. data() {
  95. return {
  96. state: 0,
  97. stateName: '营业中',
  98. show: false,
  99. showAut: false,
  100. title: '商家认证',
  101. content: '进入商家端前,我们需要一定的认证',
  102. merchantInfo: {},
  103. incomeList: [{
  104. num: '0.00',
  105. title: '总收益',
  106. },
  107. {
  108. num: '0.00',
  109. title: '本月收益',
  110. },
  111. {
  112. num: '0.00',
  113. title: '本周收益',
  114. },
  115. {
  116. num: '0.00',
  117. title: '可提现',
  118. },
  119. ],
  120. columns: [
  121. // 营业状态 0-营业中,1-休息中
  122. [{
  123. label: '营业中',
  124. id: '0',
  125. },
  126. {
  127. label: '休息中',
  128. id: '1',
  129. },
  130. ],
  131. ],
  132. list1: [{
  133. id: '1',
  134. name: '门店环境',
  135. url: '/pageMerchant/mineModule/storeEnviron',
  136. },
  137. // {
  138. // id: '2',
  139. // name: '我要开店',
  140. // url: '/pages/merchant/mine/openStore/index',
  141. // },
  142. {
  143. id: '3',
  144. name: '资质信息',
  145. url: '/pageMerchant/mineModule/openStoreAppealDetail',
  146. // url: '/pageMerchant/mineModule/certification/storeInformation',
  147. },
  148. ],
  149. list2: [{
  150. id: '1',
  151. name: '意见反馈',
  152. url: 'PageMine/feedback?channelType=1',
  153. },
  154. {
  155. id: '2',
  156. name: '设置',
  157. url: '/pageMerchant/mineModule/setting/index',
  158. },
  159. ],
  160. };
  161. },
  162. created() {
  163. this.getMerchantAuth();
  164. },
  165. mounted() {
  166. if (this.merchantInfo) {
  167. this.showAut = false;
  168. } else {
  169. this.showAut = true;
  170. }
  171. },
  172. methods: {
  173. /*===========================================================*/
  174. // 获取商家信息
  175. async getMerchantAuth() {
  176. let res = await getMerchantAuthData();
  177. if (res.code === 'OK') {
  178. // 将数据存储到vuex中
  179. this.merchantInfo = Object.assign({}, {
  180. ...res.data,
  181. mobileNumber: phoneEncryption(res.data.mobileNumber),
  182. }, );
  183. this.$store.commit('SET_MERCHANTINFO', res.data);
  184. }
  185. },
  186. /*===========================================================*/
  187. // 开始认证
  188. confirmSwitch() {
  189. uni.navigateTo({
  190. url: '/pageMerchant/mineModule/certification/index'
  191. });
  192. },
  193. /*===========================================================*/
  194. // 修改商家状态
  195. confirm(val) {
  196. this.state = val.value[0].id;
  197. this.stateName = val.value[0].label;
  198. this.show = false;
  199. updateBusinessStatus(this.merchantInfo.merchant.id, {
  200. businessStatus: this.state
  201. }).then(
  202. res => {
  203. if (res.code === 'OK') {
  204. this.$u.toast('修改成功');
  205. }
  206. },
  207. );
  208. },
  209. getStatusColor(state) {
  210. if (state === 0) {
  211. return '#19be6b';
  212. } else if (state === 1) {
  213. return '#ff9900';
  214. }
  215. },
  216. toMyPurse(){
  217. uni.navigateto({
  218. url:""
  219. })
  220. }
  221. },
  222. };
  223. </script>
  224. <style lang="scss" scoped>
  225. .mine {
  226. min-height: calc(100vh - 80rpx);
  227. box-sizing: border-box;
  228. &__nav {
  229. background-color: $uni-bg-color-primary;
  230. }
  231. &__person {
  232. height: 160rpx;
  233. padding: $uni-bg-padding-sm;
  234. background-color: $uni-bg-color-primary;
  235. position: relative;
  236. &--info {
  237. color: #fff;
  238. display: flex;
  239. .userName {
  240. width: 400rpx;
  241. font-size: 36rpx;
  242. margin: 20rpx 0 0 16rpx;
  243. .text {
  244. margin-top: 15rpx;
  245. font-size: 28rpx;
  246. }
  247. }
  248. .status {
  249. display: flex;
  250. position: absolute;
  251. bottom: 80rpx;
  252. padding-left: 20rpx;
  253. right: 0;
  254. width: 150rpx;
  255. height: 60rpx;
  256. font-size: 25rpx;
  257. align-items: center;
  258. justify-content: center;
  259. box-sizing: border-box;
  260. border-radius: 30rpx 0 0 30rpx;
  261. background-color: rgba(255, 255, 255, 0.3);
  262. }
  263. }
  264. }
  265. &__main {
  266. padding: $uni-bg-padding-sm;
  267. &--purse {
  268. background-color: $uni-bg-color;
  269. padding: $uni-bg-padding-sm;
  270. border-radius: $uni-border-radius-base;
  271. .wallet {
  272. display: flex;
  273. justify-content: space-between;
  274. font-size: 28rpx;
  275. &--title {
  276. color: #000;
  277. font-size: 36rpx;
  278. font-weight: 700;
  279. }
  280. &--more {
  281. color: #333;
  282. display: flex;
  283. justify-content: center;
  284. align-items: center;
  285. }
  286. }
  287. .walletInfo {
  288. margin: 40rpx 0;
  289. color: #333;
  290. display: flex;
  291. text-align: center;
  292. justify-content: space-around;
  293. }
  294. // .shortcut {
  295. // height: 70rpx;
  296. // padding: 0 20rpx;
  297. // color: #fff;
  298. // font-size: 28rpx;
  299. // display: flex;
  300. // align-items: center;
  301. // justify-content: space-between;
  302. // background-color: $uni-bg-color-primary;
  303. // border-radius: $uni-border-radius-sm;
  304. // }
  305. }
  306. &--setting {
  307. margin: 20rpx 0;
  308. background-color: $uni-bg-color;
  309. padding: $uni-bg-padding-sm;
  310. border-radius: $uni-border-radius-base;
  311. }
  312. }
  313. }
  314. .text-title {
  315. font-size: 34rpx;
  316. }
  317. .text-data {
  318. font-size: 40rpx;
  319. margin: 15rpx 0;
  320. font-weight: 700;
  321. }
  322. .text-info {
  323. font-size: 24rpx;
  324. }
  325. </style>