user.vue 30 KB

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