| | |
| | | <template> |
| | | <view class="box"> |
| | | <view class="box" :style=""> |
| | | <view class="head" :style="{ height: 'calc(' + (navHeight + statusbarHeight + 'px + 400rpx)') }"> |
| | | <view class="head-bar" :style="{ height: navHeight + statusbarHeight + 'px' }"> |
| | | <view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view> |
| | | <view class="head-bar-nav" :style="{ height: navHeight + 'px' }"> |
| | | <view class="loginOut"> |
| | | <view class="loginOut" @click="logoutCom()"> |
| | | <image src="/static/icon/ic_tixing@2x.png" mode="widthFix"></image> |
| | | <text>登出</text> |
| | | </view> |
| | |
| | | <view class="user"> |
| | | <view class="user-left"> |
| | | <view class="user-left-image"> |
| | | <image src="/static/logo.png" mode="widthFix"></image> |
| | | <image :src="shop.imgurl||'/static/icon/default3.png'" mode="widthFix"></image> |
| | | </view> |
| | | <view class="user-left-info"> |
| | | <view class="user-left-info-title">鼎元农机一号经销商</view> |
| | | <view class="user-left-info-title">{{shop.name||''}}</view> |
| | | <view class="user-left-info-val"> |
| | | <text>门店ID:S001</text> |
| | | <text>积分:3000</text> |
| | | <text>门店ID:{{shop.code}}</text> |
| | | <text>积分:{{(shop.integral||0).toFixed(0)}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="user-qrcode"> |
| | | <view class="user-qrcode" @click="openQrcode()"> |
| | | <image src="/static/icon/ic_QRcode@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | <view class="data" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }"> |
| | | <view class="data" :style="{ 'background-image': 'url(' + backgroundImage + ')' }"> |
| | | <view class="data-a"> |
| | | <view class="data-a-left"> |
| | | <view class="data-a-left-item active">今日</view> |
| | | <view class="data-a-left-item">本月</view> |
| | | <view class="data-a-left-item">上月</view> |
| | | <view :class="'data-a-left-item '+(active ==0?'active':'')" @click="changeActive(0)">今日</view> |
| | | <view :class="'data-a-left-item '+(active ==1?'active':'')" @click="changeActive(1)">本月</view> |
| | | <view :class="'data-a-left-item '+(active ==2?'active':'')" @click="changeActive(2)">上月</view> |
| | | </view> |
| | | <view class="data-a-to"> |
| | | <view class="data-a-to" @click="jumpShopIntegral"> |
| | | <text>销售明细</text> |
| | | <image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image> |
| | | </view> |
| | |
| | | <view class="data-c"> |
| | | <view class="data-c-item"> |
| | | <view class="data-c-item-top"> |
| | | <text>销售额(元)</text> |
| | | <image src="/static/icon/ic_visible@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | <text style="margin-right: 10rpx; ">销售额(元)</text> |
| | | <u-icon v-if="showMoney" name="eye" color="#ffffff" size="18" @click="showMoney = !showMoney"></u-icon> |
| | | <u-icon v-if="!showMoney" name="eye-off" color="#eeeeee" size="18" @click="showMoney = !showMoney"></u-icon> |
| | | <!-- <image :src="showMoney?'/static/icon/ic_visible@2x.png':'/static/icon/ic_invisible@2x.png'" @click="showMoney=!showMoney" mode="widthFix"></image> |
| | | --> </view> |
| | | <view class="data-c-item-bottom"> |
| | | <text>12,000</text> |
| | | <text>.00</text> |
| | | <text v-if="showMoney">{{(countData.saleTotalNum||0).toFixed(0)}}</text> |
| | | <text v-if="showMoney">{{countData.saleTotalFloat || '.00'}}</text> |
| | | <text v-if="!showMoney">****</text> |
| | | </view> |
| | | </view> |
| | | <view class="data-c-item"> |
| | |
| | | <text>结算利润(元)</text> |
| | | </view> |
| | | <view class="data-c-item-bottom"> |
| | | <text>12,00</text> |
| | | <text>.00</text> |
| | | <text v-if="showMoney">{{(countData.profitTotalNum||0).toFixed(0)}}</text> |
| | | <text v-if="showMoney">{{countData.profitTotalFloat || '.00'}}</text> |
| | | <text v-if="!showMoney">****</text> |
| | | </view> |
| | | </view> |
| | | <view class="data-c-item"> |
| | |
| | | <text>订单数</text> |
| | | </view> |
| | | <view class="data-c-item-bottom"> |
| | | <text>13</text> |
| | | <text v-if="showMoney">{{countData.orderNum||0}}</text> |
| | | <text v-if="!showMoney">****</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="func"> |
| | | <view class="func-item" style="margin-bottom: 30rpx;"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <view class="func-item" style="margin-bottom: 30rpx;" @click="jumpGoodsList"> |
| | | <image src="/static/icon/ic_shangpingl@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | </view> |
| | | <view class="func-item" style="margin-bottom: 30rpx;"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | <view class="func-item" style="margin-bottom: 30rpx;" @click="jumpOrderList"> |
| | | <image src="/static/icon/ic_dingdanguanli@2x.png" mode="widthFix"></image> |
| | | <text>订单管理</text> |
| | | </view> |
| | | <view class="func-item" style="margin-bottom: 30rpx;"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | <view class="func-item" style="margin-bottom: 30rpx;" @click="jumpAccount"> |
| | | <image src="/static/icon/ic_xunizhanghu@2x.png" mode="widthFix"></image> |
| | | <text>虚拟账号</text> |
| | | </view> |
| | | <view class="func-item" style="margin-bottom: 30rpx;"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | <view class="func-item" style="margin-bottom: 30rpx;" @click="jumpWriteoff"> |
| | | <image src="/static/icon/ic_zitihexiao@2x.png" mode="widthFix"></image> |
| | | <text>自提核销</text> |
| | | </view> |
| | | <view class="func-item"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | <view class="func-item" @click="jumpZizhi"> |
| | | <image src="/static/icon/ic_wodezizhi@2x.png" mode="widthFix"></image> |
| | | <text>我的资质</text> |
| | | </view> |
| | | <view class="func-item"> |
| | | <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image> |
| | | <text>商品管理</text> |
| | | <view class="func-item" @click="jumpMemberList"> |
| | | <image src="/static/icon/ic_wodehuiyuan@2x.png" mode="widthFix"></image> |
| | | <text>我的会员</text> |
| | | </view> |
| | | <view class="func-item" @click="openHaibao"> |
| | | <image src="/static/icon/ic_zhuanshuhaibao@2x.png" mode="widthFix"></image> |
| | | <text>专属海报</text> |
| | | </view> |
| | | <view style="width: 25%; height: 0;"></view> |
| | | <view style="width: 25%; height: 0;"></view> |
| | | </view> |
| | | <view class="title">待处理订单 (2)</view> |
| | | <view class="list"> |
| | | <view class="list-item" v-for="(item, index) in 5" :key="index"> |
| | | <view class="a"> |
| | | <view class="title" v-if="!show&&!showQrcode &&!showHaibao">待处理订单 ({{total}})</view> |
| | | <view class="list" v-if="!show&&!showQrcode &&!showHaibao"> |
| | | <view class="list-item" v-for="(item, index) in dataList" :key="index"> |
| | | <view class="a" @click="jumpOrderDetail(item.id)"> |
| | | <view class="a-left"> |
| | | <view class="a-left-tips">自提</view> |
| | | <text>订单号:71379283984239</text> |
| | | <view :class="'a-left-tips '+(item.receiveType==1?'shop-top-tips-a':'shop-top-tips-b')">{{item.receiveType==1?'自提':'配送'}}</view> |
| | | <text>订单号:{{item.code}}</text> |
| | | </view> |
| | | <view class="a-right">待自提</view> |
| | | <text v-if="item.status ==0" class="a-right">待支付</text> |
| | | <text v-if="item.status ==1" class="a-right">{{item.receiveType==1?'待自提':'待发货'}}</text> |
| | | <text v-if="item.status ==2" class="a-right">待收货</text> |
| | | <text v-if="item.status ==3" class="a-right">交易完成</text> |
| | | <text v-if="item.status ==4"class="a-right">已取消</text> |
| | | <text v-if="item.status ==6" class="a-right">已退款</text> |
| | | </view> |
| | | <view class="b"> |
| | | <view class="b-item"> |
| | | <view class="b" @click="jumpOrderDetail(item.id)"> |
| | | <view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])"> |
| | | <view class="b-item-image"> |
| | | <image src="/static/logo.png" mode="widthFix"></image> |
| | | <image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image> |
| | | </view> |
| | | <view class="b-item-title">中联艾禾宽齿 适用雷沃/中联/久保田</view> |
| | | <view class="b-item-title">{{item1.name||''}}</view> |
| | | <view class="b-item-jia"> |
| | | <text>¥499.00</text> |
| | | <text>x1</text> |
| | | <text>¥{{(item1.price||0).toFixed(2)}}</text> |
| | | <text>x{{item1.goodsNum||0}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="c"> |
| | | <view class="c-label"> |
| | | <view class="c-label-title">需付款:</view> |
| | | <view class="c-label-title">实付款:</view> |
| | | <view class="c-label-price"> |
| | | <text>998</text> |
| | | <text>.00</text> |
| | | <text>{{(item.price||0).toFixed(2)}}</text> |
| | | <text></text> |
| | | </view> |
| | | </view> |
| | | <view class="c-btns"> |
| | | <view class="c-btns-item blue">联系客户</view> |
| | | <view class="c-btns-item bg">自提核销</view> |
| | | <view class="c-btns-item blue" @click="contactPhone(item)">联系客户</view> |
| | | <view class="c-btns-item bg" v-if="item.status == 1 && item.receiveType ==1" @click="hexiaoOrder(item)">自提核销</view> |
| | | </view> |
| | | </view> |
| | | <view class="d"> |
| | | 订单备注:11月22日来拿 |
| | | <view class="d" v-if="item.memberInfo" @click="jumpOrderDetail(item.id)"> |
| | | 订单备注:{{item.memberInfo||''}} |
| | | </view> |
| | | </view> |
| | | <view v-if="!hasNext" class="nomore">{{total>0?'已加载全部数据':'暂无待处理订单'}}</view> |
| | | </view> |
| | | </view> |
| | | <!-- 确认退出登陆 --> |
| | | <u-popup :show="show" round="15" :safeAreaInsetBottom="false" mode="center" > |
| | | <view class="tc"> |
| | | <view class="tc-contemt"> |
| | | <view class="tc-contemt-title">确认退出登陆</view> |
| | | <view class="tc-contemt-nr"> |
| | | 您确认退出登陆吗? |
| | | </view> |
| | | </view> |
| | | <view class="tc-btn"> |
| | | <view class="tc-btn-item" @click="logoutCom">取消</view> |
| | | <view class="tc-btn-item" @click="logout" style="color: red;">确认退出</view> |
| | | </view> |
| | | </view> |
| | | </u-popup> |
| | | <u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true"> |
| | | <view class="phone"> |
| | | <view class="phone-head"> |
| | | <view></view> |
| | | <text>联系客户</text> |
| | | </view> |
| | | <!-- <view class="phone-item"> |
| | | <view> |
| | | <image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image> |
| | | <button open-type="contact" plain="true" bindcontact="handleContact">在线客服</button> |
| | | </view> |
| | | <view class="line" v-if="serverPhone && serverPhone.length"></view> |
| | | </view> --> |
| | | <view class="phone-item" > |
| | | <view> |
| | | <image src="/static/icon/ic_call@2x.png" mode="widthFix" @click="contactPhoneDo()" ></image> |
| | | <text>{{linkItem.linkname}} </text> |
| | | <text style="margin-left: 10px;"> {{linkItem.linkphone}}</text> |
| | | </view> |
| | | </view> |
| | | <view style="width: 100%; height: 30rpx;"></view> |
| | | <!-- <view class="phone-botton" @click="contactPhone()" >关闭</view> --> |
| | | </view> |
| | | </u-popup> |
| | | <u-popup :show="showQrcode" round="15" :safeAreaInsetBottom="false" mode="center" @close="openQrcode()" > |
| | | <view class="qrcode" > |
| | | <image :src="shop.programCode||''" mode="widthFix"></image> |
| | | </view> |
| | | </u-popup> |
| | | <u-popup :show="showHaibao"border-radius="15" round="15" :safeAreaInsetBottom="false" mode="center" @close="openHaibao()" > |
| | | <view class="haibao" > |
| | | <view class="haibao-img" @click="openHaibao()" > |
| | | <image :src="shop.posterImgCode||''" mode="widthFix"></image> |
| | | </view> |
| | | <view class="haibao-btn"> |
| | | <view class="haibao-btn-item" @click="shareDo(0) "> |
| | | <image src="/static/icon/share_ic_wechat@2x.png" mode="widthFix"></image> |
| | | <!-- <button open-type="share" plain="true" >小程序分享</button> --> |
| | | <text>小程序分享</text> |
| | | </view> |
| | | <view class="haibao-btn-item" style="color: red;" @click="shareDo(1) "> |
| | | <image src="/static/icon/share_ic_friends@2x.png" mode="widthFix"></image> |
| | | <!-- <button open-type="share" plain="true" >分享到朋友圈</button> --> |
| | | <text>分享到朋友圈</text> |
| | | </view> |
| | | <view class="haibao-btn-item" style="color: red;" @click="shareDo(2)"> |
| | | <image src="/static/icon/share_ic_download@2x.png" mode="widthFix"></image> |
| | | <text>下载海报</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-popup> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | import { mapState } from 'vuex' |
| | | export default { |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight']) |
| | | ...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken']) |
| | | }, |
| | | data() { |
| | | return { |
| | | backgroundImage: require('@/static/images/bg_card@2x.png') |
| | | return { |
| | | show:false, |
| | | showHaibao:false, |
| | | showQrcode:false, |
| | | active:0, |
| | | loading:false, |
| | | showMoney:false, |
| | | showPhone:false, |
| | | currentPage:1, |
| | | total:0, |
| | | hasNext:true, |
| | | dataList:[], |
| | | shop:{}, |
| | | linkItem:{}, |
| | | countData:{}, |
| | | backgroundImage:null |
| | | }; |
| | | }, |
| | | onShow() { |
| | | this.shop ={} |
| | | this.checkShopLogin() |
| | | this.active=0 |
| | | this.shop = this.shopInfo || {} |
| | | this.getCountData(0) |
| | | this.total=0 |
| | | this.hasNext=true |
| | | this.currentPage = 0 |
| | | this.getOrderList() |
| | | // this.getBase64Img('/static/images/bg_card@2x.png') |
| | | console.log(require('@/static/images/bg_card@2x.png')) |
| | | }, |
| | | onShareAppMessage() { |
| | | return { |
| | | title:'鼎元农机微商城', |
| | | path: '/pages/index/index', |
| | | imageUrl: this.shop.posterImgCode |
| | | } |
| | | }, |
| | | onShareTimeline() { |
| | | return { |
| | | title:'鼎元农机微商城', |
| | | query: `ref=${Date.now()}`, |
| | | imageUrl: this.shop.posterImgCode |
| | | } |
| | | }, |
| | | onReachBottom(){ |
| | | this.getOrderList( ); |
| | | }, |
| | | onLoad() { |
| | | var that =this |
| | | this.getBase64Img('/static/images/bg_card@2x.png') |
| | | uni.$on('updateOrder',function(data){ |
| | | if(data.info!=null && data.info.orderId!=null && data.info.orderStatus ==3){ |
| | | if(data.info.orderStatus ==3){ |
| | | that.getCountData() |
| | | } |
| | | that.total=0 |
| | | that.hasNext=true |
| | | that.currentPage = 0 |
| | | that.getOrderList() |
| | | } |
| | | }) |
| | | }, |
| | | methods:{ |
| | | getBase64Img(path){ |
| | | var that =this |
| | | uni.getFileSystemManager().readFile({ |
| | | filePath: path, // 替换为你的图片路径 |
| | | encoding: 'base64', |
| | | success: (res) => { |
| | | const base64Data = 'data:image/png;base64,' + res.data; // 拼接前缀,用于页面显示 |
| | | console.log('图片Base64编码:', base64Data); |
| | | // 可以将 base64Data 绑定到 data 中,用于页面展示 |
| | | that.backgroundImage = base64Data; |
| | | }, |
| | | fail: (err) => { |
| | | console.error('读取图片失败:', err); |
| | | } |
| | | }); |
| | | }, |
| | | shareDo(flag){ |
| | | if(flag ==0){ |
| | | if(!this.shop.posterImgCode){ |
| | | return |
| | | } |
| | | wx.downloadFile({ |
| | | url: this.shop.posterImgCode, |
| | | success: (res) => { |
| | | wx.showShareImageMenu({ |
| | | path: res.tempFilePath |
| | | }) |
| | | } |
| | | }) |
| | | }else if(flag ==1){ |
| | | if(!this.shop.posterImgCode){ |
| | | return |
| | | } |
| | | wx.downloadFile({ |
| | | url: this.shop.posterImgCode, |
| | | success: (res) => { |
| | | wx.showShareImageMenu({ |
| | | path: res.tempFilePath |
| | | }) |
| | | } |
| | | }) |
| | | }else if(flag ==2){ |
| | | if(!this.shop.posterImgCode){ |
| | | return |
| | | } |
| | | this.downloadAndSaveToAlbum(this.shop.posterImgCode) |
| | | } |
| | | }, |
| | | hexiaoOrder(item){ |
| | | uni.navigateTo({ |
| | | url:'/pagesA/pages/write-off-a/write-off-a?id='+item.id |
| | | }) |
| | | }, |
| | | openQrcode(){ |
| | | if(this.shop.programCode){ |
| | | this.showQrcode = !this.showQrcode |
| | | } |
| | | }, |
| | | openHaibao(){ |
| | | if(!this.shop.posterImgCode){ |
| | | return |
| | | } |
| | | wx.downloadFile({ |
| | | url: this.shop.posterImgCode, |
| | | success: (res) => { |
| | | if (res.statusCode === 200) { |
| | | wx.showShareImageMenu({ |
| | | path: res.tempFilePath, |
| | | needShowEntrance:false |
| | | }) |
| | | } else { |
| | | reject(new Error('海报下载失败')); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | reject(new Error('海报下载失败')); |
| | | } |
| | | }) |
| | | /* if(this.shop.programCode){ |
| | | this.showHaibao = !this.showHaibao |
| | | } */ |
| | | }, |
| | | contactPhone(item){ |
| | | this.showPhone = !this.showPhone |
| | | this.linkItem = item ||{} |
| | | console.log("==================================",this.showPhone) |
| | | }, |
| | | contactPhoneDo(){ |
| | | if(this.linkItem.linkphone !=null && this.linkItem.linkphone!=''){ |
| | | uni.makePhoneCall({ |
| | | phoneNumber: this.linkItem.linkphone |
| | | }) |
| | | } |
| | | }, |
| | | changeActive(index){ |
| | | this.getCountData(index) |
| | | }, |
| | | checkShopLogin(){ |
| | | var that =this |
| | | if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){ |
| | | this.jumpShopLogin() |
| | | } |
| | | }, |
| | | async getCountData(index){ |
| | | var that =this |
| | | let res = await that.$u.api.saleReport({ dateType: index, endDate: null, startDate: null, tokenType:1 }) |
| | | if (res.code === 200) { |
| | | this.active = index |
| | | this.countData = res.data |
| | | this.countData.profitTotal = (this.countData.profitTotal||0.00 ).toFixed(2) |
| | | this.countData.saleTotal = (this.countData.saleTotal||0.00).toFixed(2) |
| | | this.countData.profitTotalNum = Math.floor(this.countData.profitTotal) |
| | | this.countData.saleTotalNum = Math.floor( this.countData.saleTotal) |
| | | var t1 =(this.countData.profitTotal - this.countData.profitTotalNum).toFixed(2) |
| | | var t2 =(this.countData.saleTotal - this.countData.saleTotalNum).toFixed(2) |
| | | this.countData.profitTotalFloat =( t1+'').slice(1, 4) |
| | | this.countData.saleTotalFloat = ( t2+'').slice(1, 4) |
| | | } |
| | | }, |
| | | async getOrderList(){ |
| | | if(this.loading || !this.hasNext){ |
| | | return |
| | | } |
| | | this.loading=true |
| | | this.currentPage = this.currentPage+1 |
| | | if(this.currentPage == 1){ |
| | | this.hasNext =true |
| | | this.dataList=[] |
| | | } |
| | | var that =this |
| | | let res = await that.$u.api.shopOrderPage({ |
| | | capacity:10, |
| | | model: { |
| | | receiveType: 1, |
| | | status: 1 |
| | | }, |
| | | page:this.currentPage |
| | | }); |
| | | console.log(res) |
| | | if (res.code === 200 ) { |
| | | if ( res.data && res.data.page ===this.currentPage) { |
| | | res.data.records = res.data.records||[] |
| | | that.dataList.push(...res.data.records) |
| | | that.total=res.data.total |
| | | if( this.currentPage >= res.data.pageCount||0){ |
| | | that.hasNext=false |
| | | }else{ |
| | | that.hasNext=true |
| | | } |
| | | } |
| | | } |
| | | this.loading=false |
| | | }, |
| | | logoutCom(){ |
| | | this.show=!this.show |
| | | if(this.show){ |
| | | |
| | | }else{ |
| | | |
| | | } |
| | | }, |
| | | async logout(){ |
| | | var that =this |
| | | let res = await that.$u.api.shopLogout({tokenType:1 }) |
| | | if (res.code === 200) { |
| | | await that.$store.commit('setShopInfo',null) |
| | | await that.$store.commit('setShopToken',null) |
| | | that.jumpShopLogin() |
| | | } |
| | | }, |
| | | jumpOrderDetail(id){ |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/order-details/order-details?userType=1&id='+id |
| | | }) |
| | | }, |
| | | jumpShopLogin() { |
| | | uni.navigateTo({ |
| | | url: '/pages/login/login' |
| | | }) |
| | | }, |
| | | jumpZizhi() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/my-qualifications/my-qualifications' |
| | | }) |
| | | }, |
| | | jumpGoodsList() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/product-management/product-management' |
| | | }) |
| | | }, |
| | | jumpOrderList() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/order/order?userType=1' |
| | | }) |
| | | }, |
| | | jumpAccount() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/virtual-account/virtual-account' |
| | | }) |
| | | }, |
| | | jumpWriteoff() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/write-off/write-off' |
| | | }) |
| | | }, |
| | | jumpMemberList() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/my-membership/my-membership' |
| | | }) |
| | | }, |
| | | jumpShopIntegral() { |
| | | uni.navigateTo({ |
| | | url: '/pagesA/pages/shop_points/shop_points' |
| | | }) |
| | | } , |
| | | async downloadAndSaveToAlbum(url) { |
| | | try { |
| | | // 1. 下载图片 |
| | | const { tempFilePath } = await new Promise((resolve, reject) => { |
| | | uni.downloadFile({ |
| | | url: url, |
| | | success: (res) => { |
| | | if (res.statusCode === 200) { |
| | | resolve(res); |
| | | } else { |
| | | reject(new Error('下载失败')); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | reject(err); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 2. 获取相册权限 |
| | | await new Promise((resolve, reject) => { |
| | | uni.getSetting({ |
| | | success: (res) => { |
| | | if (!res.authSetting['scope.writePhotosAlbum']) { |
| | | uni.authorize({ |
| | | scope: 'scope.writePhotosAlbum', |
| | | success: resolve, |
| | | fail: () => { |
| | | uni.showToast({ |
| | | title: '请开启相册权限', |
| | | icon: 'none' |
| | | }); |
| | | reject(new Error('未授权写入相册')); |
| | | } |
| | | }); |
| | | } else { |
| | | resolve(); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 3. 保存图片到相册 |
| | | await new Promise((resolve, reject) => { |
| | | uni.saveImageToPhotosAlbum({ |
| | | filePath: tempFilePath, |
| | | success: resolve, |
| | | fail: (err) => { |
| | | reject(err); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | uni.showToast({ |
| | | title: '保存成功' |
| | | }); |
| | | |
| | | } catch (err) { |
| | | uni.showToast({ |
| | | title: '保存失败', |
| | | icon: 'none' |
| | | }); |
| | | console.error(err); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | .list { |
| | | width: 100%; |
| | | margin-top: 30rpx; |
| | | padding-bottom: 60rpx; |
| | | .list-item { |
| | | width: 100%; |
| | | padding: 30rpx; |
| | |
| | | .a-left { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | .a-left-tips { |
| | | padding: 0 6rpx; |
| | | height: 40rpx; |
| | | line-height: 40rpx; |
| | | background: #00B775; |
| | | border-radius: 8rpx; |
| | | font-weight: 400; |
| | | font-size: 22rpx; |
| | | color: #FFFFFF; |
| | | margin-right: 16rpx; |
| | | } |
| | | .shop-top-tips-a { |
| | | background: #00B775; |
| | | border: 1rpx solid #00B775; |
| | | } |
| | | .shop-top-tips-b { |
| | | background: #004096; |
| | | border: 1rpx solid #004096; |
| | | } |
| | | text { |
| | | font-weight: 400; |
| | |
| | | } |
| | | } |
| | | .b { |
| | | width: 100%; |
| | | height: 136rpx; |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-top: 22rpx; |
| | |
| | | font-size: 30rpx; |
| | | color: #222222; |
| | | margin-right: 30rpx; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 2; /* 限制文本为2行 */ |
| | | -webkit-box-orient: vertical; |
| | | overflow: hidden; |
| | | } |
| | | .b-item-jia { |
| | | flex-shrink: 0; |
| | |
| | | .data-c-item-top { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | text { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | .qrcode{ |
| | | text-align: center; |
| | | width: calc(100vw - 148rpx); |
| | | height: calc(100vw - 148rpx); |
| | | padding: 20px; |
| | | image{ |
| | | width: calc(100vw - 188rpx); |
| | | height: calc(100vw - 188rpx); |
| | | } |
| | | } |
| | | .haibao{ |
| | | border-radius: 24rpx; |
| | | background-color: #f2f2f2; |
| | | text-align: center; |
| | | .haibao-img{ |
| | | padding: 54rpx 44rpx 44rpx 44rpx; |
| | | text-align: center; |
| | | width: calc(100vw - 148rpx); |
| | | image{ |
| | | border-radius: 24rpx; |
| | | width: calc(100vw - 188rpx); |
| | | } |
| | | } |
| | | .haibao-btn{ |
| | | width: 100%; |
| | | height: 264rpx; |
| | | background: #FFFFFF; |
| | | border-radius: 24rpx; |
| | | display: flex; |
| | | align-items:center; |
| | | justify-content: space-between; |
| | | .haibao-btn-item{ |
| | | flex:1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items:center; |
| | | justify-content: space-between; |
| | | image{ |
| | | width: 88rpx; |
| | | height: 88rpx; |
| | | } |
| | | button{ |
| | | border:none; |
| | | font-weight: 400; |
| | | font-size: 26rpx; |
| | | margin-top:12rpx; |
| | | color: #333333; |
| | | line-height: 36rpx; |
| | | text-align: center; |
| | | font-style: normal; |
| | | } |
| | | text{ |
| | | font-weight: 400; |
| | | font-size: 26rpx; |
| | | margin-top:12rpx; |
| | | color: #333333; |
| | | line-height: 36rpx; |
| | | text-align: center; |
| | | font-style: normal; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |