太原网站建设世纪优创,国内优秀企业网站设计,网站首页做几个关键词,电子东莞网站建设1.分类图书
2.书单推荐
4.会员卡次、期限购买
5.借阅时间选择
6.积分签到
7.优惠Q领取
前端uniapp开发 后端thinkphp开发 完全开源 template view classsp-section sp-index !-- search -- view classtemplate view classsp-section sp-index !-- search -- view classsp-index__search clickjumpTo(pages/index/search) input typetext placeholder书籍名称/作者名称 placeholder-classsp-index__search-desc readonly / /view !-- back -- view classsp-index__back/view !-- banner -- view classsp-index__swiper swiper :indicator-dotsswiper.indicatorDots :autoplayswiper.autoplay :intervalswiper.interval :durationswiper.duration swiper-item v-for(item, $index) in info.rotation_chart :key$index image :srcitem.rotation_image clickjumpToDetail(item)/image /swiper-item /swiper /view !-- grid -- view classsp-index__menu view classsp-index__menu-item v-for(item, $index) in info.age :key$index clicksetCategory($index) image :srcitem.age_img/image text{{ item.age }}/text /view /view !-- ads -- view classsp-index__link view classsp-index__link-item clickjumpTo(pages/mine/member) text成为会员/text text畅享多重特权福利/text /view view classsp-index__link-item clickjumpTo(pages/mine/article) text租借流程/text text便捷租书运送快/text /view /view !-- ads -- view classsp-index__ad v-ifinfo.index_img info.index_img.index_img image :srcinfo.index_img.index_img clickjumpTo(pages/mine/member)/image /view !-- 推荐书单 -- view classsp-index__boxes view classsp-index__title text classsp-index__title-main推荐书单/text text classsp-index__title-more clickjumpTo(pages/book/series)更多gt;/text /view scroll-view :scroll-xtrue classsp-index__hot view classsp-index__hot-item v-for(item, $index) in info.book_menu :key$index clickjumpTo(pages/book/list?id item.id) view classsp-index__hot-back/view view classsp-index__hot-pics image v-for(book, $book) in item.book_list :key$book :srcbook.book_img/image /view view classsp-index__hot-info{{ item.menu_name }}/view /view /scroll-view /view !-- 系列精品 -- view classsp-index__boxes view classsp-index__title text classsp-index__title-main系列精品/text /view view classsp-index__list view classsp-index__list-item v-foritem in info.book_series :keyitem.id clickjumpTo(pages/book/series?id item.id) view classsp-index__list-info text{{ item.series_name }}/text text{{ item.series_synopsis }}/text /view view classsp-index__list-pics image :srcitem.series_img/image /view /view /view /view !-- 推荐图书 -- view classsp-index__boxes view classsp-index__title text classsp-index__title-main推荐图书/text /view view classsp-index__goods sp-goods v-for(item, $index) in info.books :key$index :index$index :infoitem / /view /view !-- section classsp-groods__row sp-index__goods sp-goods / /section -- !-- 用户信息 -- view classsp-index__user v-ifshowUsers !info.users || info.users.age 0 view classsp-index__user-content view classsp-index__user-icon/view image src../../static/images/index/back.png modewidthFix/image view classsp-index__user-title填写宝贝信息/view view classsp-index__user-form view classsp-index__user-item label宝贝昵称/label input typetext placeholder请输入宝贝昵称 v-modeluser.username /view view classsp-index__user-item label宝贝性别/label view classsp-index__user-sex view classsp-index__user-man :class{ active: user.sex 男 } click() { user.sex 男 } /view view classsp-index__user-woman :class{ active: user.sex 女 } click() { user.sex 女 } /view /view /view view classsp-index__user-item label宝贝年龄/label input typetext placeholder请输入宝贝年龄 v-modeluser.age /view view classsp-index__user-type label喜欢的图书类型/label view classsp-index__user-classify text v-for(item, $index) in navs :key$index :class{ checked: item.checked } clicksetNavsChecked($index) {{ item.class_name }}/text /view /view /view view classsp-index__user-button clicksaveUserInfo完成/view /view /view !-- 碳层 -- view classsp-index__mask v-ifshowPopup view classsp-index__mask-image image :srcinfo.index_img.index_popup clicktoPopupDetail/image view classsp-index__mask-close clickclosePopup/view /view /view !-- fixed 客服 -- sp-contact / !-- 登录 -- u-popup v-modelshow modebottom borderRadius24 :closeabletrue sp-login v-if!isUser completegetLoginComplete / /u-popup /view /template
script export default { name: MemberIndex, data () { return { show: false, info: {}, isUser: true, swiper: { indicatorDots: true, autoplay: true, interval: 2000, duration: 500 }, navs: [], user: { username: , sex: , age: , id: }, showUsers: false, showPopup: false } }, onLoad () { // this.setLogin() }, onShow () { // this.getInitData() const userId uni.getStorageSync(userId) this.isUser userId ? true : false this.show userId ? false : true if (this.isUser) { this.getInitData(userId) } this.getCategory() setTimeout(() { this.showPopup uni.getStorageSync(showPopup) ? uni.getStorageSync(showPopup) : false }, 500) }, created () {}, mounted () { }, methods: { // 点击年龄跳转 setCategory (index) { uni.setStorageSync(ageIndex, index) uni.switchTab({ url: /pages/book/category }) }, // popup跳转 toPopupDetail () { uni.navigateTo({ url: this.info.index_img.index_popup_url }) }, // 关闭popup closePopup () { this.showPopup false uni.setStorageSync(showPopup, false) }, // 保存 async saveUserInfo() { const params this.user params.book_interest this.navs.filter(item item.checked).map(item item.id) if (params.username ) { this.$u.toast(请填写宝宝昵称) return false } if (params.sex ) { this.$u.toast(请选择宝宝性别) return false } if (params.age ) { this.$u.toast(请选择宝宝年龄) return false } if (params.book_interest ) { this.$u.toast(请选择图书类型) return false } const userId uni.getStorageSync(userId) params.user_id userId delete params.id const { code, data } await this.$u.api.IndexApi.setModalInfo(params) console.log(saveUsers, code, data) if (code 200) { const userId uni.getStorageSync(userId) this.getInitData(userId) } }, // 获取1级分类 async getCategory () { const { code, data } await this.$u.api.IndexApi.getFirsetCategory() if (code 200) { this.navs data.first_class.map(item { item.checked false return item }) } }, setNavsChecked(index) { this.navs[index].checked !this.navs[index].checked }, jumpTo(val) { this.$u.route(val) }, // 跳转到书籍详情 jumpToDetail (item) { // join_type: 1, // 0不关联,1书籍详情,2推荐书单详情,3系列精品详情,4推广页面 if (item.join_type 0 || item.book_id 0) { return false } else if (item.join_type 1) { uni.navigateTo({ url: /pages/book/detail?id item.book_id }) } else if (item.join_type 2) { uni.navigateTo({ url: /pages/book/list?id item.book_id }) } else if (item.join_type 3) { uni.navigateTo({ url: /pages/book/series?id item.book_id }) } else if (item.join_type 4) { uni.navigateTo({ url: /pages/mine/qrcodeExtension }) } else { return false } }, // 出发获取首页 getLoginComplete () { const userId uni.getStorageSync(userId) this.isUser userId ? true : false this.show userId ? false : true // this.isUser true this.getInitData(userId) }, // 获取首页信息 async getInitData (id) { const { code, data } await this.$u.api.IndexApi.getIndexInfo(id) if (code 200) { this.info data this.showUsers this.info.users.age 0 this.showPopup this.info.users.age 1 } } }, onShareAppMessage () {} }