Browse Source

咨询

master
unknown 1 year ago
parent
commit
ad341977f0
  1. 10
      config/api.js
  2. 2
      config/site.config.js
  3. 35
      pages/indexEntry/consult/pubConsult/pubConsult.vue
  4. 71
      pages/indexEntry/publicVideo/videoDetail/videoDetail.vue
  5. 2
      pages/tabbar/index/index.vue

10
config/api.js

@ -22,8 +22,14 @@ export const publicVideoPage = (params) => http.get('business/video/page', {para
export const publicGetvideo = (params) => http.get('business/video/getvideo', {params: params})
// 公益视频点赞
export const createUpvote = (data) => http.post('business/contentdata/createUpvote', data)
// 公益视频取消点赞 upvoteId
export const deleteUpvote = (data) => http.delete(`/business/contentdata/deleteUpvote?upvoteId=${data.upvoteId}&mobile=${data.mobile}`)
// 公益视频收藏
export const createCollect = (data) => http.post('business/contentdata/createCollect', data)
// 公益视频取消收藏 CollectId
export const deleteRetransmission = (data) => http.delete(`business/contentdata/deleteCollect?collectId=${data.CollectId}&mobile=${data.mobile}`)
// 公益视频分享
export const createRetransmission = (data) => http.post('business/contentdata/createRetransmission', data)
// 公益视频是否点赞收藏
export const getlikesCollection = (params) => http.get('business/users/getContent', {params: params})
// 行业资讯,
@ -32,6 +38,10 @@ export const getarticleList = (params) => http.get('business/video/article', {pa
export const getarticlezcList = (params) => http.get('business/video/articlezc', {params: params})
// 行业资讯,行业政策 详情
export const getarticle = (params) => http.get('business/video/getarticle', {params: params})
// 创建咨询
export const createconsult = (data) => http.post('business/appcomplain/createconsult', data)
// 上传图片
export const uploadImg = (data) => http.post('infra/file/upload', data)
// 驾照类型
export const licenseType = () => http.get('system/dict/licenseType', )

2
config/site.config.js

@ -2,7 +2,7 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false
module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',//非代理地址
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.36:48080/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.26:48080/',
httpPrefix: 'app-api/',
imgUrl: 'http://jxtemp.oss-cn-hangzhou.aliyuncs.com/defaultImages/app/bigImg/'

35
pages/indexEntry/consult/pubConsult/pubConsult.vue

@ -35,20 +35,20 @@
<view class="card" style="padding-bottom: 0;">
<view class="phone_row">
<view class="label">联系电话</view>
<view class="uInput my">
<u--input placeholder="输入手机号码,以便我们回复您!" v-model="value" border="none" type="number" fontSize="14"></u--input>
</view>
<view class="uInput my">{{ this.vuex_userInfo.mobile }}</view>
</view>
</view>
<view class="btn active">提交</view>
<view class="btn active" @click="submintFn">提交</view>
</view>
</view>
</template>
<script>
import { APP_API, APP_HOST } from '@/site.config.js';
const _url = APP_HOST + APP_API + '/util/manage/uploadFile.do';
import { WX_API, H5_API } from '@/config/site.config.js';
import { createconsult } from '@/config/api.js'
var _url = H5_API+ WX_API
// let url = 'api'
export default {
data() {
return {
@ -56,7 +56,20 @@
imgArr: [],
}
},
onLoad() {
this.value = this.vuex_userInfo.mobile
},
methods: {
async submintFn() {
let obj = {
images: 'abc.png',
studentPhone: this.vuex_userInfo.mobile,
type: 1,
studentId: this.$store.state.user.vuex_loginInfo.userId
}
const {data: res} = await createconsult(obj)
},
//
chooseImages(type) {
let imgNum = 3 - (this.imgArr.length)
@ -76,10 +89,11 @@
},
uploadImgApi(filePath) {
console.log(filePath)
let token = 'Bearer '+ this.$store.state.user.vuex_loginInfo.accessToken
let _this = this
//
uni.uploadFile({
url: _url,//
url: _url + 'infra/file/upload',//
filePath: filePath,//
name: 'file',
@ -88,7 +102,8 @@
fileSuffix: "png"
},
header: {
token: uni.getStorageSync("Authorization") || '',
Authorization: token,
'tenant-id': 1
},
success(res) {
console.log('上传成功')
@ -97,7 +112,9 @@
console.log(res2)
uni.hideLoading();
},
complete: ()=> {}
complete: (err)=> {
console.log(err)
}
})
},
}

71
pages/indexEntry/publicVideo/videoDetail/videoDetail.vue

@ -14,26 +14,35 @@
</view>
</view>
<view class="operate">
<view class="operateItem" @click="likeFn">
<view class="icon">
<image src="/static/images/index/dianzan_nor.png" mode=""></image>
<!-- <image src="/static/images/index/dianzan_cli.png" mode=""></image> -->
<view class="operateWith">
<view class="operateItem" @click="likeFn">
<view class="icon">
<image src="/static/images/index/dianzan_nor.png" mode="" v-if="!operateInfo.upvote"></image>
<image src="/static/images/index/dianzan_cli.png" mode="" v-else></image>
</view>
<view class="txt">点赞</view>
</view>
<view class="txt">点赞</view>
</view>
<view class="operateItem" @click="createCollectFn">
<view class="icon">
<image src="/static/images/index/shoucang_nor.png" mode=""></image>
<!-- <image src="/static/images/index/shoucang_cli.png" mode=""></image> -->
<view class="operateWith">
<view class="operateItem" @click="createCollectFn">
<view class="icon">
<image src="/static/images/index/shoucang_nor.png" mode="" v-if="!operateInfo.collect"></image>
<image src="/static/images/index/shoucang_cli.png" mode="" v-else></image>
</view>
<view class="txt">收藏</view>
</view>
<view class="txt">收藏</view>
</view>
<view class="operateItem">
<view class="icon">
<image src="/static/images/index/fenxiang_nor.png" mode=""></image>
<view class="operateWith">
<!-- #ifdef MP-WEIXIN -->
<view class="operateItem" @click="createRetransmissionFn">
<view class="icon">
<image src="/static/images/index/fenxiang_nor.png" mode=""></image>
</view>
<view class="txt">分享</view>
</view>
<view class="txt">分享</view>
<!-- #endif -->
</view>
</view>
<!-- <view class="videolist">
@ -53,11 +62,12 @@
<script>
import videoItem from '../comp/videoItem'
import { publicGetvideo, createUpvote, getlikesCollection, createCollect } from '@/config/api.js'
import { publicGetvideo, createUpvote, getlikesCollection, createCollect, createRetransmission, deleteUpvote, deleteRetransmission } from '@/config/api.js'
export default {
components: { videoItem },
data() {
return {
operateInfo: {},
id: '',
vdoDetail: {},
params: {}
@ -79,19 +89,33 @@
//
async getlikesCollection() {
const {data: res} = await getlikesCollection(this.params)
this.operateInfo = res
},
//
async likeFn() {
const {data: res} = await createUpvote(this.params)
if(this.operateInfo.upvote) {
await deleteUpvote({upvoteId: this.operateInfo.upvoteId,mobile: this.vuex_userInfo.mobile})
}else {
await createUpvote(this.params)
}
this.getlikesCollection()
console.log(res)
},
//
async createCollectFn() {
const {data: res} = await createCollect(this.params)
if(this.operateInfo.collect) {
await deleteRetransmission({mobile: this.vuex_userInfo.mobile, CollectId: this.operateInfo.collectId})
}else {
await createCollect(this.params)
}
this.getlikesCollection()
},
//
async createRetransmissionFn() {
const {data: res} = await createRetransmission(this.params)
this.getlikesCollection()
console.log(res)
},
}
}
</script>
@ -115,10 +139,15 @@
}
.operate {
display: flex;
justify-content: space-between;
// justify-content: space-between;
.operateWith {
flex: 1;
}
.operateItem {
width: 188rpx;
height: 132rpx;
margin: 0 auto;
background: #FFFFFF;
border-radius: 16rpx;
display: flex;

2
pages/tabbar/index/index.vue

@ -79,7 +79,7 @@
<view class="swiper-item" :class="'swiper-item' + index">
<view class="flex-b">
<view class="imgBox">
<image :src="item.picture" mode=""></image>
<image :src="item.picture" mode="widthFix"></image>
</view>
<view class="rightText">
<view class="text towRowText">{{ item.title }}</view>

Loading…
Cancel
Save