Browse Source

初始化

master
jianglong 3 years ago
parent
commit
c991b82a87
  1. 23
      api/community.js
  2. 1
      bundle/pages/address_edit/address_edit.vue
  3. 49
      bundle_b/pages/community_detail/community_detail.vue
  4. 58
      bundle_b/pages/published_works/published_works.vue
  5. 2
      components/community-recommend/community-recommend.vue
  6. 2
      components/index-home/index-home.vue
  7. 17
      pages.json
  8. 19
      pages/community/community.vue
  9. 26
      pages/community/components/explore.vue
  10. 6
      pages/community/components/follow.vue
  11. 20
      pages/community/components/like-header.vue
  12. 6
      pages/community/components/lists.vue
  13. 39
      pages/user/vip.vue

23
api/community.js

@ -40,6 +40,12 @@ export function getCommunityCate() {
return request.get("community/cate")
}
// 分类
export function getCommunityCate2(params) {
return request.get("community/cate",{params})
}
// 发现页文章列表
export function getCommunityArticleLists(params) {
return request.get("community/articleLists", {params})
@ -129,3 +135,20 @@ export function getCommunitySearchHistory() {
export function apiCommunityClearSearchHistory() {
return request.post("community_search/clear")
}
// 发现页文章列表
export function getOrganLists(params) {
return request.get("community/organLists", {params})
}
// 发现页文章列表
export function getTeamLists(params) {
return request.get("community/teamLists", {params})
}
// 发现页文章列表
export function getTeamOrganDetail(params) {
return request.get("community/organTeamDetail", {params})
}

1
bundle/pages/address_edit/address_edit.vue

@ -139,6 +139,7 @@
}
},
regionChange(region) {
console.log(region)
this.addressObj.province_id = region[0].value;
this.addressObj.city_id = region[1].value;
this.addressObj.district_id = region[2].value;

49
bundle_b/pages/community_detail/community_detail.vue

@ -59,37 +59,52 @@
<!-- 提到的宝贝( 商品 ) -->
<view class="goods-box bb flex row-between" @click="showGoodsPopup=true"
<!-- <view class="goods-box bb flex row-between" @click="showGoodsPopup=true"
v-if="communityInfo.goods_data.length">
<text class="nr lighter">查看TA提到的宝贝({{communityInfo.goods_data.length}})</text>
<text class="nr lighter">查看TA提到的宝贝({{communityInfo.goods_data.length}})</text> -->
<!-- <text class="tips xs">300+人评价</text> -->
<view class="goods flex">
<!-- <view class="goods flex">
<block v-for="(goodsItem, goodsIndex) in communityInfo.goods_data" :key="goodsIndex">
<u-image v-if="goodsIndex<=2" :src="goodsItem.image" width="58" height="58" class="m-l-6">
</u-image>
</block>
<u-icon name="arrow-right" class="m-l-10"></u-icon>
</view>
</view>
</view> -->
<!-- 提到的店铺( 店铺 ) -->
<view class="goods-box bb flex row-between" @click="showShopPopup=true"
<!-- <view class="goods-box bb flex row-between" @click="showShopPopup=true"
v-if="communityInfo.shop_data.length">
<text class="nr lighter">查看TA提到的店铺({{communityInfo.shop_data.length}})</text>
<text class="nr lighter">查看TA提到的店铺({{communityInfo.shop_data.length}})</text> -->
<!-- <text class="tips xs">300+人评价</text> -->
<view class="goods flex">
<!-- <view class="goods flex">
<block v-for="(shopItem, shopIndex) in communityInfo.shop_data" :key="shopIndex">
<u-image v-if="shopIndex<=2" :src="shopItem.logo" width="58" height="58" class="m-l-6">
</u-image>
</block>
<u-icon name="arrow-right" class="m-l-10"></u-icon>
</view>
</view>
</view> -->
<!-- 内容文字 -->
<view class="content">
<view class="text">
{{ communityInfo.content }}
<view class="text" >
<text>任务类型{{communityInfo.clabel}} </text>
</view>
<view class="text" >
<text>联系人{{communityInfo.contact_name}} </text>
</view>
<view class="text" >
<text>联系方式{{communityInfo.contact}} </text>
</view>
<view class="text" >
<text>联系时间{{communityInfo.contact_time}} </text>
</view>
<view class="xs muted" style="margin-top: 12rpx;">
发布时间{{ communityInfo.create_time || '2023-05-20 05:13:14' }}
</view>
<view class="text" style="margin-top: 12rpx;">
内容{{ communityInfo.content }}
</view>
<view class="tags" v-if="communityInfo.topic">
<navigator hover-class="none"
@ -97,15 +112,14 @@
<text># {{ communityInfo.topic.name }}</text>
</navigator>
</view>
<view class="xs muted">
{{ communityInfo.create_time || '2022-05-20 05:13:14' }}
</view>
</view>
</view>
<!-- Main End -->
<!-- Comment Start -->
<view class="comment-box m-t-20 bg-white">
<!-- <view class="comment-box m-t-20 bg-white">
<view class="comment-title bb" id="comment">
评价 ({{ communityInfo.total_comment || '0' }})
</view>
@ -131,21 +145,16 @@
<community-comment-list :comment="commentItem" @reply="onReply">
</community-comment-list>
</block>
<!-- 加载 -->
<view class="flex row-center primary nd p-50" v-if="more === 1 && loading">
<u-loading :color="colorConfig.primary" :size="40" mode="circle"></u-loading>
<text class="m-l-20">加载中</text>
</view>
<!-- 加载底部 -->
<view class="text-center muted nd p-50" v-else>
<text>没有更多了~</text>
</view>
</template>
</template>
</view>
<!-- Comment End -->
<!-- Footer Start -->
<view class="footer flex bg-white">
<view class="content-wrapper flex row-between">
<view class="flex-1 flex" @click="handleComment">
@ -162,7 +171,7 @@
<text>{{ communityInfo.total_comment || '0' }}</text>
</view>
</view>
</view>
</view> -->
<!-- Footer End -->
<!-- 管理 -->

58
bundle_b/pages/published_works/published_works.vue

@ -29,14 +29,14 @@
</u-field>
</view>
<!-- 联系人姓名 -->
<view class="apply-form-item">
<u-field label="联系我" v-model="formData.contact" label-width="160" placeholder="请输入联系人" />
</view>
<view class="apply-form-item">
<u-field label="联系我" v-model="formData.contact" label-width="160" placeholder="请输入联系人" />
</view>
<!-- 手机号码 -->
<view class="apply-form-item">
<u-field label="联系方式" v-model="formData.contact_name" label-width="160" placeholder="请输入联系方式" />
</view>
<!-- 手机号码 -->
<view class="apply-form-item">
<u-field label="联系方式" v-model="formData.contact_name" label-width="160" placeholder="请输入联系方式" />
</view>
<!-- 手机号码 -->
<view class="apply-form-item">
@ -44,7 +44,7 @@
</view>
<!-- 宝贝推荐 店铺推荐-->
<view class="item flex row-between recommend" @click="showRecommend">
<!-- <view class="item flex row-between recommend" @click="showRecommend">
<view class="flex nr normal">
<image src="/bundle_b/static/icon_recommend.png" class="image m-r-10"></image>
<text v-if="formData.shop.length===0 && formData.goods.length===0">商品/店铺</text>
@ -68,7 +68,7 @@
</template>
<u-icon name="arrow-right" size="22" color="#707070" class="m-l-10" />
</view>
</view>
</view> -->
@ -107,9 +107,10 @@
<!-- 组件 话题 -->
<topic v-model="showTopicPopup" @change="handleTopic"></topic>
<u-select v-model="showPop" mode="single-column" value-name="id" label-name="name" :list="CommunityCateLists"
<!-- <u-select v-model="showPop" mode="single-column" value-name="id" label-name="name" :list="CommunityCateLists"
@confirm="confirmSelect"></u-select> -->
<u-select v-model="showPop" mode="mutil-column-auto" :list="CommunityCateLists"
@confirm="confirmSelect"></u-select>
</view>
</template>
@ -234,17 +235,36 @@
//
getCommunityCate() {
getCommunityCate().then(res => {
this.CommunityCateLists = res.data;
let catedata = [
{"value":0,"label":"需求","children":[]},
{"value":1,"label":"服务","children":[]},
]
res.data.forEach((item) => {
let tmp = {}
tmp.value = item.id;
tmp.label = item.name;
if(item.type == 0 ) {
catedata[0]['children'].push(tmp)
}else{
catedata[1]['children'].push(tmp)
}
})
console.log(catedata,222)
this.CommunityCateLists = catedata;
})
},
confirmSelect(e) {
const {
value,
label
} = e[0]
this.formData.cate_id = value
this.formData.clabel = label
console.log("表单:",this.formData)
// const {
// value,
// label
// } = e[0]
// this.formData.cate_id = value
// this.formData.clabel = label
// console.log("",this.formData)
this.formData.cate_id = e[1].value;
this.formData.clabel = e[0].label + "-" + e[1].label
},
//

2
components/community-recommend/community-recommend.vue

@ -3,7 +3,7 @@
<view class="active-hd flex row-between" v-if="title">
<view class="xxl bold">{{title}}</view>
<router-link :to="url" navType="pushTab">
<view class="sm">发现好物 <u-icon name="arrow-right"></u-icon>
<view class="sm">前往大厅 <u-icon name="arrow-right"></u-icon>
</view>
</router-link>
</view>

2
components/index-home/index-home.vue

@ -110,7 +110,7 @@
<!-- 种草社区 -->
<view class="m-t-20" v-if="appConfig.index_setting.community_show && communityArticle.length">
<community-recommend :list="communityArticle" title="种草社区" url="/pages/community/community"></community-recommend>
<community-recommend :list="communityArticle" title="服务大厅" url="/pages/community/community"></community-recommend>
</view>
<!-- 店铺 -->

17
pages.json

@ -82,7 +82,7 @@
"keepScroll": true
},
"style": {
"navigationBarTitleText": "铺街"
"navigationBarTitleText": "铺街"
}
},
{
@ -93,7 +93,18 @@
"keepScroll": true
},
"style": {
"navigationBarTitleText": "种草"
"navigationBarTitleText": "服务大厅"
}
},
{
"path": "pages/community/organ_team_details",
"name": "community2",
"meta": {
"auth": false,
"keepScroll": true
},
"style": {
"navigationBarTitleText": "专家机构详情"
}
},
{
@ -821,7 +832,7 @@
"auth": true
},
"style": {
"navigationBarTitleText": "发布文章"
"navigationBarTitleText": "发布任务"
}
},
{

19
pages/community/community.vue

@ -4,8 +4,14 @@
<like-header @change="handleNav" :current="currentNav" />
<view class="container">
<follow :active="currentNav" v-show="currentNav===0" @share="handleShare"></follow>
<!-- 发现 -->
<explore :active="currentNav" v-show="currentNav===1"></explore>
<!-- 找服务 -->
<explore :active="currentNav" v-show="currentNav===1" ></explore>
<!-- 找需求 -->
<xuqiu :active="currentNav" v-show="currentNav===2" ></xuqiu>
<!-- 检测机构 -->
<organ :active="currentNav" v-show="currentNav===3" ></organ>
<!-- 专家服务 -->
<team :active="currentNav" v-show="currentNav===4" ></team>
</view>
</template>
<template v-else>
@ -21,12 +27,18 @@
<script>
import LikeHeader from "./components/like-header.vue"
import Explore from "./components/explore.vue"
import Xuqiu from "./components/xuqiu.vue"
import Organ from "./components/organ.vue"
import Follow from "./components/follow.vue"
import Team from "./components/team.vue"
export default {
components: {
LikeHeader,
Explore,
Follow
Follow,
Xuqiu,
Organ,
Team
},
data() {
return {
@ -58,6 +70,7 @@
methods: {
handleNav(event) {
this.currentNav = Number(event)
console.log(this.currentNav,333)
},
//
handleShare(event) {

26
pages/community/components/explore.vue

@ -1,7 +1,7 @@
<template>
<view class="explore">
<!-- 搜索 -->
<view>
<view >
<router-link
:to="{path: '/bundle_b/pages/community_search/community_search'}">
<u-search disabled
@ -13,7 +13,7 @@
<view class="content">
<tabs :current="current" @change="changeTabs" height="100" >
<tab v-for="(item, index) in tabList" :key="index" :name="item.name">
<lists :cateId="item.id" :i="index" :index="current"></lists>
<lists :cateId="item.id" :typeId="type" :i="index" :index="current"></lists>
</tab>
</tabs>
</view>
@ -22,7 +22,7 @@
<script>
import {
getCommunityCate,
getCommunityCate2,
getCommunityArticleLists
} from '@/api/community.js';
import Lists from "./lists.vue"
@ -30,15 +30,30 @@
components: {
Lists
},
props: {
active: {
type: Number
}
},
data() {
return {
tabList: [{
name: '全部',
id: ''
}],
current: 0
current: 0.,
type:1,
}
},
watch: {
active() {
if(this.active == 1){
this.initRecommendTopic()
this.mescroll.resetUpScroll()
}
}
},
created() {
this.initRecommendTopic()
},
@ -46,6 +61,7 @@
initMescroll(event) {
this.isInit = true; // true
this.mescroll = event;
},
handleCancel() {
this.keyword = '';
@ -56,7 +72,7 @@
},
//
initRecommendTopic() {
getCommunityCate().then(res => {
getCommunityCate2({'type':this.type}).then(res => {
if( res.code === 1 ) {
this.tabList = [{
name: '全部',

6
pages/community/components/follow.vue

@ -160,8 +160,10 @@
},
watch: {
active() {
uni.$emit('hasNew', 0)
this.mescroll.resetUpScroll()
if(this.active == 0){
uni.$emit('hasNew', 0)
this.mescroll.resetUpScroll()
}
}
},
created() {

20
pages/community/components/like-header.vue

@ -9,11 +9,24 @@
<text v-if="hasNew" class="new"></text>
</view>
<view class="mainnav--item" :class="{'active': current === 1}" @click="changeNav(1)">
<text>发现</text>
<text>服务</text>
</view>
<view class="mainnav--item" :class="{'active': current === 2}" @click="changeNav(2)">
<text>需求</text>
</view>
<view class="mainnav--item" :class="{'active': current === 3}" @click="changeNav(3)">
<text>机构</text>
</view>
<view class="mainnav--item" :class="{'active': current === 4}" @click="changeNav(4)">
<text>专家</text>
</view>
</view>
<view class="user flex row-right">
<router-link to="/bundle_b/pages/community_search/community_search">
<router-link to="/bundle_b/pages/community_search/community_search" >
<u-icon v-if="current==0" name="search" size="34" class="m-r-20"></u-icon>
</router-link>
<router-link to="/bundle_b/pages/community_user/community_user">
@ -33,7 +46,7 @@
current: {
type: Number,
default: 1
}
},
},
data() {
return {
@ -47,6 +60,7 @@
},
methods: {
changeNav(index) {
console.log(index)
if(!this.isLogin) return this.$Router.push('/pages/login/login')
this.$emit('change', index);
}

6
pages/community/components/lists.vue

@ -32,7 +32,10 @@
props: {
cateId: {
type: [String, Number]
}
},
typeId: {
type: [String, Number]
}
},
data() {
return {
@ -69,6 +72,7 @@
const pageSize = page.size
getCommunityArticleLists({
type:this.typeId,
cate_id: this.cateId,
page_no: pageNum,
page_size: pageSize,

39
pages/user/vip.vue

@ -144,7 +144,8 @@
org_id:0,
svip: null,
mc_id: 0,
initIn: false
initIn: false,
inPay:false
};
},
@ -213,13 +214,18 @@
menuJump(item)
},
pay() {
if (this.type === 'free') {
console.log("开启试用")
this.orderFreeBuyFun();
} else {
console.log("开启购买")
this.onSubmitOrder();
if(this.inPay){
return
}else{
if (this.type === 'free') {
console.log("开启试用")
this.orderFreeBuyFun();
} else {
console.log("开启购买")
this.onSubmitOrder();
}
}
},
scrollToCard() {
const query = uni.createSelectorQuery().in(this);
@ -336,7 +342,13 @@
msg: orderMsg
} = await userFreeOrderBuy(submitObj)
if (orderCode !== 1) return this.showLoading = false
if (orderCode !== 1) {
//true
this.inPay = false;
return this.showLoading = false
}
//true
this.inPay = false;
let msg = "开通会员成功"
this.showLoading = false
setTimeout(function () {
@ -346,6 +358,8 @@
},
async orderBuyFun() {
//true
this.inPay = true;
const submitObj = {
org_id: this.org_id //id
};
@ -355,9 +369,16 @@
msg: orderMsg
} = await userOrderBuy(submitObj)
if (orderCode !== 1) return this.showLoading = false
if (orderCode !== 1) {
//true
this.inPay = false;
this.showLoading = false
return
}
this.showLoading = false
let order_id = orderData.trade_id;
//true
this.inPay = false;
uni.$on('payment', params => {
setTimeout(() => {

Loading…
Cancel
Save