user.vue 30 KB

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