user.vue 27 KB

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