user.vue 27 KB

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