12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514 |
- <template>
- <view class="container">
- <view style="position: absolute;padding-left: 80%; display: flex;">
- <image @click='smBtnClick' style='width:21px;height:21px;' src="../../static/img/saoma.png"></image>
- <image @click='setting' style='width:21px;height:21px;margin-left: 20rpx;'
- src="../../static/img/sign/shezhi@3x.png"></image>
- </view>
- <view class="indexUp flex justify-between">
- <view class='flex'>
- <image v-bind:src="headUrl" class="headPortrait"></image>
- <view class="personal">
- <view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
- <view style='font-size:13px;color:#8F97AB;' class="information">{{hasLogin?starUserphone:''}}</view>
- <view v-if="haveCompany">
- <view v-if='hasLogin' @click='show=true' class="company">
- <image class='icon' style='width:19px;height:19px;' src="../../static/img/icon_qiye@3x.png"
- mode=""></image> {{compName}}>
- </view>
- <u-picker @confirm='compconfirm' mode="selector" v-model="show" :range="companyList"
- range-key="compName"></u-picker>
- </view>
- </view>
- </view>
- </view>
- <view style='background:transparent;margin-bottom:0;padding:0;' class="cu-list grid"
- :class="['col-' + gridCol,gridBorder?'':'no-border']">
- <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
- v-if="index<gridCol*2">
- <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
- <image :src="item.src" class="sign"></image>
- <text style="color: #333333;">{{item.name}}</text>
- </view>
- </view>
- </view>
- <view v-if="hasLogin" class="cover-container">
- <view class='cover-container-item'>
- <view style='font-size:16px;padding-left:14px;'>我的功能</view>
- <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
- <view class="cu-item" style='text-align:center;' v-for="(item,index) in gridList1" :key="index"
- @click="gridClick(item, index)" v-show="item.show">
- <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
- <text v-if='item.num==3&&taskTip&&taskTip<100' class='badge_user'>{{taskTip}}</text>
- <text v-if='item.num==3&&taskTip&&taskTip>100' class='badge_user'>...</text>
- <image :src="item.src" class="sign1"></image>
- </view>
- <text style="color: #333333;">{{item.name}}</text>
- </view>
- </view>
- </view>
- </view>
- <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
- :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
- :showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
- </view>
- <!-- <view style="margin-top: 10rpx;">
- <web-view src="https://datav.aliyuncs.com/share/01de6913a5761ab4d3171b1f0b3e0704"></web-view>
- </view> -->
- <!-- <view style='text-align:center;'>
- <navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
- class="path" hover-class="navigator-hover">《服务协议》</navigator>
- <navigator
- url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
- class="path" hover-class="navigator-hover">《隐私政策》</navigator>
- </view> -->
- <!-- <view class="guess-section-wrap">
- <view class='flex justify-between'>
- <view class='title Medium'>工厂价格</view>
- </view>
- <view class=' guess-section-wrap-item clearfix' v-for='(item,index1) in plantList' :key="index1">
- <view class='factory'>{{item.factory}}</view>
- <view class='wrap'>{{item.city}} {{item.factoryType}}</view>
- <view class='price'>
- <text class='currectprice '>{{item.price}}</text>
- 较昨日
- <image v-if='item.comparePrice>0' style="width:7.5px;height:9px;"
- src='../../static/img/homepage/shangsheng.png'></image>
- <image v-if='item.comparePrice<0' style="width:7.5px;height:9px;"
- src='../../static/img/homepage/xiajiang.png'></image>
- <text v-if='item.comparePrice>0' class='yesterday up'>{{item.comparePrice}}</text>
- <text v-if='item.comparePrice<0' class='yesterday down'>{{-item.comparePrice}}</text>
- <text v-if='item.comparePrice==0' class='yesterday'>-</text>
- </view>
- </view>
- </view>
- <u-back-top :scroll-top="scrollTop" mode="circle" icon="arrow-upward"></u-back-top> -->
- </view>
- </template>
- <script>
- import helper from '@/common/helper.js';
- import dragButton from "@/components/drag-button/drag-button.vue";
- import {
- mapState
- } from 'vuex';
- let startY = 0,
- moveY = 0,
- pageAtTop = true;
- export default {
- components: {
- dragButton
- },
- data() {
- return {
- isShowAlert: false,
- content: '您尚未登录,是否立即登录?',
- haveCompany: false,
- scrollTop: 0,
- inputShow: false,
- modalName: '',
- compName: '',
- mycarStyle: '',
- show: false,
- feild: undefined,
- inputContent: '',
- coverTransform: 'translateY(0px)',
- coverTransition: '0s',
- moving: false,
- footprintList: [],
- isVip: false,
- userInfoTmp: [],
- inputStatus: 'none',
- carInfo: [],
- plantList: [],
- headUrl: "../../static/img/myimg/YongHu@3x.png",
- userphone: "",
- gridCol: 4,
- gridBorder: false,
- username: "请更改昵称",
- companyList: [],
- gridList: [{
- num: 0,
- name: '认证',
- // icon: 'cuIcon-apps',
- src: '../../static/img/myimg/renzheng@3x.png',
- tips: 0,
- url: '/pages/attestation/index',
- show: true
- },
- {
- num: 1,
- name: '粮脉',
- // icon: 'cuIcon-apps',
- src: '../../static/img/myimg/liangmai@3x.png',
- tips: 0,
- url: '/pages/grain_pulse/my_grain_pulse',
- show: true
- },
- {
- num: 2,
- name: '发布',
- // icon: 'cuIcon-news',
- src: '../../static/img/myimg/fabu@3x.png',
- tips: 0,
- url: `/pages/release/release`,
- show: true
- },
- {
- num: 3,
- name: '货运收发',
- // icon: 'cuIcon-copy',
- src: '../../static/img/sign/receiveGoods@2x.png',
- tips: 0,
- url: `/pageA/freightTransport/index`,
- show: true
- },
- ],
- gridList1: [
- // {
- // num: 2,
- // name: '我的票据',
- // // icon: 'cuIcon-news',
- // src: '../../static/img/sign/piaoju@3x.png',
- // tips: 0,
- // url: `/pages/bill/index`,
- // show: true
- // },
- // {
- // num: 3,
- // name: '我的合同',
- // // icon: 'cuIcon-calendar',
- // src: '../../static/img/sign/myContract@2x.png',
- // tips: 0,
- // url: '/pageB/contract/contract',
- // show: true
- // },
- // {
- // num: 4,
- // name: '我的任务',
- // // icon: 'cuIcon-copy',
- // src: '../../static/img/sign/myTask@2x.png',
- // tips: 0,
- // url: '/pages/task/my_task',
- // show: true
- // },
- // {
- // num: 5,
- // name: '联系客服',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/service.png',
- // tips: 0,
- // url: `/pages/erp/contactCustomerService/contactCustomerService`,
- // show: true
- // },
- // {
- // num: 6,
- // name: '数据报表',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/shujubaobiao@2x.png',
- // tips: 0,
- // url: `/pages/user/report`,
- // show: false
- // },
- // {
- // num: 7,
- // name: '库点监控',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/kudianjiankong@2x.png',
- // tips: 0,
- // url: `/pages/user/depotMonitoring`,
- // show: false
- // },
- // {
- // num: 8,
- // name: '库点收购',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/kdsg.png',
- // tips: 0,
- // url: `/pages/user/depotAcquisition/depotAcquisition`,
- // show: true
- // },
- // {
- // num: 2,
- // name: '我的合同',
- // // icon: 'cuIcon-calendar',
- // src: '../../static/img/sign/myContract@2x.png',
- // tips: 0,
- // url: '/pageB/contract/contract',
- // show: true
- // },
- {
- num: 0,
- name: 'ERP业务',
- // icon: 'cuIcon-copy',
- src: '../../static/img/myimg/erp.png',
- tips: 0,
- url: `/pages/erp/index`,
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- {
- num: 1,
- // name: '入库管理',
- name: '收购业务',
- // icon: 'cuIcon-copy',
- src: '../../static/img/myimg/sg.png',
- tips: 0,
- url: `/pages/erpbusiness/index`,
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- {
- num: 2,
- name: '我的票据',
- // icon: 'cuIcon-news',
- src: '../../static/img/sign/piaoju@3x.png',
- tips: 0,
- url: `/pages/bill/index`,
- show: true
- },
- {
- num: 3,
- name: '我的任务',
- // icon: 'cuIcon-copy',
- src: '../../static/img/sign/myTask@2x.png',
- tips: 0,
- url: '/pages/task/my_task',
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- {
- num: 4,
- name: '联系客服',
- // icon: 'cuIcon-edit',
- src: '../../static/img/sign/service.png',
- tips: 0,
- url: `/pages/erp/contactCustomerService/contactCustomerService`,
- show: true
- },
- {
- num: 5,
- name: '库点收购',
- // icon: 'cuIcon-edit',
- src: '../../static/img/sign/kdsg.png',
- tips: 0,
- url: `/pages/user/depotAcquisition/depotAcquisition`,
- show: true
- },
- {
- num: 6,
- name: '数据报表',
- // icon: 'cuIcon-edit',
- src: '../../static/img/sign/shujubaobiao@2x.png',
- tips: 0,
- url: `/pages/user/newReport`,
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- {
- num: 7,
- name: '库点监控',
- // icon: 'cuIcon-edit',
- src: '../../static/img/sign/kudianjiankong@2x.png',
- tips: 0,
- url: `/pages/user/depotMonitoring`,
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- {
- num: 8,
- name: 'OA办公',
- // icon: 'cuIcon-edit',
- src: '../../static/img/oa_office/oaOffice.png',
- tips: 0,
- url: `/pages/oa_office/the_oaOffice`,
- show: uni.getStorageSync('pcUserInfo') ? true : false
- },
- // {
- // num: 9,
- // name: '打卡',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/daka.png',
- // tips: 0,
- // url: `/pages/clock/the_clock`,
- // show: true
- // },
- // {
- // num: 10,
- // name: '请假',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/qingjia.png',
- // tips: 0,
- // url: `/pages/leave/the_leave`,
- // show: true
- // },
- // {
- // num: 11,
- // name: '加油',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/jiayou.png',
- // tips: 0,
- // url: `/pages/fuelfilling/the_fuel_filling`,
- // show: true
- // },
- // {
- // num: 10,
- // name: '短途记录',
- // // icon: 'cuIcon-edit',
- // src: '../../static/img/sign/dt.png',
- // tips: 0,
- // url: `/pages/shortDistance/short_distance_record`,
- // show: true
- // }
- ],
- showTran: true,
- companyId: 1,
- current: 4
- }
- },
- // #ifndef MP
- onNavigationBarButtonTap(e) {
- const index = e.index;
- if (index === 0) {
- this.navTo('/pages/set/set');
- } else if (index === 1) {
- // #ifdef APP-PLUS
- const pages = getCurrentPages();
- const page = pages[pages.length - 1];
- const currentWebview = page.$getAppWebview();
- currentWebview.hideTitleNViewButtonRedDot({
- index
- });
- // #endif
- uni.navigateTo({
- url: '/pages/notice/notice'
- })
- }
- },
- // #endif
- computed: {
- ...mapState(['hasLogin', 'userInfo', 'clientId']),
- // 手机号中间4位加*
- starUserphone() {
- let reg = /^(\d{3})\d{4}(\d{4})$/;
- if (this.userphone) {
- return this.userphone.replace(reg, "$1****$2");
- }
- }
- },
- onPageScroll(e) {
- this.scrollTop = e.scrollTop;
- },
- onShow() {
-
- // uni.showLoading({
- // title: '加载中',
- // mask: true
- // })
- // console.log(111111111)
- this.pcUserInfo = uni.getStorageSync('pcUserInfo')
- if (this.pcUserInfo) {
- // console.log(2222222)
- for (var i = 0; i < this.gridList1.length; i++) {
- if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
- .gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
- this.gridList1[i].show = true
- }
- }
- } else {
- // console.log(33333333)
- for (var i = 0; i < this.gridList1.length; i++) {
- if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
- .gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
- this.gridList1[i].show = false
- }
- }
- }
- // console.log("uni.getStorageSync('compName1')")
- // console.log(uni.getStorageSync("compName1"))
- // if (uni.getStorageSync("compName1")) {
- // this.haveCompany = true
- // } else {
- // this.haveCompany = false
- // }
- this.isShow();
- uni.hideKeyboard()
- uni.showTabBar()
- uni.removeTabBarBadge({
- index: 4
- })
- this.loadData()
- console.log("hasLogin", this.hasLogin)
- var that = this
- if (this.userInfo) {
- if (!this.userInfo.avatarUrl) {
- this.headUrl = "../../static/img/myimg/YongHu@3x.png"
- } else {
- this.headUrl = this.userInfo.avatarUrl
- }
- this.username = this.userInfo.userName ? this.userInfo.userName : uni.getStorageSync("userInfo").data
- .userName
- this.userphone = this.userInfo.phone ? this.userInfo.phone : uni.getStorageSync("userInfo").data.phone
- this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
- console.log("noticeNumber", res)
- if (res.data.data) {
- let name = 'myTip';
- let value = res.data.data.total;
- that.$store.commit('$uStore', {
- name,
- value
- });
- if (value != 0 && value) {
- uni.setTabBarBadge({
- index: 4,
- text: value + ""
- })
- }
- name = 'taskTip';
- value = res.data.data.total;
- that.$store.commit('$uStore', {
- name,
- value
- });
- // name = 'contractTip';
- // value = res.data.data.contractTip;
- // that.$store.commit('$uStore', {
- // name,
- // value
- // });
- }
- })
- console.log("this.1111")
- // uni.getStorage({
- // key: 'compName1',
- // success: function (res) {
- // console.log("this.2222")
- // console.log(res.data);
- // if(res.data){
- // that.compName = res.data
- // that.haveCompany = true
- // }
- // },
- // fail() {
- // }
- // });
- // console.log(uni.getStorageSync('compName1'))
- if(uni.getStorageSync('compName1')){
- that.compName = uni.getStorageSync('compName1').company
- }
- that.$api.doRequest('get', '/commonUser/getCompOwn', {
- phone: that.userInfo.phone
- }).then(res => {
- if (res.data.data) {
- // uni.hideLoading()
- that.companyList = res.data.data
- if(that.pcUserInfo){
- for(let i=0;i<that.companyList.length;i++){
- if(that.pcUserInfo.compId == that.companyList[i].compId){
- // uni.setStorageSync('compName1',that.companyList[i])
- uni.setStorageSync('compName1', {company:that.companyList[i].compName})
-
- that.compName = that.companyList[i].compName
- }
-
- }
- }
- // uni.setStorageSync('companyList', that.companyList)
- console.log("that.3333")
- console.log(that.companyList)
- if (that.companyList.length > 0) {
- console.log("this.compName1")
- console.log(that.compName)
- if (!that.compName) {
- console.log(111111111111)
- that.compName = that.companyList[0].compName
- uni.setStorageSync('compName1', {company:that.companyList[0].compName})
- }else{
- uni.setStorageSync('compName1', {company:that.compName})
- }
- console.log("this.compName2")
- console.log(that.compName)
- that.haveCompany = true
- } else {
- that.haveCompany = false
- }
- }
- })
- } else {
- this.headUrl = "../../static/img/myimg/YongHu@3x.png"
- this.username = "立即登录"
- }
- console.log("this.userInfo", this.userInfo)
- },
- methods: {
- alertBtn() {
- uni.navigateTo({
- url: '/pages/public/login'
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- compconfirm(e) {
- var that = this
- uni.showLoading({
- title: '登录中',
- mask: true
- })
- console.log("clinetId", this.clientId)
- this.$api.doRequest('get', '/commonUser/login', {
- phone: this.userInfo.phone,
- password: "999999",
- cid: this.clientId
- }).then(res => {
- if (res.data.code == 200) {
- console.log("userInfo", res.data.data)
- uni.setStorageSync('userInfo', res.data.data)
- uni.removeStorageSync("cangid")
- this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
- mobilePhone: this.userInfo.phone,
- companyName: this.companyList[e[0]].compName,
- veriCode: "123456",
- }).then(res1 => {
- console.log("loginQuickly", res)
- uni.setStorageSync("cangid",'')
- if (res1.data.code == 200) {
- uni.setStorageSync('pcUserInfo', res1.data.data)
- uni.setStorageSync('compName1', {company:that.companyList[e[0]].compName})
- // uni.setStorageSync('compName1', that.companyList[e[0]].compName)
- that.compName = that.companyList[e[0]].compName
- helper.getListByUserId()
- } else {
- // that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
- // veriCode: "123456",}).then(res2 => {
- // uni.setStorageSync('pcUserInfo', res2.data.data)
- // helper.getListByUserId()
- // })
- }
- that.$store.commit('login', res.data.data)
- var name = 'userInfo';
- var value = res.data.data;
- that.$store.commit('$uStore', {
- name,
- value
- });
- // that.liangxinLogin()
- // uni.switchTab({
- // url: '/pages/sale/information'
- // });
- uni.hideLoading()
- uni.hideKeyboard()
- uni.showTabBar()
- uni.removeTabBarBadge({
- index: 4
- })
- that.loadData()
- that.username = that.userInfo.userName ? that.userInfo.userName : uni
- .getStorageSync("userInfo").data
- .userName
- that.userphone = that.userInfo.phone ? that.userInfo.phone : uni
- .getStorageSync("userInfo").data.phone
- that.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
- console.log("noticeNumber", res)
- if (res.data.data) {
- let name = 'myTip';
- let value = res.data.data.total;
- that.$store.commit('$uStore', {
- name,
- value
- });
- if (value != 0 && value) {
- uni.setTabBarBadge({
- index: 4,
- text: value + ""
- })
- }
- name = 'taskTip';
- value = res.data.data.total;
- that.$store.commit('$uStore', {
- name,
- value
- });
- // name = 'contractTip';
- // value = res.data.data.contractTip;
- // that.$store.commit('$uStore', {
- // name,
- // value
- // });
- }
- })
- that.$api.msg('切换成功')
- })
- } else {
- uni.hideLoading()
- uni.showToast({
- title: res.data.message,
- icon: 'none',
- duration: 2000
- })
- }
- })
- .catch(res => {
- console.log(res);
- });
- // var that = this
- // this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
- // mobilePhone: this.userInfo.phone,
- // companyName: this.companyList[e[0]].compName,
- // veriCode: "123456",
- // }).then(res1 => {
- // if (res1.data.code == 200) {
- // uni.setStorageSync('pcUserInfo', res1.data.data)
- // uni.setStorageSync('compName1', that.companyList[e[0]].compName)
- // that.compName = that.companyList[e[0]].compName
- // helper.getListByUserId()
- // that.$api.msg('切换成功')
- // } else {
- // that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
- // mobilePhone: '14444444444',
- // companyName: this.companyList[e[0]].compName,
- // veriCode: "123456",
- // }).then(res2 => {
- // uni.setStorageSync('pcUserInfo', res2.data.data)
- // uni.setStorageSync('compName1', that.companyList[e[0]].compName)
- // that.compName = that.companyList[e[0]].compName
- // helper.getListByUserId()
- // that.$api.msg('切换成功')
- // })
- // }
- // })
- },
- getRoles: function(role) {
- let _roles = uni.getStorageSync('rolesList')
- for (let i = 0; i < _roles.length; i++) {
- if (_roles[i] == role) {
- return true
- }
- }
- return false
- },
- isShow() {
- for (let k = 0; k < this.gridList1.length; k++) {
- if (k == 6) {
- this.gridList1[k].show = this.getRoles('reportData.view')
- } else if (k == 7) {
- this.gridList1[k].show = this.getRoles('monitoring.view')
- }
- }
- },
- smBtnClick() {
- if (!this.hasLogin) {
- this.isShowAlert = true;
- // uni.showModal({
- // title: '提示',
- // content: '您尚未登录,是否立即登录?',
- // showCancel: true,
- // confirmText: '登录',
- // success: (e) => {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // },
- // fail: () => {},
- // complete: () => {}
- // })
- } else {
- uni.scanCode({
- success: function(res) {
- console.log('条码内容:' + res.result);
- uni.navigateTo({
- url: "/pages/erpbusiness/sm/sm?data=" + res.result
- })
- }
- });
- }
- },
- fankui() {
- uni.navigateTo({
- url: `/pages/user/fankui`
- })
- },
- zhibo() {
- uni.navigateTo({
- url: `/pageB/video/broadcast`
- })
- },
- look() {
- uni.navigateTo({
- url: `/pageB/video/look`
- })
- },
- contactUs() {
- const that = this
- uni.makePhoneCall({
- // 手机号
- phoneNumber: '18241771147',
- // 成功回调
- success: (res) => {},
- // 失败回调
- fail: (res) => {}
- });
- },
- loadData() {
- // 工厂价格
- // let that = this
- // that.$api.request('news', 'getFactoryPriceInfo', {
- // category: this.category,
- // page: 1,
- // limit: 99999
- // }, failres => {
- // that.$api.msg(failres.errmsg)
- // this.isLoadMore = false
- // this.loadStatus = 'nomore'
- // if (this.pages > 1) {
- // this.pages = 1
- // }
- // uni.hideLoading()
- // }).then(res => {
- // let data = res.data
- // that.plantList = data
- // // that.makeScrollData(that.plantList, 8)
- // uni.hideLoading()
- // })
- // const that = this
- // if(uni.getStorageSync("PageCur")){
- // that.PageCur = uni.getStorageSync("PageCur");
- // }
- // that.userInfoTmp = uni.getStorageSync("userInfo")
- // uni.showLoading({
- // title: '正在加载',
- // mask:true
- // })
- // that.$api.request('integral', 'getIndexData', failres => {
- // that.$api.msg(failres.errmsg)
- // uni.hideLoading()
- // }).then(res => {
- // let data = res.data
- // uni.setStorageSync("message", data.message);
- // uni.setStorageSync("task", data.task);
- // uni.setStorageSync("contract", data.contract);
- // uni.setStorageSync('showTran', data.showTran);
- // that.showTran = data.showTran
- // that.gridList[4].tips = data.task
- // that.gridList[2].tips = data.contract
- // that.companyId = data.companyId
- // uni.hideLoading()
- // })
- },
- gridClick(item, index) {
- var that = this
- if (item.name == "退出登录") {
- this.logout()
- return;
- } else if (item.name == "联系我们") {
- //#ifdef MP
- this.inputShow = true
- this.inputStatus = 'inline'
- this.feild = "nickname"
- this.inputContent = ''
- //#endif
- //#ifdef APP-PLUS
- this.contactUs()
- //#endif
- return;
- } else if (item.name == '我的车辆') {
- const that = this
- uni.showLoading({
- title: '正在加载',
- mask: true
- })
- that.$api.request('tran', 'getMyCarList', failres => {
- that.$api.msg(failres.errmsg)
- uni.hideLoading()
- }).then(res => {
- that.carInfo = res.data
- if (that.carInfo.length == 0) {
- that.$api.msg('暂无车辆信息')
- } else {
- var height = that.carInfo.length * 100
- var width = 500
- that.mycarStyle = "height:" + height + "rpx;width:" + width + "rpx"
- that.modalName = 'MycarModal'
- }
- uni.hideLoading()
- })
- return;
- }
- if (!this.hasLogin) {
- this.isShowAlert = true;
- // uni.showModal({
- // title: '提示',
- // content: '您尚未登录,是否立即登录?',
- // showCancel: true,
- // confirmText: '登录',
- // success: (e) => {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // },
- // fail: () => {},
- // complete: () => {}
- // })
- } else {
- if (item.url) {
- uni.navigateTo({
- url: item.url + `?companyId=${that.companyId}`
- })
- }
- }
- },
- setting() {
- if (!this.hasLogin) {
- this.isShowAlert = true;
- // uni.showModal({
- // title: '提示',
- // content: '您尚未登录,是否立即登录?',
- // showCancel: true,
- // confirmText: '登录',
- // success: (e) => {
- // if (e.confirm) {
- // uni.navigateTo({
- // url: '/pages/public/login'
- // })
- // }
- // },
- // fail: () => {},
- // complete: () => {}
- // })
- } else {
- uni.navigateTo({
- url: '/pages/user/setUp'
- })
- }
- },
- toLogin() {
- console.log("userInfo", this.userInfo)
- if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
- uni.navigateTo({
- url: '/pages/public/login_account_number'
- })
- } else {
- uni.navigateTo({
- url: '/pages/user/setUp'
- })
- }
- // else if(!this.userInfo.nickname){
- // this.inputShow = true
- // this.inputStatus = 'inline'
- // this.feild = "nickname"
- // this.inputContent = ''
- // }
- },
- confirm() {
- const that = this
- if (!that.inputContent) {
- that.$api.msg('输入不能为空')
- return
- }
- let obj = {}
- obj[that.feild] = that.inputContent
- that.$api.request('user', 'syncUserInfo', obj).then(res => {
- that.userInfo.nickname = that.inputContent
- that.inputContent = ''
- that.$store.commit('login', that.userInfo)
- })
- },
- cancel() {
- this.inputShow = false
- this.inputStatus = 'none'
- this.genderShow = false
- },
- myAccount() {
- uni.navigateTo({
- url: `/pageA/pages/contract`
- })
- },
- logout() {
- // const that = this
- this.isShowAlert = true
- // uni.showModal({
- // title: '询问',
- // content: '您确定要退出吗?',
- // cancelText: '取消',
- // confirmText: '确定',
- // success: (e) => {
- // if (e.confirm) {
- // uni.hideTabBarRedDot({
- // index: 3
- // })
- // uni.clearStorageSync();
- // that.$store.commit('logout')
- // that.$api.logout()
- // uni.navigateTo({
- // url: `/pages/public/login`
- // })
- // }
- // }
- // })
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- if (!this.hasLogin) {
- url = '/pages/public/login';
- }
- uni.navigateTo({
- url
- })
- },
- mycarClick(carNo) {
- this.modalName = null
- uni.navigateTo({
- url: `/pageB/car/mycar_detail?carNo=${carNo}`
- })
- },
- qrClick(userInfo) {
- this.modalName = null
- uni.navigateTo({
- url: `/pages/user/qr`
- })
- },
- scanCode() {
- uni.scanCode({
- success: function(res) {
- uni.navigateTo({
- url: res.result
- })
- }
- })
- },
- hideModal(e) {
- this.modalName = null
- },
- }
- }
- </script>
- <style lang='scss' scoped>
- .company {
- position: fixed;
- right: 0;
- top: 10%;
- background: url('../../static/img/qiyebeijing.png');
- background-size: 100%;
- font-size: 11px;
- padding-bottom: 5px;
- padding-left: 10px;
- border-radius: 40rpx 0 0 40rpx;
- }
- .company .icon {
- position: relative;
- top: 4px;
- }
- page {
- background: #F8F9FC;
- }
- .container {
- padding-top: 85px;
- padding-top: 35px;
- background-color: #F5F6FA;
- position: relative;
- width: 100vw;
- overflow: hidden;
- background: url('~@/static/img/login/bg_slices/bg@3x.png');
- background-size: 100% 100%;
- margin: 0 auto;
- height: calc(100vh - 0px);
- }
- .cu-tag.badge {
- right: 26rpx;
- }
- .path {
- color: #007aff;
- display: inline-block;
- text-align: center;
- }
- .icon {
- margin-right: 10rpx;
- }
- .portrait-box {
- margin-top: 20rpx;
- }
- .qr-wrap {
- margin-top: 20upx;
- color: #fff;
- font-size: 32rpx;
- }
- .cu-list {
- /* height: 483rpx;
- overflow-y: scroll; */
- margin-top: 16rpx;
- margin-bottom: 80rpx;
- }
- .cu-list.grid>.cu-item .badge_user {
- color: #fff;
- display: flex;
- justify-content: center;
- align-items: center;
- border: 1px solid #fff;
- background-color: #f43530;
- padding: 4px;
- position: absolute;
- font-size: 12px;
- font-weight: 700;
- width: 22px;
- height: 22px;
- right: 19px;
- top: -12px;
- z-index: 2;
- border-radius: 50%;
- }
- @keyframes move_wave {
- 0% {
- transform: translateX(0) translateZ(0) scaleY(1)
- }
- 50% {
- transform: translateX(-25%) translateZ(0) scaleY(0.55)
- }
- 100% {
- transform: translateX(-50%) translateZ(0) scaleY(1)
- }
- }
- .bg {
- position: relative;
- height: 300rpx;
- /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
- /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
- background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
- }
- .bg_ware {
- position: absolute;
- left: 0;
- bottom: -2rpx;
- width: 100%;
- mix-blend-mode: screen;
- height: 224rpx;
- }
- %flex-center {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- %section {
- display: flex;
- justify-content: space-around;
- align-content: center;
- background: #fff;
- border-radius: 10upx;
- }
- .grid-item-box {
- flex: 1;
- /* position: relative;
- */
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15px 0;
- }
- .user-section {
- height: 520upx;
- padding: 100upx 30upx 0;
- position: relative;
- .bg {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- filter: blur(1px);
- box-shadow: 0px 1px 8px #ccc;
- /* background:linear-gradient(#0eb0c9,#126bae); */
- /* opacity: .7; */
- }
- }
- .user-info-box {
- height: 180upx;
- /* display:flex; */
- /* align-items:center; */
- text-align: center;
- position: relative;
- z-index: 1;
- .portrait {
- width: 130upx;
- height: 130upx;
- border: 5upx solid #fff;
- border-radius: 50%;
- }
- .username {
- font-size: $font-lg + 3upx;
- color: #fff;
- margin-top: 20upx;
- }
- }
- .vip-card-box {
- display: flex;
- flex-direction: column;
- color: #f7d680;
- height: 240upx;
- background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
- border-radius: 16upx 16upx 0 0;
- overflow: hidden;
- position: relative;
- padding: 20upx 24upx;
- .card-bg {
- position: absolute;
- top: 20upx;
- right: 0;
- width: 380upx;
- height: 260upx;
- }
- .b-btn {
- position: absolute;
- right: 20upx;
- top: 16upx;
- width: 132upx;
- height: 40upx;
- text-align: center;
- line-height: 40upx;
- font-size: 22upx;
- color: #36343c;
- border-radius: 20px;
- background: linear-gradient(left, #f9e6af, #ffd465);
- z-index: 1;
- }
- .tit {
- font-size: $font-base+2upx;
- color: #f7d680;
- margin-bottom: 28upx;
- .yticon {
- color: #f6e5a3;
- margin-right: 16upx;
- }
- }
- .e-b {
- font-size: $font-sm;
- color: #d8cba9;
- margin-top: 10upx;
- }
- }
- .cover-container {
- padding: 1px 10px;
- padding-bottom: 20rpx;
- /* background-color: #F5F6FA; */
- /* border-radius: 20px; */
- margin-top: 12upx;
- .arc {
- position: absolute;
- left: 0;
- top: -34upx;
- width: 100%;
- height: 36upx;
- }
- }
- .tj-sction {
- @extend %section;
- .tj-item {
- @extend %flex-center;
- flex-direction: column;
- height: 140upx;
- font-size: $font-sm;
- color: #75787d;
- }
- .num {
- font-size: $font-lg;
- color: $font-color-dark;
- margin-bottom: 8upx;
- }
- }
- .order-section {
- @extend %section;
- padding: 28upx 0;
- margin-top: 20upx;
- .order-item {
- @extend %flex-center;
- width: 120upx;
- height: 120upx;
- border-radius: 10upx;
- font-size: $font-sm;
- color: $font-color-dark;
- }
- .yticon {
- font-size: 48upx;
- margin-bottom: 18upx;
- color: #fa436a;
- }
- .icon-shouhoutuikuan {
- font-size: 44upx;
- }
- }
- .history-section {
- padding: 30upx 0 0;
- margin-top: 20upx;
- background: #fff;
- border-radius: 10upx;
- .sec-header {
- display: flex;
- align-items: center;
- font-size: $font-base;
- color: $font-color-dark;
- line-height: 40upx;
- margin-left: 30upx;
- .yticon {
- font-size: 44upx;
- color: #5eba8f;
- margin-right: 16upx;
- line-height: 40upx;
- }
- }
- .h-list {
- white-space: nowrap;
- padding: 30upx 30upx 0;
- image {
- display: inline-block;
- width: 160upx;
- height: 160upx;
- margin-right: 20upx;
- border-radius: 10upx;
- }
- }
- }
- .grid {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- /* border-top: 2upx solid rgba(172,172,172,.2); */
- .grid-item-3 {
- box-sizing: border-box;
- width: calc(100% / 3);
- border-bottom: 2upx solid rgba(172, 172, 172, .2);
- border-right: 2upx solid rgba(172, 172, 172, .2);
- text-align: center;
- padding: 40upx 0;
- position: relative;
- /* view{
- font-size: $font-sm;
- margin-top: 16upx;
- color: $font-color-dark;
- } */
- .grid_icon {
- font-size: 48upx;
- margin-bottom: 18upx;
- color: #fa436a;
- }
- .tip_text {
- display: block;
- padding: 4upx 8upx;
- text-align: center;
- border-radius: 36upx;
- font-size: 24upx;
- background-color: #fa436a;
- color: rgba(255, 255, 255, 1);
- position: absolute;
- right: 6upx;
- top: 6upx;
- }
- }
- .grid-item-3:nth-child(3n + 3),
- .grid-item-4:nth-child(4n + 4) {
- border-right: none;
- }
- }
- .headPortrait {
- width: 112rpx;
- height: 112rpx;
- border-radius: 40px;
- border: 2px solid #ffffff;
- }
- .personal {
- margin-top: 10px;
- margin-left: 10px;
- }
- .information {
- font-size: 15px;
- font-weight: 600;
- height: 60rpx;
- position: relative;
- z-index: 10;
- }
- .indexlow {
- /* margin-top: 30px; */
- border-radius: 10px;
- }
- .cu-list>.cu-item:after {
- border: none;
- }
- .sign {
- width: 35px;
- height: 35px;
- top: 4px;
- }
- .sign1 {
- width: 26px;
- height: 26px;
- top: 4px;
- }
- .indexUp {
- padding: 0 20px;
- align-items: center;
- }
- .cu-list.grid>.cu-item .cu-tag.badge {
- color: #fff;
- background: #FF6600;
- font-size: 9px;
- line-height: 5px;
- padding: 5px;
- }
- .cover-container-item {
- background: #fff;
- border-radius: 10px;
- padding: 10px 0;
- }
- .cover-container-item .cu-list {
- margin: 0;
- }
- .cover-container-item .cu-list.grid>.cu-item [class*=cuIcon] {
- margin: 0;
- }
- .guess-section-wrap-item {
- float: left;
- width: 38vw;
- background: #F9F9FA;
- padding: 7px;
- margin: 20rpx;
- border-radius: 3px;
- // width:50%;
- }
- .guess-section-wrap-item:first-child {
- // margin-left:2px;
- }
- .clearfix:after {
- content: "";
- display: block;
- clear: both;
- }
- .guess-section-wrap {
- padding: 15px;
- margin: 10rpx 20rpx;
- border-radius: 5px;
- background: #fff;
- overflow: hidden;
- }
- .guess-section-wrap .price {
- color: #B2B3BB;
- display: flex;
- align-items: center;
- }
- .title {
- font-size: 28upx;
- color: $font-color-dark;
- font-weight: bold;
- height: 50upx;
- line-height: 50upx;
- flex: 2.5;
- }
- .factory {
- font-size: 26rpx;
- font-weight: 900;
- }
- .currectprice {
- color: rgba(253, 113, 79, 1);
- font-size: 18px;
- font-weight: 550;
- vertical-align: middle;
- margin-right: 10px;
- }
- .yesterday {
- font-size: 14px;
- font-weight: 600;
- vertical-align: middle;
- }
- .yesterday.up {
- color: rgba(253, 113, 79, 1);
- }
- .yesterday.down {
- color: #22C572;
- }
- </style>
|