【个人中心】

1、进入自己实现的店铺装修
pull/1/MERGE
YunaiV 2023-08-19 15:40:30 +08:00
parent e452f7cb19
commit 330e508900
1 changed files with 54 additions and 87 deletions

View File

@ -49,7 +49,7 @@
<view class="txt">收藏</view> <view class="txt">收藏</view>
</view> </view>
</view> </view>
<!-- <view class="sign" @click="goSignIn"></view> --> <view class="sign" @click="goSignIn"></view>
</view> </view>
<view class="order-wrapper"> <view class="order-wrapper">
<view class="order-hd flex"> <view class="order-hd flex">
@ -73,14 +73,15 @@
</view> </view>
</view> </view>
</view> </view>
<view class="contenBox"> <view class="contenBox">
<!-- 轮播 --> <!-- 轮播 -->
<view class="slider-wrapper" v-if="imgUrls.length>0"> <view class="slider-wrapper" v-if="slideShows.length>0">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" <swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff"> :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index"> <block v-for="(item,index) in slideShows" :key="index">
<swiper-item class="borRadius14"> <swiper-item class="borRadius14">
<image :src="item.pic" class="slide-image" @click="navito(item.url)"></image> <image :src="item.picUrl" class="slide-image" @click="navito(item.url)"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -90,13 +91,14 @@
<view class="user-menus" style="margin-top: 20rpx;"> <view class="user-menus" style="margin-top: 20rpx;">
<view class="menu-title">我的服务</view> <view class="menu-title">我的服务</view>
<view class="list-box"> <view class="list-box">
<block v-for="(item,index) in MyMenus" :key="index"> <block v-for="(item,index) in menus" :key="index">
<navigator class="item" :url="item.url" hover-class="none" <navigator class="item" :url="item.url" hover-class="none"
v-if="!(item.url =='/pages/service/index' || (item.url =='/pages/users/user_spread_user/index' && !userInfo.isPromoter))"> v-if="!(item.url ==='/pages/service/index' || (item.url === '/pages/users/user_spread_user/index' && !userInfo.isPromoter))">
<image :src="item.pic"></image> <image :src="item.picUrl"></image>
<text>{{item.name}}</text> <text>{{ item.name }}</text>
</navigator> </navigator>
</block> </block>
<!-- TODO 芋艿以后联系客服的方式重新搞下 -->
<!-- #ifndef MP --> <!-- #ifndef MP -->
<view class="item" @click="kefuClick"> <view class="item" @click="kefuClick">
<image :src="servicePic"></image> <image :src="servicePic"></image>
@ -111,39 +113,26 @@
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
<image src="/static/images/support.png" alt="" class='support'> <image src="/static/images/support.png" alt="" class='support' />
<view class="uni-p-b-98"></view> <view class="uni-p-b-98"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view> </view>
</template> </template>
<script> <script>
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import Cache from '@/utils/cache'; import Cache from '@/utils/cache';
import {BACK_URL} from '@/config/cache'; import { BACK_URL } from '@/config/cache';
import {getMenuList} from '@/api/user.js'; import { orderData } from '@/api/order.js';
import {orderData} from '@/api/order.js'; import { toLogin } from '@/libs/login.js';
import {toLogin} from '@/libs/login.js'; import { getCity } from '@/api/api.js';
import {getCity} from '@/api/api.js'; import { mapGetters } from "vuex";
import {mapGetters} from "vuex"; import * as DecorateApi from '@/api/promotion/decorate.js';
// #ifdef H5 const app = getApp();
import Auth from '@/libs/wechat';
// #endif
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
const app = getApp();
export default { export default {
components: { components: {
// #ifdef MP },
authorize
// #endif
},
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']), computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']),
data() { data() {
return { return {
@ -178,17 +167,14 @@
num: 0 num: 0
}, },
], ],
imgUrls: [],
userMenu: [], slideShows: [], //
autoplay: true, circular: true,
circular: true, interval: 3000,
interval: 3000, duration: 500,
duration: 500, menus: [], //
isAuto: false, //
isShowAuth: false, // orderStatusNum: {},
orderStatusNum: {},
MyMenus: [],
wechatUrl: [],
servicePic: '/static/images/customer.png', servicePic: '/static/images/customer.png',
sysHeight: sysHeight, sysHeight: sysHeight,
// #ifdef MP // #ifdef MP
@ -197,23 +183,22 @@
// #ifdef H5 // #ifdef H5
pageHeight: app.globalData.windowHeight, pageHeight: app.globalData.windowHeight,
// #endif // #endif
// #ifdef H5
isWeixin: Auth.isWeixin()
//#endif
} }
}, },
onLoad() { onLoad() {
let that = this; if (!this.isLogin) {
// #ifdef H5
toLogin()
// #endif
}
// #ifdef H5 // #ifdef H5
that.$set(that, 'pageHeight', app.globalData.windowHeight); this.$set(this, 'pageHeight', app.globalData.windowHeight);
// #endif // #endif
that.$set(that, 'MyMenus', app.globalData.MyMenus); this.$set(this, 'menus', app.globalData.MyMenus);
if (!this.$Cache.has('cityList')) this.getCityList(); if (!this.$Cache.has('cityList')) {
if (that.isLogin == false) { this.getCityList();
// #ifdef H5 }
toLogin()
// #endif
}
}, },
onShow: function() { onShow: function() {
let that = this; let that = this;
@ -276,23 +261,6 @@
Cache.set(BACK_URL, '') Cache.set(BACK_URL, '')
toLogin(); toLogin();
}, },
//
onLoadFun() {
this.getMyMenus();
// this.setVisit();
this.getOrderData();
},
Setting: function() {
uni.openSetting({
success: function(res) {
console.log(res.authSetting)
}
});
},
//
authColse: function(e) {
this.isShowAuth = e
},
// //
bindPhone() { bindPhone() {
uni.navigateTo({ uni.navigateTo({
@ -300,24 +268,24 @@
}) })
}, },
/** /**
*
* 获取个人中心图标 * 获取个人中心图标
*/ */
getMyMenus: function() { getMyMenus: function() {
let that = this; if (this.menus.length > 0) {
if (this.MyMenus.length) return; return;
getMenuList().then(res => { }
that.$set(that, 'MyMenus', res.data.routine_my_menus); DecorateApi.getDecorateComponentListByPage(2).then(res => {
that.wechatUrl = res.data.routine_my_menus.filter((item) => { //
return item.url.indexOf('service') !== -1 const slideShow = res.data.find(item => item.code === 'slide-show');
}) if (slideShow) {
res.data.routine_my_menus.map((item) => { this.$set(this, "slideShows", JSON.parse(slideShow.value));
if (item.url.indexOf('service') !== -1) that.servicePic = item.pic }
}) //
if(res.data.routine_my_banner){ const menu = res.data.find(item => item.code === 'menu');
that.imgUrls = res.data.routine_my_banner if (menu) {
} this.$set(this, "menus", JSON.parse(menu.value));
}); }
})
}, },
// //
goEdit() { goEdit() {
@ -362,7 +330,6 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page, page,
body { body {
@ -526,7 +493,7 @@
padding: 30rpx 16rpx; padding: 30rpx 16rpx;
position: relative; position: relative;
z-index: 11; z-index: 11;
.order-hd { .order-hd {
justify-content: space-between; justify-content: space-between;
font-size: 30rpx; font-size: 30rpx;