user.vue 28 KB

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