修复部分bug

This commit is contained in:
唐明明
2021-10-09 17:21:18 +08:00
parent 09c68e4289
commit ce1f3ff02f
22 changed files with 12438 additions and 58615 deletions

50
App.vue
View File

@@ -1,24 +1,36 @@
<script> <script>
export default { export default {
onLaunch () { onLaunch() {
console.log('App Launch') // if (typeof WeixinJSBridge == 'object' && typeof WeixinJSBridge.invoke == 'function') {
}, // handleFontSize();
onShow () { // } else {
console.log('App Show') // document.addEventListener('WeixinJSBridgeReady', handleFontSize, false);
uni.hideLoading() // }
}, // function handleFontSize() {
onHide () { // // 设置网页字体为默认大小
console.log('App Hide') // WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
}, // // 重写设置网页字体大小的事件
globalData: { // WeixinJSBridge.on('menu:setfont', function() {
mainColor: "white" // WeixinJSBridge.invoke('setFontSizeCallback', { fontSize: 0 });
} // });
// }
},
onShow() {
console.log('App Show');
},
onHide() {
console.log('App Hide');
},
globalData: {
mainColor: 'white'
} }
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import 'uview-ui/index.scss';
page{ page {
background: #f5f5f5; background: #f5f5f5;
} -webkit-text-size-adjust: 100% !important;
</style> }
</style>

View File

@@ -31,7 +31,7 @@ const request = (parameter) => {
'Authorization': store.getters.getToken || '' 'Authorization': store.getters.getToken || ''
} }
console.log('parameterDbug', parameter) // console.log('parameterDbug', parameter)
// 加载提示 // 加载提示
uni.showLoading({ uni.showLoading({

View File

@@ -1,97 +1,99 @@
/** /**
* Web-zdx * Web-zdx
* moduleName:个人中心相关操作 * moduleName:个人中心相关操作
*/ */
import { request } from '../index' import {
request
// 关注店铺 } from '../index'
const shopSubscribe = (id) => {
return request({ // 关注店铺
url: 'mall/shops/subscribe/' + id, const shopSubscribe = (id) => {
method: 'POST' return request({
}) url: 'mall/shops/subscribe/' + id,
} method: 'POST'
})
// 我的关注店铺列表 }
const shopSubscribeList = (page) => {
return request({ // 我的关注店铺列表
url: 'mall/shops/subscribe', const shopSubscribeList = (page) => {
method:'get', return request({
data:{ url: 'mall/shops/subscribe',
page:page method: 'get',
} data: {
}) page: page
} }
})
// 关于我们 }
const aboutUs = () => {
return request({ // 关于我们
url: 'articles/about' const aboutUs = () => {
}) return request({
} url: 'articles/about'
})
// 获取用户信息 }
const getUserInfo = () => {
return request({ // 获取用户信息
url: 'user/app' const getUserInfo = () => {
}) return request({
} url: 'user/app'
})
// 获取用户设置中心的信息 }
const getUserSettingInfo = () => {
return request({ // 获取用户设置中心的信息
url: 'user/setting' const getUserSettingInfo = () => {
}) return request({
} url: 'user/setting'
})
// 账号余额等信息 }
const chaineb = (data) => {
return request({ // 账号余额等信息
url: 'user/account/chaineb', const chaineb = (data) => {
method:'get', return request({
data:data url: 'user/account/chaineb',
}) method: 'get',
} data: data
})
// 我的足迹 }
const browsers = (page) => {
return request({ // 我的足迹
url: 'mall/goods/browsers', const browsers = (page) => {
method: 'get', return request({
data: { url: 'mall/goods/browsers',
page:page, method: 'get',
page_size:20 data: {
} page: page,
}) page_size: 20
} }
})
// 修改用户头像或昵称 }
const resetUserInfo= (data) => {
return request({ // 修改用户头像或昵称
url: 'user/'+data.key, const resetUserInfo = (data) => {
method: 'PUT', return request({
data:{ url: 'user/' + data.key,
value:data.value method: 'PUT',
} data: {
}) value: data.value
} }
})
// 我的推广码 }
const appcode = () => {
return request({ // 我的推广码
url: 'user/appcode' const appcode = () => {
}) return request({
} url: 'user/appcode'
})
export { }
shopSubscribe,
shopSubscribeList, export {
aboutUs, shopSubscribe,
getUserInfo, shopSubscribeList,
getUserSettingInfo, aboutUs,
chaineb, getUserInfo,
browsers, getUserSettingInfo,
resetUserInfo, chaineb,
appcode browsers,
resetUserInfo,
appcode
} }

View File

@@ -30,7 +30,7 @@
<view class="member-tips-title" v-if="wordData.grade == 1">会员升级/续费</view> <view class="member-tips-title" v-if="wordData.grade == 1">会员升级/续费</view>
<view class="member-tips-title" v-else-if="wordData.grade == 2">续费</view> <view class="member-tips-title" v-else-if="wordData.grade == 2">续费</view>
<view class="member-tips-title" v-else>企业会员</view> <view class="member-tips-title" v-else>企业会员</view>
<view class="member-tips-time">有效期{{wordData.identity}}</view> <view class="member-tips-time nowrap">有效期{{wordData.identity}}</view>
</view> </view>
<view class="member-btn" v-if="wordData.grade == 3"> <view class="member-btn" v-if="wordData.grade == 3">
<image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image> <image class="member-btn-icon" src="../../static/icons/store_icon_vip.png" mode="aspectFill"></image>

View File

@@ -507,7 +507,7 @@
} }
}, { }, {
"path": "pages/coupons/couponList", "path": "pages/coupons/couponList",
"name": "Coupons", "name": "CouponsList",
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",

View File

@@ -79,7 +79,20 @@
<label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label> <label class="input-label">{{timeIndex == 0 ? '券有效期': '延期天数'}}</label>
<block v-if="timeIndex === 0"> <block v-if="timeIndex === 0">
<view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view> <view class="input-text" @click="showDatePicker = true">{{datePickerValue.length == 0 ? '选择优惠券有效期区间': datePickerValue[0] + ' ' + datePickerValue[1]}}<uni-icons class="picker-icon" type="arrowdown" size="14" /></view>
<tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/> <u-calendar
:safe-area-inset-bottom="true"
v-model="showDatePicker"
mode="range"
active-bg-color="#e93340"
range-bg-color="rgba(0, 0, 0, .05)"
range-color="#e93340"
btn-type="default"
max-date="2099-12-12"
:min-date="minDate"
@change="confirmDatePicker"
>
</u-calendar>
<!-- <tn-date-picker :show="showDatePicker" :monthNum="12" color="#e93340" :showTips="true" beginText="开始日期" endText="结束日期" @confirm="confirmDatePicker" @cancel="showDatePicker = false"/> -->
</block> </block>
<block v-if="timeIndex === 1"> <block v-if="timeIndex === 1">
<view class="input-number"> <view class="input-number">
@@ -107,6 +120,7 @@
</template> </template>
<script> <script>
import date from '@/public/date'
import TnDatePicker from "@/components/tn-datepicker/tn-datepicker"; import TnDatePicker from "@/components/tn-datepicker/tn-datepicker";
import { uploads } from '@/apis/interfaces/uploading' import { uploads } from '@/apis/interfaces/uploading'
import { pushCoupons } from '@/apis/interfaces/coupons' import { pushCoupons } from '@/apis/interfaces/coupons'
@@ -138,12 +152,19 @@
price : '', // 减少金额 price : '', // 减少金额
description : '', // 使用规则 description : '', // 使用规则
coupongoods : [], // 关联商品 coupongoods : [], // 关联商品
timeNumber : 1 // 延期券时间 timeNumber : 1 , // 延期券时间
minDate : '' // 优惠券最小期限
}; };
}, },
onShow(){ onShow(){
new date().then(res => {
this.minDate = res
})
this.coupongoods = this.$store.getters.getCoupongoods this.coupongoods = this.$store.getters.getCoupongoods
}, },
onUnload() {
this.$store.commit('setCoupongoods', [])
},
methods:{ methods:{
// 发券数量 // 发券数量
quantityChange(value){ quantityChange(value){
@@ -163,11 +184,15 @@
}, },
// 选择 // 选择
changePicker(e){ changePicker(e){
if(e.target.dataset.type === 'typeIndex'){
this.$store.commit('setCoupongoods', [])
this.coupongoods = this.$store.getters.getCoupongoods
}
this[e.target.dataset.type] = e.detail.value this[e.target.dataset.type] = e.detail.value
}, },
// 日期 // 日期
confirmDatePicker(e){ confirmDatePicker(e){
this.datePickerValue = e.value this.datePickerValue = [e.startDate , e.endDate]
this.showDatePicker = false this.showDatePicker = false
}, },
// 上传优惠券封面 // 上传优惠券封面

View File

@@ -140,8 +140,7 @@
</view> </view>
</u-circle-progress> </u-circle-progress>
<view class="now-get" v-if='item.can.get' <view class="now-get" v-if='item.can.get'
@click="toReceiveCoupon('services',index,item.coupon_id)"> @click="toReceiveCoupon('services',index,item.coupon_id)">立即领取</view>
立即领取</view>
<view class="now-get now-got" v-if="!item.can.get && item.can.is_get" <view class="now-get now-got" v-if="!item.can.get && item.can.is_get"
@click="toUse(item.coupon_id)">去使用</view> @click="toUse(item.coupon_id)">去使用</view>
</view> </view>
@@ -261,7 +260,6 @@
// 获取首页列表 // 获取首页列表
getCoupons() { getCoupons() {
couponsByCompanyId({}).then(res => { couponsByCompanyId({}).then(res => {
console.log(res)
this.activities = res.activities // 顶部活动 this.activities = res.activities // 顶部活动
this.notices = res.notices // 通知消息 this.notices = res.notices // 通知消息
let notices = res.notices let notices = res.notices

View File

@@ -188,7 +188,7 @@
.cover{ .cover{
position: relative; position: relative;
border-right: dashed 3rpx $border-color; border-right: dashed 3rpx $border-color;
width: 148rpx; width: 208rpx;
text-align: center; text-align: center;
.cover-img{ .cover-img{
width: 148rpx; width: 148rpx;
@@ -234,7 +234,7 @@
} }
.mian{ .mian{
justify-content: center; justify-content: center;
width: calc(100% - 148rpx - #{$padding*2}); width: calc(100% - 208rpx);
box-sizing: border-box; box-sizing: border-box;
@extend .vertical; @extend .vertical;
.title{ .title{

View File

@@ -152,7 +152,7 @@
<view class="title"> <view class="title">
限时抢购<text>海量商家优惠券</text> 限时抢购<text>海量商家优惠券</text>
</view> </view>
<navigator class="more" open-type="navigate" url="/pages/coupons/couponList">查看更多</navigator> <view class="more" @click="onCoupons('more')">查看更多</view>
</view> </view>
<view class="coupons" v-if="coupons.length > 0"> <view class="coupons" v-if="coupons.length > 0">
<view class="coupons-item" v-for="(item, index) in coupons" :key="index"> <view class="coupons-item" v-for="(item, index) in coupons" :key="index">
@@ -173,7 +173,7 @@
<view class="logo"> <view class="logo">
<image class="logo-img" :src="item.cover" mode="aspectFill"></image> <image class="logo-img" :src="item.cover" mode="aspectFill"></image>
</view> </view>
<view class="btn">立即领取</view> <button class="btn" :disabled="!item.can.get" @click="onCoupons('get', item.coupon_id, index)">{{item.can.get ? '立即领取' : '已领取'}}</button>
</view> </view>
</view> </view>
<!-- 优选商品 --> <!-- 优选商品 -->
@@ -186,9 +186,10 @@
<script> <script>
import { companies, companiesList } from '@/apis/interfaces/company' import { companies, companiesList } from '@/apis/interfaces/company'
import { mall, list } from '@/apis/interfaces/goods' import { mall, list, managesCoupons } from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list' import goodsList from '@/components/goods-list/goods-list'
import industryList from '@/components/industry-list/industry-list' import industryList from '@/components/industry-list/industry-list'
import userAuth from '@/public/userAuth'
export default{ export default{
comments:{ comments:{
goodsList, goodsList,
@@ -251,6 +252,34 @@
break break
} }
}, },
// 领取,更多优惠券
onCoupons(type, id, index){
let token = this.$store.getters.getToken
if(token == ''){
let userLogin = new userAuth()
userLogin.Login()
return
}
if(type === 'more'){
this.$Router.push({name: 'CouponsList'})
return
}
if(type === 'get'){
managesCoupons(id).then(res=>{
this.$set(this.coupons, index, res)
uni.showToast({
title: '领取成功',
type: 'primary',
duration: 3000
})
}).catch(err => {
uni.showToast({
icon : 'none',
title: err.message
})
})
}
},
// 企业广场 // 企业广场
getCompanies(){ getCompanies(){
companies().then(res=>{ companies().then(res=>{
@@ -323,7 +352,6 @@
}, },
// 打开微信小程序 // 打开微信小程序
onOpenWechat(e){ onOpenWechat(e){
console.log(e)
plus.share.getServices(res => { plus.share.getServices(res => {
let sweixin = null; let sweixin = null;
for(let val of res){ for(let val of res){
@@ -568,7 +596,14 @@
text-align: center; text-align: center;
line-height: 64rpx; line-height: 64rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
&[disabled]{
background: rgba($color: #faf2dd, $alpha: .8);
color: rgba($color: #fd5f3c, $alpha: .5);
}
&::after{
border: none;
}
} }
} }
} }

View File

@@ -19,10 +19,10 @@
</view> </view>
<view class="lists"> <view class="lists">
<!-- 优选商品 --> <!-- 优选商品 -->
<goods-list :list="searchArr" priceType="CNY" v-if="searchType == 0" /> <goods-list :list="searchArr" priceType="CNY" v-if="searchType == 0" @on-goods="onGoods" />
<!-- 商家 --> <!-- 商家 -->
<industry-list :list="searchArr" v-if="searchType == 1"/> <industry-list :list="searchArr" v-if="searchType == 1" @on-industry="onOpenWechat"/>
</view> </view>
<!-- 分页 --> <!-- 分页 -->
@@ -77,6 +77,37 @@
} }
}, },
methods: { methods: {
// 商品详情
onGoods(e){
this.$Router.push({name: 'goodsDetails', params: {id: e.goods_id}})
},
// 打开微信小程序
onOpenWechat(e){
plus.share.getServices(res => {
let sweixin = null;
for(let val of res){
if(val.id === 'weixin'){
sweixin = val
}
}
/** 以此为例子 显示跳转引导页
* 'index_4'
* index 跳小程序企业首页
* 4 企业id
**/
if(sweixin != null){
sweixin.launchMiniProgram({
id : e.original_id,
path: 'pages/login/guide?scene=index_' + e.company_id,
})
}else{
uni.showToast({
title: '当前环境不支持打开微信小程序',
icon : 'none'
})
}
})
},
// 列表数据 // 列表数据
getList() { getList() {
// type=0为商品列表; type=1为企业列表 // type=0为商品列表; type=1为企业列表

View File

@@ -398,13 +398,13 @@
content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?', content : this.$Route.query.type === 'edit' ? '商品权证已更新,是否立即补充产品附加信息认证?' : '商品权证已发布,是否立即补充产品附加信息认证?',
cancelText : '稍后认证', cancelText : '稍后认证',
confirmText : '立即认证', confirmText : '立即认证',
success : res => { success : modalRes => {
if(res.cancel){ if(modalRes.cancel){
this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2) this.$Router.back(this.$Route.query.type === 'edit' ? 1 : 2)
} }
if(res.confirm){ if(modalRes.confirm){
let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res let goodsId = this.$Route.query.type === 'edit' ? this.$Route.query.id : res
this.$Router.push({name: 'goodsAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}}) this.$Router.replace({name: 'goodsAuth', params: { id: goodsId , type: 'goodsAdd', edit: this.$Route.query.type === 'edit'}})
} }
} }
}) })

View File

@@ -324,8 +324,8 @@
font-size: $title-size; font-size: $title-size;
font-weight: bold; font-weight: bold;
line-height: 50rpx; line-height: 50rpx;
display: flex;
.title-hot { .title-hot {
display: inline-block;
background-color: #fee195; background-color: #fee195;
font-size: 24rpx; font-size: 24rpx;
border-radius: 50rpx; border-radius: 50rpx;

View File

@@ -140,6 +140,7 @@
product_address : this.productAddress, product_address : this.productAddress,
extend_cover : this.extendCover[0].path extend_cover : this.extendCover[0].path
} }
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData) let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
submitFund.then(res => { submitFund.then(res => {
uni.showModal({ uni.showModal({
@@ -149,7 +150,7 @@
success : res => { success : res => {
if(res.confirm){ if(res.confirm){
if(this.$Route.query.type == 'goodsAdd'){ if(this.$Route.query.type == 'goodsAdd'){
this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 3) this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 2)
}else{ }else{
this.$Router.back() this.$Router.back()
} }

View File

@@ -133,9 +133,10 @@
}, },
// 选择支付类型 // 选择支付类型
payType(e){ payType(e){
console.log(e.detail.value)
this.payValue = e.detail.value this.payValue = e.detail.value
}, },
//数量变化 //数量变化
numberChange(e){ numberChange(e){
this.qty = e this.qty = e

View File

@@ -1,176 +1,172 @@
<template> <template>
<view v-if='loding'> <view v-if='loding'>
<block v-if="this.$store.state.token != ''"> <block v-if="this.$store.state.token != ''">
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="user"> <view class="user">
<view class="user-tool" @click="$Router.push({name:'Setting'})"> <view class="user-tool" @click="$Router.push({name:'Setting'})">
<image src="@/static/icons/user_icon_00.png" mode="widthFix" /> <image src="@/static/icons/user_icon_00.png" mode="widthFix" />
</view> </view>
<view class="user-content"> <view class="user-content">
<image class="info-cover" :src="base.avatar" mode="aspectFill" /> <image class="info-cover" :src="base.avatar || require('@/static/images/boss.png')" mode="aspectFill" />
<view class="info-nickname">{{base.nickname}}</view> <view class="info-nickname">{{base.nickname}}</view>
<view class="info-signa">潮流就是我的态度</view> <view class="info-signa">潮流就是我的态度</view>
<view class="info-tags"> <view class="info-tags" v-if="this.$store.state.token != ''">
<text class="info-tags-item identity" v-if="base.identity">{{base.identity.name}}</text> <text class="info-tags-item identity" v-if="base.identity">{{base.identity.name}}</text>
<text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text> <text class="info-tags-item vip" v-if="base.company_level.name">{{base.company_level.name }}</text>
</view> </view>
</view> </view>
<view class="user-tabs"> <view class="user-tabs">
<view class="user-tabs-item" :class="{'show': tabsIndex === 0}" @click="tabsIndex = 0">管理中心</view> <view class="user-tabs-item" :class="{'show': tabsIndex === 0}" @click="tabsIndex = 0">管理中心</view>
<view class="user-tabs-item" :class="{'show': tabsIndex === 1}" @click="tabsIndex = 1">我的推广</view> <view class="user-tabs-item" :class="{'show': tabsIndex === 1}" @click="tabsIndex = 1">我的推广</view>
</view> </view>
</view> </view>
<!-- 消息 --> <!-- 消息 -->
<view class="user-ad"> <view class="user-ad" v-if="message.length > 0">
<uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons> <uni-icons class="user-ad-icon" type="sound-filled" color="#e93340"></uni-icons>
<swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular> <swiper class="user-ad-swiper" :interval="3000" autoplay vertical circular>
<swiper-item v-for="(item,index) in message" :key='index'> <swiper-item v-for="(item,index) in message" :key='index'>
<view class="user-ad-item">{{item}}</view> <view class="user-ad-item">{{item}}</view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<block v-if="tabsIndex === 0"> <block v-if="tabsIndex === 0">
<!-- 我的资产 --> <!-- 我的资产 -->
<view class="user-group"> <view class="user-group">
<view class="title"> <view class="title">
<view class="title-text">我的资产</view> <view class="title-text">我的资产</view>
</view> </view>
<view class="group-flex group-flex-4"> <view class="group-flex group-flex-4">
<view class="item" @click="showToast"> <view class="item" @click="showToast">
<view class="item-num">{{base.account.token}}</view> <view class="item-num">{{base.account.token}}</view>
<view class="item-title">原石</view> <view class="item-title">原石</view>
</view> </view>
<view class="item" @click="showToast"> <view class="item" @click="showToast">
<view class="item-num">{{base.account.contribution}}</view> <view class="item-num">{{base.account.contribution}}</view>
<view class="item-title">贡献值</view> <view class="item-title">贡献值</view>
</view> </view>
<view class="item" @click="$Router.push({name:'Eb'})"> <view class="item" @click="$Router.push({name:'Eb'})">
<view class="item-num">{{base.account.eb}}</view> <view class="item-num">{{base.account.eb}}</view>
<view class="item-title">易币</view> <view class="item-title">易币</view>
</view> </view>
<view class="item" @click="showToast"> <view class="item" @click="showToast">
<view class="item-num">{{base.account.money}}</view> <view class="item-num">{{base.account.money}}</view>
<view class="item-title">零钱</view> <view class="item-title">零钱</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 我的权证 --> <!-- 我的权证 -->
<view class="user-group"> <view class="user-group">
<view class="title" > <view class="title" >
<view class="title-text">我的权证</view> <view class="title-text">我的权证</view>
</view> </view>
<view class="group-flex group-flex-4"> <view class="group-flex group-flex-4">
<view class="item" @click="$Router.push({name:'NumberWeight'})"> <view class="item" @click="$Router.push({name:'NumberWeight'})">
<view class="item-num">{{count.warrnats}}</view> <view class="item-num">{{count.warrnats}}</view>
<view class="item-title">权证持有</view> <view class="item-title">权证持有</view>
</view> </view>
<view class="item" @click="$Router.push({name: 'marketManag'})"> <view class="item" @click="$Router.push({name: 'marketManag'})">
<view class="item-num">{{count.warrnat_transfer}}</view> <view class="item-num">{{count.warrnat_transfer}}</view>
<view class="item-title">权证转让</view> <view class="item-title">权证转让</view>
</view> </view>
<view class="item" @click="$Router.push({name:'ServicesOrder'})"> <view class="item" @click="$Router.push({name:'ServicesOrder'})">
<view class="item-num">{{count.shipment_fuwu_count}}</view> <view class="item-num">{{count.shipment_fuwu_count}}</view>
<view class="item-title">已使用</view> <view class="item-title">已使用</view>
</view> </view>
<view class="item" @click="$Router.push({name:'MallShipments'})"> <view class="item" @click="$Router.push({name:'MallShipments'})">
<view class="item-num">{{count.shipment_goods_count}}</view> <view class="item-num">{{count.shipment_goods_count}}</view>
<view class="item-title">已提货</view> <view class="item-title">已提货</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 我的权证 --> <!-- 我的权证 -->
<view class="user-group"> <view class="user-group">
<view class="group-flex group-flex-4"> <view class="group-flex group-flex-4">
<view class="item" @click="$Router.push({name:'Collection'})"> <view class="item" @click="$Router.push({name:'Collection'})">
<image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" /> <image class="item-cover" src="@/static/icons/user_icon_02.png" mode="aspectFill" />
<view class="item-title">收藏的企业</view> <view class="item-title">收藏的企业</view>
</view> </view>
<view class="item" @click="$Router.push({name:'CouponList'})"> <view class="item" @click="$Router.push({name:'CouponList'})">
<image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" /> <image class="item-cover" src="@/static/icons/user_icon_03.png" mode="aspectFill" />
<view class="item-title">我的优惠券</view> <view class="item-title">我的优惠券</view>
</view> </view>
<view class="item" @click="$Router.push({name:'HistoryShop'})"> <view class="item" @click="$Router.push({name:'HistoryShop'})">
<image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" /> <image class="item-cover" src="@/static/icons/user_icon_01.png" mode="aspectFill" />
<view class="item-title">我的足迹</view> <view class="item-title">我的足迹</view>
</view> </view>
<view class="item" @click="$Router.push({name:'AddressList'})"> <view class="item" @click="$Router.push({name:'AddressList'})">
<image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" /> <image class="item-cover" src="@/static/icons/user_icon_04.png" mode="aspectFill" />
<view class="item-title">地址管理</view> <view class="item-title">地址管理</view>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
<block v-else-if="tabsIndex === 1"> <block v-else-if="tabsIndex === 1">
<!-- 我的权证 --> <!-- 我的权证 -->
<view class="user-group"> <view class="user-group">
<view class="title"> <view class="title">
<view class="title-text">推广数据</view> <view class="title-text">推广数据</view>
</view> </view>
<view class="group-flex group-flex-2"> <view class="group-flex group-flex-2">
<view class="item"> <view class="item">
<view class="item-num">{{relations.children}}</view> <view class="item-num">{{relations.children}}</view>
<view class="item-title">推广人数</view> <view class="item-title">推广人数</view>
</view> </view>
<view class="item"> <view class="item">
<view class="item-num">{{relations.company}}</view> <view class="item-num">{{relations.company}}</view>
<view class="item-title">推广企业</view> <view class="item-title">推广企业</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 排名信息 --> <!-- 排名信息 -->
<view class="user-group"> <view class="user-group">
<view class="title"> <view class="title">
<view class="title-text">推广排名</view> <view class="title-text">推广排名</view>
</view> </view>
<view class="ranking ranking-after"> <view class="ranking ranking-after">
<view class="ranking-title"> <view class="ranking-title">
<view class="ranking-text">全站推广人数</view> <view class="ranking-text">全站推广人数</view>
<view class="ranking-number">{{relations.childrenRank}}</view> <view class="ranking-number">{{relations.childrenRank}}</view>
</view> </view>
<image class="tips" src="../../static/icons/property_icon_00.png" mode="aspectFill" /> <image class="tips" src="../../static/icons/property_icon_00.png" mode="aspectFill" />
</view> </view>
<view class="ranking"> <view class="ranking">
<view class="ranking-title"> <view class="ranking-title">
<view class="ranking-text">推广企业</view> <view class="ranking-text">推广企业</view>
<view class="ranking-number">{{relations.companyRank}}</view> <view class="ranking-number">{{relations.companyRank}}</view>
</view> </view>
<image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" /> <image class="tips" src="../../static/icons/property_icon_01.png" mode="aspectFill" />
</view> </view>
</view> </view>
<!-- 推广海报 -->
<view class="poster-text">推广海报</view>
<!-- 推广海报 --> <view class="code">
<view class="poster-text">推广海报</view> <image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" />
<image class='code-img' :src="shareCode" mode="widthFix" />
<!-- <carousel :img-list="imgList" url-key="url" @selected="selectedBanner"/> --> </view>
<view class="code">
<image class="code-img-bg" src="/static/images/share_bg_3.png" mode="aspectFill" /> </block>
<image class='code-img' :src="shareCode" mode="widthFix" /> <!-- 弹窗 -->
</view> <u-toast ref="uToast" />
<!-- 版权信息 -->
</block> <view class="copyright">易品新境 beta 1.0.0</view>
<!-- 弹窗 --> </block>
<u-toast ref="uToast" /> <block v-else>
<!-- 版权信息 --> <view class="statusBar">
<view class="copyright">易品新境 beta 1.0.0</view> <view class="statusBar-title">我的资产</view>
</block> </view>
<block v-else> <view class="store-login">
<view class="statusBar"> <image class="icon" src="@/static/icons/login-icon.png" mode="widthFix"></image>
<view class="statusBar-title">我的资产</view> <view class="sub-title">一键开启您的易货之旅</view>
</view> <button type="default" @click="login">登录</button>
<view class="store-login"> </view>
<image class="icon" src="@/static/icons/login-icon.png" mode="widthFix"></image> </block>
<view class="sub-title">一键开启您的易货之旅</view>
<button type="default" @click="login">登录</button>
</view>
</block>
</view> </view>
</template> </template>
<script> <script>
import carousel from '@/components/vear-carousel/vear-carousel' import carousel from '@/components/vear-carousel/vear-carousel'
import {getUserInfo , appcode} from '@/apis/interfaces/mine' import { getUserInfo , appcode } from '@/apis/interfaces/mine'
import userAuth from '@/public/userAuth' import userAuth from '@/public/userAuth'
export default { export default {
components: { components: {
@@ -178,65 +174,54 @@
}, },
data() { data() {
return { return {
tabsIndex: 0, tabsIndex : 0,
imgList: [{ base : {
url: 'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg', avatar : '',
id: 1 nickname: '',
},{ account : {
url: 'https://img9.51tietu.net/pic/2019-091200/euzekmi5m23euzekmi5m23.jpg', token : 0,
id: 2 contribution: 0,
},{ eb : 0,
url: 'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg', money : 0
id: 3 }
}], },
base:'', count : {
count:'', warrnats : 0,
relations:'', warrnat_transfer : 0,
message:'', shipment_fuwu_count : 0,
loding:true, shipment_goods_count: 0
shareCode:'' },
relations : '',
message : [],
shareCode : '',
loding : false
} }
}, },
onShow(){ onShow(){
console.log(this.$store.state.token) if(this.$store.state.token != '') this.userInfo()
if(this.$store.state.token != ''){ else this.loding = true
this.getUserInfo()
}
}, },
methods: { methods: {
// 获取用户的基本信息 // 获取用户的基本信息
getUserInfo(){ userInfo(){
getUserInfo().then(res => { Promise.all([getUserInfo(), appcode()]).then(res => {
this.base = res.base let userInfoData = res[0],
this.count = res.count appcodeData = res[1]
this.message = res.message
this.relations = res.relations this.base = userInfoData.base
this.count = userInfoData.count
this.message = userInfoData.message
this.relations = userInfoData.relations
this.shareCode = appcodeData.code
this.loding = true this.loding = true
}).catch(err => { }).catch(err => {
this.$refs.uToast.show({ uni.showToast({
title: err.message, title: err.message,
type: 'error', icon : 'none'
icon:false,
duration: 3000
})
})
appcode().then(res => {
this.shareCode = res.code
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'error',
icon:false,
duration: 3000
}) })
}) })
}, },
outLogin(){
this.$store.commit('setToken', '')
},
selectedBanner(item, index) {
console.log('🥒', item, index)
},
// 努力开发中,,, // 努力开发中,,,
showToast(){ showToast(){
this.$refs.uToast.show({ this.$refs.uToast.show({

View File

@@ -25,16 +25,12 @@
<view @click="loginOut" class="list-item"> <view @click="loginOut" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
<image src="/static/images/reset-info.png" mode="widthFix" /> <image src="/static/images/reset-info.png" mode="widthFix" />
<span>切换账户</span> <span>退出登录</span>
</view> </view>
<u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon> <u-icon name="arrow-right" color="#f1f1f1" size="28"></u-icon>
</view> </view>
</view> </view>
<!-- 底部banner -->
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
</template> </template>
@@ -81,14 +77,16 @@
}) })
}, },
loginOut() { loginOut() {
uni.removeStorageSync('token') this.$store.commit('setToken', '')
uni.reLaunch({ this.$Router.replaceAll({name: 'Equity'})
url: '/pages/login/login'
})
}, },
// 上传头像 // 上传头像
updImgs(type) { updImgs(type) {
uni.chooseImage({ uni.chooseImage({
crop: {
width: 80,
height: 80
},
success: res => { success: res => {
let path = res.tempFiles.map((val, index) => { let path = res.tempFiles.map((val, index) => {
return { return {
@@ -166,7 +164,6 @@
margin: 0 40rpx; margin: 0 40rpx;
padding: 30rpx 0; padding: 30rpx 0;
width: calc(100% - 80rpx); width: calc(100% - 80rpx);
button::after { button::after {
border: none; border: none;
background-color: none; background-color: none;

View File

@@ -1,16 +1,17 @@
/** /**
* Web唐明明 * Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。 * 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。 * 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 日期 * moduleName: 日期
*/ */
export default getDate = (type) =>{ export default getDate = (type) =>{
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const date = new Date() const date = new Date()
const year = date.getFullYear() const year = date.getFullYear()
const month = (date.getMonth() + 1) <= 9 ? '0' + (date.getMonth() + 1) : date.getMonth()
const month = (date.getMonth() + 1) <= 9 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
const day = date.getDate() const day = date.getDate()
switch(type){ switch(type){

View File

@@ -7,6 +7,7 @@
import { RouterMount, createRouter } from 'uni-simple-router'; import { RouterMount, createRouter } from 'uni-simple-router';
import store from '../store/index' import store from '../store/index'
import userAuth from '../public/userAuth'
const router = createRouter({ const router = createRouter({
platform: process.env.VUE_APP_PLATFORM, platform: process.env.VUE_APP_PLATFORM,
@@ -15,11 +16,6 @@ const router = createRouter({
// 全局路由前置守卫 // 全局路由前置守卫
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
const token = store.getters.getToken || uni.getStorageSync('token')
// 检查是否需要登录
if(to.meta.auth && token === ''){
return
}
next(); next();
}) })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"name\":\"\",\"path\":\"\",\"query\":\"\",\"id\":0}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.1.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}} {"@platforms":["android","iPhone","iPad"],"id":"__UNI__CD19AAD","name":"易品新境","version":{"name":"1.0.0","code":"100"},"description":"易品新境为商家提供营销引流工具","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"OAuth":{},"Payment":{},"Share":{},"Geolocation":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#f5f5f5"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common"},"google":{"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{},"plugins":{"oauth":{"univerify":{},"weixin":{"appid":"wx222fbe58feee7819","appsecret":"3d24525a636d7573a8fae885097d5cf7","UniversalLinks":""}},"payment":{"weixin":{"__platform__":["android"],"appid":"wx222fbe58feee7819","UniversalLinks":""}},"share":{"weixin":{"appid":"wx222fbe58feee7819","UniversalLinks":""}},"maps":{},"ad":{},"geolocation":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"arguments":"{\"name\":\"\",\"path\":\"\",\"query\":\"\",\"id\":0}","allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.2.9","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#bababa","selectedColor":"#e93340","backgroundColor":"#FFFFFF","borderStyle":"rgba(255,255,255,0.4)","list":[{"pagePath":"pages/equity/index","text":"通证权易","iconPath":"static/tabBar/tabBar_icon_00.png","selectedIconPath":"static/tabBar/tabBar_show_00.png"},{"pagePath":"pages/market/index","text":"转让市场","iconPath":"static/tabBar/tabBar_icon_01.png","selectedIconPath":"static/tabBar/tabBar_show_01.png"},{"pagePath":"pages/store/index","text":"企业工具","iconPath":"static/tabBar/tabBar_icon_02.png","selectedIconPath":"static/tabBar/tabBar_show_02.png"},{"pagePath":"pages/property/index","text":"我的资产","iconPath":"static/tabBar/tabBar_icon_03.png","selectedIconPath":"static/tabBar/tabBar_show_03.png"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"}}