user.vue 30 KB

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