Browse Source

'优化页面逻辑和接口'

master
Lj 1 month ago
parent
commit
681dfff58f
13 changed files with 196 additions and 74 deletions
  1. +60
    -38
      App.vue
  2. +6
    -0
      api/model/index.js
  3. +1
    -1
      config.js
  4. +6
    -3
      pages/component/home.vue
  5. +51
    -10
      pages/component/my.vue
  6. +12
    -6
      pages/component/recycle.vue
  7. +1
    -1
      pages/manager/user.vue
  8. +1
    -1
      pages/subcomponent/detail.vue
  9. +6
    -4
      pages/subcomponent/promo-qrcode.vue
  10. +7
    -3
      pages/subcomponent/promotion.vue
  11. +2
    -0
      pages/subcomponent/select.vue
  12. +40
    -7
      pages/subcomponent/withdraw.vue
  13. +3
    -0
      pages/wxUserInfo.vue

+ 60
- 38
App.vue View File

@ -1,24 +1,28 @@
<script>
import routerInterception from '@/utils/router-interception.js'
import config from '/config.js'
export default {
globalData: {
flag: 1,
login_status:true,
phone:null,
bannerList: [],
pricePreviewList: [],
configData: [],
globalData: {
flag: 1,
login_status: true,
phone: null,
bannerList: [],
pricePreviewList: [],
configData: [],
qr_path: ''
},
onLaunch: function() {
routerInterception()
this.getBannerList()
this.getPricePreviewList()
this.getConfigData()
this.getQrCode()
// console.log(this.$utils)
console.log('App Launch')
},
onLoad: function() {
this.getBannerList()
this.getQrCode();
console.log('App Show')
},
onHide: function() {
@ -30,7 +34,7 @@
this.$api && this.$api('getBanner', {}, res => {
if (res && res.code === 200 && Array.isArray(res.result)) {
getApp().globalData.bannerList = res.result
console.log(getApp().globalData.bannerList,'bannerList')
console.log(getApp().globalData.bannerList, 'bannerList')
uni.$emit('bannerListUpdated')
}
})
@ -44,59 +48,77 @@
})
},
getConfigData() {
this.$api('getConfig', {}, res => {
console.log('Config data response:', JSON.parse(JSON.stringify(res)) )
if (res && res.success && Array.isArray(res.result)) {
getApp().globalData.configData = res.result
// console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) )
}
})
},
this.$api('getConfig', {}, res => {
console.log('Config data response:', JSON.parse(JSON.stringify(res)))
if (res && res.success && Array.isArray(res.result)) {
getApp().globalData.configData = res.result
// console.log('Config data set:', JSON.parse(JSON.stringify(this.configData)) )
}
})
},
getQrCode() {
// console.log(config.baseUrl,'config.baseUrl')
let that = this;
if (!uni.getStorageSync('token')) {
return
}
uni.getImageInfo({
src: `${config.baseUrl}/recycle-admin/applet/promotion/getInviteCode?token=${uni.getStorageSync('token')}`,
success: res => {
getApp().globalData.configData.qr_path = res.path
console.log(getApp().globalData.configData.qr_path,
'getApp().globalData.configData.qr_path')
},
fail: err => {
console.log(err)
}
})
}
}
}
</script>
<style >
/* // @import "./uni_modules/vk-uview-ui/index.scss"; */
<style>
/* // @import "./uni_modules/vk-uview-ui/index.scss"; */
/*每个页面公共css */
.uni-tabbar-bottom{
/*每个页面公共css */
.uni-tabbar-bottom {
display: none;
}
.icon {
width: 50rpx;
height: 50rpx;
}
.nav-bar{
.nav-bar {
/* margin-top: calc(70rpx + env(safe-area-inset-top)); */
height: 30%;
display: flex;
justify-content: center;
}
/* 每个页面公共css */
/* 解决小程序和app滚动条的问题 */
::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
}
/* 解决H5的问题 */
uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
display: none;
width: 0 !important;
height: 0 !important;
-webkit-appearance: none;
background: transparent;
color: transparent;
}
</style>
</style>

+ 6
- 0
api/model/index.js View File

@ -205,6 +205,12 @@ const api = {
url: '/recycle-admin/applet/index/getAreaList',
method: 'GET',
auth : true,
},
getCumulativeRecoveryCount: {
url: '/recycle-admin/applet/order/getCumulativeRecoveryCount',
method: 'GET',
auth : true,
},
}

+ 1
- 1
config.js View File

