user.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299
  1. <template>
  2. <view class="container">
  3. <view style="position: absolute;padding-left: 80%; display: flex;">
  4. <image @click='smBtnClick' style='width:21px;height:21px;' src="../../static/img/saoma.png"></image>
  5. <image @click='setting' style='width:21px;height:21px;margin-left: 20rpx;'
  6. src="../../static/img/sign/shezhi@3x.png"></image>
  7. </view>
  8. <view class="indexUp flex justify-between">
  9. <view class='flex'>
  10. <image v-bind:src="headUrl" class="headPortrait"></image>
  11. <view class="personal">
  12. <view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
  13. <view style='font-size:13px;color:#8F97AB;' class="information">{{hasLogin?starUserphone:''}}</view>
  14. <view v-if="haveCompany">
  15. <view v-if='hasLogin' @click='show=true' class="company">
  16. <image class='icon' style='width:19px;height:19px;' src="../../static/img/icon_qiye@3x.png"
  17. mode=""></image> {{compName}}>
  18. </view>
  19. <u-picker @confirm='compconfirm' mode="selector" v-model="show" :range="companyList"
  20. range-key="compName"></u-picker>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view style='background:transparent;margin-bottom:0;padding:0;' class="cu-list grid"
  26. :class="['col-' + gridCol,gridBorder?'':'no-border']">
  27. <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
  28. v-if="index<gridCol*2">
  29. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  30. <image :src="item.src" class="sign"></image>
  31. <text style="color: #333333;">{{item.name}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="cover-container">
  36. <view class='cover-container-item'>
  37. <view style='font-size:16px;padding-left:14px;'>我的功能</view>
  38. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
  39. <view class="cu-item" style='text-align:center;' v-for="(item,index) in gridList1" :key="index"
  40. @click="gridClick(item, index)" v-show="item.show">
  41. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  42. <text v-if='item.num==4&&taskTip&&taskTip<100' class='badge_user'>{{taskTip}}</text>
  43. <text v-if='item.num==4&&taskTip&&taskTip>100' class='badge_user'>...</text>
  44. <image :src="item.src" class="sign1"></image>
  45. </view>
  46. <text style="color: #333333;">{{item.name}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  52. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  53. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  54. </view>
  55. <!-- <view style="margin-top: 10rpx;">
  56. <web-view src="https://datav.aliyuncs.com/share/01de6913a5761ab4d3171b1f0b3e0704"></web-view>
  57. </view> -->
  58. <!-- <view style='text-align:center;'>
  59. <navigator
  60. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  61. class="path" hover-class="navigator-hover">《服务协议》</navigator>
  62. <navigator
  63. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  64. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  65. </view> -->
  66. <!-- <view class="guess-section-wrap">
  67. <view class='flex justify-between'>
  68. <view class='title Medium'>工厂价格</view>
  69. </view>
  70. <view class=' guess-section-wrap-item clearfix' v-for='(item,index1) in plantList' :key="index1">
  71. <view class='factory'>{{item.factory}}</view>
  72. <view class='wrap'>{{item.city}} {{item.factoryType}}</view>
  73. <view class='price'>
  74. <text class='currectprice '>{{item.price}}</text>
  75. 较昨日
  76. <image v-if='item.comparePrice>0' style="width:7.5px;height:9px;"
  77. src='../../static/img/homepage/shangsheng.png'></image>
  78. <image v-if='item.comparePrice<0' style="width:7.5px;height:9px;"
  79. src='../../static/img/homepage/xiajiang.png'></image>
  80. <text v-if='item.comparePrice>0' class='yesterday up'>{{item.comparePrice}}</text>
  81. <text v-if='item.comparePrice<0' class='yesterday down'>{{-item.comparePrice}}</text>
  82. <text v-if='item.comparePrice==0' class='yesterday'>-</text>
  83. </view>
  84. </view>
  85. </view>
  86. <u-back-top :scroll-top="scrollTop" mode="circle" icon="arrow-upward"></u-back-top> -->
  87. </view>
  88. </template>
  89. <script>
  90. import helper from '@/common/helper.js';
  91. import dragButton from "@/components/drag-button/drag-button.vue";
  92. import {
  93. mapState
  94. } from 'vuex';
  95. let startY = 0,
  96. moveY = 0,
  97. pageAtTop = true;
  98. export default {
  99. components: {
  100. dragButton
  101. },
  102. data() {
  103. return {
  104. isShowAlert: false,
  105. content: '您尚未登录,是否立即登录?',
  106. haveCompany: false,
  107. scrollTop: 0,
  108. inputShow: false,
  109. modalName: '',
  110. compName: '',
  111. mycarStyle: '',
  112. show: false,
  113. feild: undefined,
  114. inputContent: '',
  115. coverTransform: 'translateY(0px)',
  116. coverTransition: '0s',
  117. moving: false,
  118. footprintList: [],
  119. isVip: false,
  120. userInfoTmp: [],
  121. inputStatus: 'none',
  122. carInfo: [],
  123. plantList: [],
  124. headUrl: "../../static/img/myimg/YongHu@3x.png",
  125. userphone: "",
  126. gridCol: 4,
  127. gridBorder: false,
  128. username: "请更改昵称",
  129. companyList: [],
  130. gridList: [{
  131. num: 0,
  132. name: '认证',
  133. // icon: 'cuIcon-apps',
  134. src: '../../static/img/myimg/renzheng@3x.png',
  135. tips: 0,
  136. url: '/pages/attestation/index',
  137. show: true
  138. },
  139. {
  140. num: 1,
  141. name: '粮脉',
  142. // icon: 'cuIcon-apps',
  143. src: '../../static/img/myimg/liangmai@3x.png',
  144. tips: 0,
  145. url: '/pages/grain_pulse/my_grain_pulse',
  146. show: true
  147. },
  148. {
  149. num: 2,
  150. name: '发布',
  151. // icon: 'cuIcon-news',
  152. src: '../../static/img/myimg/fabu@3x.png',
  153. tips: 0,
  154. url: `/pages/release/release`,
  155. show: true
  156. },
  157. {
  158. num: 3,
  159. name: '货运收发',
  160. // icon: 'cuIcon-copy',
  161. src: '../../static/img/sign/receiveGoods@2x.png',
  162. tips: 0,
  163. url: `/pageA/freightTransport/index`,
  164. show: true
  165. },
  166. ],
  167. gridList1: [{
  168. num: 0,
  169. name: 'ERP业务',
  170. // icon: 'cuIcon-copy',
  171. src: '../../static/img/myimg/erp.png',
  172. tips: 0,
  173. url: `/pages/erp/index`,
  174. show: true
  175. },
  176. {
  177. num: 1,
  178. name: '入库管理',
  179. // name: '收购业务',
  180. // icon: 'cuIcon-copy',
  181. src: '../../static/img/myimg/sg.png',
  182. tips: 0,
  183. url: `/pages/erpbusiness/index`,
  184. show: true
  185. },
  186. {
  187. num: 2,
  188. name: '我的票据',
  189. // icon: 'cuIcon-news',
  190. src: '../../static/img/sign/piaoju@3x.png',
  191. tips: 0,
  192. url: `/pages/bill/index`,
  193. show: true
  194. },
  195. {
  196. num: 3,
  197. name: '我的合同',
  198. // icon: 'cuIcon-calendar',
  199. src: '../../static/img/sign/myContract@2x.png',
  200. tips: 0,
  201. url: '/pageB/contract/contract',
  202. show: true
  203. },
  204. {
  205. num: 4,
  206. name: '我的任务',
  207. // icon: 'cuIcon-copy',
  208. src: '../../static/img/sign/myTask@2x.png',
  209. tips: 0,
  210. url: '/pages/task/my_task',
  211. show: true
  212. },
  213. {
  214. num: 5,
  215. name: '联系客服',
  216. // icon: 'cuIcon-edit',
  217. src: '../../static/img/sign/service.png',
  218. tips: 0,
  219. url: `/pages/erp/contactCustomerService/contactCustomerService`,
  220. show: true
  221. },
  222. {
  223. num: 6,
  224. name: '数据报表',
  225. // icon: 'cuIcon-edit',
  226. src: '../../static/img/sign/shujubaobiao@2x.png',
  227. tips: 0,
  228. url: `/pages/user/report`,
  229. show: false
  230. },
  231. {
  232. num: 7,
  233. name: '库点监控',
  234. // icon: 'cuIcon-edit',
  235. src: '../../static/img/sign/kudianjiankong@2x.png',
  236. tips: 0,
  237. url: `/pages/user/depotMonitoring`,
  238. show: false
  239. },
  240. {
  241. num: 8,
  242. name: '库点收购',
  243. // icon: 'cuIcon-edit',
  244. src: '../../static/img/sign/kdsg.png',
  245. tips: 0,
  246. url: `/pages/user/depotAcquisition/depotAcquisition`,
  247. show: true
  248. },
  249. // {
  250. // num: 1,
  251. // name: '我的票据',
  252. // // icon: 'cuIcon-news',
  253. // src: '../../static/img/sign/piaoju@3x.png',
  254. // tips: 0,
  255. // url: `/pages/bill/index`,
  256. // show: true
  257. // },
  258. // {
  259. // num: 2,
  260. // name: '我的合同',
  261. // // icon: 'cuIcon-calendar',
  262. // src: '../../static/img/sign/myContract@2x.png',
  263. // tips: 0,
  264. // url: '/pageB/contract/contract',
  265. // show: true
  266. // },
  267. // {
  268. // num: 3,
  269. // name: '我的任务',
  270. // // icon: 'cuIcon-copy',
  271. // src: '../../static/img/sign/myTask@2x.png',
  272. // tips: 0,
  273. // url: '/pages/task/my_task',
  274. // show: true
  275. // },
  276. // {
  277. // num: 4,
  278. // name: '联系客服',
  279. // // icon: 'cuIcon-edit',
  280. // src: '../../static/img/sign/service.png',
  281. // tips: 0,
  282. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  283. // show: true
  284. // },
  285. // {
  286. // num: 5,
  287. // name: '数据报表',
  288. // // icon: 'cuIcon-edit',
  289. // src: '../../static/img/sign/shujubaobiao@2x.png',
  290. // tips: 0,
  291. // url: `/pages/user/report`,
  292. // show: false
  293. // },
  294. // {
  295. // num: 6,
  296. // name: '库点监控',
  297. // // icon: 'cuIcon-edit',
  298. // src: '../../static/img/sign/kudianjiankong@2x.png',
  299. // tips: 0,
  300. // url: `/pages/user/depotMonitoring`,
  301. // show: false
  302. // },
  303. // {
  304. // num: 7,
  305. // name: '库点收购',
  306. // // icon: 'cuIcon-edit',
  307. // src: '../../static/img/sign/kdsg.png',
  308. // tips: 0,
  309. // url: `/pages/user/depotAcquisition/depotAcquisition`,
  310. // show: true
  311. // }
  312. ],
  313. showTran: true,
  314. companyId: 1,
  315. current: 4
  316. }
  317. },
  318. // #ifndef MP
  319. onNavigationBarButtonTap(e) {
  320. const index = e.index;
  321. if (index === 0) {
  322. this.navTo('/pages/set/set');
  323. } else if (index === 1) {
  324. // #ifdef APP-PLUS
  325. const pages = getCurrentPages();
  326. const page = pages[pages.length - 1];
  327. const currentWebview = page.$getAppWebview();
  328. currentWebview.hideTitleNViewButtonRedDot({
  329. index
  330. });
  331. // #endif
  332. uni.navigateTo({
  333. url: '/pages/notice/notice'
  334. })
  335. }
  336. },
  337. // #endif
  338. computed: {
  339. ...mapState(['hasLogin', 'userInfo']),
  340. // 手机号中间4位加*
  341. starUserphone() {
  342. let reg = /^(\d{3})\d{4}(\d{4})$/;
  343. if (this.userphone) {
  344. return this.userphone.replace(reg, "$1****$2");
  345. }
  346. }
  347. },
  348. onPageScroll(e) {
  349. this.scrollTop = e.scrollTop;
  350. },
  351. onShow() {
  352. if (uni.getStorageSync('compName')) {
  353. this.haveCompany = true
  354. } else {
  355. this.haveCompany = false
  356. }
  357. this.isShow();
  358. uni.hideKeyboard()
  359. uni.showTabBar()
  360. uni.removeTabBarBadge({
  361. index: 4
  362. })
  363. this.loadData()
  364. console.log("hasLogin", this.hasLogin)
  365. if (this.userInfo) {
  366. if (!this.userInfo.avatarUrl) {
  367. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  368. } else {
  369. this.headUrl = this.userInfo.avatarUrl
  370. }
  371. this.username = this.userInfo.userName?this.userInfo.userName:uni.getStorageSync("userInfo").data.userName
  372. this.userphone = this.userInfo.phone?this.userInfo.phone:uni.getStorageSync("userInfo").data.phone
  373. var that = this
  374. this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
  375. console.log("noticeNumber", res)
  376. if (res.data.data) {
  377. let name = 'myTip';
  378. let value = res.data.data.total;
  379. that.$store.commit('$uStore', {
  380. name,
  381. value
  382. });
  383. if (value != 0 && value) {
  384. uni.setTabBarBadge({
  385. index: 4,
  386. text: value + ""
  387. })
  388. }
  389. name = 'taskTip';
  390. value = res.data.data.total;
  391. that.$store.commit('$uStore', {
  392. name,
  393. value
  394. });
  395. // name = 'contractTip';
  396. // value = res.data.data.contractTip;
  397. // that.$store.commit('$uStore', {
  398. // name,
  399. // value
  400. // });
  401. }
  402. })
  403. if (!uni.getStorageSync('compName')) {
  404. this.$api.doRequest('get', '/commonUser/getCompOwn', {
  405. phone: this.userInfo.phone
  406. }).then(res => {
  407. if (res.data.data) {
  408. this.companyList = res.data.data
  409. if (this.companyList.length > 0) {
  410. this.compName = this.companyList[0].compName
  411. uni.setStorageSync('compName', this.companyList[0].compName)
  412. this.haveCompany = true
  413. }
  414. }
  415. })
  416. } else {
  417. this.compName = uni.getStorageSync('compName')
  418. }
  419. } else {
  420. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  421. this.username = "立即登录"
  422. }
  423. console.log("this.userInfo", this.userInfo)
  424. },
  425. methods: {
  426. alertBtn() {
  427. uni.navigateTo({
  428. url: '/pages/public/login'
  429. })
  430. },
  431. cancelClick() {
  432. this.isShowAlert = false
  433. },
  434. compconfirm(e) {
  435. var that = this
  436. this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
  437. mobilePhone: this.userInfo.phone,
  438. companyName: this.companyList[e[0]].compName,
  439. veriCode: "123456",
  440. }).then(res1 => {
  441. if (res1.data.code == 200) {
  442. uni.setStorageSync('pcUserInfo', res1.data.data)
  443. uni.setStorageSync('compName', that.companyList[e[0]].compName)
  444. that.compName = that.companyList[e[0]].compName
  445. helper.getListByUserId()
  446. that.$api.msg('切换成功')
  447. } else {
  448. that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
  449. mobilePhone: '14444444444',
  450. companyName: this.companyList[e[0]].compName,
  451. veriCode: "123456",
  452. }).then(res2 => {
  453. uni.setStorageSync('pcUserInfo', res2.data.data)
  454. uni.setStorageSync('compName', that.companyList[e[0]].compName)
  455. that.compName = that.companyList[e[0]].compName
  456. helper.getListByUserId()
  457. that.$api.msg('切换成功')
  458. })
  459. }
  460. })
  461. },
  462. getRoles: function(role) {
  463. let _roles = uni.getStorageSync('rolesList')
  464. for (let i = 0; i < _roles.length; i++) {
  465. if (_roles[i] == role) {
  466. return true
  467. }
  468. }
  469. return false
  470. },
  471. isShow() {
  472. for (let k = 0; k < this.gridList1.length; k++) {
  473. if (k == 6) {
  474. this.gridList1[k].show = this.getRoles('reportData.view')
  475. } else if (k == 7) {
  476. this.gridList1[k].show = this.getRoles('monitoring.view')
  477. }
  478. }
  479. },
  480. smBtnClick() {
  481. if (!this.hasLogin) {
  482. this.isShowAlert = true;
  483. // uni.showModal({
  484. // title: '提示',
  485. // content: '您尚未登录,是否立即登录?',
  486. // showCancel: true,
  487. // confirmText: '登录',
  488. // success: (e) => {
  489. // if (e.confirm) {
  490. // uni.navigateTo({
  491. // url: '/pages/public/login'
  492. // })
  493. // }
  494. // },
  495. // fail: () => {},
  496. // complete: () => {}
  497. // })
  498. } else {
  499. uni.scanCode({
  500. success: function(res) {
  501. console.log('条码内容:' + res.result);
  502. uni.navigateTo({
  503. url: "/pages/erpbusiness/sm/sm?data=" + res.result
  504. })
  505. }
  506. });
  507. }
  508. },
  509. fankui() {
  510. uni.navigateTo({
  511. url: `/pages/user/fankui`
  512. })
  513. },
  514. zhibo() {
  515. uni.navigateTo({
  516. url: `/pageB/video/broadcast`
  517. })
  518. },
  519. look() {
  520. uni.navigateTo({
  521. url: `/pageB/video/look`
  522. })
  523. },
  524. contactUs() {
  525. const that = this
  526. uni.makePhoneCall({
  527. // 手机号
  528. phoneNumber: '18241771147',
  529. // 成功回调
  530. success: (res) => {},
  531. // 失败回调
  532. fail: (res) => {}
  533. });
  534. },
  535. loadData() {
  536. // 工厂价格
  537. let that = this
  538. that.$api.request('news', 'getFactoryPriceInfo', {
  539. category: this.category,
  540. page: 1,
  541. limit: 99999
  542. }, failres => {
  543. that.$api.msg(failres.errmsg)
  544. this.isLoadMore = false
  545. this.loadStatus = 'nomore'
  546. if (this.pages > 1) {
  547. this.pages = 1
  548. }
  549. uni.hideLoading()
  550. }).then(res => {
  551. let data = res.data
  552. that.plantList = data
  553. // that.makeScrollData(that.plantList, 8)
  554. uni.hideLoading()
  555. })
  556. // const that = this
  557. // if(uni.getStorageSync("PageCur")){
  558. // that.PageCur = uni.getStorageSync("PageCur");
  559. // }
  560. // that.userInfoTmp = uni.getStorageSync("userInfo")
  561. // uni.showLoading({
  562. // title: '正在加载',
  563. // mask:true
  564. // })
  565. // that.$api.request('integral', 'getIndexData', failres => {
  566. // that.$api.msg(failres.errmsg)
  567. // uni.hideLoading()
  568. // }).then(res => {
  569. // let data = res.data
  570. // uni.setStorageSync("message", data.message);
  571. // uni.setStorageSync("task", data.task);
  572. // uni.setStorageSync("contract", data.contract);
  573. // uni.setStorageSync('showTran', data.showTran);
  574. // that.showTran = data.showTran
  575. // that.gridList[4].tips = data.task
  576. // that.gridList[2].tips = data.contract
  577. // that.companyId = data.companyId
  578. // uni.hideLoading()
  579. // })
  580. },
  581. gridClick(item, index) {
  582. var that = this
  583. if (item.name == "退出登录") {
  584. this.logout()
  585. return;
  586. } else if (item.name == "联系我们") {
  587. //#ifdef MP
  588. this.inputShow = true
  589. this.inputStatus = 'inline'
  590. this.feild = "nickname"
  591. this.inputContent = ''
  592. //#endif
  593. //#ifdef APP-PLUS
  594. this.contactUs()
  595. //#endif
  596. return;
  597. } else if (item.name == '我的车辆') {
  598. const that = this
  599. uni.showLoading({
  600. title: '正在加载',
  601. mask: true
  602. })
  603. that.$api.request('tran', 'getMyCarList', failres => {
  604. that.$api.msg(failres.errmsg)
  605. uni.hideLoading()
  606. }).then(res => {
  607. that.carInfo = res.data
  608. if (that.carInfo.length == 0) {
  609. that.$api.msg('暂无车辆信息')
  610. } else {
  611. var height = that.carInfo.length * 100
  612. var width = 500
  613. that.mycarStyle = "height:" + height + "rpx;width:" + width + "rpx"
  614. that.modalName = 'MycarModal'
  615. }
  616. uni.hideLoading()
  617. })
  618. return;
  619. }
  620. if (!this.hasLogin) {
  621. this.isShowAlert = true;
  622. // uni.showModal({
  623. // title: '提示',
  624. // content: '您尚未登录,是否立即登录?',
  625. // showCancel: true,
  626. // confirmText: '登录',
  627. // success: (e) => {
  628. // if (e.confirm) {
  629. // uni.navigateTo({
  630. // url: '/pages/public/login'
  631. // })
  632. // }
  633. // },
  634. // fail: () => {},
  635. // complete: () => {}
  636. // })
  637. } else {
  638. if (item.url) {
  639. uni.navigateTo({
  640. url: item.url + `?companyId=${that.companyId}`
  641. })
  642. }
  643. }
  644. },
  645. setting() {
  646. if (!this.hasLogin) {
  647. this.isShowAlert = true;
  648. // uni.showModal({
  649. // title: '提示',
  650. // content: '您尚未登录,是否立即登录?',
  651. // showCancel: true,
  652. // confirmText: '登录',
  653. // success: (e) => {
  654. // if (e.confirm) {
  655. // uni.navigateTo({
  656. // url: '/pages/public/login'
  657. // })
  658. // }
  659. // },
  660. // fail: () => {},
  661. // complete: () => {}
  662. // })
  663. } else {
  664. uni.navigateTo({
  665. url: '/pages/user/setUp'
  666. })
  667. }
  668. },
  669. toLogin() {
  670. console.log("userInfo", this.userInfo)
  671. if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
  672. uni.navigateTo({
  673. url: '/pages/public/login_account_number'
  674. })
  675. } else {
  676. uni.navigateTo({
  677. url: '/pages/user/setUp'
  678. })
  679. }
  680. // else if(!this.userInfo.nickname){
  681. // this.inputShow = true
  682. // this.inputStatus = 'inline'
  683. // this.feild = "nickname"
  684. // this.inputContent = ''
  685. // }
  686. },
  687. confirm() {
  688. const that = this
  689. if (!that.inputContent) {
  690. that.$api.msg('输入不能为空')
  691. return
  692. }
  693. let obj = {}
  694. obj[that.feild] = that.inputContent
  695. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  696. that.userInfo.nickname = that.inputContent
  697. that.inputContent = ''
  698. that.$store.commit('login', that.userInfo)
  699. })
  700. },
  701. cancel() {
  702. this.inputShow = false
  703. this.inputStatus = 'none'
  704. this.genderShow = false
  705. },
  706. myAccount() {
  707. uni.navigateTo({
  708. url: `/pageA/pages/contract`
  709. })
  710. },
  711. logout() {
  712. // const that = this
  713. this.isShowAlert = true
  714. // uni.showModal({
  715. // title: '询问',
  716. // content: '您确定要退出吗?',
  717. // cancelText: '取消',
  718. // confirmText: '确定',
  719. // success: (e) => {
  720. // if (e.confirm) {
  721. // uni.hideTabBarRedDot({
  722. // index: 3
  723. // })
  724. // uni.clearStorageSync();
  725. // that.$store.commit('logout')
  726. // that.$api.logout()
  727. // uni.navigateTo({
  728. // url: `/pages/public/login`
  729. // })
  730. // }
  731. // }
  732. // })
  733. },
  734. /**
  735. * 统一跳转接口,拦截未登录路由
  736. * navigator标签现在默认没有转场动画,所以用view
  737. */
  738. navTo(url) {
  739. if (!this.hasLogin) {
  740. url = '/pages/public/login';
  741. }
  742. uni.navigateTo({
  743. url
  744. })
  745. },
  746. mycarClick(carNo) {
  747. this.modalName = null
  748. uni.navigateTo({
  749. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  750. })
  751. },
  752. qrClick(userInfo) {
  753. this.modalName = null
  754. uni.navigateTo({
  755. url: `/pages/user/qr`
  756. })
  757. },
  758. scanCode() {
  759. uni.scanCode({
  760. success: function(res) {
  761. uni.navigateTo({
  762. url: res.result
  763. })
  764. }
  765. })
  766. },
  767. hideModal(e) {
  768. this.modalName = null
  769. },
  770. }
  771. }
  772. </script>
  773. <style lang='scss' scoped>
  774. .company {
  775. position: fixed;
  776. right: 0;
  777. top: 10%;
  778. background: url('../../static/img/qiyebeijing.png');
  779. background-size: 100%;
  780. font-size: 11px;
  781. padding-bottom: 5px;
  782. padding-left: 10px;
  783. border-radius: 40rpx 0 0 40rpx;
  784. }
  785. .company .icon {
  786. position: relative;
  787. top: 4px;
  788. }
  789. page {
  790. background: #F8F9FC;
  791. }
  792. .container {
  793. padding-top: 85px;
  794. padding-top: 35px;
  795. background-color: #F5F6FA;
  796. position: relative;
  797. width: 100vw;
  798. overflow: hidden;
  799. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  800. background-size: 100% 100%;
  801. margin: 0 auto;
  802. height: calc(100vh - 0px);
  803. }
  804. .cu-tag.badge {
  805. right: 26rpx;
  806. }
  807. .path {
  808. color: #007aff;
  809. display: inline-block;
  810. text-align: center;
  811. }
  812. .icon {
  813. margin-right: 10rpx;
  814. }
  815. .portrait-box {
  816. margin-top: 20rpx;
  817. }
  818. .qr-wrap {
  819. margin-top: 20upx;
  820. color: #fff;
  821. font-size: 32rpx;
  822. }
  823. .cu-list {
  824. /* height: 483rpx;
  825. overflow-y: scroll; */
  826. margin-top: 16rpx;
  827. margin-bottom: 80rpx;
  828. }
  829. .cu-list.grid>.cu-item .badge_user {
  830. color: #fff;
  831. border: 1px solid #fff;
  832. background-color: #FF6600;
  833. display: inline-block;
  834. padding: 0.45em .25em 0.25em;
  835. position: absolute;
  836. font-size: 9px;
  837. font-weight: 700;
  838. line-height: 1;
  839. text-align: center;
  840. white-space: nowrap;
  841. vertical-align: top;
  842. width: 22px;
  843. height: 22px;
  844. right: 19px;
  845. /* transform: scale(0.5); */
  846. top: -12px;
  847. z-index: 2;
  848. border-radius: 50%;
  849. transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  850. }
  851. @keyframes move_wave {
  852. 0% {
  853. transform: translateX(0) translateZ(0) scaleY(1)
  854. }
  855. 50% {
  856. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  857. }
  858. 100% {
  859. transform: translateX(-50%) translateZ(0) scaleY(1)
  860. }
  861. }
  862. .bg {
  863. position: relative;
  864. height: 300rpx;
  865. /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
  866. /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
  867. background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
  868. }
  869. .bg_ware {
  870. position: absolute;
  871. left: 0;
  872. bottom: -2rpx;
  873. width: 100%;
  874. mix-blend-mode: screen;
  875. height: 224rpx;
  876. }
  877. %flex-center {
  878. display: flex;
  879. flex-direction: column;
  880. justify-content: center;
  881. align-items: center;
  882. }
  883. %section {
  884. display: flex;
  885. justify-content: space-around;
  886. align-content: center;
  887. background: #fff;
  888. border-radius: 10upx;
  889. }
  890. .grid-item-box {
  891. flex: 1;
  892. /* position: relative;
  893. */
  894. /* #ifndef APP-NVUE */
  895. display: flex;
  896. /* #endif */
  897. flex-direction: column;
  898. align-items: center;
  899. justify-content: center;
  900. padding: 15px 0;
  901. }
  902. .user-section {
  903. height: 520upx;
  904. padding: 100upx 30upx 0;
  905. position: relative;
  906. .bg {
  907. position: absolute;
  908. left: 0;
  909. top: 0;
  910. width: 100%;
  911. height: 100%;
  912. filter: blur(1px);
  913. box-shadow: 0px 1px 8px #ccc;
  914. /* background:linear-gradient(#0eb0c9,#126bae); */
  915. /* opacity: .7; */
  916. }
  917. }
  918. .user-info-box {
  919. height: 180upx;
  920. /* display:flex; */
  921. /* align-items:center; */
  922. text-align: center;
  923. position: relative;
  924. z-index: 1;
  925. .portrait {
  926. width: 130upx;
  927. height: 130upx;
  928. border: 5upx solid #fff;
  929. border-radius: 50%;
  930. }
  931. .username {
  932. font-size: $font-lg + 3upx;
  933. color: #fff;
  934. margin-top: 20upx;
  935. }
  936. }
  937. .vip-card-box {
  938. display: flex;
  939. flex-direction: column;
  940. color: #f7d680;
  941. height: 240upx;
  942. background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
  943. border-radius: 16upx 16upx 0 0;
  944. overflow: hidden;
  945. position: relative;
  946. padding: 20upx 24upx;
  947. .card-bg {
  948. position: absolute;
  949. top: 20upx;
  950. right: 0;
  951. width: 380upx;
  952. height: 260upx;
  953. }
  954. .b-btn {
  955. position: absolute;
  956. right: 20upx;
  957. top: 16upx;
  958. width: 132upx;
  959. height: 40upx;
  960. text-align: center;
  961. line-height: 40upx;
  962. font-size: 22upx;
  963. color: #36343c;
  964. border-radius: 20px;
  965. background: linear-gradient(left, #f9e6af, #ffd465);
  966. z-index: 1;
  967. }
  968. .tit {
  969. font-size: $font-base+2upx;
  970. color: #f7d680;
  971. margin-bottom: 28upx;
  972. .yticon {
  973. color: #f6e5a3;
  974. margin-right: 16upx;
  975. }
  976. }
  977. .e-b {
  978. font-size: $font-sm;
  979. color: #d8cba9;
  980. margin-top: 10upx;
  981. }
  982. }
  983. .cover-container {
  984. padding: 1px 10px;
  985. padding-bottom: 20rpx;
  986. /* background-color: #F5F6FA; */
  987. /* border-radius: 20px; */
  988. margin-top: 12upx;
  989. .arc {
  990. position: absolute;
  991. left: 0;
  992. top: -34upx;
  993. width: 100%;
  994. height: 36upx;
  995. }
  996. }
  997. .tj-sction {
  998. @extend %section;
  999. .tj-item {
  1000. @extend %flex-center;
  1001. flex-direction: column;
  1002. height: 140upx;
  1003. font-size: $font-sm;
  1004. color: #75787d;
  1005. }
  1006. .num {
  1007. font-size: $font-lg;
  1008. color: $font-color-dark;
  1009. margin-bottom: 8upx;
  1010. }
  1011. }
  1012. .order-section {
  1013. @extend %section;
  1014. padding: 28upx 0;
  1015. margin-top: 20upx;
  1016. .order-item {
  1017. @extend %flex-center;
  1018. width: 120upx;
  1019. height: 120upx;
  1020. border-radius: 10upx;
  1021. font-size: $font-sm;
  1022. color: $font-color-dark;
  1023. }
  1024. .yticon {
  1025. font-size: 48upx;
  1026. margin-bottom: 18upx;
  1027. color: #fa436a;
  1028. }
  1029. .icon-shouhoutuikuan {
  1030. font-size: 44upx;
  1031. }
  1032. }
  1033. .history-section {
  1034. padding: 30upx 0 0;
  1035. margin-top: 20upx;
  1036. background: #fff;
  1037. border-radius: 10upx;
  1038. .sec-header {
  1039. display: flex;
  1040. align-items: center;
  1041. font-size: $font-base;
  1042. color: $font-color-dark;
  1043. line-height: 40upx;
  1044. margin-left: 30upx;
  1045. .yticon {
  1046. font-size: 44upx;
  1047. color: #5eba8f;
  1048. margin-right: 16upx;
  1049. line-height: 40upx;
  1050. }
  1051. }
  1052. .h-list {
  1053. white-space: nowrap;
  1054. padding: 30upx 30upx 0;
  1055. image {
  1056. display: inline-block;
  1057. width: 160upx;
  1058. height: 160upx;
  1059. margin-right: 20upx;
  1060. border-radius: 10upx;
  1061. }
  1062. }
  1063. }
  1064. .grid {
  1065. display: flex;
  1066. align-items: center;
  1067. flex-wrap: wrap;
  1068. /* border-top: 2upx solid rgba(172,172,172,.2); */
  1069. .grid-item-3 {
  1070. box-sizing: border-box;
  1071. width: calc(100% / 3);
  1072. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  1073. border-right: 2upx solid rgba(172, 172, 172, .2);
  1074. text-align: center;
  1075. padding: 40upx 0;
  1076. position: relative;
  1077. /* view{
  1078. font-size: $font-sm;
  1079. margin-top: 16upx;
  1080. color: $font-color-dark;
  1081. } */
  1082. .grid_icon {
  1083. font-size: 48upx;
  1084. margin-bottom: 18upx;
  1085. color: #fa436a;
  1086. }
  1087. .tip_text {
  1088. display: block;
  1089. padding: 4upx 8upx;
  1090. text-align: center;
  1091. border-radius: 36upx;
  1092. font-size: 24upx;
  1093. background-color: #fa436a;
  1094. color: rgba(255, 255, 255, 1);
  1095. position: absolute;
  1096. right: 6upx;
  1097. top: 6upx;
  1098. }
  1099. }
  1100. .grid-item-3:nth-child(3n + 3),
  1101. .grid-item-4:nth-child(4n + 4) {
  1102. border-right: none;
  1103. }
  1104. }
  1105. .headPortrait {
  1106. width: 112rpx;
  1107. height: 112rpx;
  1108. border-radius: 40px;
  1109. border: 2px solid #ffffff;
  1110. }
  1111. .personal {
  1112. margin-top: 10px;
  1113. margin-left: 10px;
  1114. }
  1115. .information {
  1116. font-size: 15px;
  1117. font-weight: 600;
  1118. height: 60rpx;
  1119. }
  1120. .indexlow {
  1121. /* margin-top: 30px; */
  1122. border-radius: 10px;
  1123. }
  1124. .cu-list>.cu-item:after {
  1125. border: none;
  1126. }
  1127. .sign {
  1128. width: 35px;
  1129. height: 35px;
  1130. top: 4px;
  1131. }
  1132. .sign1 {
  1133. width: 26px;
  1134. height: 26px;
  1135. top: 4px;
  1136. }
  1137. .indexUp {
  1138. padding: 0 20px;
  1139. align-items: center;
  1140. }
  1141. .cu-list.grid>.cu-item .cu-tag.badge {
  1142. color: #fff;
  1143. background: #FF6600;
  1144. font-size: 9px;
  1145. line-height: 5px;
  1146. padding: 5px;
  1147. }
  1148. .cover-container-item {
  1149. background: #fff;
  1150. border-radius: 10px;
  1151. padding: 10px 0;
  1152. }
  1153. .cover-container-item .cu-list {
  1154. margin: 0;
  1155. }
  1156. .cover-container-item .cu-list.grid>.cu-item [class*=cuIcon] {
  1157. margin: 0;
  1158. }
  1159. .guess-section-wrap-item {
  1160. float: left;
  1161. width: 38vw;
  1162. background: #F9F9FA;
  1163. padding: 7px;
  1164. margin: 20rpx;
  1165. border-radius: 3px;
  1166. // width:50%;
  1167. }
  1168. .guess-section-wrap-item:first-child {
  1169. // margin-left:2px;
  1170. }
  1171. .clearfix:after {
  1172. content: "";
  1173. display: block;
  1174. clear: both;
  1175. }
  1176. .guess-section-wrap {
  1177. padding: 15px;
  1178. margin: 10rpx 20rpx;
  1179. border-radius: 5px;
  1180. background: #fff;
  1181. overflow: hidden;
  1182. }
  1183. .guess-section-wrap .price {
  1184. color: #B2B3BB;
  1185. display: flex;
  1186. align-items: center;
  1187. }
  1188. .title {
  1189. font-size: 28upx;
  1190. color: $font-color-dark;
  1191. font-weight: bold;
  1192. height: 50upx;
  1193. line-height: 50upx;
  1194. flex: 2.5;
  1195. }
  1196. .factory {
  1197. font-size: 26rpx;
  1198. font-weight: 900;
  1199. }
  1200. .currectprice {
  1201. color: rgba(253, 113, 79, 1);
  1202. font-size: 18px;
  1203. font-weight: 550;
  1204. vertical-align: middle;
  1205. margin-right: 10px;
  1206. }
  1207. .yesterday {
  1208. font-size: 14px;
  1209. font-weight: 600;
  1210. vertical-align: middle;
  1211. }
  1212. .yesterday.up {
  1213. color: rgba(253, 113, 79, 1);
  1214. }
  1215. .yesterday.down {
  1216. color: #22C572;
  1217. }
  1218. </style>