user.vue 27 KB

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