@ -3,7 +3,7 @@ const type = 'dev'
const config = {
dev: {
baseUrl: 'https://www.ddmhs.top',
baseUrl: 'http://h5.xzaiyp.top',
},
prod: {
baseUrl: 'https://www.ddmhs.top',


+ 6
- 3
pages/component/home.vue View File

@ -13,7 +13,7 @@
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<video
v-if="item.type == 1"
:src="item.image"
:src="item.voUrl"
autoplay
muted
loop
@ -358,7 +358,10 @@ export default {
this.sbkCion = sbk ? sbk.keyContent : '';
},
},
onLoad() {
onLoad(query) {
if (query.shareId) {
uni.setStorageSync('shareId', query.shareId)
};
this.getAreaList();
this.getPricePreview();
this.getRecentGoods();
@ -403,7 +406,7 @@ export default {
.banner {
width: 100%;
height: 350rpx;
height: 390rpx;
position: relative;
overflow: hidden;
border-radius: 0 0 30rpx 30rpx;


+ 51
- 10
pages/component/my.vue View File

@ -29,7 +29,10 @@
<!-- 用户信息卡片 -->
<view class="user-card" v-if="login_status">
<view class="user-info">
<image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image>
<view class="avatar-badge-box">
<image class="avatar" :src="userInfo.headImage" mode="aspectFill"></image>
<view class="avatar-badge">{{ userTypeText }}</view>
</view>
<view class="info">
<text class="name">{{userInfo.nickName}}</text>
<text class="id">ID: {{userInfo.intentioCode}}</text>
@ -327,6 +330,7 @@ export default {
this.$api("getUserByToken",{},(res)=>{
if(res.code == 200){
this.userInfo = res.result
// isTuiType 0,1广,2广使
}
})
} else {
@ -348,11 +352,10 @@ export default {
}
})
},
getTotalOrders(){
this.$api && this.$api('getOrderListPage', {}, res => {
if (res && res.code === 200 && res.result && Array.isArray(res.result.records)) {
//
this.totalOrders = res.result.total || 0
getCumulativeRecoveryCount(){
this.$api && this.$api('getCumulativeRecoveryCount', {}, res => {
if (res && res.code === 200 && res.result) {
this.totalOrders = res.result
} else {
this.totalOrders = 0
}
@ -372,6 +375,12 @@ export default {
myBannerImage() {
const banner = (getApp().globalData.bannerList || []).find(item => item.title === '我的-轮播图');
return banner ? banner.image : '';
},
userTypeText() {
// 0 , 1 广, 2 广使
if (this.userInfo.isTuiType === 1) return '推广达人'
if (this.userInfo.isTuiType === 2) return '推广大使'
return '普通用户'
}
},
onLoad() {
@ -382,7 +391,7 @@ export default {
})
this.fetchUserInfo()
this.fetchOrderList()
this.getTotalOrders()
this.getCumulativeRecoveryCount()
uni.$on('bannerListUpdated', () => {
this.$forceUpdate && this.$forceUpdate()
})
@ -392,11 +401,11 @@ export default {
},
onShow() {
this.fetchUserInfo()
this.getTotalOrders()
this.getCumulativeRecoveryCount()
},
onPullDownRefresh() {
this.fetchUserInfo()
this.getTotalOrders()
this.getCumulativeRecoveryCount()
setTimeout(() => {
uni.stopPullDownRefresh()
uni.showToast({
@ -461,11 +470,43 @@ export default {
align-items: center;
margin-bottom: 40rpx;
.avatar {
.avatar-badge-box {
position: relative;
width: 110rpx;
height: 110rpx;
border-radius: 12rpx;
overflow: hidden;
background: #fff;
flex-shrink: 0;
margin-right: 24rpx;
display: flex;
align-items: flex-end;
justify-content: center;
}
.avatar {
width: 100%;
height: 100%;
border-radius: 12rpx;
display: block;
}
.avatar-badge {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 32rpx;
line-height: 32rpx;
background: rgba(238,238,238,0.95);
color: #999;
font-size: 24rpx;
text-align: center;
border-bottom-left-radius: 12rpx;
border-bottom-right-radius: 12rpx;
font-weight: 400;
letter-spacing: 2rpx;
z-index: 2;
}
.info {


+ 12
- 6
pages/component/recycle.vue View File

@ -13,7 +13,7 @@
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<video
v-if="item.type == 1"
:src="item.image"
:src="item.voUrl"
autoplay
muted
loop
@ -52,7 +52,7 @@
<view class="goods-info-wrap">
<view class="goods-header">
<text class="goods-name">{{item.name}}</text>
<view class="brand-check-placeholder" v-if="item.shopCion">
<view class="brand-check-placeholder" v-if="item.isPin == 'Y'?treu:false">
<view class="brand-check" @click="checkBrand(index)">
<text>查看品牌</text>
<uni-icons type="right" size="12" color="#ff7a0e"></uni-icons>
@ -233,7 +233,7 @@
<view v-for="letter in brandIndexList" :key="letter" :id="'brand-letter-' + letter">
<view class="brand-letter">{{letter}}</view>
<view v-for="brand in filteredBrandList.filter(b => b.letter === letter)" :key="brand.name" class="brand-item" @click="openBrandConfirm(brand)">
<image :src="brand.logo" class="brand-logo" mode="aspectFit" />
<image :src="brand.image" class="brand-logo" mode="aspectFit" />
<text class="brand-name">{{brand.name}}</text>
</view>
</view>
@ -280,7 +280,7 @@
<view class="brand-confirm-popup">
<view class="brand-confirm-title">品牌确认提示</view>
<view class="brand-confirm-logo-wrap">
<image :src="brandConfirmInfo.logo" class="brand-confirm-logo" mode="aspectFit" />
<image :src="brandConfirmInfo.image" class="brand-confirm-logo" mode="aspectFit" />
</view>
<view class="brand-confirm-name">{{ brandConfirmInfo.name }}</view>
<view class="brand-confirm-desc">请确认所选品牌是否与实物品牌信息一致否则将无法进行回收</view>
@ -316,7 +316,7 @@ export default {
showPickupConfirm: false,
showBrandConfirm: false,
brandConfirmInfo: {
logo: '',
image: '',
name: ''
},
brandList: [],
@ -623,7 +623,7 @@ export default {
openBrandConfirm(brand) {
this.brandConfirmInfo = {
id: brand.id,
logo: brand.logo,
image: brand.image,
name: brand.name
}
this.showBrandConfirm = true
@ -674,6 +674,12 @@ export default {
return key.charAt(0).toUpperCase()
}
}
let index = this.brandIndexList.indexOf(firstChar.toUpperCase())
if (index != -1) {
return this.brandIndexList[index]
}
return '#'
},


+ 1
- 1
pages/manager/user.vue View File

@ -162,7 +162,7 @@ export default {
id: user.id,
name: user.name || user.nickName || '-',
phone: user.phone || '-',
role: user.isTuiRole === 'Y' ? '推广官' : '',
role: user.isUser === 'Y' ? '推广官' : '',
blocked: user.isBlack === 'Y',
avatar: user.headImage || user.avatar || user.avatarUrl || ''
}));


+ 1
- 1
pages/subcomponent/detail.vue View File

@ -364,7 +364,7 @@ export default {
this.clothesList = res.result.commonOrderList || []
this.expressCompany = res.result.wliu || ''
this.expressNo = res.result.expressNo || ''
this.phone = res.result.phone || ''
this.phone = res.result.deliveryPhone || ''
//
this.setOrderStatus(res.result.status, res.result.state, res.result)
}


+ 6
- 4
pages/subcomponent/promo-qrcode.vue View File

@ -22,7 +22,7 @@
<!-- 二维码区 -->
<view class="qrcode-modal-section">
<image class="qrcode-img" :src="qrcodeUrl" mode="aspectFit" />
<view class="invite-code">邀请码{{inviteCode}}</view>
<!-- <view class="invite-code">邀请码{{inviteCode}}</view> -->
</view>
<!-- 底部按钮 -->
<view class="bottom-btns-modal">
@ -55,6 +55,8 @@ export default {
this.statusBarHeight = sysInfo.statusBarHeight
this.navBarHeight = 44
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
//
this.qrcodeUrl = getApp().globalData.configData.qr_path
},
methods: {
async onRefresh() {
@ -142,13 +144,13 @@ export default {
}
.qrcode-modal-section {
margin-top: 48rpx;
width: 80vw;
width: 120vw;
display: flex;
flex-direction: column;
align-items: center;
.qrcode-img {
width: 80vw;
height: 80vw;
width: 100%;
height: 100%;
max-width: 480rpx;
max-height: 480rpx;
background: #fff;


+ 7
- 3
pages/subcomponent/promotion.vue View File

@ -6,7 +6,7 @@
<view class="back-icon" @tap="navigateBack">
<uni-icons type="left" size="22" color="#222" />
</view>
<view class="nav-bar-title">回收侠·推客联盟</view>
<view class="nav-bar-title">爱简收·推客联盟</view>
<view class="nav-bar-right">
<uni-icons type="more-filled" size="22" color="#222" />
</view>
@ -93,7 +93,7 @@
<!-- 底部按钮区 -->
<view class="bottom-btns">
<button class="btn gray" @tap="goQrcode">我的二维码</button>
<button class="btn green" @tap="goUpgrade" v-if="status===''">立即升级推广官</button>
<button class="btn green" @tap="goUpgrade" v-if="status== 3">立即升级推广官</button>
<button class="btn gray" v-if="status==0" @tap="showProgressModal = true">查看申请进度</button>
</view>
<!-- 申请进度弹窗 -->
@ -223,9 +223,13 @@ export default {
getMyPromotionInfo(){
this.$api('getMyPromotionInfo', {}, (res) => {
if (res && res.success && res.result) {
// console.log(res.result,'res.result')
if (res.result.status == 0) {
this.status = res.result.status
console.log(this.status,'this.status')
}
}else{
this.status = 3
console.log(this.status,'this.status')
}
})
},


+ 2
- 0
pages/subcomponent/select.vue View File

@ -296,6 +296,8 @@ export default {
if (!this.form.phone) return uni.showToast({ title: '请输入手机号', icon: 'none' })
if (!this.form.address) return uni.showToast({ title: '请选择地区', icon: 'none' })
if (!this.form.addressDetails) return uni.showToast({ title: '请输入详细地址', icon: 'none' })
//
if (!/^1[3-9]\d{9}$/.test(this.form.phone)) return uni.showToast({ title: '请输入正确的手机号', icon: 'none' })
const params = {
name: this.form.name,
phone: this.form.phone,


+ 40
- 7
pages/subcomponent/withdraw.vue View File

@ -1,9 +1,24 @@
<template>
<view class="withdraw-container">
<!-- 顶部banner轮播图 -->
<view class="banner">
<swiper
:indicator-dots="false"
:autoplay="true"
:interval="3000"
:duration="500"
circular
style="width: 100%; height: 390rpx;"
>
<swiper-item v-for="(item, index) in bannerList" :key="item.id || index">
<image v-if="item.image" :src="item.image" mode="aspectFill" style="width: 100%; height: 100%;" />
</swiper-item>
</swiper>
</view>
<!-- 顶部自适应导航栏 -->
<view class="nav-bar" :style="{height: (statusBarHeight + 88) + 'rpx', paddingTop: statusBarHeight + 'px'}">
<view class="nav-bar">
<view class="back" @tap="goBack">
<uni-icons type="left" size="22" color="#222"></uni-icons>
<uni-icons type="left" size="20"></uni-icons>
</view>
<text class="title">提现</text>
</view>
@ -11,7 +26,7 @@
<!-- 主内容卡片 -->
<view
class="main-card"
:style="{marginTop: (statusBarHeight + 88 + 32) + 'rpx', marginLeft: '24rpx', marginRight: '24rpx'}"
:style="{marginLeft: '24rpx', marginRight: '24rpx'}"
>
<view class="section-title">微信提现</view>
<view class="form-group">
@ -73,18 +88,18 @@ export default {
mixins: [pullRefreshMixin],
data() {
return {
statusBarHeight: 0,
realName: '',
amount: '',
showNoticePopup: false,
fromPromotion: false
fromPromotion: false,
bannerList: []
}
},
onLoad(options) {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
if (options && options.fromPromotion === 'true') {
this.fromPromotion = true
}
this.bannerList = getApp().globalData.bannerList || []
},
methods: {
async onRefresh() {
@ -123,16 +138,33 @@ export default {
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
}
.banner {
width: 100%;
height: 390rpx;
position: relative;
overflow: hidden;
border-radius: 0 0 30rpx 30rpx;
margin-bottom: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.nav-bar {
display: flex;
align-items: center;
height: calc(150rpx + var(--status-bar-height));
padding: 0 32rpx;
padding-top: var(--status-bar-height);
background: #fff;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 999;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.02);
box-sizing: border-box;
}
.back {
padding: 20rpx;
@ -152,6 +184,7 @@ export default {
box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.06);
padding: 48rpx 36rpx 32rpx 36rpx;
position: relative;
margin-top: calc(150rpx + var(--status-bar-height) + 32rpx);
}
.section-title {
font-size: 34rpx;


+ 3
- 0
pages/wxUserInfo.vue View File

@ -88,6 +88,9 @@ export default {
})) {
return
}
if (uni.getStorageSync('shareId')) {
self.userInfo.shareId = uni.getStorageSync('shareId')
}
self.$api('updateInfo', self.userInfo, res => {
console.log(res, self.userInfo);


Loading…
Cancel
Save