| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942 |
- <template>
- <view style="padding-bottom: 100upx">
- <view class="bg padding-bottom">
- <view class="u-flex padding">
- <view class="u-m-r-10">
- <!-- @click="goNav('/pages/my/userinfo')" -->
- <image :src="shopCover" style="width: 100rpx; height: 100rpx; border-radius: 100rpx" @click="goNavs(list[0].url)"></image>
- </view>
- <view class="u-flex-1 u-m-l-10 flex justify-between align-center" v-if="!isLogin">
- <view class="u-font-18 text-bold">
- <!-- #ifdef MP-WEIXIN -->
- <view class="margin-left-sm margin-top-xs" style="width: 220rpx">{{ shopName }}</view>
- <!-- #endif -->
- <!-- #ifndef MP-WEIXIN -->
- <view class="margin-left-sm margin-top-xs" style="width: 220rpx">{{ shopName }}</view>
- <!-- #endif -->
- </view>
- <view class="erweima" @click="shopQr()">二维码</view>
- <view class="erweima" @click="shopQrSphere()">私域二维码</view>
- </view>
- <view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">登录</view>
- </view>
- <view class="moneybox" v-if="XCXIsSelect == '是'">
- <view class="padding" style="background: #fcd202; border-radius: 20upx 20upx 0upx 0upx">
- <view class="flex justify-between">
- <view>
- <view>累计收益(元)</view>
- <view class="margin-top-xs" style="font-size: 40upx">
- ¥
- <text style="font-size: 55upx">{{ sumMoney }}</text>
- </view>
- </view>
- <view class="btn" @click="goQian()">立即提现</view>
- </view>
- <view class="flex justify-between align-center text-center margin-top">
- <view>
- <view>今日收益</view>
- <view class="margin-top-xs" style="font-size: 38upx">
- ¥
- <text style="font-size: 48upx">{{ dayMoney ? dayMoney : '0' }}</text>
- </view>
- </view>
- <view>
- <view>本月收益</view>
- <view class="margin-top-xs" style="font-size: 38upx">
- ¥
- <text style="font-size: 48upx">{{ monthMoney ? monthMoney : '0' }}</text>
- </view>
- </view>
- <view>
- <view>本月提现</view>
- <view class="margin-top-xs" style="font-size: 38upx">
- ¥
- <text style="font-size: 48upx">{{ cashMoney ? cashMoney : '0' }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="flex align-center justify-between padding-lr padding-tb-sm" style="background: #fcb202; border-radius: 0upx 0upx 20upx 20upx">
- <view class="">每次提现平台将扣除相应手续费</view>
- <view class="xflist" @click="goNav('/my/other/cashList')">钱包明细</view>
- </view>
- </view>
- </view>
- <view class="bg margin-top-sm">
- <!-- 店铺管理 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNavs(list[0].url)">
- <image :src="list[0].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[0].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 订阅消息配置 -->
- <view class="flex padding-lr padding-tb dfs" v-if="userId">
- <image src="../../static/images/my/dianpu.png" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">订阅消息配置</view>
- <switch color="#1677ff" :checked="isChecked" @change="switchChange" />
- </view>
- <!-- 商品管理 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNavs(list[1].url)">
- <image :src="list[1].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[1].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 销量管理 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[18].url)">
- <image :src="list[18].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[18].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 订单管理 -->
- <view class="flex padding-lr padding-tb" @click="goOrder()">
- <image :src="list[2].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[2].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 分类管理 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[3].url)">
- <image :src="list[3].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[3].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 规格管理 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[4].url)">
- <image :src="list[4].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[4].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 保证金 -->
- <view class="flex padding-lr padding-tb" @click="goNav(list[5].url)" v-if="XCXIsSelect == '是'">
- <image :src="list[5].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[5].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 规格管理 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[13].url)">
- <image :src="list[13].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[13].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 精选活动 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[14].url)">
- <image :src="list[14].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[14].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 优惠券管理 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[15].url)">
- <image :src="list[15].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[15].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 打印机配置 -->
- <view class="flex padding-lr padding-tb" @click="goNavs(list[16].url)">
- <image :src="list[16].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[16].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 供货订购 -->
- <view class="flex padding-lr padding-tb" @click="goGong()">
- <image :src="list[17].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[17].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- </view>
- <view class="bg margin-top-sm">
- <!-- 聊天中心 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[12].url)">
- <image :src="list[12].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[12].title }}</view>
- <view class="flex align-center">
- <view v-if="messageCount" class="bott">{{ messageCount }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- </view>
- <!-- 联系客服 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[6].url)">
- <image :src="list[6].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[6].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 关于我们 -->
- <!-- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[7].url)">
- <image :src="list[7].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[7].title}}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view> -->
- <!-- 意见反馈 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[8].url)" v-if="XCXIsSelect == '是'">
- <image :src="list[8].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[8].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 我的投诉 -->
- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[9].url)">
- <image :src="list[9].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[9].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- #ifdef MP-WEIXIN -->
- <view class="flex padding-lr padding-tb dfs" @click="gouser()">
- <image :src="list[10].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[10].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- #endif -->
- <!-- 系统设置 -->
- <view class="flex padding-lr padding-tb dfs" @click="goset()">
- <image :src="list[11].image" style="width: 50rpx; height: 50rpx" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[11].title }}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view>
- <!-- 退出登录 -->
- <!-- <view class="flex padding-lr padding-tb dfs" @click="TuiLogin()" v-if="!isLogin">
- <image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
- <view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
- <image src="../../static/images/my/right.png" class="images" mode=""></image>
- </view> -->
- </view>
- <!-- 二维码弹窗 -->
- <u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" closeable>
- <view style="width: 180px; height: 180px; margin: 40px auto">
- <image :src="shopQrImg" style="width: 100%; height: 100%" @click="previewImage(shopQrImg)"></image>
- </view>
- </u-popup>
- <!-- 私域二维码弹窗 -->
- <u-popup v-model="showSphere" mode="center" border-radius="14" width="500rpx" height="500rpx" closeable>
- <view style="width: 180px; height: 180px; margin: 40px auto">
- <image :src="shopQrImgSphere" style="width: 100%; height: 100%" @click="previewImage(shopQrImgSphere)"></image>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import configurl from '../../common/config.js'
- import { encrypt, decrypt, urlSafeBase64Decode, urlSafeBase64Encode } from '@/utils/cryptojs.js'
- export default {
- data() {
- return {
- shopCover: '../../static/logo.png',
- isLogin: true,
- shopName: '匿名',
- sumMoney: 0, //累计余额
- dayMoney: 0, //今日收益
- monthMoney: 0, //本月预估收益
- cashMoney: 0, // 本月预估提现
- shopToken: '',
- isVip: false,
- invitationCode: '', //邀请码
- list: [
- {
- image: '../../static/images/my/dianpu.png',
- title: '店铺管理',
- url: '/my/store/index'
- },
- {
- image: '../../static/images/my/shangpin.png',
- title: '商品管理',
- url: '/my/store/addgood'
- },
- {
- image: '../../static/images/my/order.png',
- title: '订单管理',
- url: '/pages/order/index'
- },
- {
- image: '../../static/images/my/fenlei.png',
- title: '分类管理',
- url: '/my/store/fenlei'
- },
- {
- image: '../../static/images/my/guige.png',
- title: '规格管理',
- url: '/my/store/guige'
- },
- {
- image: '../../static/images/my/baozhengjin.png',
- title: '保证金',
- url: '/my/other/money'
- },
- {
- image: '../../static/images/my/kefu.png',
- title: '联系客服',
- url: '/pages/my/chat'
- },
- {
- image: '../../static/images/my/guanyu.png',
- title: '关于我们',
- url: '/my/other/about'
- },
- {
- image: '../../static/images/my/yijian.png',
- title: '意见反馈',
- url: '/my/feedback/index'
- },
- {
- image: '../../static/images/my/00.png',
- title: '我的投诉',
- url: '/my/other/tousu'
- },
- {
- image: '../../static/images/my/user.png',
- title: '前往用户端',
- url: ''
- },
- {
- image: '../../static/images/my/set1.png',
- title: '系统设置',
- url: '/my/other/set'
- },
- {
- image: '../../static/images/my/liaotian.png',
- title: '聊天中心',
- url: '/pages/my/liaotian'
- },
- {
- image: '../../static/images/order/pinglun.png',
- title: '店铺评价',
- url: '/my/store/pingjia'
- },
- {
- image: '../../static/images/order/hd.png',
- title: '精选活动',
- url: '/my/store/huodong'
- },
- {
- image: '../../static/images/order/yhq.png',
- title: '优惠券管理',
- url: '/my/yhq/yhq'
- },
- {
- image: '../../static/images/order/print.png',
- title: '打印机配置',
- url: '/my/print/print'
- },
- {
- image: '../../static/images/order/gonghuo.png',
- title: '供货订购',
- url: ''
- },
- {
- image: '../../static/images/order/yhq.png',
- title: '销量管理',
- url: '/pages/my/sales/sales'
- }
- ],
- renzheng: 0,
- XCXIsSelect: '否',
- isCashDeposit: '',
- show: false,
- showSphere: false,
- shopQrImg: '',
- shopQrImgSphere: '',
- open: true,
- arr: [],
- messageCount: '',
- isChecked: false,
- userId: '',
- messageConfiguration: '',
- timer: null,
- errCount: 0
- }
- },
- onLoad() {
- // this.messageCount = uni.getStorageSync('messageCount')
- this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
- this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
- this.userId = uni.getStorageSync('userId')
- this.open = uni.getStorageSync('open')
- this.$Request.getT('/app/common/type/354').then((res) => {
- //订单取消通知
- if (res.code == 0) {
- if (res.data && res.data.value) {
- this.arr.push(res.data.value)
- }
- }
- })
- this.$Request.getT('/app/common/type/353').then((res) => {
- //订单取消通知
- if (res.code == 0) {
- if (res.data && res.data.value) {
- this.arr.push(res.data.value)
- }
- }
- })
- this.$Request.getT('/app/common/type/352').then((res) => {
- //新订单通知
- if (res.code == 0) {
- if (res.data && res.data.value) {
- this.arr.push(res.data.value)
- }
- }
- })
- // let that= this
- // if (this.open = true) {
- // uni.showModal({
- // title: '提示',
- // content: '请先去完善店铺信息,上线店铺后同城外卖用户端首页展示您的店铺。',
- // success: function(res) {
- // if (res.confirm) {
- // console.log('用户点击确定');
- // that.open = false
- // that.$queue.setData("open", that.open);
- // } else if (res.cancel) {
- // console.log('用户点击取消');
- // that.open = false
- // that.$queue.setData("open", that.open);
- // }
- // }
- // })
- // }
- },
- onShow() {
- this.userId = uni.getStorageSync('userId')
- this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
- if (this.shopToken) {
- this.messageCount = uni.getStorageSync('messageCount')
- this.isLogin = false
- this.getUserInfo()
- this.getshanghuinfo()
- this.getAmount()
- } else {
- this.isLogin = true
- this.shopName = '匿名'
- this.shopCover = '../../static/logo.png'
- this.sumMoney = 0 //累计余额
- this.dayMoney = 0 //今日收益
- this.monthMoney = 0 //本月收益
- this.cashMoney = 0 //本月提现
- }
- if (this.userId) {
- this.getSetData()
- }
- },
- onHide() {
- if (this.timer) {
- clearInterval(this.timer)
- }
- },
- methods: {
- getSetData() {
- // 获取订阅消息配置
- let data = {
- shopId: uni.getStorageSync('shopId')
- }
- this.$Request.getT('/app/goods/selectGoodShop', data).then((res) => {
- // console.log(res, '888')
- if (res.code == 0) {
- if (res.data.messageConfiguration == 1) {
- this.isChecked = false
- } else {
- this.isChecked = true
- }
- this.messageConfiguration = res.data.messageConfiguration
- if (this.messageConfiguration == 0) {
- this.timer = setInterval(() => {
- // 订单消息提醒
- let data = {
- shopIds: this.$queue.getData('shopId')
- }
- this.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then((res) => {
- console.log(res, '999')
- if (res.code === 0) {
- if (res.data > 0) {
- if (this.errCount != res.data) {
- this.errCount = res.data
- this.aplayAudio()
- uni.showModal({
- title: '消息',
- content: '有' + res.data + '条订单,请前往订单中心处理。',
- success: (ret) => {
- if (ret.confirm) {
- uni.switchTab({
- url: '/pages/order/index'
- })
- } else {
- console.log('else', ret)
- this.defineCallBack()
- }
- }
- })
- // this.chatNum = data.data
- }
- } else {
- this.errCount = 0
- }
- }
- })
- }, 10000)
- }
- }
- })
- },
- aplayAudio() {
- const innerAudioContext = uni.createInnerAudioContext()
- innerAudioContext.autoplay = true
- innerAudioContext.src = 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3'
- innerAudioContext.onPlay(() => {
- console.log('开始播放')
- })
- innerAudioContext.onError((res) => {
- console.log(res.errMsg)
- console.log(res.errCode)
- })
- },
- defineCallBack() {
- let data = {
- shopIds: this.$queue.getData('shopId')
- }
- this.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then((res) => {
- if (res.code === 0) {
- this.errCount = 0
- }
- })
- },
- previewImage(img) {
- let arr = []
- arr.push(img)
- //uniapp预览轮播图方法
- uni.previewImage({
- current: 0, //预览图片的下标
- urls: arr //预览图片的地址,必须要数组形式
- })
- },
- //跳转设置
- goset() {
- uni.navigateTo({
- url: '/my/other/set'
- })
- },
- //生成二维码
- shopQr() {
- // uni.showLoading({
- // title: '二维码生成中',
- // duration: 1000,
- // icon: 'none'
- // });
- this.show = true
- let shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
- let shopTypeId = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopTypeId').toString()))
- this.shopQrImg = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr?shopId=' + shopid + '&shopTypeId=' + shopTypeId
- console.log(this.shopQrImg, 'oooo')
- },
- //生成私域二维码
- shopQrSphere() {
- this.showSphere = true
- let shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
- let shopTypeId = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopTypeId').toString()))
- this.shopQrImgSphere = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr2?shopId=' + shopid + '&shopTypeId=' + shopTypeId
- console.log(this.shopQrImgSphere, 'oooo——Sphere')
- },
- //跳转用户端
- gouser() {
- wx.navigateToMiniProgram({
- appId: 'wx45ab46867002aa0b',
- path: '/pages/index/index',
- envVersion: 'release', // 打开正式版
- success(res) {
- // 打开成功
- },
- fail: function (err) {
- console.log(err)
- }
- })
- },
- //跳转供货商
- goGong() {
- wx.navigateToMiniProgram({
- appId: 'wx45ab46867002aa0b',
- path: '/pages/index/shopList/indexShop',
- envVersion: 'release', // 打开正式版release
- success(res) {
- // 打开成功
- },
- fail: function (err) {
- console.log(err)
- }
- })
- },
- goQian() {
- if (this.shopToken) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendindexMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re)
- if (datas.indexOf('accept') != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- uni.navigateTo({
- url: '/my/other/wallet'
- })
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- uni.navigateTo({
- url: '/pages/my/loginphone'
- })
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- }
- },
- bindFb() {
- let renzheng = uni.getStorageSync('renzheng')
- console.log(this.userId, renzheng)
- if (this.shopToken) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendindexMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re)
- if (datas.indexOf('accept') != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- uni.navigateTo({
- url: '/my/publish/editor'
- })
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- uni.navigateTo({
- url: '/pages/my/loginphone'
- })
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- }
- },
- goOrder() {
- uni.switchTab({
- url: '/pages/order/index'
- })
- },
- //列表跳转
- goNav(e, name) {
- console.log(e)
- if (this.shopToken) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendindexMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re)
- if (datas.indexOf('accept') != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- uni.navigateTo({
- url: e
- })
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- uni.navigateTo({
- url: '/pages/my/loginphone'
- })
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- }
- },
- //列表跳转
- goNavs(e, name) {
- console.log(e)
- let cashDeposit = uni.getStorageSync('cashDeposit')
- if (this.shopToken) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendindexMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re)
- if (datas.indexOf('accept') != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- if (cashDeposit == 0 || cashDeposit == 'null') {
- uni.showModal({
- title: '提示',
- content: '您还未缴纳保证金,请先去缴纳保证金',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- uni.navigateTo({
- url: '/my/other/money'
- })
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- } else {
- uni.navigateTo({
- url: e
- })
- }
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定')
- uni.navigateTo({
- url: '/pages/my/loginphone'
- })
- } else if (res.cancel) {
- console.log('用户点击取消')
- }
- }
- })
- }
- },
- goLogin(e) {
- uni.navigateTo({
- url: e
- })
- },
- //我的收益
- getAmount() {
- let data = {
- shopId: uni.getStorageSync('shopId')
- }
- this.$Request.get('/app/shop/shopEarnings', data).then((res) => {
- if (res.code == 0) {
- this.sumMoney = parseFloat(res.data.shopAllEarnings).toFixed(2) //累计余额
- this.dayMoney = parseFloat(res.data.shopEarningsDay).toFixed(2) //今日收益
- this.monthMoney = parseFloat(res.data.shopEarningsMonth).toFixed(2) //本月收益
- this.cashMoney = parseFloat(res.data.cashMoney).toFixed(2) //本月提现
- }
- })
- },
- getshanghuinfo() {
- let data = {
- shopId: uni.getStorageSync('shopId')
- }
- this.$Request.get('/app/shop/selectShopMessage', data).then((res) => {
- if (res.code == 0) {
- uni.setStorageSync('cashDeposit', res.data.cashDeposit)
- }
- })
- },
- goNav(url) {
- if (this.shopToken) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendindexMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re)
- if (datas.indexOf('accept') != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- uni.navigateTo({
- url
- })
- } else {
- uni.navigateTo({
- url: '/pages/my/loginphone'
- })
- }
- },
- getUserInfo() {
- this.$Request.getA('/sys/user/info').then((res) => {
- console.log(res, 'ljh')
- if (res.code == 0) {
- this.shopName = res.user.shopList[0].shopName
- this.shopCover = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover : '../../static/logo.png'
- this.$queue.setData('avatar', res.user.shopList[0].shopCover)
- this.$queue.setData('userId', res.user.userId)
- this.$queue.setData('shopId', res.user.shopList[0].shopId)
- this.$queue.setData('mobile', res.user.mobile)
- this.$queue.setData('shopUserName', res.user.shopList[0].shopName)
- if (res.user.userEntity) {
- this.$queue.setData('zhiFuBao', res.user.userEntity.zhiFuBao)
- this.$queue.setData('zhiFuBaoName', res.user.userEntity.zhiFuBaoName)
- }
- }
- })
- },
- // switch切换回调
- switchChange(e) {
- let data = {
- shopId: uni.getStorageSync('shopId'),
- messageConfiguration: e.detail.value ? 0 : 1
- }
- this.$Request.postJson('/app/goods/updateGoodShop', data).then((res) => {
- if (res.code == 0) {
- uni.showToast({
- title: this.isChecked ? '关闭成功' : '开启成功',
- icon: 'none',
- mask: true
- })
- setTimeout(() => {
- if (this.timer) {
- clearInterval(this.timer)
- }
- this.getSetData()
- }, 1500)
- }
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #f2f2f2;
- }
- .bg {
- background: #ffffff;
- }
- .camera {
- width: 54px;
- height: 44px;
- &:active {
- background-color: #ededed;
- }
- }
- .btn-bg {
- width: 64px;
- height: 28px;
- background: linear-gradient(90deg, #cda26e 0%, #dcb78a 100%);
- border-radius: 28px;
- text-align: center;
- line-height: 28px;
- margin-top: 4px;
- color: '#604320';
- }
- .images {
- width: 18rpx;
- height: 30rpx;
- }
- .dfs {
- display: flex;
- align-items: center;
- }
- .moneybox {
- width: 690upx;
- margin: 0 auto;
- // height: 369upx;
- // background: #2FB57A;
- border-radius: 20upx 20upx 20upx 20upx;
- }
- .btn {
- width: 160upx;
- height: 60upx;
- background: linear-gradient(90deg, #3d3734 0%, #252323 100%);
- border-radius: 50upx;
- text-align: center;
- line-height: 60upx;
- color: #ffffff;
- }
- .xflist {
- width: 150upx;
- height: 50upx;
- background: #211d2c;
- color: #ffffff;
- border-radius: 5upx;
- text-align: center;
- line-height: 50upx;
- }
- .erweima {
- background: #fcd202;
- padding: 5px 10px;
- border-radius: 20px;
- }
- .bott {
- background: red;
- color: #ffffff;
- width: 30upx;
- height: 30upx;
- text-align: center;
- line-height: 26upx;
- padding: 5rpx;
- border-radius: 60%;
- font-size: 23rpx;
- margin-right: 15rpx;
- }
- </style>
|