index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view>
  3. <u-sticky h5-nav-height="0">
  4. <view class="status_bar bg-blue">
  5. </view>
  6. <view class="bg-blue white">
  7. <view class="center pd-20" style="padding-top: 52rpx;">
  8. <view class="size-36 mr-10">我的</view>
  9. </view>
  10. </view>
  11. </u-sticky>
  12. <view class="w100 bg-blue"></view>
  13. <view class="my-header">
  14. <image class="" src="../../static/my-bg.png" style="position:absolute;z-index:-1;width:100%;height:260rpx;" mode=""></image>
  15. <view class="plr-36 ptb-40">
  16. <view class="flex_l" @click="goLogin">
  17. <image src="../../static/my-head-icon.png" mode=""></image>
  18. <view>
  19. <view class="size-32 ml-40 white">
  20. {{token?userInfo.truename:'登录/注册'}}
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="plr-65 ptb-35 umargin bg-white flex" @click="goWallet">
  26. <view class="text-center">
  27. <view class="">
  28. ¥{{token?income||0:0}}
  29. </view>
  30. <view class="size-28 gray-2 mt-10">
  31. 累计收入
  32. </view>
  33. </view>
  34. <view class="text-center">
  35. <view class="">
  36. ¥{{token?money||0:0}}
  37. </view>
  38. <view class="size-28 gray-2 mt-10">
  39. 账户余额
  40. </view>
  41. </view>
  42. <view class="text-center">
  43. <view class="">
  44. ¥{{token?today_money||0:0}}
  45. </view>
  46. <view class="size-28 gray-2 mt-10">
  47. 今日收入
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="w100" style="height: 20rpx;background: #F8F8F8;"></view>
  53. <u-cell-item title="实名认证" :class="[userInfo.real_verified==0?'':userInfo.real_verified==1?'active':userInfo.real_verified==2?'active':'']"
  54. :value="!token?'请登录':userInfo.real_verified==0?'未认证':userInfo.real_verified==1?'已认证':userInfo.real_verified==2?'待审核':'已拒绝'"
  55. :arrow="userInfo.real_verified==0?true:userInfo.real_verified==1?false:userInfo.real_verified==2?false:true" @click="goIDcard">
  56. <view slot="icon" class="icon flex1 flex-middle mr-20">
  57. <image src="../../static/my-1.png" mode=""></image>
  58. </view>
  59. </u-cell-item>
  60. <u-cell-item title="驾照认证" :class="[userInfo.driver_verified==0?'':userInfo.driver_verified==1?'active':userInfo.driver_verified==2?'active':'']"
  61. :value="!token?'请登录':userInfo.driver_verified==0?'未认证':userInfo.driver_verified==1?'已认证':userInfo.driver_verified==2?'待审核':'已拒绝'"
  62. :arrow="userInfo.driver_verified==0?true:userInfo.driver_verified==1?false:userInfo.driver_verified==2?false:true"
  63. @click="goDriver">
  64. <view slot="icon" class="icon flex1 flex-middle mr-20">
  65. <image src="../../static/my-2.png" mode=""></image>
  66. </view>
  67. </u-cell-item>
  68. <u-cell-item v-if="hasSF" title="车主认证" :class="[userInfo.card_verified==0?'':userInfo.card_verified==1?'active':userInfo.card_verified==2?'active':'']"
  69. :value="!token?'请登录':userInfo.card_verified==0?'未认证':userInfo.card_verified==1?'已认证':userInfo.card_verified==2?'待审核':'已拒绝'"
  70. :arrow="userInfo.card_verified==0?true:userInfo.card_verified==1?false:userInfo.card_verified==2?false:true" @click="goOwner">
  71. <view slot="icon" class="icon flex1 flex-middle mr-20">
  72. <image src="../../static/my-3.png" mode=""></image>
  73. </view>
  74. </u-cell-item>
  75. <view class="w100" style="height: 20rpx;background: #F8F8F8;"></view>
  76. <u-cell-item v-if="hasSF" title="顺风车发布" class="active" @click="toSflist">
  77. <view slot="icon" class="icon flex1 flex-middle mr-20">
  78. <image src="../../static/my-4.png" mode=""></image>
  79. </view>
  80. </u-cell-item>
  81. <u-cell-item title="我的订单" class="active" @click="goOrder">
  82. <view slot="icon" class="icon flex1 flex-middle mr-20">
  83. <image src="../../static/my-5.png" mode=""></image>
  84. </view>
  85. </u-cell-item>
  86. <view class="flex plr-32 ptb-26" style="height: 103rpx;" @click="goPay">
  87. <view class="flex" @click.stop="showModel=true">
  88. <view class="icon mr-20">
  89. <image src="../../static/my-6.png" mode=""></image>
  90. </view>
  91. <view class="mr-20" style="font-weight: 700;">
  92. 平台服务费
  93. </view>
  94. <u-icon name="question-circle" color="#969799"></u-icon>
  95. </view>
  96. <view class="flex1 flex-middle">
  97. <view class="" v-if="!token">
  98. 0
  99. </view>
  100. <view :class="[fee * 1== 0?'blue':'red','mr-5']" v-else>
  101. {{fee*1==0?fee:'-'+fee}}
  102. </view>
  103. <u-icon name="arrow-right" color="#969799" size="28"></u-icon>
  104. </view>
  105. </view>
  106. <view class="w100" style="height: 20rpx;background: #F8F8F8;"></view>
  107. <u-cell-item title="设置" @click="goSet">
  108. <view slot="icon" class="icon flex1 flex-middle mr-20">
  109. <image src="../../static/my-7.png" mode=""></image>
  110. </view>
  111. </u-cell-item>
  112. <u-cell-item title="联系我们" @click="goContact">
  113. <view slot="icon" class="icon flex1 flex-middle mr-20">
  114. <image src="../../static/my-8.png" mode=""></image>
  115. </view>
  116. </u-cell-item>
  117. <u-cell-item title="帮助中心" @click="goHelp">
  118. <view slot="icon" class="icon flex1 flex-middle mr-20">
  119. <image src="../../static/my-9.png" mode=""></image>
  120. </view>
  121. </u-cell-item>
  122. <u-cell-item title="关于我们" @click="goAbout">
  123. <view slot="icon" class="icon flex1 flex-middle mr-20">
  124. <image src="../../static/my-10.png" mode=""></image>
  125. </view>
  126. </u-cell-item>
  127. <view class="w100" style="height: 20rpx;background: #F8F8F8;"></view>
  128. <pay :show="show" @money="getmoney" @close="show=false"></pay>
  129. <u-modal v-model="showModel" content="线下结算产生订单服务费,欠缴的服务费达到平台设置的限额,将无法接单"></u-modal>
  130. </view>
  131. </template>
  132. <script>
  133. import {
  134. mapState
  135. } from 'vuex';
  136. export default {
  137. data() {
  138. return {
  139. fee: '', //平台服务费
  140. income: '', //累计收入
  141. money: '', //可提现金额
  142. today_money: '', //今日收入
  143. IDcard: '未认证',
  144. Driver: '未认证',
  145. Owner: '',
  146. show: false, //支付
  147. showModel: false,
  148. }
  149. },
  150. computed: {
  151. ...mapState(['userInfo', 'token', 'tabList']),
  152. hasSF() {
  153. let a = false
  154. this.tabList.forEach(item => {
  155. if (item.id == 1) a = true
  156. })
  157. return a
  158. },
  159. hasDJ() {
  160. let a = false
  161. this.tabList.forEach(item => {
  162. if (item.id == 0) a = true
  163. })
  164. return a
  165. },
  166. },
  167. onLoad() {
  168. },
  169. onShow() {
  170. if (this.token) {
  171. this.$store.dispatch('updateUserInfo')
  172. this.getmoney()
  173. this.driver_status = this.userInfo.driver_status == 1 ? true : false
  174. }
  175. },
  176. methods: {
  177. change(status) {
  178. console.log(status);
  179. this.$http('/addons/ddrive/user/driver_status', {
  180. status: status ? 0 : 1
  181. }, "POST").then(data => {
  182. this.$store.dispatch('updateUserInfo')
  183. })
  184. },
  185. toSflist() {
  186. uni.navigateTo({
  187. url: "/pages/shunfeng/pub-list"
  188. })
  189. },
  190. goLogin() {
  191. if (!this.token) {
  192. uni.navigateTo({
  193. url: '/pages/login/index'
  194. })
  195. }
  196. },
  197. goPay() {
  198. if (parseFloat(this.fee) > 0) {
  199. this.show = true
  200. }
  201. },
  202. goWallet() { //钱包
  203. if (this.token) {
  204. uni.navigateTo({
  205. url: '/pages/my/wallet'
  206. })
  207. } else {
  208. uni.showToast({
  209. title: '请登录',
  210. icon: 'none'
  211. })
  212. }
  213. },
  214. goIDcard() { //实名认证
  215. if (this.userInfo.real_verified == 0 || this.userInfo.real_verified == -1) {
  216. uni.navigateTo({
  217. url: '/pages/my/IDcard'
  218. })
  219. }
  220. },
  221. goDriver() { //驾照认证
  222. if (this.userInfo.driver_verified == 0 || this.userInfo.driver_verified == -1) {
  223. uni.navigateTo({
  224. url: '/pages/my/Driver'
  225. })
  226. }
  227. },
  228. goOwner() { //车主认证
  229. if (this.userInfo.card_verified == 0 || this.userInfo.card_verified == -1) {
  230. uni.navigateTo({
  231. url: '/pages/my/owner/index'
  232. })
  233. }
  234. },
  235. goOrder() { //订单
  236. uni.navigateTo({
  237. url: '/pages/my/my-order'
  238. })
  239. },
  240. goSet() { //设置
  241. uni.navigateTo({
  242. url: '/pages/my/set/index'
  243. })
  244. },
  245. goContact() { //联系我们
  246. uni.navigateTo({
  247. url: '/pages/my/contact'
  248. })
  249. },
  250. goHelp() { //帮助中心
  251. uni.navigateTo({
  252. url: '/pages/my/help/index'
  253. })
  254. },
  255. goAbout() { //关于我们
  256. uni.navigateTo({
  257. url: '/pages/my/about'
  258. })
  259. },
  260. // 我的收入
  261. getmoney() {
  262. this.$http('/addons/ddrive/user/userIncome', "POST").then(data => {
  263. //console.log(data);
  264. this.money = parseFloat(data.money).toFixed(2)
  265. this.income = parseFloat(data.income).toFixed(2)
  266. this.today_money = parseFloat(data.today_income).toFixed(2)
  267. this.fee = data.platform_service_fee
  268. })
  269. }
  270. }
  271. }
  272. </script>
  273. <style lang="scss" scoped>
  274. .my-header {
  275. image {
  276. width: 104rpx;
  277. height: 104rpx;
  278. }
  279. }
  280. .umargin {
  281. margin: 0 20px;
  282. border-radius: 10rpx;
  283. }
  284. .left {
  285. height: 42rpx;
  286. }
  287. .icon {
  288. image {
  289. width: 42rpx;
  290. height: 42rpx;
  291. }
  292. }
  293. .active {
  294. /deep/.u-cell__value {
  295. color: $blue;
  296. }
  297. }
  298. .red {
  299. /deep/.u-cell__value {
  300. color: $red;
  301. }
  302. }
  303. </style>