user.vue 30 KB

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