Browse Source

修改需求

master
岳鹏龙 8 months ago
parent
commit
28ac396cb4
  1. 41
      package-lock.json
  2. 3
      package.json
  3. 36
      src/api/index.ts
  4. 35
      src/api/learningCenter.ts
  5. 14
      src/api/memberCenter.ts
  6. 15
      src/api/mine.ts
  7. 63
      src/api/shop.ts
  8. 6
      src/api/user.ts
  9. 22
      src/components/zh-scroll/interface.ts
  10. 828
      src/components/zh-scroll/zh-scroll.vue
  11. 36
      src/main.ts
  12. 546
      src/pages/index/ChatDialog.vue
  13. 278
      src/pages/index/active/activeDetail.vue
  14. 358
      src/pages/index/active/activelist.vue
  15. 1446
      src/pages/index/index.vue
  16. 388
      src/pages/index/shoppage/financialAssistance.vue
  17. 699
      src/pages/index/shoppage/interactiveDetail.vue
  18. 673
      src/pages/index/shoppage/interactiveZone.vue
  19. 188
      src/pages/index/shoppage/jrbDetail.vue
  20. 300
      src/pages/index/shoppage/makeAssistance.vue
  21. 326
      src/pages/index/shoppage/mediaDetail.vue
  22. 463
      src/pages/index/shoppage/mediaHelp.vue
  23. 645
      src/pages/index/shoppage/mtbmakeMessage.vue
  24. 118
      src/pages/index/shoppage/shopHelp.vue
  25. 262
      src/pages/index/shoppage/shophelpDetail.vue
  26. 1091
      src/pages/index/specialSubject.vue
  27. 225
      src/pages/index/tabsComm.vue
  28. 153
      src/pages/index/ztdetail.vue
  29. 482
      src/pages/learningCenter/detail.vue
  30. 788
      src/pages/learningCenter/index.vue
  31. 46
      src/pages/learningCenter/useTimeDiff.js
  32. 214
      src/pages/login/login.vue
  33. 503
      src/pages/memberCenter/index.vue
  34. 1005
      src/pages/memberCenter/inpart.vue
  35. 165
      src/pages/mine/associatedDetail.vue
  36. 130
      src/pages/mine/associatedEnterprise.vue
  37. 531
      src/pages/mine/completeInformation.vue
  38. 341
      src/pages/mine/index.vue
  39. 363
      src/pages/mine/myApplication.vue
  40. 187
      src/pages/mine/myCourses.vue
  41. 698
      src/pages/mine/porsonalinfo.vue
  42. BIN
      src/static/img/aiback.png
  43. BIN
      src/static/img/aiimg.png
  44. BIN
      src/static/img/hdzq.png
  45. BIN
      src/static/img/xzs.png
  46. BIN
      src/static/tabbar/index_select.png
  47. 184
      src/store/user.ts
  48. 16
      src/utils/http.ts

41
package-lock.json

@ -28,6 +28,7 @@
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"echarts": "^5.5.0", "echarts": "^5.5.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"pnpm": "^10.14.0",
"sass": "^1.63.2", "sass": "^1.63.2",
"uview-plus": "^3.4.9", "uview-plus": "^3.4.9",
"vue": "^3.2.45", "vue": "^3.2.45",
@ -51,7 +52,6 @@
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.16.1", "eslint-plugin-vue": "^9.16.1",
"feng-uniapp-exploit": "^1.0.2", "feng-uniapp-exploit": "^1.0.2",
"husky": "^8.0.0",
"pinia-plugin-unistorage": "^0.0.17", "pinia-plugin-unistorage": "^0.0.17",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"sass-loader": "^10.4.1", "sass-loader": "^10.4.1",
@ -7431,20 +7431,6 @@
"node": ">=10.17.0" "node": ">=10.17.0"
} }
}, },
"node_modules/husky": {
"version": "8.0.3",
"dev": true,
"license": "MIT",
"bin": {
"husky": "lib/bin.js"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"dev": true, "dev": true,
@ -9840,6 +9826,22 @@
"node": ">=4.0.0" "node": ">=4.0.0"
} }
}, },
"node_modules/pnpm": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/pnpm/-/pnpm-10.14.0.tgz",
"integrity": "sha512-rSenlkG0nD5IGhaoBbqnGBegS74Go40X5g4urug/ahRsamiBJfV5LkjdW6MOfaUqXNpMOZK5zPMz+c4iOvhHSA==",
"license": "MIT",
"bin": {
"pnpm": "bin/pnpm.cjs",
"pnpx": "bin/pnpx.cjs"
},
"engines": {
"node": ">=18.12"
},
"funding": {
"url": "https://opencollective.com/pnpm"
}
},
"node_modules/possible-typed-array-names": { "node_modules/possible-typed-array-names": {
"version": "1.1.0", "version": "1.1.0",
"dev": true, "dev": true,
@ -17687,10 +17689,6 @@
"version": "2.1.0", "version": "2.1.0",
"dev": true "dev": true
}, },
"husky": {
"version": "8.0.3",
"dev": true
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"dev": true, "dev": true,
@ -19191,6 +19189,11 @@
"pngjs": { "pngjs": {
"version": "3.4.0" "version": "3.4.0"
}, },
"pnpm": {
"version": "10.14.0",
"resolved": "https://registry.npmjs.org/pnpm/-/pnpm-10.14.0.tgz",
"integrity": "sha512-rSenlkG0nD5IGhaoBbqnGBegS74Go40X5g4urug/ahRsamiBJfV5LkjdW6MOfaUqXNpMOZK5zPMz+c4iOvhHSA=="
},
"possible-typed-array-names": { "possible-typed-array-names": {
"version": "1.1.0", "version": "1.1.0",
"dev": true "dev": true

3
package.json

@ -42,7 +42,6 @@
"preinstall": "node ./auto/preinstall.js", "preinstall": "node ./auto/preinstall.js",
"lint": "eslint --ext .ts,.js,.vue ./src", "lint": "eslint --ext .ts,.js,.vue ./src",
"fix": "eslint --fix --ext .ts,.js,.vue ./src", "fix": "eslint --fix --ext .ts,.js,.vue ./src",
"prepare": "husky install",
"rm": "rm -rf node_modules package-lock.json pnpm-lock.yaml && pnpm install" "rm": "rm -rf node_modules package-lock.json pnpm-lock.yaml && pnpm install"
}, },
"dependencies": { "dependencies": {
@ -65,6 +64,7 @@
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"echarts": "^5.5.0", "echarts": "^5.5.0",
"pinia": "2.0.36", "pinia": "2.0.36",
"pnpm": "^10.14.0",
"sass": "^1.63.2", "sass": "^1.63.2",
"uview-plus": "^3.4.9", "uview-plus": "^3.4.9",
"vue": "^3.2.45", "vue": "^3.2.45",
@ -88,7 +88,6 @@
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.16.1", "eslint-plugin-vue": "^9.16.1",
"feng-uniapp-exploit": "^1.0.2", "feng-uniapp-exploit": "^1.0.2",
"husky": "^8.0.0",
"pinia-plugin-unistorage": "^0.0.17", "pinia-plugin-unistorage": "^0.0.17",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"sass-loader": "^10.4.1", "sass-loader": "^10.4.1",

36
src/api/index.ts

@ -17,60 +17,60 @@ export function bannerList() {
} }
//banner详情 //banner详情
export function bannerInfo(id:string) { export function bannerInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/banner_info/'+id, url: '/api/huiqitong/banner_info/' + id,
method: 'GET' method: 'GET'
}) })
} }
//活动列表 //活动列表
export function activityList(data:any) { export function activityList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/activity_list', url: '/api/huiqitong/activity_list',
method: 'GET', method: 'GET',
data data
}) })
} }
//活动详情 //活动详情
export function activityInfo(id:string) { export function activityInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/activity_info/'+id, url: '/api/huiqitong/activity_info/' + id,
method: 'GET', method: 'GET'
}) })
} }
//专题详情 //专题详情
export function specialInfo(id: string) { export function specialInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/special_info?special_id='+id, url: '/api/huiqitong/special_info?special_id=' + id,
method: 'GET' method: 'GET'
}) })
} }
//专题内容列表 //专题内容列表
export function specialList(id: string) { export function specialList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/special_list?special_id=1&page=1&limit=10', url: '/api/huiqitong/special_list',
method: 'GET' method: 'GET',
data
}) })
} }
//专题内容详情 //专题内容详情
export function specialListInfo(id: string) { export function specialListInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/special_list_info/'+id, url: '/api/huiqitong/special_list_info/' + id,
method: 'GET' method: 'GET'
}) })
} }
//ai客服 //ai客服
export function ai(data: any) { export function ai(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/ai', url: '/api/huiqitong/ai',
method: 'POST', method: 'POST',
data data
}) })
} }

35
src/api/learningCenter.ts

@ -9,63 +9,70 @@ export function myStudy() {
} }
//学习中心列表 //学习中心列表
export function studyCenter(recommend:string,title:string,type:string,page:string,limit:string) { export function studyCenter(recommend: string, title: string, type: string, page: string, limit: string) {
return request.http({ return request.http({
url: '/api/huiqitong/study_center?recommend='+recommend+'&title='+title+'&s_type='+type+'&page='+page+'&limit='+limit, url: '/api/huiqitong/study_center?recommend=' + recommend + '&title=' + title + '&s_type=' + type + '&page=' + page + '&limit=' + limit,
method: 'GET' method: 'GET'
}) })
} }
//学习中心详情 //学习中心详情
export function studyCenterDetail(id:string) { export function studyCenterDetail(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/study_center/'+id, url: '/api/huiqitong/study_center/' + id,
method: 'GET' method: 'GET'
}) })
} }
//收藏学习 //收藏学习
export function collect(data:{item_id:string}) { export function collect(data: { item_id: string }) {
return request.http({ return request.http({
url: '/api/huiqitong/collect', url: '/api/huiqitong/collect',
method: 'POST', method: 'POST',
data data
}) })
} }
//取消收藏 //取消收藏
export function removeCollect(data:{item_id:string}) { export function removeCollect(data: { item_id: string }) {
return request.http({ return request.http({
url: '/api/huiqitong/remove_collect', url: '/api/huiqitong/remove_collect',
method: 'POST', method: 'POST',
data data
}) })
} }
//增加观看次数 //增加观看次数
export function watchCount(data:{id:string}) { export function watchCount(data: { id: string }) {
return request.http({ return request.http({
url: '/api/huiqitong/watch_count', url: '/api/huiqitong/watch_count',
method: 'POST', method: 'POST',
data data
}) })
} }
//观看进度记录 //观看进度记录
export function studyRecord(data:any) { export function studyRecord(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/study_record', url: '/api/huiqitong/study_record',
method: 'POST', method: 'POST',
data data
}) })
} }
//是否收藏 //是否收藏
export function isCollect(data:any) { export function isCollect(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/is_collect', url: '/api/huiqitong/is_collect',
method: 'POST', method: 'POST',
data data
}) })
} }
//学习中心分类
export function studyCenterCategory() {
return request.http({
url: '/api/huiqitong/study_center_category',
method: 'GET'
})
}

14
src/api/memberCenter.ts

@ -9,28 +9,28 @@ export function memberTagList() {
} }
//会员列表 //会员列表
export function memberCenter(data:any) { export function memberCenter(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/member_center', url: '/api/huiqitong/member_center',
method: 'GET', method: 'GET',
data data
}) })
} }
//会员详情 //会员详情
export function memberCenterInfo(id: string) { export function memberCenterInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/member_center_info/'+id, url: '/api/huiqitong/member_center_info/' + id,
method: 'GET' method: 'GET'
}) })
} }
//入会申请 //入会申请
export function memberApply(data:any) { export function memberApply(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/member_apply', url: '/api/huiqitong/member_apply',
method: 'POST', method: 'POST',
data data
}) })
} }
@ -38,8 +38,6 @@ export function memberApply(data:any) {
export function myMemberApply() { export function myMemberApply() {
return request.http({ return request.http({
url: '/api/huiqitong/my_member_apply', url: '/api/huiqitong/my_member_apply',
method: 'POST', method: 'POST'
}) })
} }

15
src/api/mine.ts

@ -1,27 +1,26 @@
import { request } from '@/utils/http' import { request } from '@/utils/http'
//修改用户信息(单项) //修改用户信息(单项)
export function modifyField(field:string,value:string) { export function modifyField(field: string, value: string) {
return request.http({ return request.http({
url: '/api/huiqitong/modify/'+ field +'?value=' + value, url: '/api/huiqitong/modify/' + field + '?value=' + value,
method: 'PUT' method: 'PUT'
}) })
} }
//修改用户信息(单项) //修改用户信息(单项)
export function modifyField1(field:string,data:any) { export function modifyField1(field: string, data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/modify/'+ field, url: '/api/huiqitong/modify/' + field,
method: 'PUT', method: 'PUT',
data data
}) })
} }
//图片上传 //图片上传
export function updataImage(data:any) { export function updataImage(data: any) {
return request.http({ return request.http({
url: '/api/file/image', url: '/api/file/image',
method: 'POST', method: 'POST',
data data
}) })
} }

63
src/api/shop.ts

@ -9,62 +9,62 @@ export function storeCategoryAll() {
} }
//开店帮内容 //开店帮内容
export function storeList(data:any) { export function storeList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/store_list', url: '/api/huiqitong/store_list',
method: 'GET', method: 'GET',
data data
}) })
} }
//开店帮内容详情 //开店帮内容详情
export function storeInfo(id:string) { export function storeInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/store_info/'+id, url: '/api/huiqitong/store_info/' + id,
method: 'GET', method: 'GET'
}) })
} }
//金融帮信息列表 //金融帮信息列表
export function financeList(data:any) { export function financeList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/finance_list', url: '/api/huiqitong/finance_list',
method: 'GET', method: 'GET',
data data
}) })
} }
//金融帮信息详情 //金融帮信息详情
export function financeInfo(id:string) { export function financeInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/finance_info/'+id, url: '/api/huiqitong/finance_info/' + id,
method: 'GET' method: 'GET'
}) })
} }
//媒体帮列表 //媒体帮列表
export function mediumList(data:any) { export function mediumList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/medium_list', url: '/api/huiqitong/medium_list',
method: 'GET', method: 'GET',
data data
}) })
} }
//媒体帮内容详情 //媒体帮内容详情
export function mediumInfo(id:string) { export function mediumInfo(id: string) {
return request.http({ return request.http({
url: '/api/huiqitong/medium_info/'+id, url: '/api/huiqitong/medium_info/' + id,
method: 'GET' method: 'GET'
}) })
} }
//发布需求 //发布需求
export function mediumAdd(data:any) { export function mediumAdd(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/medium/add', url: '/api/huiqitong/medium/add',
method: 'POST', method: 'POST',
data data
}) })
} }
@ -77,66 +77,63 @@ export function myMedium() {
} }
//发帖 //发帖
export function addPosts(data:any) { export function addPosts(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/add', url: '/api/huiqitong/posts/add',
method: 'POST', method: 'POST',
data data
}) })
} }
//帖子列表 //帖子列表
export function postsList(data:any) { export function postsList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/list', url: '/api/huiqitong/posts/list',
method: 'GET', method: 'GET',
data data
}) })
} }
//评论帖子 //评论帖子
export function commentsPosts(data:any) { export function commentsPosts(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/comments', url: '/api/huiqitong/posts/comments',
method: 'POST', method: 'POST',
data data
}) })
} }
//点赞/取消点赞 //点赞/取消点赞
export function likesPosts(data:any) { export function likesPosts(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/likes', url: '/api/huiqitong/posts/likes',
method: 'POST', method: 'POST',
data data
}) })
} }
//评论列表 //评论列表
export function commentsList(data:any) { export function commentsList(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/comments/list', url: '/api/huiqitong/posts/comments/list',
method: 'GET', method: 'GET',
data data
}) })
} }
//是否点赞 //是否点赞
export function isLikes(data:any) { export function isLikes(data: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/isLikes', url: '/api/huiqitong/posts/isLikes',
method: 'POST', method: 'POST',
data data
}) })
} }
//帖子详情 //帖子详情
export function postsInfo(id:any) { export function postsInfo(id: any) {
return request.http({ return request.http({
url: '/api/huiqitong/posts/info/'+id, url: '/api/huiqitong/posts/info/' + id,
method: 'GET', method: 'GET'
}) })
} }

6
src/api/user.ts

@ -17,14 +17,12 @@ export interface dateListtype extends listType {
export function infoForOpenid() { export function infoForOpenid() {
return request.http({ return request.http({
url: '/api/huiqitong/member/info', url: '/api/huiqitong/member/info',
method: 'GET', method: 'GET'
}) })
} }
export function logout() { export function logout() {
return request.http({ return request.http({
url: '/api/huiqitong/logout', url: '/api/huiqitong/logout',
method: 'PUT', method: 'PUT'
}) })
} }

22
src/components/zh-scroll/interface.ts

@ -1,16 +1,16 @@
/* 左右联动props */ /* 左右联动props */
export interface ICateItem { export interface ICateItem {
id: number; id: number
name: string; name: string
icon: string; icon: string
goods_list: IGood[]; goods_list: IGood[]
[key: string]: any; [key: string]: any
} }
export interface IGood { export interface IGood {
id: number; id: number
content: string; content: string
name: string; name: string
images: string; images: string
[key: string]: any; [key: string]: any
} }

828
src/components/zh-scroll/zh-scroll.vue

@ -1,420 +1,422 @@
<template> <template>
<view class="zh-wrapper"> <view class="zh-wrapper">
<scroll-view class="menus" :scroll-into-view="menuScrollIntoView" scroll-with-animation scroll-y> <scroll-view class="menus" :scroll-into-view="menuScrollIntoView" scroll-with-animation scroll-y>
<view class="wrapper"> <view class="wrapper">
<view class="menu" :id="`menu-${item.id}`" :class="{'current': item.id == curCateId}" <view
v-for="(item, index) in goods" :key="index" @tap="handleMenuTap(item.id)"> class="menu"
<view class="changeicon" v-if="item.id == curCateId"> :id="`menu-${item.id}`"
:class="{ current: item.id == curCateId }"
</view> v-for="(item, index) in goods"
<text class="menutitle">{{ item.name }}</text> :key="index"
</view> @tap="handleMenuTap(item.id)"
</view> >
</scroll-view> <view class="changeicon" v-if="item.id == curCateId"></view>
<scroll-view class="goods" scroll-with-animation scroll-y :scroll-top="cateScrollTop" <text class="menutitle">{{ item.name }}</text>
@scroll="handleGoodsScroll"> </view>
<view class="wrapper"> </view>
<view class="list"> </scroll-view>
<!-- category begin --> <scroll-view class="goods" scroll-with-animation scroll-y :scroll-top="cateScrollTop" @scroll="handleGoodsScroll">
<view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`"> <view class="wrapper">
<view class="title"> <view class="list">
<image :src="baseurl+item.icon_path" class="icon"></image> <!-- category begin -->
<text class="fristtitle">{{ item.name }}</text> <view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`">
</view> <view class="title">
<view class="items"> <image :src="baseurl + item.icon_path" class="icon"></image>
<!-- 商品 begin --> <text class="fristtitle">{{ item.name }}</text>
<view class="good" v-for="(good, key) in item.list" :key="key" @click="goxdbdetail(good.id)"> </view>
<slot name="custom" :data="good"> <view class="items">
<!-- <image :src="good.images" class="image"></image> --> <!-- 商品 begin -->
<!-- <view class="title"> --> <view class="good" v-for="(good, key) in item.list" :key="key" @click="goxdbdetail(good.id)">
<!-- <image :src="baseurl+good.icon_path" class="icon"></image> --> <slot name="custom" :data="good">
<text class="name">{{ good.title }}</text> <!-- <image :src="good.images" class="image"></image> -->
<!-- </view> --> <!-- <view class="title"> -->
<image class="lefticon" src="@/static/img/icon2.png" mode=""></image> <!-- <image :src="baseurl+good.icon_path" class="icon"></image> -->
<!-- <view class="right"> --> <text class="name">{{ good.title }}</text>
<!-- <text class="tips">{{ good.content }}</text> --> <!-- </view> -->
<!-- </view> --> <image class="lefticon" src="@/static/img/icon2.png" mode=""></image>
</slot> <!-- <view class="right"> -->
</view> <!-- <text class="tips">{{ good.content }}</text> -->
<!-- 商品 end --> <!-- </view> -->
</view> </slot>
</view> </view>
<!-- category end --> <!-- 商品 end -->
</view> </view>
</view> </view>
</scroll-view> <!-- category end -->
</view> </view>
</view>
</scroll-view>
</view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick, getCurrentInstance, watch } from "vue"; import { ref, nextTick, getCurrentInstance, watch } from 'vue'
import { ICateItem } from "./interface"; import { ICateItem } from './interface'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL+'/') const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const props = defineProps<{ const props = defineProps<{
scrollList: ICateItem[], scrollList: ICateItem[]
searchVal: string, searchVal: string
}>() }>()
const instance = getCurrentInstance(); const instance = getCurrentInstance()
const menuScrollIntoView = ref(""); const menuScrollIntoView = ref('')
const cateScrollTop = ref(0); const cateScrollTop = ref(0)
// //
const sizeCalcState = ref(false); const sizeCalcState = ref(false)
const goods = ref<ICateItem[]>([]); const goods = ref<ICateItem[]>([])
const curCateId = ref(0); const curCateId = ref(0)
watch( watch(
() => props.scrollList, () => props.scrollList,
newVal => { (newVal) => {
goods.value = newVal; goods.value = newVal
curCateId.value = goods.value[0]?.id curCateId.value = goods.value[0]?.id
nextTick(() => { nextTick(() => {
if (newVal && newVal.length > 0) { if (newVal && newVal.length > 0) {
calcSize(); calcSize()
} }
}) })
}, },
{ {
immediate: true, immediate: true,
deep: true deep: true
} }
) )
// //
function handleMenuTap(id: number) { function handleMenuTap(id: number) {
if (!sizeCalcState.value) { if (!sizeCalcState.value) {
calcSize() calcSize()
} }
curCateId.value = id curCateId.value = id
nextTick(() => { nextTick(() => {
cateScrollTop.value = goods.value.find(item => item.id == id).top cateScrollTop.value = goods.value.find((item) => item.id == id).top
}) })
} }
function fuzzyMatchGoods(goodsArray, searchTerm) { function fuzzyMatchGoods(goodsArray, searchTerm) {
const term = searchTerm.trim().toLowerCase(); const term = searchTerm.trim().toLowerCase()
return goodsArray.filter(goodsItem => console.log(goodsArray)
goodsItem.children.some(child => return goodsArray.filter((goodsItem) => goodsItem.list.some((child) => (child.title?.toLowerCase() ?? '').includes(term)))
(child.name?.toLowerCase() ?? '').includes(term) }
)
); //
} function searchleMenuTap(search: string) {
if (!sizeCalcState.value) {
// calcSize()
function searchleMenuTap(search: string) { }
if (!sizeCalcState.value) { try {
calcSize() nextTick(() => {
} const arr = fuzzyMatchGoods(goods.value, props.searchVal)
try { console.log(arr[0])
nextTick(() => { curCateId.value = arr[0]?.id
const arr = fuzzyMatchGoods(goods.value,search) cateScrollTop.value = arr[0].top
console.log(arr[0]); })
curCateId.value = arr[0]?.id } catch (error) {
cateScrollTop.value = arr[0].top uni.showToast({
}) title: '搜索为空'
} catch(error) { })
uni.showToast({ }
title: '搜索为空' }
})
} //
} function handleGoodsScroll({ detail }) {
if (!sizeCalcState.value) {
// calcSize()
function handleGoodsScroll({ detail }) { }
if(!sizeCalcState.value) { const { scrollTop } = detail
calcSize() // scrollTop + 1scrolltop
} let tabs = goods.value.filter((item) => item.top <= scrollTop + 1).reverse()
const { scrollTop } = detail if (tabs.length > 0) {
// scrollTop + 1scrolltop curCateId.value = tabs[0].id
let tabs = goods.value.filter(item=> item.top <= (scrollTop + 1)).reverse() }
if(tabs.length > 0){ }
curCateId.value = tabs[0].id
} function calcSize() {
} let h = 10
function calcSize() { goods.value.forEach((item) => {
let h = 10 let view = uni.createSelectorQuery().in(instance).select(`#cate-${item.id}`)
view.fields(
goods.value.forEach(item => { {
let view = uni.createSelectorQuery().in(instance).select(`#cate-${item.id}`) size: true
view.fields({ },
size: true (data: any) => {
}, (data: any) => { item.top = h
item.top = h h += data.height
h += data.height item.bottom = h
item.bottom = h }
}).exec() ).exec()
}) })
sizeCalcState.value = true sizeCalcState.value = true
} }
const goxdbdetail = (id: string) => { const goxdbdetail = (id: string) => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/shoppage/shophelpDetail?id='+id url: '/pages/index/shoppage/shophelpDetail?id=' + id
}) })
} }
defineExpose({ defineExpose({
searchleMenuTap searchleMenuTap
}) })
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
height: 100%; height: 100%;
} }
.zh-wrapper { .zh-wrapper {
height: calc(100% - 66rpx); height: calc(100% - 66rpx);
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
display: flex; display: flex;
.menus { .menus {
width: 200rpx; width: 200rpx;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background-color: #F1F3F9; background-color: #f1f3f9;
.wrapper { .wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
.menu { .menu {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
padding: 30rpx 20rpx; padding: 30rpx 20rpx;
font-size: 26rpx; font-size: 26rpx;
color: #3D3D3D; color: #3d3d3d;
position: relative; position: relative;
&:nth-last-child(1) { &:nth-last-child(1) {
margin-bottom: 130rpx; margin-bottom: 130rpx;
} }
&.current { &.current {
background-color: #ffffff; background-color: #ffffff;
color: #0072FF; color: #0072ff;
} }
.dot { .dot {
position: absolute; position: absolute;
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
line-height: 34rpx; line-height: 34rpx;
font-size: 22rpx; font-size: 22rpx;
// background-color: $uni-color-primary; // background-color: $uni-color-primary;
color: #ffffff; color: #ffffff;
top: 16rpx; top: 16rpx;
right: 10rpx; right: 10rpx;
border-radius: 100%; border-radius: 100%;
text-align: center; text-align: center;
} }
.menutitle { .menutitle {
margin-left: 20rpx; margin-left: 20rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
.changeicon { .changeicon {
width: 20rpx; width: 20rpx;
height: 40rpx; height: 40rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
position: fixed; position: fixed;
left: 0; left: 0;
} }
} }
} }
} }
.goods { .goods {
flex: 1; flex: 1;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background-color: #ffffff; background-color: #ffffff;
.wrapper { .wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 20rpx; padding: 20rpx;
.list { .list {
width: 100%; width: 100%;
font-size: 28rpx; font-size: 28rpx;
padding-bottom: 130rpx; padding-bottom: 130rpx;
.category { .category {
width: 100%; width: 100%;
.title { .title {
padding: 10rpx 0; padding: 10rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
color: #0C092A; color: #0c092a;
.icon { .icon {
width: 38rpx; width: 38rpx;
height: 38rpx; height: 38rpx;
} }
.fristtitle { .fristtitle {
margin-left: 20rpx; margin-left: 20rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 530; font-weight: 530;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
} }
} }
.items { .items {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-bottom: -30rpx; padding-bottom: -30rpx;
:deep(.good) { :deep(.good) {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 30rpx; margin-bottom: 30rpx;
padding-left: 40rpx; padding-left: 40rpx;
.name { .name {
max-width: 100%; max-width: 100%;
margin-left: 10rpx; margin-left: 10rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 300; font-weight: 300;
color: #606266; color: #606266;
overflow: hidden; /* 隐藏溢出内容 */ overflow: hidden; /* 隐藏溢出内容 */
white-space: nowrap; /* 禁止换行 */ white-space: nowrap; /* 禁止换行 */
text-overflow: ellipsis; /* 显示省略号 */ text-overflow: ellipsis; /* 显示省略号 */
}
} .icon {
.icon { width: 38rpx;
width: 38rpx; height: 38rpx;
height: 38rpx; }
} .lefticon {
.lefticon { width: 16rpx;
width: 16rpx; height: 28rpx;
height: 28rpx; margin-right: 6rpx;
margin-right: 6rpx; }
}
// .image {
// .image { // width: 160rpx;
// width: 160rpx; // height: 160rpx;
// height: 160rpx; // margin-right: 20rpx;
// margin-right: 20rpx; // border-radius: 8rpx;
// border-radius: 8rpx; // }
// }
// .right {
// .right { // flex: 1;
// flex: 1; // height: 160rpx;
// height: 160rpx; // overflow: hidden;
// overflow: hidden; // display: flex;
// display: flex; // flex-direction: column;
// flex-direction: column; // align-items: flex-start;
// align-items: flex-start; // justify-content: space-between;
// justify-content: space-between; // padding-right: 14rpx;
// padding-right: 14rpx;
// .name {
// .name { // font-family: Source Han Sans;
// font-family: Source Han Sans; // font-size: 28rpx;
// font-size: 28rpx; // font-weight: 300;
// font-weight: 300; // line-height: 48rpx;
// line-height: 48rpx; // display: flex;
// display: flex; // align-items: center;
// align-items: center; // letter-spacing: normal;
// letter-spacing: normal; // color: #606266;
// color: #606266; // }
// }
// .tips {
// .tips { // width: 100%;
// width: 100%; // height: 40rpx;
// height: 40rpx; // line-height: 40rpx;
// line-height: 40rpx; // overflow: hidden;
// overflow: hidden; // text-overflow: ellipsis;
// text-overflow: ellipsis; // white-space: nowrap;
// white-space: nowrap; // font-size: 28rpx;
// font-size: 28rpx; // color: #606266;
// color: #606266; // margin-bottom: 10rpx;
// margin-bottom: 10rpx; // }
// }
// .price_and_action {
// .price_and_action { // width: 100%;
// width: 100%; // display: flex;
// display: flex; // justify-content: space-between;
// justify-content: space-between; // align-items: center;
// align-items: center;
// .price {
// .price { // font-size: #606266;
// font-size: #606266; // font-weight: 600;
// font-weight: 600; // }
// }
// .btn-group {
// .btn-group { // display: flex;
// display: flex; // justify-content: space-between;
// justify-content: space-between; // align-items: center;
// align-items: center; // position: relative;
// position: relative;
// .btn {
// .btn { // padding: 0 20rpx;
// padding: 0 20rpx; // box-sizing: border-box;
// box-sizing: border-box; // font-size: 28rpx;
// font-size: 28rpx; // height: 44rpx;
// height: 44rpx; // line-height: 44rpx;
// line-height: 44rpx;
// &.property_btn {
// &.property_btn { // border-radius: 24rpx;
// border-radius: 24rpx; // }
// }
// &.add_btn,
// &.add_btn, // &.reduce_btn {
// &.reduce_btn { // padding: 0;
// padding: 0; // width: 44rpx;
// width: 44rpx; // border-radius: 44rpx;
// border-radius: 44rpx; // }
// } // }
// }
// .dot {
// .dot { // position: absolute;
// position: absolute; // background-color: #ffffff;
// background-color: #ffffff; // color: #606266;
// color: #606266; // font-size: 28rpx;
// font-size: 28rpx; // width: 36rpx;
// width: 36rpx; // height: 36rpx;
// height: 36rpx; // line-height: 36rpx;
// line-height: 36rpx; // text-align: center;
// text-align: center; // border-radius: 100%;
// border-radius: 100%; // right: -12rpx;
// right: -12rpx; // top: -10rpx;
// top: -10rpx; // }
// }
// .number {
// .number { // width: 44rpx;
// width: 44rpx; // height: 44rpx;
// height: 44rpx; // line-height: 44rpx;
// line-height: 44rpx; // text-align: center;
// text-align: center; // }
// } // }
// } // }
// } // }
// } }
} }
} }
} }
} }
} }
} </style>
</style>

36
src/main.ts

@ -7,20 +7,22 @@ import fengUniappExploit from 'feng-uniapp-exploit'
import store from './store' import store from './store'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
app.use(uviewPlus) app.use(uviewPlus)
app.use(fengUniappExploit) app.use(fengUniappExploit)
app.use(store) app.use(store)
app.mixin({ app.mixin({
onShareAppMessage() { // 分享给好友 onShareAppMessage() {
return { // 分享给好友
title: '惠企帮', return {
path: '/pages/index/index', title: '惠企帮',
} path: '/pages/index/index'
}, }
onShareTimeline() { // 分享朋友圈 },
return { title: '惠企帮' } onShareTimeline() {
} // 分享朋友圈
}) return { title: '惠企帮' }
return { app } }
} })
return { app }
}

546
src/pages/index/ChatDialog.vue

@ -1,275 +1,285 @@
<template> <template>
<view class="dialog-container" v-if="visible"> <view class="dialog-container" v-if="visible">
<view class="dialog-mask" @click="close">×</view> <view class="dialog-mask" @click="close">×</view>
<view class="dialog-content" :style="{height: isdx?'88%':'686rpx'}"> <view class="dialog-content" :style="{ height: isdx ? '88%' : '686rpx' }">
<view class="butss"> <view class="butss">
<image style="width: 40rpx;height: 40rpx;" @click="dxclick" :src="isdx?'/static/img/sx.png':'/static/img/fd.png'" mode=""></image> <image
</view> style="width: 152rpx; margin-left: 20rpx; top: -120rpx; left: -2rpx; position: absolute"
<scroll-view class="message-box" scroll-y> src="@/static/img/aiimg.png"
<view class="akstart" v-if="showfirst"> mode="widthFix"
<view v-for="(msg,index) in messages" :key="index" :class="['message', msg.role]"> ></image>
<image class="aicon" src="@/static/img/aiicon.png" mode=""></image> <view style="display: flex; align-items: center">
<view class="bubble"> <view style="font-size: 50rpx; color: #007fff" @click="close">×</view>
<text>{{ msg.content }}</text> <image
</view> style="width: 40rpx; height: 40rpx; margin-left: 40rpx"
</view> @click="dxclick"
<view v-if="loading" class="loading">AI思考中...</view> :src="isdx ? '/static/img/sx.png' : '/static/img/fd.png'"
</view> mode=""
<view class="cnxw" v-else> ></image>
<view class="message assistant"> </view>
<image class="aicon" src="@/static/img/aiicon.png" mode=""></image> </view>
<view class="bubble"> <scroll-view class="message-box" scroll-y :style="{ height: isdx ? '80%' : '70%' }">
<text class="cwtitle">猜你想问</text> <view class="akstart" v-if="showfirst">
<u-line color="#99CCFF" margin="20rpx 0"></u-line> <view v-for="(msg, index) in messages" :key="index" :class="['message', msg.role]">
<text class="cwtxt" @click="askClcik('小微企业优惠政策')">小微企业优惠政策</text> <image class="aicon" src="@/static/img/aiicon.png" mode=""></image>
<text class="cwtxt" @click="askClcik('2025年最新小微企业优惠政策')">2025年最新小微企业优惠政策</text> <view class="bubble">
</view> <text>{{ msg.content }}</text>
</view> </view>
</view> </view>
</scroll-view> <view v-if="loading" class="loading">AI思考中...</view>
<view class="input-box" v-if="showfirst"> </view>
<input v-model="inputText" placeholder="请输入问题" @confirm="send" /> <view class="cnxw" v-else>
<button @click="send" :disabled="loading">发送</button> <view class="message assistant">
</view> <image class="aicon" src="@/static/img/aiicon.png" mode="widthFix"></image>
<view class="inputbox" @click="showfirst = true" v-else> <view class="bubble">
<image style="width: 28rpx;height: 26rpx;margin-right: 8rpx;" src="@/static/img/daan.png" mode=""> <text class="cwtitle">猜你想问</text>
</image> <u-line color="#99CCFF" margin="20rpx 0"></u-line>
找不到答案点此提问 <text class="cwtxt" @click="askClcik('小微企业优惠政策')">小微企业优惠政策</text>
</view> <text class="cwtxt" @click="askClcik('2025年最新小微企业优惠政策')">2025年最新小微企业优惠政策</text>
</view> </view>
</view> </view>
</view>
</scroll-view>
<view class="input-box" v-if="showfirst">
<input v-model="inputText" placeholder="请输入问题" @confirm="send" />
<button @click="send" :disabled="loading">发送</button>
</view>
<view class="inputbox" @click="showfirst = true" v-else>
<image style="width: 28rpx; height: 26rpx; margin-right: 8rpx" src="@/static/img/daan.png" mode=""></image>
找不到答案点此提问
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { ai } from '@/api/index'
} from 'vue'
import { const showfirst = ref(false)
ai
} from '@/api/index' const props = defineProps({
visible: Boolean
const showfirst = ref(false) })
const emit = defineEmits(['close'])
const props = defineProps({
visible: Boolean, const messages = ref([])
}) const inputText = ref('')
const emit = defineEmits(['close']) const loading = ref(false)
const messages = ref([]) const close = () => emit('close')
const inputText = ref('')
const loading = ref(false) const send = async () => {
if (!inputText.value.trim()) return
const close = () => emit('close')
//
const send = async () => { messages.value.push({
if (!inputText.value.trim()) return role: 'user',
content: inputText.value
// })
messages.value.push({
role: 'user', const question = inputText.value
content: inputText.value inputText.value = ''
}) loading.value = true
const question = inputText.value try {
inputText.value = '' const { data } = await ai({
loading.value = true messages: question
})
try {
const { // AI
data messages.value.push({
} = await ai({ role: 'assistant',
"messages": question content: data.content
}) })
} catch (e) {
// AI messages.value.push({
messages.value.push({ role: 'system',
role: 'assistant', content: '服务异常,请稍后重试'
content: data.content })
}) } finally {
} catch (e) { loading.value = false
messages.value.push({ }
role: 'system', }
content: '服务异常,请稍后重试' const askClcik = (val) => {
}) showfirst.value = true
} finally { inputText.value = val
loading.value = false }
}
} const isdx = ref(false)
const askClcik = (val) => { const dxclick = () => {
showfirst.value = true isdx.value = !isdx.value
inputText.value = val }
}
const isdx = ref(false)
const dxclick = () => {
isdx.value = !isdx.value
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.dialog-container { .dialog-container {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
z-index: 999; z-index: 999;
} }
.dialog-mask { .dialog-mask {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
} }
.dialog-content { .dialog-content {
position: absolute; position: absolute;
width: 100%; width: 100%;
bottom: 0; bottom: 0;
background: #E7F3FF; background: #e7f3ff;
box-sizing: border-box; box-sizing: border-box;
border: 2rpx solid #FFFFFF; border: 2rpx solid #ffffff;
box-shadow: 0rpx -30rpx 20rpx 0rpx rgba(0, 0, 0, 0.2); box-shadow: 0rpx -30rpx 20rpx 0rpx rgba(0, 0, 0, 0.2);
border-radius: 96rpx 0rpx 0rpx 0rpx; border-radius: 96rpx 0rpx 0rpx 0rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.message-box { .message-box {
height: 85%; padding: 30rpx 30rpx 10rpx 30rpx;
padding: 30rpx 30rpx 10rpx 30rpx; box-sizing: border-box;
box-sizing: border-box; }
}
.message {
.message { margin-bottom: 30rpx;
margin-bottom: 30rpx; display: flex;
display: flex; }
}
.message.user {
.message.user { justify-content: flex-end;
justify-content: flex-end; }
}
.message.assistant {
.message.assistant { justify-content: flex-start;
justify-content: flex-start; }
}
.bubble {
.bubble { max-width: 75%;
max-width: 75%; padding: 20rpx 30rpx;
padding: 20rpx 30rpx; border-radius: 10rpx;
border-radius: 10rpx; background-color: aliceblue;
background-color: aliceblue; }
}
.user {
.user { .bubble {
.bubble { background: #95ec69;
background: #95ec69; }
}
.aicon {
.aicon { width: 0;
width: 0; height: 0;
height: 0; }
} }
}
.assistant {
.assistant { .aicon {
.aicon { width: 64rpx;
width: 74rpx; }
height: 64rpx;
} .bubble {
background: #ffffff;
.bubble { margin-left: 20rpx;
background: #FFFFFF;
margin-left: 20rpx; text {
font-family: Source Han Sans;
text { font-size: 24rpx;
font-family: Source Han Sans; font-weight: 300;
font-size: 24rpx; line-height: 48rpx;
font-weight: 300; text-align: justify;
line-height: 48rpx; /* 浏览器可能不支持 */
text-align: justify; display: flex;
/* 浏览器可能不支持 */ align-items: center;
display: flex; letter-spacing: normal;
align-items: center; color: #000000;
letter-spacing: normal; }
color: #000000; }
} }
}
} .input-box {
width: 100%;
.input-box { position: fixed;
height: 15%; bottom: 0;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 20rpx; padding: 25rpx;
border-radius: 40rpx 40rpx 0rpx 0rpx; box-sizing: border-box;
background: #FFFFFF; border-radius: 40rpx 40rpx 0rpx 0rpx;
box-shadow: 0rpx -2rpx 12rpx 0rpx rgba(0, 0, 0, 0.05); background: #ffffff;
} box-shadow: 0rpx -2rpx 12rpx 0rpx rgba(0, 0, 0, 0.05);
}
input {
flex: 1; input {
padding: 16rpx 24rpx; flex: 1;
border: 2rpx solid #ddd; padding: 16rpx 24rpx;
border-radius: 8rpx; border: 2rpx solid #ddd;
} border-radius: 8rpx;
}
button {
margin-left: 20rpx; button {
padding: 0 30rpx; margin-left: 20rpx;
background: #007aff; padding: 0 30rpx;
color: white; background: #007aff;
height: 70rpx; color: white;
display: flex; height: 70rpx;
align-items: center; display: flex;
} align-items: center;
}
.loading {
text-align: center; .loading {
color: #999; text-align: center;
} color: #999;
}
.cwtitle {
color: #007FFF !important; .cwtitle {
} color: #007fff !important;
}
.cwtxt {
font-family: Source Han Sans; .cwtxt {
font-size: 24rpx; font-family: Source Han Sans;
font-weight: 300; font-size: 24rpx;
line-height: 48rpx; font-weight: 300;
text-align: justify; line-height: 48rpx;
/* 浏览器可能不支持 */ text-align: justify;
display: flex; /* 浏览器可能不支持 */
align-items: center; display: flex;
letter-spacing: normal; align-items: center;
color: #666666; letter-spacing: normal;
} color: #666666;
}
.inputbox {
height: 15%; .inputbox {
display: flex; height: 15%;
align-items: center; display: flex;
justify-content: center; align-items: center;
padding: 20rpx; justify-content: center;
border-radius: 40rpx 40rpx 0rpx 0rpx; padding: 20rpx;
background: #FFFFFF; border-radius: 40rpx 40rpx 0rpx 0rpx;
box-shadow: 0rpx -2rpx 12rpx 0rpx rgba(0, 0, 0, 0.05); background: #ffffff;
font-family: Source Han Sans; box-shadow: 0rpx -2rpx 12rpx 0rpx rgba(0, 0, 0, 0.05);
font-size: 24rpx; font-family: Source Han Sans;
font-weight: 300; font-size: 24rpx;
line-height: 48rpx; font-weight: 300;
text-align: justify; line-height: 48rpx;
/* 浏览器可能不支持 */ text-align: justify;
display: flex; /* 浏览器可能不支持 */
align-items: center; display: flex;
letter-spacing: normal; align-items: center;
color: #007FFF; letter-spacing: normal;
} color: #007fff;
.butss { }
width: 100%;
text-align: end; .butss {
padding: 20rpx; width: 100%;
} display: flex;
</style> align-items: center;
justify-content: flex-end;
padding: 20rpx;
}
</style>

278
src/pages/index/active/activeDetail.vue

@ -1,158 +1,152 @@
<template> <template>
<image style="width: 100%;height: 352rpx;" :src="baseurl + detaildata.index_pic" mode=""></image> <image style="width: 100%; height: 352rpx" :src="baseurl + detaildata.index_pic" mode=""></image>
<view class="container"> <view class="container">
<text class="headtxt">{{detaildata.title}}</text> <text class="headtxt">{{ detaildata.title }}</text>
<text class="address">活动地点{{detaildata.address}}</text> <text class="address">活动地点{{ detaildata.address }}</text>
<view class="adressnum"> <view class="adressnum">
<text class="time">活动时间{{detaildata.activity_time}}</text> <text class="time">活动时间{{ detaildata.activity_time }}</text>
<view class="ydl"> <view class="ydl">
<text class="time">阅读量</text> <text class="time">阅读量</text>
<text class="value"> <text class="value">
{{detaildata.count}} {{ detaildata.count }}
</text> </text>
</view> </view>
</view> </view>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">活动详情</text> <text class="title">活动详情</text>
</view> </view>
<u-parse :content="detaildata.content"></u-parse> <u-parse :content="detaildata.content"></u-parse>
<text class="certetime">{{detaildata.create_time}}</text> <text class="certetime">{{ detaildata.create_time }}</text>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { activityInfo } from '@/api/index'
import {
ref
} from 'vue';
import {
activityInfo
} from '@/api/index'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const detaildata = ref({}) const detaildata = ref({})
onLoad(async (param) => { onLoad(async (param) => {
await activityInfo(param.id).then((res) => { await activityInfo(param.id).then((res) => {
if (res.code === 1) { if (res.code === 1) {
detaildata.value = res.data detaildata.value = res.data
} }
}) })
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 352rpx); height: calc(100vh - 352rpx);
width: 100%; width: 100%;
padding: 40rpx 40rpx 0 40rpx; padding: 40rpx 40rpx 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
.titlepart { .titlepart {
margin-top: 40rpx; margin-top: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 30rpx; margin-bottom: 30rpx;
.icon { .icon {
width: 12rpx; width: 12rpx;
height: 32rpx; height: 32rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
} }
.title { .title {
margin-left: 18rpx; margin-left: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.headtxt { .headtxt {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: normal; font-weight: normal;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.address { .address {
margin-top: 28rpx; margin-top: 28rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.adressnum { .adressnum {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.time { .time {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.ydl { .ydl {
display: flex; display: flex;
align-items: center; align-items: center;
.time { .time {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.value { .value {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #007FFF color: #007fff;
} }
} }
} }
.certetime { .certetime {
font-family: Roboto; font-family: Roboto;
font-size: 28rpx; font-size: 28rpx;
font-weight: normal; font-weight: normal;
line-height: 80rpx; line-height: 80rpx;
letter-spacing: normal; letter-spacing: normal;
color: #A1A1A1; color: #a1a1a1;
} }
} }
</style> </style>

358
src/pages/index/active/activelist.vue

@ -1,182 +1,190 @@
<template> <template>
<view class="container"> <view class="container">
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" <u-search
placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" @search="search"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> @clickIcon="clickIcon"
@clear="clear"
<scroll-view scroll-y="auto" class="main" @scrolltolower="onloadmore"> shape="square"
<view class="ztone" v-for="(item,index) in ztList" :key="index" @click="godetail(item.id)"> placeholder="请输入搜索内容"
<image style="width: 150rpx;height: 150rpx;border-radius: 8rpx;flex: 1;" :src="baseurl+item.index_pic" mode=""> placeholder-color="#A9D4FF"
</image> v-model="keyword"
<view class="rightpart"> search-icon="/static/img/search.png"
<view class="splace"> search-icon-size="14"
{{item.title}} :show-action="false"
</view> height="40"
<view class="titlepart"> margin="40rpx 24rpx 24rpx 24rpx"
<text class="title">{{item.activity_time}}</text> bg-color="#FFFFFF"
<image style="width: 32rpx;height: 44rpx;" src="@/static/img/Icon.png" mode="aspectFill"> ></u-search>
</image>
</view> <scroll-view scroll-y="auto" class="main" @scrolltolower="onloadmore">
<view class="ms"> <view class="ztone" v-for="(item, index) in ztList" :key="index" @click="godetail(item.id)">
{{item.address}} <image style="width: 150rpx; height: 150rpx; border-radius: 8rpx; flex: 1" :src="baseurl + item.index_pic" mode=""></image>
</view> <view class="rightpart">
</view> <view class="splace">
</view> {{ item.title }}
</scroll-view> </view>
</view> <view class="titlepart">
<text class="title">{{ item.activity_time }}</text>
<image style="width: 32rpx; height: 44rpx" src="@/static/img/Icon.png" mode="aspectFill"></image>
</view>
<view class="ms">
{{ item.address }}
</view>
</view>
</view>
</scroll-view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { activityList } from '@/api/index'
} from 'vue'; import { onShow } from '@dcloudio/uni-app'
import { activityList } from '@/api/index'
import { onShow } from '@dcloudio/uni-app'; const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') //
const keyword = ref('')
const page = ref(1)
// const pagesize = ref(7)
const keyword = ref('');
const page = ref(1) const search = async (val) => {
const pagesize = ref(7) page.value = 1
pagesize.value = 7
const search = async (val) => { await getActivityList(keyword.value, page.value, pagesize.value)
page.value = 1 }
pagesize.value = 7
await getActivityList(keyword.value, page.value, pagesize.value) const clickIcon = async () => {
} page.value = 1
pagesize.value = 7
const clickIcon = async () => { await getActivityList(keyword.value, page.value, pagesize.value)
page.value = 1 }
pagesize.value = 7
await getActivityList(keyword.value, page.value, pagesize.value) const clear = async () => {
} page.value = 1
pagesize.value = 7
const clear = async () => { await getActivityList(keyword.value, page.value, pagesize.value)
page.value = 1 }
pagesize.value = 7
await getActivityList(keyword.value, page.value, pagesize.value) const ztList = ref([])
}
const onloadmore = async () => {
const ztList = ref([]) page.value++
let params = {
const onloadmore = async () => { title: keyword.value,
page.value++ page: page.value,
let params = { limit: pagesize.value
'title': keyword.value, }
'page': page.value, await activityList(params).then((res) => {
'limit': pagesize.value ztList.value = [...ztList.value, ...res.data.data]
} })
await activityList(params).then((res) => { }
ztList.value = [...ztList.value, ...res.data.data]
}) const godetail = (id) => {
} uni.navigateTo({
url: '/pages/index/active/activeDetail?id=' + id
const godetail = (id) => { })
uni.navigateTo({ }
url: '/pages/index/active/activeDetail?id=' + id
}) const getActivityList = async (name, page, limit) => {
} let params = {
title: name,
const getActivityList = async (name, page, limit) => { page: page,
let params = { limit: limit
'title': name, }
'page': page, await activityList(params).then((res) => {
'limit': limit ztList.value = res.data.data
} })
await activityList(params).then((res) => { }
ztList.value = res.data.data
}) onShow(async () => {
} keyword.value = ''
await getActivityList('', 1, 7)
onShow(async() => { })
await getActivityList('',1,7)
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background: linear-gradient(0deg, #F1F3F9 72%, rgba(129, 179, 222, 0.5) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgba(129, 179, 222, 0.5) 88%);
height: 100vh; height: 100vh;
width: 100%; width: 100%;
overflow-y: hidden; overflow-y: hidden;
.main { .main {
margin-top: 10rpx; margin-top: 10rpx;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 24rpx; padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
.ztone { .ztone {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
margin-top: 20rpx; margin-top: 20rpx;
padding: 10rpx; padding: 10rpx;
border-radius: 8rpx; border-radius: 8rpx;
background: #FFFFFF; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
border: 2rpx solid rgba(0, 127, 255, 0.12); border: 2rpx solid rgba(0, 127, 255, 0.12);
.rightpart { .rightpart {
width: 100%; width: 100%;
margin-left: 20rpx; margin-left: 20rpx;
flex: 3; flex: 3;
display: grid; display: grid;
.titlepart { .titlepart {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 300; font-weight: 300;
line-height: normal; line-height: normal;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
letter-spacing: normal; letter-spacing: normal;
color: #666666; color: #666666;
margin-top: 20rpx; margin-top: 20rpx;
} }
} }
.splace { .splace {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.ms { .ms {
margin-top: 8rpx; margin-top: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 300; font-weight: 300;
line-height: normal; line-height: normal;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
letter-spacing: normal; letter-spacing: normal;
color: #666666; color: #666666;
} }
} }
} }
} }
} }
.hdzq { .hdzq {
width: 182rpx; width: 182rpx;
height: 80rpx; height: 80rpx;
position: fixed; position: fixed;
right: 0; right: 0;
top: 70%; top: 70%;
margin-right: -14rpx; margin-right: -14rpx;
} }
</style> </style>

1446
src/pages/index/index.vue

File diff suppressed because it is too large

388
src/pages/index/shoppage/financialAssistance.vue

@ -1,199 +1,203 @@
<template> <template>
<u-navbar title="金融帮" placeholder="true" bgColor="#F1F3F9" :autoBack="true"> <u-navbar title="金融帮" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar>
</u-navbar> <view class="container">
<view class="container"> <u-search
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" @search="search"
placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" @clickIcon="clickIcon"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> @clear="clear"
<view class="main"> shape="square"
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore"> placeholder="请输入搜索内容"
<view class="ztone" v-for="(item,index) in ztList" :key="index" @click="godetail(item.id)"> placeholder-color="#A9D4FF"
<image style="width: 150rpx;height: 150rpx;border-radius: 28rpx;flex: 1;" :src="baseurl+item.index_pic" mode=""> v-model="keyword"
</image> search-icon="/static/img/search.png"
<view class="rightpart"> search-icon-size="14"
<view class="splace"> :show-action="false"
{{item.bank}} height="40"
</view> margin="40rpx 24rpx 24rpx 24rpx"
<view class="titlepart"> bg-color="#FFFFFF"
<text class="title">{{item.name}}</text> ></u-search>
<image style="width: 32rpx;height: 44rpx;" src="@/static/img/Icon.png" mode="aspectFill"> <view class="main">
</image> <scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore">
</view> <view class="ztone" v-for="(item, index) in ztList" :key="index" @click="godetail(item.id)">
<view class="ms"> <image style="width: 150rpx; height: 150rpx; border-radius: 28rpx; flex: 1" :src="baseurl + item.index_pic" mode=""></image>
{{item.branch}} <view class="rightpart">
</view> <view class="splace">
</view> {{ item.bank }}
</view> </view>
</scroll-view> <view class="titlepart">
</view> <text class="title">{{ item.name }}</text>
</view> <image style="width: 32rpx; height: 44rpx" src="@/static/img/Icon.png" mode="aspectFill"></image>
<liuDragButton :widthPx="'145rpx'"> </view>
<image class="hdzq" src="@/static/img/hdzq.png" mode="" @click="gohdzq"></image> <view class="ms">
</liuDragButton> {{ item.branch }}
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<liuDragButton :width-px="'145rpx'">
<image class="hdzq" src="@/static/img/hdzq.png" mode="" @click="gohdzq"></image>
</liuDragButton>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { financeList } from '@/api/shop'
} from 'vue'; import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
import {
financeList const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
} from '@/api/shop'
import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue' //
const keyword = ref('')
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') const page = ref(1)
const pagesize = ref(6)
//
const keyword = ref(''); const search = async (val) => {
const page = ref(1) page.value = 1
const pagesize = ref(6) pagesize.value = 6
await getfinanceList(keyword.value, page.value, pagesize.value)
}
const search = async (val) => {
page.value = 1 const clickIcon = async () => {
pagesize.value = 6 page.value = 1
await getfinanceList(keyword.value, page.value, pagesize.value) pagesize.value = 6
} await getfinanceList(keyword.value, page.value, pagesize.value)
}
const clickIcon = async () => {
page.value = 1 const clear = async () => {
pagesize.value = 6 page.value = 1
await getfinanceList(keyword.value, page.value, pagesize.value) pagesize.value = 6
} await getfinanceList(keyword.value, page.value, pagesize.value)
}
const clear = async () => {
page.value = 1 const ztList = ref([])
pagesize.value = 6
await getfinanceList(keyword.value, page.value, pagesize.value) const godetail = (id) => {
} uni.navigateTo({
url: '/pages/index/shoppage/jrbDetail?id=' + id
const ztList = ref([]) })
}
const godetail = (id) => {
uni.navigateTo({ const gohdzq = () => {
url: '/pages/index/shoppage/jrbDetail?id=' + id uni.navigateTo({
}) url: '/pages/index/shoppage/interactiveZone'
} })
}
const gohdzq = () => {
uni.navigateTo({ const getfinanceList = async (name, page, limit) => {
url: '/pages/index/shoppage/interactiveZone' let params = {
}) keyword: name,
} page: page,
limit: limit
const getfinanceList = async (name, page, limit) => { }
let params = { await financeList(params).then((res) => {
'keyword': name, ztList.value = res.data.data
'page': page, })
'limit': limit }
}
await financeList(params).then((res) => { const onloadmore = async () => {
ztList.value = res.data.data page.value++
}) let params = {
} keyword: keyword.value,
page: page.value,
const onloadmore = async () => { limit: pagesize.value
page.value++ }
let params = { await financeList(params).then((res) => {
'keyword': keyword.value, ztList.value = [...ztList.value, ...res.data.data]
'page': page.value, })
'limit': pagesize.value }
}
await financeList(params).then((res) => { onShow(async () => {
ztList.value = [...ztList.value, ...res.data.data] await getfinanceList('', 1, 6)
}) })
}
onShow(async() => {
await getfinanceList('',1,6)
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background: linear-gradient(0deg, #F1F3F9 72%, rgba(129, 179, 222, 0.5) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgba(129, 179, 222, 0.5) 88%);
height: calc(100vh - 178rpx); height: calc(100vh - 178rpx);
width: 100%; width: 100%;
overflow-y: hidden; overflow-y: hidden;
.hyonne { .hyonne {
max-height: calc(100vh - 350rpx); max-height: calc(100vh - 350rpx);
overflow-y: auto; overflow-y: auto;
} }
.main { .main {
margin-top: 10rpx; margin-top: 10rpx;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 24rpx; padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: hidden; overflow-y: hidden;
.ztone { .ztone {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 210rpx; height: 210rpx;
margin-top: 30rpx; margin-top: 30rpx;
padding: 30rpx; padding: 30rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: #FFFFFF; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
border: 2rpx solid rgba(0, 127, 255, 0.12); border: 2rpx solid rgba(0, 127, 255, 0.12);
.rightpart { .rightpart {
width: 100%; width: 100%;
margin-left: 40rpx; margin-left: 40rpx;
flex: 3; flex: 3;
display: grid; display: grid;
.titlepart { .titlepart {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.title { .title {
font-family: Poppins; font-family: Poppins;
font-size: 24rpx; font-size: 24rpx;
font-weight: 600; font-weight: 600;
line-height: 34rpx; line-height: 34rpx;
letter-spacing: normal; letter-spacing: normal;
/* 外部/Colors/Dark/Base 1 */ /* 外部/Colors/Dark/Base 1 */
color: #161719; color: #161719;
margin-top: 13rpx; margin-top: 13rpx;
} }
} }
.splace { .splace {
font-family: Poppins; font-family: Poppins;
font-size: 24rpx; font-size: 24rpx;
font-weight: normal; font-weight: normal;
line-height: 34rpx; line-height: 34rpx;
letter-spacing: normal; letter-spacing: normal;
/* 外部/Colors/Dark/Base 1 */ /* 外部/Colors/Dark/Base 1 */
color: #161719; color: #161719;
} }
.ms { .ms {
margin-top: 13rpx; margin-top: 13rpx;
font-family: Poppins; font-family: Poppins;
font-size: 20rpx; font-size: 20rpx;
font-weight: normal; font-weight: normal;
line-height: 28rpx; line-height: 28rpx;
letter-spacing: normal; letter-spacing: normal;
/* 外部/Colors/Light/Base 3 */ /* 外部/Colors/Light/Base 3 */
color: #91919F; color: #91919f;
} }
} }
} }
} }
} }
.hdzq { .hdzq {
width: 182rpx; width: 212rpx;
height: 80rpx; height: 86rpx;
position: fixed; position: fixed;
right: 0; right: 0;
top: 70%; top: 70%;
margin-right: -14rpx; margin-right: -14rpx;
} }
</style> </style>

699
src/pages/index/shoppage/interactiveDetail.vue

@ -1,354 +1,359 @@
<template> <template>
<u-navbar :title="'帖子详情'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'帖子详情'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<scroll-view class="cardbox"> <scroll-view class="cardbox" style="max-height: 80vh" scroll-y="true">
<view class="dhone"> <view class="dhone">
<view class="head"> <view class="head">
<image style="height: 96rpx;width: 96rpx;border-radius: 50%;" <image style="height: 96rpx; width: 96rpx; border-radius: 50%" :src="baseurl + '/' + listdata.member_head_pic" mode=""></image>
:src="baseurl + '/' + listdata.member_head_pic" mode=""> <view class="namepart">
</image> <text class="name">{{ listdata.member_nickname }}</text>
<view class="namepart"> <text class="date">{{ listdata.create_time }}</text>
<text class="name">{{listdata.member_nickname}}</text> </view>
<text class="date">{{listdata.create_time}}</text> </view>
</view> <text class="pl">{{ listdata.content }}</text>
</view> <view class="bottom">
<text class="pl">{{listdata.content}}</text> <view class="left">
<view class="bottom"> <image
<view class="left"> style="width: 36rpx; height: 34rpx"
<image style="width: 36rpx;height: 34rpx;" :src="listdata.is_like ? '/static/img/ydz.png' : '/static/img/dz.png'"
:src="listdata.is_like?'/static/img/ydz.png':'/static/img/dz.png'" @click="dzClick(listdata.is_like, listdata.posts_id)"
@click="dzClick(listdata.is_like,listdata.posts_id)" mode=""> mode=""
</image> ></image>
<text class="value">{{listdata.like_count}}</text> <text class="value">{{ listdata.like_count }}</text>
</view> </view>
<view class="right"> <view class="right">
<image style="width: 36rpx;height: 36rpx;" src="@/static/img/pl.png" mode=""></image> <image style="width: 36rpx; height: 36rpx" src="@/static/img/pl.png" mode=""></image>
<text class="value">{{listdata.comment_count}}</text> <text class="value">{{ listdata.comment_count }}</text>
</view> </view>
</view> </view>
<scroll-view style="max-height: 60vh;" scroll-y="true" @scrolltolower="scrolltolower"> <scroll-view @scrolltolower="scrolltolower">
<view class="ypl" v-for="(item,index) in pllist" :key="index"> <view class="ypl" v-for="(item, index) in pllist" :key="index">
<view class="head"> <view class="head">
<view class="left"> <view class="left">
<image style="height: 40rpx;width: 40rpx;border-radius: 50%;" <image
:src="baseurl + '/' + item.member_head_pic" mode=""></image> style="height: 40rpx; width: 40rpx; border-radius: 50%"
<text class="name">{{item.member_nickname}}</text> :src="baseurl + '/' + item.member_head_pic"
</view> mode=""
<view class="right"> ></image>
<text class="value">{{item.like_count}}</text> <text class="name">{{ item.member_nickname }}</text>
<image style="width: 24rpx;height: 24rpx;margin-left: 8rpx;" </view>
:src="item.is_like?'/static/img/ydz.png':'/static/img/dz.png'" <view class="right">
@click="pldzClick(item.is_like,item.comments_id)" mode=""> <text class="value">{{ item.like_count }}</text>
</image> <image
</view> style="width: 24rpx; height: 24rpx; margin-left: 8rpx"
</view> :src="item.is_like ? '/static/img/ydz.png' : '/static/img/dz.png'"
<text class="pl">{{item.content}}</text> @click="pldzClick(item.is_like, item.comments_id)"
</view> mode=""
</scroll-view> ></image>
</view> </view>
</scroll-view> </view>
<view class="plpart"> <text class="pl">{{ item.content }}</text>
<u-textarea class="textarea" v-model="plvalue" height="20" placeholder="请输入内容" autoHeight></u-textarea> </view>
<view class="butt" @click="pullmess">发布</view> </scroll-view>
</view> </view>
</view> </scroll-view>
<view class="plpart">
<u-textarea class="textarea" v-model="plvalue" height="20" placeholder="请输入内容" auto-height></u-textarea>
<view class="butt" @click="pullmess">发布</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { postsInfo, commentsList, likesPosts, commentsPosts } from '@/api/shop'
import { import useUserStore from '@/store/user'
ref const userStore = useUserStore()
} from 'vue';
import { const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
postsInfo,
commentsList, const listdata = ref({})
likesPosts,
commentsPosts const plvalue = ref('')
} from '@/api/shop'
import useUserStore from '@/store/user' const dzClick = (like, id) => {
const userStore = useUserStore() if (userStore.userInfo.moblie === undefined) {
uni.showToast({
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') title: '请登录后操作!',
icon: 'none'
const listdata = ref({}) })
} else {
const plvalue = ref('') listdata.value.is_like = !like
if (!like) {
const dzClick = (like, id) => { listdata.value.like_count++
if (userStore.userInfo.moblie === undefined) { } else {
uni.showToast({ listdata.value.like_count--
title: '请登录后操作!', }
icon: 'none' likesPosts({
}) target_id: id,
} else { type: 'posts'
listdata.value.is_like = !like })
if (!like) { }
listdata.value.like_count++ }
} else {
listdata.value.like_count-- const pldzClick = (like, id) => {
} if (userStore.userInfo.moblie === undefined) {
likesPosts({ uni.showToast({
target_id: id, title: '请登录后操作!',
type: 'posts' icon: 'none'
}) })
} } else {
} pllist.value.forEach((ele) => {
if (ele.comments_id === id) {
const pldzClick = (like, id) => { ele.is_like = !ele.is_like
if (userStore.userInfo.moblie === undefined) { if (ele.is_like) {
uni.showToast({ ele.like_count++
title: '请登录后操作!', } else {
icon: 'none' ele.like_count--
}) }
} else { likesPosts({
pllist.value.forEach((ele) => { target_id: id,
if (ele.comments_id === id) { type: 'comments'
ele.is_like = !ele.is_like })
if (ele.is_like) { }
ele.like_count++ })
} else { }
ele.like_count-- }
} const postsid = ref(0)
likesPosts({ const page = ref(1)
target_id: id, const limit = ref(6)
type: 'comments' const pllist = ref([])
}) const getplList = async (id) => {
} await commentsList({
}) page: page.value,
} limit: limit.value,
} posts_id: postsid.value
const postsid = ref(0) }).then((res) => {
const page = ref(1) if (res.code === 1) {
const limit = ref(6) pllist.value = [...pllist.value, ...res.data.data]
const pllist = ref([]) }
const getplList = async (id) => { })
await commentsList({ }
page: page.value, const scrolltolower = async () => {
limit: limit.value, page.value++
posts_id: postsid.value await getplList()
}).then((res) => { }
if (res.code === 1) {
pllist.value = [...pllist.value,...res.data.data] const pullmess = async () => {
} await commentsPosts({
}) posts_id: postsid.value,
} content: plvalue.value
const scrolltolower = async () => { }).then((res) => {
page.value++ if (res.code === 1) {
await getplList() uni.showToast({
} title: '评论成功',
duration: 1000,
const pullmess = async () => { success: async () => {
await commentsPosts({ plvalue.value = ''
posts_id: postsid.value, page.value = 1
content: plvalue.value await postsInfo(postsid.value).then((res) => {
}).then((res) => { listdata.value = res.data
if (res.code === 1) { })
uni.showToast({ page.value = 1
title: '评论成功', limit.value = 6
duration: 1000, await commentsList({
success: async () => { page: page.value,
plvalue.value = '' limit: limit.value,
page.value = 1 posts_id: postsid.value
await postsInfo(postsid.value).then((res) => { }).then((res) => {
listdata.value = res.data if (res.code === 1) {
}) pllist.value = res.data.data
await getplList() }
} })
}) }
} })
}) }
} })
}
onLoad(async (param) => {
postsid.value = param.id onLoad(async (param) => {
page.value = 1 postsid.value = param.id
await postsInfo(param.id).then((res) => { page.value = 1
listdata.value = res.data await postsInfo(param.id).then((res) => {
}) listdata.value = res.data
await getplList() })
}) await getplList()
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
overflow-y: hidden; overflow-y: hidden;
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
.cardbox { .cardbox {
.dhone {
.dhone { margin-top: 30rpx;
margin-top: 30rpx; width: 100%;
width: 100%; padding: 40rpx;
padding: 40rpx; display: grid;
display: grid; align-items: center;
align-items: center; box-sizing: border-box;
box-sizing: border-box; background: #ffffff;
background: #FFFFFF;
.head {
.head { display: flex;
display: flex; align-items: center;
align-items: center;
.namepart {
.namepart { margin-left: 20rpx;
margin-left: 20rpx; display: grid;
display: grid;
.name {
.name { font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 350;
font-weight: 350; line-height: 26rpx;
line-height: 26rpx; letter-spacing: normal;
letter-spacing: normal; color: #0c092a;
color: #0C092A; }
}
.date {
.date { margin-top: 18rpx;
margin-top: 18rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 350;
font-weight: 350; line-height: 30rpx;
line-height: 30rpx; letter-spacing: normal;
letter-spacing: normal; color: #858494;
color: #858494; }
} }
} }
}
.pl {
.pl { margin-top: 24rpx;
margin-top: 24rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 350;
font-weight: 350; text-align: justify;
text-align: justify; /* 浏览器可能不支持 */
/* 浏览器可能不支持 */ letter-spacing: normal;
letter-spacing: normal; color: #0c092a;
color: #0C092A; }
}
.bottom {
.bottom { margin-top: 20rpx;
margin-top: 20rpx; display: flex;
display: flex; align-items: center;
align-items: center; justify-content: space-between;
justify-content: space-between;
.left {
.left { display: flex;
display: flex; align-items: center;
align-items: center;
.value {
.value { margin-left: 8rpx;
margin-left: 8rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 36rpx;
font-size: 36rpx; font-weight: 350;
font-weight: 350; line-height: 72rpx;
line-height: 72rpx; display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: normal;
letter-spacing: normal; color: #858494;
color: #858494; }
} }
}
.right {
.right { display: flex;
display: flex; align-items: center;
align-items: center;
.value {
.value { margin-left: 8rpx;
margin-left: 8rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 36rpx;
font-size: 36rpx; font-weight: 350;
font-weight: 350; line-height: 72rpx;
line-height: 72rpx; display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: normal;
letter-spacing: normal; color: #858494;
color: #858494; }
} }
} }
} }
} }
}
.ypl {
.ypl { width: 100%;
width: 100%; border-radius: 8rpx;
border-radius: 8rpx; background: #f8f9fa;
background: #F8F9FA; padding: 24rpx;
padding: 24rpx; margin-top: 22rpx;
margin-top: 22rpx;
.head {
.head { display: flex;
display: flex; align-items: center;
align-items: center; justify-content: space-between;
justify-content: space-between;
.left {
.left { display: flex;
display: flex; align-items: center;
align-items: center;
.name {
.name { margin-left: 8rpx;
margin-left: 8rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 350;
font-weight: 350; line-height: 26rpx;
line-height: 26rpx; letter-spacing: normal;
letter-spacing: normal; color: #333333;
color: #333333; }
} }
}
.right {
.right { display: flex;
display: flex; align-items: center;
align-items: center;
.value {
.value { font-family: Source Han Sans;
font-size: 24rpx;
font-family: Source Han Sans; font-weight: 350;
font-size: 24rpx; line-height: 20rpx;
font-weight: 350; letter-spacing: normal;
line-height: 20rpx; color: #858494;
letter-spacing: normal; }
color: #858494; }
} }
}
} .pl {
font-family: Source Han Sans;
.pl { font-size: 24rpx;
font-family: Source Han Sans; font-weight: 350;
font-size: 24rpx; line-height: normal;
font-weight: 350; text-align: justify;
line-height: normal; /* 浏览器可能不支持 */
text-align: justify; display: flex;
/* 浏览器可能不支持 */ align-items: center;
display: flex; letter-spacing: normal;
align-items: center; color: #0c092a;
letter-spacing: normal; }
color: #0C092A; }
} }
}
} .plpart {
position: fixed;
.plpart { bottom: 0;
position: fixed; width: 100%;
bottom: 0; padding: 20px 15px;
width: 100%; box-sizing: border-box;
padding: 20px 15px; display: flex;
box-sizing: border-box; align-items: center;
display: flex;
align-items: center; .textarea {
}
.textarea {}
.butt {
.butt { margin-left: 10px;
margin-left: 10px; padding: 9px 8px;
padding: 9px 8px; box-sizing: border-box;
box-sizing: border-box; background-color: #5ac725;
background-color: #5AC725; border-radius: 5px;
border-radius: 5px; color: #ffffff;
color: #FFFFFF; }
} }
} </style>
</style>

673
src/pages/index/shoppage/interactiveZone.vue

@ -1,343 +1,344 @@
<template> <template>
<u-navbar :title="'互动专区'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'互动专区'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<u-tabs :list="list1" @click="click"></u-tabs> <u-tabs :list="list1" @click="click"></u-tabs>
<scroll-view class="cardbox" scroll-y="true" @scrolltolower="scrolltolower"> <scroll-view class="cardbox" scroll-y="true" @scrolltolower="scrolltolower">
<view class="dhone" v-for="(item,index) in datalist" :key="index"> <view class="dhone" v-for="(item, index) in datalist" :key="index">
<view class="head"> <view class="head">
<image style="height: 96rpx;width: 96rpx;border-radius: 50%;" :src="url + '/' + item.member_head_pic" mode=""> <image style="height: 96rpx; width: 96rpx; border-radius: 50%" :src="url + '/' + item.member_head_pic" mode=""></image>
</image> <view class="namepart">
<view class="namepart"> <text class="name">{{ item.member_nickname }}</text>
<text class="name">{{item.member_nickname}}</text> <text class="date">{{ item.create_time }}</text>
<text class="date">{{item.create_time}}</text> </view>
</view> </view>
</view> <text class="pl">{{ item.content }}</text>
<text class="pl">{{item.content}}</text> <view class="ypl" v-if="item.comments">
<view class="ypl" v-if="item.comments"> <view class="head">
<view class="head"> <view class="left">
<view class="left"> <image
<image style="height: 40rpx;width: 40rpx;border-radius: 50%;" :src="url + '/' + item.comments?.member_head_pic" style="height: 40rpx; width: 40rpx; border-radius: 50%"
mode=""></image> :src="url + '/' + item.comments?.member_head_pic"
<text class="name">{{item.comments?.member_nickname}}</text> mode=""
</view> ></image>
<view class="right"> <text class="name">{{ item.comments?.member_nickname }}</text>
<text class="value">{{item.comments?.like_count}}</text> </view>
<image style="width: 24rpx;height: 24rpx;margin-left: 8rpx;" :src="item.comments.is_like?'/static/img/ydz.png':'/static/img/dz.png'" <view class="right">
mode="" @click="pldzClick(item.posts_id,item.comments.is_like,item.comments.comments_id)"></image> <text class="value">{{ item.comments?.like_count }}</text>
</view> <image
</view> style="width: 24rpx; height: 24rpx; margin-left: 8rpx"
<text class="pl">{{item.comments?.content}}</text> :src="item.comments.is_like ? '/static/img/ydz.png' : '/static/img/dz.png'"
</view> mode=""
<view class="bottom"> @click="pldzClick(item.posts_id, item.comments.is_like, item.comments.comments_id)"
<view class="left"> ></image>
<image style="width: 36rpx;height: 34rpx;" </view>
:src="item.is_like?'/static/img/ydz.png':'/static/img/dz.png'" @click="dzClick(item.is_like,item.posts_id)" mode=""> </view>
</image> <text class="pl">{{ item.comments?.content }}</text>
<text class="value">{{item.like_count}}</text> </view>
</view> <view class="bottom">
<view class="right"> <view class="left">
<image style="width: 36rpx;height: 36rpx;" src="@/static/img/pl.png" mode="" <image
@click="godetail(item.posts_id)"></image> style="width: 36rpx; height: 34rpx"
<text class="value">{{item.comment_count}}</text> :src="item.is_like ? '/static/img/ydz.png' : '/static/img/dz.png'"
</view> @click="dzClick(item.is_like, item.posts_id)"
</view> mode=""
</view> ></image>
</scroll-view> <text class="value">{{ item.like_count }}</text>
</view> </view>
<liuDragButton :widthPx="'145rpx'"> <view class="right">
<image class="hdzq" src="@/static/img/fbhd.png" mode="" @click="goxzhdzq"></image> <image style="width: 36rpx; height: 36rpx" src="@/static/img/pl.png" mode="" @click="godetail(item.posts_id)"></image>
</liuDragButton> <text class="value">{{ item.comment_count }}</text>
</view>
</view>
</view>
</scroll-view>
</view>
<liuDragButton :width-px="'145rpx'">
<image class="hdzq" src="@/static/img/fbhd.png" mode="" @click="goxzhdzq"></image>
</liuDragButton>
</template> </template>
<script setup> <script setup>
import { postsList, likesPosts } from '@/api/shop' import { postsList, likesPosts } from '@/api/shop'
import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue' import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const userStore = useUserStore() const userStore = useUserStore()
const url = ref(import.meta.env.VITE_APP_BASE_URL) const url = ref(import.meta.env.VITE_APP_BASE_URL)
//
// const list1 = reactive([
const list1 = reactive([{ {
name: '小店帮', name: '小店帮',
id: 1 id: 1
}, },
{ {
name: '金融帮', name: '金融帮',
id: 2 id: 2
}, },
{ {
name: '媒体帮', name: '媒体帮',
id: 3 id: 3
}, },
{ {
name: '企业帮', name: '企业帮',
id: 4 id: 4
} }
]); ])
const typeid = ref(1)
const typeid = ref(1) //
// const click = async (item) => {
const click = async(item) => { page.value = 1
page.value = 1 typeid.value = item.id
typeid.value = item.id datalist.value = []
datalist.value = [] await getpostsList()
await getpostsList() }
}
const dzClick = (like, id) => {
if (userStore.userInfo.moblie === undefined) {
const dzClick = (like,id) => { uni.showToast({
if(userStore.userInfo.moblie === undefined) { title: '请登录后操作!',
uni.showToast({ icon: 'none'
title: '请登录后操作!', })
icon: 'none' } else {
}) datalist.value.forEach((ele) => {
} else { if (ele.posts_id === id) {
datalist.value.forEach((ele)=> { ele.is_like = !ele.is_like
if(ele.posts_id === id) { if (ele.is_like) {
ele.is_like = !ele.is_like ele.like_count++
if(ele.is_like) { } else {
ele.like_count++ ele.like_count--
} else { }
ele.like_count-- likesPosts({ target_id: id, type: 'posts' })
} }
likesPosts({target_id: id, type: 'posts'}) })
} }
}) }
}
} const scrolltolower = async () => {
page.value++
const scrolltolower = async() => { await getpostsList()
page.value++ }
await getpostsList()
} const goxzhdzq = () => {
uni.navigateTo({
const goxzhdzq = () => { url: '/pages/index/shoppage/makeAssistance'
uni.navigateTo({ })
url: '/pages/index/shoppage/makeAssistance' }
})
} const godetail = (id) => {
uni.navigateTo({
const godetail = (id) => { url: '/pages/index/shoppage/interactiveDetail?id=' + id
uni.navigateTo({ })
url: '/pages/index/shoppage/interactiveDetail?id='+id }
})
} const page = ref(1)
const limit = ref(4)
const page = ref(1) const datalist = ref([])
const limit = ref(4) const getpostsList = async () => {
const datalist = ref([]) await postsList({ page: page.value, limit: limit.value, type_id: typeid.value }).then((res) => {
const getpostsList = async() => { if (res.code === 1) {
await postsList({page: page.value, limit: limit.value, type_id: typeid.value}).then((res)=> { datalist.value = [...datalist.value, ...res.data.data]
if(res.code === 1) { }
datalist.value = [...datalist.value, ...res.data.data] })
} }
})
} const pldzClick = (postid, like, id) => {
if (userStore.userInfo.moblie === undefined) {
const pldzClick = (postid, like, id) => { uni.showToast({
if (userStore.userInfo.moblie === undefined) { title: '请登录后操作!',
uni.showToast({ icon: 'none'
title: '请登录后操作!', })
icon: 'none' } else {
}) datalist.value.forEach((ele) => {
} else { if (ele.posts_id === postid) {
datalist.value.forEach((ele) => { ele.comments.is_like = !like
if (ele.posts_id === postid) { if (ele.comments.is_like) {
ele.comments.is_like = !like ele.comments.like_count++
if (ele.comments.is_like) { } else {
ele.comments.like_count++ ele.comments.like_count--
} else { }
ele.comments.like_count-- likesPosts({
} target_id: id,
likesPosts({ type: 'comments'
target_id: id, })
type: 'comments' }
}) })
} }
}) }
}
} onLoad(async (e) => {
page.value = 1
datalist.value = []
await getpostsList()
console.log(userStore.cometype)
onLoad(async(e)=> { })
page.value = 1
datalist.value = []
await getpostsList()
console.log(userStore.cometype);
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #F1F3F9; background-color: #f1f3f9;
height: calc(100vh - 96px); height: calc(100vh - 96px);
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
.cardbox { .cardbox {
max-height: calc(100vh - 150px); max-height: calc(100vh - 150px);
.dhone { .dhone {
margin-top: 30rpx; margin-top: 30rpx;
width: 100%; width: 100%;
padding: 40rpx; padding: 40rpx;
display: grid; display: grid;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
background: #FFFFFF; background: #ffffff;
.head { .head {
display: flex; display: flex;
align-items: center; align-items: center;
.namepart { .namepart {
margin-left: 20rpx; margin-left: 20rpx;
display: grid; display: grid;
.name { .name {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 26rpx; line-height: 26rpx;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.date { .date {
margin-top: 18rpx; margin-top: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 30rpx; line-height: 30rpx;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
.pl { .pl {
margin-top: 24rpx; margin-top: 24rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.bottom { .bottom {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.value { .value {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 350; font-weight: 350;
line-height: 72rpx; line-height: 72rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
.right { .right {
display: flex; display: flex;
align-items: center; align-items: center;
.value { .value {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 350; font-weight: 350;
line-height: 72rpx; line-height: 72rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
} }
} }
.ypl { .ypl {
width: 100%; width: 100%;
border-radius: 8rpx; border-radius: 8rpx;
background: #F8F9FA; background: #f8f9fa;
padding: 24rpx; padding: 24rpx;
margin-top: 22rpx; margin-top: 22rpx;
.head { .head {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.name { .name {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 26rpx; line-height: 26rpx;
letter-spacing: normal; letter-spacing: normal;
color: #333333; color: #333333;
} }
} }
.right { .right {
display: flex; display: flex;
align-items: center; align-items: center;
.value { .value {
font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 24rpx;
font-size: 24rpx; font-weight: 350;
font-weight: 350; line-height: 20rpx;
line-height: 20rpx; letter-spacing: normal;
letter-spacing: normal; color: #858494;
color: #858494; }
} }
} }
}
.pl {
.pl { font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 24rpx;
font-size: 24rpx; font-weight: 350;
font-weight: 350; line-height: normal;
line-height: normal; text-align: justify;
text-align: justify; /* 浏览器可能不支持 */
/* 浏览器可能不支持 */ display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: normal;
letter-spacing: normal; color: #0c092a;
color: #0C092A; }
} }
} }
}
.hdzq {
.hdzq { width: 108rpx;
width: 108rpx; height: 108rpx;
height: 108rpx; position: fixed;
position: fixed; right: 0;
right: 0; top: 75%;
top: 75%; }
} </style>
</style>

188
src/pages/index/shoppage/jrbDetail.vue

@ -1,106 +1,100 @@
<template> <template>
<u-navbar :title="'金融帮'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'金融帮'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">产品说明</text> <text class="title">产品说明</text>
</view> </view>
<image style="width: 100%;height: 286rpx;margin-top: 40rpx;" :src="baseurl + listdata.index_pic" mode=""></image> <image style="width: 100%; height: 286rpx; margin-top: 40rpx" :src="baseurl + listdata.index_pic" mode=""></image>
<u-parse :content="listdata.content"></u-parse> <u-parse :content="listdata.content"></u-parse>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">联系方式</text> <text class="title">联系方式</text>
</view> </view>
<view class="people"> <view class="people">
<text class="text">{{listdata.listdata}} {{listdata.tel}}</text> <text class="text">{{ listdata.listdata }} {{ listdata.tel }}</text>
</view> </view>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">微信二维码</text> <text class="title">微信二维码</text>
</view> </view>
<image style="width: 338rpx;height: 338rpx;margin-top: 28rpx;margin-left: 24%;" :src="baseurl+listdata.code_pic" mode=""></image> <image style="width: 338rpx; height: 338rpx; margin-top: 28rpx; margin-left: 24%" :src="baseurl + listdata.code_pic" mode=""></image>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { financeInfo } from '@/api/shop'
import {
ref
} from 'vue';
import {
financeInfo
} from '@/api/shop'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const listdata = ref({})
onLoad(async(param) => { const listdata = ref({})
await financeInfo(param.id).then((res) => {
listdata.value = res.data onLoad(async (param) => {
}) await financeInfo(param.id).then((res) => {
}) listdata.value = res.data
})
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
padding: 40rpx 40rpx 0 40rpx; padding: 40rpx 40rpx 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
.titlepart { .titlepart {
margin-top: 40rpx; margin-top: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.icon{ .icon {
width: 12rpx; width: 12rpx;
height: 32rpx; height: 32rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
} }
.title { .title {
margin-left: 18rpx; margin-left: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.message { .message {
margin-top: 36rpx; margin-top: 36rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
.people { .people {
margin-top: 28rpx; margin-top: 28rpx;
display: flex; display: flex;
.text { .text {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
} }
} }
</style> </style>

300
src/pages/index/shoppage/makeAssistance.vue

@ -1,162 +1,174 @@
<template> <template>
<view class="boxhdzq"> <view class="boxhdzq">
<view class="xzzq"> <view class="xzzq">
<view class="left"> <view class="left">
<image style="width: 28rpx;height: 28rpx;" src="@/static/img/xzzq.png" mode=""></image> <image style="width: 28rpx; height: 28rpx" src="@/static/img/xzzq.png" mode=""></image>
<text class="txt">选择专区</text> <text class="txt">选择专区</text>
</view> </view>
<view class="right"> <view class="right">
<input style="text-align: end;" v-model="xzvalue" type="text" placeholder="请选择您要提问的专区" <input
placeholder-class="placlass" disabled @tap="showxz = true" /> style="text-align: end"
<u-action-sheet :actions="list" @select="selectClick" @close="showxz = false" :show="showxz" v-model="xzvalue"
closeOnClickOverlay="true"></u-action-sheet> type="text"
<image style="width: 16rpx;height: 28rpx;margin-left: 8rpx;" src="@/static/img/right.png" mode=""> placeholder="请选择您要提问的专区"
</image> placeholder-class="placlass"
</view> disabled
</view> @tap="showxz = true"
<u-textarea v-model="nrvalue" placeholder="请输入您的内容...." count autoHeight maxlength="200" height="266" />
border="none"></u-textarea> <u-action-sheet
<view class="buts"> :actions="list"
<view class="button" @click="submit" @select="selectClick"
:style="nrvalue===''?'background: linear-gradient(90deg, rgba(0, 127, 255, 0.3) 0%, rgba(153, 204, 255, 0.3) 100%)':''"> @close="showxz = false"
发布 :show="showxz"
</view> close-on-click-overlay="true"
</view> ></u-action-sheet>
</view> <image style="width: 16rpx; height: 28rpx; margin-left: 8rpx" src="@/static/img/right.png" mode=""></image>
</view>
</view>
<u-textarea v-model="nrvalue" placeholder="请输入您的内容...." count auto-height maxlength="200" height="266" border="none"></u-textarea>
<view class="buts">
<view
class="button"
@click="submit"
:style="nrvalue === '' ? 'background: linear-gradient(90deg, rgba(0, 127, 255, 0.3) 0%, rgba(153, 204, 255, 0.3) 100%)' : ''"
>
发布
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { addPosts } from '@/api/shop'
} from 'vue';
import { addPosts } from '@/api/shop'
const list = ref([{ const list = ref([
name: '小店帮', {
id: 1 name: '小店帮',
}, id: 1
{ },
name: '金融帮', {
id: 2 name: '金融帮',
}, id: 2
{ },
name: '媒体帮', {
id: 3 name: '媒体帮',
}, id: 3
{ },
name: '企业帮', {
id: 4 name: '企业帮',
} id: 4
]); }
])
const showxz = ref(false) const showxz = ref(false)
const xzvalue = ref('') const xzvalue = ref('')
const xzid = ref(1) const xzid = ref(1)
const nrvalue = ref('') const nrvalue = ref('')
const selectClick = (index) => { const selectClick = (index) => {
xzvalue.value = index.name xzvalue.value = index.name
xzid.value = index.id xzid.value = index.id
showxz.value = false showxz.value = false
}; }
const submit = () => { const submit = () => {
if (nrvalue.value !== '') { if (nrvalue.value !== '') {
let params = { let params = {
type_id: xzid.value, type_id: xzid.value,
content: nrvalue.value content: nrvalue.value
} }
addPosts(params).then((res)=> { addPosts(params).then((res) => {
if(res.code === 1) { if (res.code === 1) {
uni.showToast({ uni.showToast({
title: '发布成功', title: '发布成功',
duration: 1500, duration: 1500,
success() { success() {
setTimeout(()=> { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/shoppage/interactiveZone' url: '/pages/index/shoppage/interactiveZone'
}) })
},1500) }, 1500)
} }
}) })
} }
}) })
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.boxhdzq { .boxhdzq {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background: #F1F3F9; background: #f1f3f9;
.xzzq { .xzzq {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 28rpx 40rpx; padding: 28rpx 40rpx;
background: #FFFFFF; background: #ffffff;
border-bottom: 4rpx solid #F1F3F9; border-bottom: 4rpx solid #f1f3f9;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.txt { .txt {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
line-height: normal; line-height: normal;
letter-spacing: normal; letter-spacing: normal;
color: #273847; color: #273847;
} }
} }
.right { .right {
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
.buts { .buts {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
.button { .button {
margin-top: 108rpx; margin-top: 108rpx;
border-radius: 248rpx; border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(90deg, #007fff 0%, #99ccff 100%);
width: 576rpx; width: 576rpx;
height: 96rpx; height: 96rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
} }
.placlass { .placlass {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 40rpx; line-height: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #D3D3D3; color: #d3d3d3;
} }
</style> </style>

326
src/pages/index/shoppage/mediaDetail.vue

@ -1,170 +1,174 @@
<template> <template>
<u-navbar :title="'媒体帮'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'媒体帮'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<image style="width: 100%;height: 300rpx;" src="@/static/img/ztback.png" mode=""></image> <image style="width: 100%; height: 300rpx" src="@/static/img/ztback.png" mode=""></image>
<view class="main"> <view class="main">
<view class="head"> <view class="head">
<image class="toux" :src="baseurl + userData.head_pic" mode=""></image> <image class="toux" :src="baseurl + userData.head_pic" mode=""></image>
<text class="name">{{userData.name}}</text> <text class="name">{{ userData.name }}</text>
<text class="type">{{userData.member_tag_title || userData.tag_name}}</text> <text class="type">{{ userData.member_tag_title || userData.tag_name }}</text>
</view> </view>
<view class="content"> <view class="content">
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">{{userData.introduce?'个人介绍':'助企案例'}}</text> <text class="title">{{ userData.introduce ? '个人介绍' : '助企案例' }}</text>
</view> </view>
<text class="message" v-if="userData.introduce">{{userData.introduce}}</text> <text class="message" v-if="userData.introduce">{{ userData.introduce }}</text>
<u-parse v-if="userData.content" :content="userData.content"></u-parse> <u-parse v-if="userData.content" :content="userData.content"></u-parse>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">联系方式</text> <text class="title">联系方式</text>
</view> </view>
<view class="people"> <view class="people">
<text class="text">{{userData.moblie||userData.tel}}</text> <text class="text">{{ userData.moblie || userData.tel }}</text>
</view> </view>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">微信二维码</text> <text class="title">微信二维码</text>
</view> </view>
<image style="width: 338rpx;height: 338rpx;margin-top: 28rpx;margin-left: 24%;" v-if="userData.wx_code" :src="baseurl + userData.wx_code" mode=""></image> <image
<image style="width: 338rpx;height: 338rpx;margin-top: 28rpx;margin-left: 24%;" v-if="userData.code_pic" :src="baseurl + userData.code_pic" mode=""></image> style="width: 338rpx; height: 338rpx; margin-top: 28rpx; margin-left: 24%"
</view> v-if="userData.wx_code"
</view> :src="baseurl + userData.wx_code"
</view> mode=""
></image>
<image
style="width: 338rpx; height: 338rpx; margin-top: 28rpx; margin-left: 24%"
v-if="userData.code_pic"
:src="baseurl + userData.code_pic"
mode=""
></image>
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { memberCenterInfo } from '@/api/memberCenter'
import { import { mediumInfo } from '@/api/shop'
ref
} from 'vue';
import { memberCenterInfo } from '@/api/memberCenter'
import {
mediumInfo
} from '@/api/shop'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
const userData = ref({}) const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
onLoad(async(param) => { const userData = ref({})
if(param.type === 'mt') {
await mediumInfo(param.id).then((res)=> { onLoad(async (param) => {
if(res.code === 1) { if (param.type === 'mt') {
userData.value = res.data await mediumInfo(param.id).then((res) => {
} if (res.code === 1) {
}) userData.value = res.data
} else { }
await memberCenterInfo(param.id).then((res)=> { })
console.log(res); } else {
if(res.code === 1) { await memberCenterInfo(param.id).then((res) => {
userData.value = res.data console.log(res)
} if (res.code === 1) {
}) userData.value = res.data
} }
}) })
}
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
.main { .main {
width: 100%; width: 100%;
margin-top: -200rpx; margin-top: -200rpx;
.head { .head {
width: 100%; width: 100%;
display: grid; display: grid;
justify-items: center; justify-items: center;
.toux { .toux {
width: 316rpx; width: 316rpx;
height: 316rpx; height: 316rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 50%; border-radius: 50%;
/* White */ /* White */
border: 8rpx solid #FFFFFF; border: 8rpx solid #ffffff;
box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(101, 101, 101, 0.15); box-shadow: 0rpx 8rpx 40rpx 0rpx rgba(101, 101, 101, 0.15);
} }
.name { .name {
margin-top: 32rpx; margin-top: 32rpx;
font-family: Inter; font-family: Inter;
font-size: 60rpx; font-size: 60rpx;
font-weight: 520; font-weight: 520;
line-height: 84rpx; line-height: 84rpx;
text-align: center; text-align: center;
letter-spacing: normal; letter-spacing: normal;
color: #000000; color: #000000;
} }
.type { .type {
margin-top: 4rpx; margin-top: 4rpx;
font-family: Inter; font-family: Inter;
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
line-height: 44rpx; line-height: 44rpx;
text-align: center; text-align: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
.content { .content {
padding: 0 40rpx; padding: 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 100rpx; padding-bottom: 100rpx;
} }
} }
.titlepart { .titlepart {
margin-top: 40rpx; margin-top: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.icon{ .icon {
width: 12rpx; width: 12rpx;
height: 32rpx; height: 32rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
} }
.title { .title {
margin-left: 18rpx; margin-left: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.message { .message {
margin-top: 36rpx; margin-top: 36rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
.people { .people {
margin-top: 28rpx; margin-top: 28rpx;
display: flex; display: flex;
.text { .text {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
} }
} }
</style> </style>

463
src/pages/index/shoppage/mediaHelp.vue

@ -1,257 +1,256 @@
<template> <template>
<view class="container"> <view class="container">
<u-navbar title="媒体帮" placeholder="true" bgColor="#F1F3F9" :autoBack="true"> <u-navbar title="媒体帮" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar>
</u-navbar> <u-search
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" @search="search"
placeholderColor="#a4c7ff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" @clickIcon="clickIcon"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx"></u-search> @clear="clear"
<scroll-view scroll-y="auto" class="mtlist" @scrolltolower="onloadmore"> shape="square"
<view class="mtone" v-for="(item,index) in mtList" :key="index" @click="gomtbdetail(item.id)"> placeholder="请输入搜索内容"
<view class="headpart"> placeholder-color="#a4c7ff"
<u-avatar :src="baseurl+item.head_pic" size="44"></u-avatar> v-model="keyword"
<view class="right"> search-icon="/static/img/search.png"
<text class="name">{{item.name}}</text> search-icon-size="14"
<view class="tab"> :show-action="false"
{{item.tag_name}} height="40"
</view> margin="40rpx 24rpx 24rpx 24rpx"
</view> ></u-search>
</view> <scroll-view scroll-y="auto" class="mtlist" @scrolltolower="onloadmore">
<image style="width: 100%;height: 400rpx;margin-top: 30rpx;" :src="baseurl+item.publicize_pic" mode=""> <view class="mtone" v-for="(item, index) in mtList" :key="index" @click="gomtbdetail(item.id)">
</image> <view class="headpart">
<view class="bottompart"> <u-avatar :src="baseurl + item.head_pic" size="44"></u-avatar>
<view class="part"> <view class="right">
<image style="width: 22rpx;height: 24rpx;" src="@/static/img/dh.png" mode=""></image> <text class="name">{{ item.name }}</text>
<text class="text">{{item.tel}}</text> <view class="tab" v-if="item.tag_name !== ''">
</view> {{ item.tag_name }}
<view class="part"> </view>
<image style="width: 22rpx;height: 24rpx;" src="@/static/img/yx.png" mode=""></image> </view>
<text class="text">{{item.email}}</text> </view>
</view> <image style="width: 100%; height: 400rpx; margin-top: 30rpx" :src="baseurl + item.publicize_pic" mode=""></image>
</view> <view class="bottompart">
</view> <view class="part">
</scroll-view> <image style="width: 22rpx; height: 24rpx" src="@/static/img/dh.png" mode=""></image>
<view class="fbxxbutton"> <text class="text">{{ item.tel }}</text>
<view class="button" @click="gofbxx"> </view>
发布信息 <view class="part">
</view> <image style="width: 22rpx; height: 24rpx" src="@/static/img/yx.png" mode=""></image>
</view> <view class="text">{{ item.email }}</view>
</view> </view>
<liuDragButton :widthPx="'145rpx'"> </view>
<image class="hdzq" src="@/static/img/hdzq.png" mode="" @click="gohdzq"></image> </view>
</liuDragButton> </scroll-view>
<view class="fbxxbutton">
<view class="button" @click="gofbxx">发布信息</view>
</view>
</view>
<liuDragButton :width-px="'145rpx'">
<image class="hdzq" src="@/static/img/hdzq.png" mode="" @click="gohdzq"></image>
</liuDragButton>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { mediumList } from '@/api/shop'
} from 'vue'; import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
import {
mediumList
} from '@/api/shop'
import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
//
const keyword = ref('')
const page = ref(1)
const pagesize = ref(2)
const search = async (val) => {
page.value = 1
pagesize.value = 2
await getmediumList(keyword.value, page.value, pagesize.value)
}
// const clickIcon = async () => {
const keyword = ref(''); page.value = 1
const page = ref(1) pagesize.value = 2
const pagesize = ref(2) await getmediumList(keyword.value, page.value, pagesize.value)
}
const clear = async () => {
page.value = 1
pagesize.value = 2
await getmediumList(keyword.value, page.value, pagesize.value)
}
const search = async (val) => { const gohdzq = () => {
page.value = 1 uni.navigateTo({
pagesize.value = 2 url: '/pages/index/shoppage/interactiveZone'
await getmediumList(keyword.value, page.value, pagesize.value) })
} }
const clickIcon = async () => {
page.value = 1
pagesize.value = 2
await getmediumList(keyword.value, page.value, pagesize.value)
}
const clear = async () => {
page.value = 1
pagesize.value = 2
await getmediumList(keyword.value, page.value, pagesize.value)
}
const gohdzq = () => { const mtList = ref([])
uni.navigateTo({
url: '/pages/index/shoppage/interactiveZone'
})
}
const mtList = ref([]) const gomtbdetail = (id) => {
uni.navigateTo({
const gomtbdetail = (id) => { url: '/pages/index/shoppage/mediaDetail?id=' + id + '&type=' + 'mt'
uni.navigateTo({ })
url: '/pages/index/shoppage/mediaDetail?id='+id +'&type='+'mt' }
})
}
const gofbxx = () => {
uni.navigateTo({
url: '/pages/index/shoppage/mtbmakeMessage'
})
}
const getmediumList = async (name, page, limit) => { const gofbxx = () => {
let params = { uni.navigateTo({
'name': name, url: '/pages/index/shoppage/mtbmakeMessage'
'page': page, })
'limit': limit }
}
await mediumList(params).then((res) => { const getmediumList = async (name, page, limit) => {
mtList.value = res.data.data let params = {
}) name: name,
} page: page,
limit: limit
const onloadmore = async () => { }
page.value++ await mediumList(params).then((res) => {
let params = { mtList.value = res.data.data
'name': keyword.value, })
'page': page.value, }
'limit': pagesize.value
} const onloadmore = async () => {
await mediumList(params).then((res) => { page.value++
mtList.value = [...mtList.value, ...res.data.data] let params = {
}) name: keyword.value,
} page: page.value,
limit: pagesize.value
onShow(async() => { }
await getmediumList('',1,2) await mediumList(params).then((res) => {
}) mtList.value = [...mtList.value, ...res.data.data]
})
}
onShow(async () => {
await getmediumList('', 1, 2)
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background: linear-gradient(0deg, #F1F3F9 72%, rgba(62, 146, 249, 0.2) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgba(62, 146, 249, 0.2) 88%);
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
.mtlist { .mtlist {
margin-top: 8rpx; margin-top: 8rpx;
padding: 0 24rpx; padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
height: 100vh; height: 100vh;
max-height: calc(100vh - 336rpx); max-height: calc(100vh - 336rpx);
padding-bottom: 168rpx; padding-bottom: 168rpx;
.mtone { .mtone {
margin-top: 30rpx; margin-top: 30rpx;
width: 100%; width: 100%;
height: 666rpx; height: 666rpx;
border-radius: 24rpx; border-radius: 24rpx;
background: #FFFFFF; background: #ffffff;
display: grid; display: grid;
padding: 40rpx 24rpx; padding: 40rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
.headpart { .headpart {
display: flex; display: flex;
align-items: center; align-items: center;
.right { .right {
margin-left: 16rpx; margin-left: 16rpx;
display: grid; display: grid;
justify-items: baseline; justify-items: baseline;
.name { .name {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 350; font-weight: 350;
line-height: 43.2rpx; line-height: 43.2rpx;
display: flex; display: flex;
align-items: center; align-items: center;
text-transform: capitalize; text-transform: capitalize;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.tab { .tab {
margin-top: 8rpx; margin-top: 8rpx;
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
border-radius: 0rpx 4rpx 20rpx 0rpx; border-radius: 0rpx 4rpx 20rpx 0rpx;
background: linear-gradient(70deg, #312984 -45%, #867BF5 99%); background: linear-gradient(70deg, #312984 -45%, #867bf5 99%);
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
font-size: 24rpx; font-size: 24rpx;
font-weight: normal; font-weight: normal;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #FFFFFF; color: #ffffff;
text-shadow: 0rpx 4rpx 4rpx rgba(0, 0, 0, 0.2); text-shadow: 0rpx 4rpx 4rpx rgba(0, 0, 0, 0.2);
} }
} }
} }
.bottompart { .bottompart {
margin-top: 26rpx; margin-top: 26rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.part { .part {
display: flex; display: flex;
align-items: center; align-items: center;
.text { .text {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 300; font-weight: 300;
line-height: 33.6rpx; line-height: 33.6rpx;
display: flex; display: flex;
align-items: center; align-items: center;
text-transform: capitalize; letter-spacing: normal;
letter-spacing: normal; color: #606266;
color: #606266; }
} }
} }
} }
} }
} }
}
.hdzq { .hdzq {
width: 182rpx; width: 212rpx;
height: 80rpx; height: 86rpx;
position: fixed; position: fixed;
right: 0; right: 0;
top: 70%; top: 70%;
margin-right: -14rpx; margin-right: -14rpx;
} }
.fbxxbutton { .fbxxbutton {
width: 100%; width: 100%;
height: 168rpx; height: 168rpx;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
background: #FFFFFF; background: #ffffff;
/* 标签栏投影 */ /* 标签栏投影 */
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3); box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.button { .button {
width: 574rpx; width: 574rpx;
height: 96rpx; height: 96rpx;
border-radius: 248rpx; border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(90deg, #007fff 0%, #99ccff 100%);
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
</style> </style>

645
src/pages/index/shoppage/mtbmakeMessage.vue

@ -1,332 +1,361 @@
<template> <template>
<u-navbar :title="'媒体帮'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'媒体帮'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<view class="formlist"> <view class="formlist">
<u-form :model="form" ref="uFormRef" labelPosition="top" :rules="rules"> <u-form :model="form" ref="uFormRef" label-position="top" :rules="rules">
<u-form-item label="头像" prop="head_pic"> <u-form-item label="头像" prop="head_pic">
<u-upload class="uploadbox" @afterRead="txafterRead" :maxCount="1" :imageMode="'heightFix'" <u-upload class="uploadbox" @afterRead="txafterRead" :max-count="1" :image-mode="'heightFix'" :width="auto" :height="144">
:width="auto" :height="144"> <view class="yyzz" v-if="form.head_pic === ''">
<view class="yyzz" v-if="form.head_pic === ''"> <image style="width: 40rpx; height: 40rpx" src="@/static/img/yyzz.png" mode=""></image>
<image style="width: 40rpx;height: 40rpx;" src="@/static/img/yyzz.png" mode=""></image> 上传头像
上传头像 </view>
</view> <image
<image v-else style="width: 100%;height: 288rpx;margin-top: 12rpx;" v-else
:src="baseurl+ '/' + form.head_pic" mode="scaleToFill"></image> style="width: 100%; height: 288rpx; margin-top: 12rpx"
</u-upload> :src="baseurl + '/' + form.head_pic"
</u-form-item> mode="scaleToFill"
<u-form-item label="姓名" prop="name"> ></image>
<u-input v-model="form.name" placeholder="请输入真实姓名" placeholderStyle="color: #D3D3D3;" /> </u-upload>
</u-form-item> </u-form-item>
<u-form-item label="标签" prop="type"> <u-form-item label="姓名" prop="name">
<u-input v-model="form.type" placeholder="请选择" placeholderStyle="color: #D3D3D3;" <u-input v-model="form.name" placeholder="请输入真实姓名" placeholder-style="color: #D3D3D3;" />
suffixIcon="arrow-down" @focus="show=true" /> </u-form-item>
<u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="show=false" keyName="name"></u-picker> <u-form-item label="标签" prop="type">
</u-form-item> <u-input
<u-form-item label="联系方式" prop="tel"> v-model="form.type"
<u-input v-model="form.tel" placeholder="请输入联系方式" placeholderStyle="color: #D3D3D3;" /> placeholder="请选择"
</u-form-item> placeholder-style="color: #D3D3D3;"
<u-form-item label="微信二维码" prop="code_pic"> suffix-icon="arrow-down"
<u-upload class="uploadbox" @afterRead="codeafterRead" :maxCount="1" :imageMode="'heightFix'" @focus="show = true"
:width="auto" :height="144"> />
<view class="yyzz" v-if="form.code_pic === ''"> <u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="show = false" key-name="name"></u-picker>
<image style="width: 40rpx;height: 40rpx;" src="@/static/img/yyzz.png" mode=""></image> </u-form-item>
上传微信二维码 <u-form-item label="联系方式" prop="tel">
</view> <u-input v-model="form.tel" placeholder="请输入联系方式" placeholder-style="color: #D3D3D3;" />
<image v-else style="width: 100%;height: 288rpx;margin-top: 12rpx;" </u-form-item>
:src="baseurl+ '/' + form.code_pic" mode="scaleToFill"></image> <u-form-item label="微信二维码" prop="code_pic">
</u-upload> <u-upload class="uploadbox" @afterRead="codeafterRead" :max-count="1" :image-mode="'heightFix'" :width="auto" :height="144">
</u-form-item> <view class="yyzz" v-if="form.code_pic === ''">
<u-form-item label="邮箱" prop="email"> <image style="width: 40rpx; height: 40rpx" src="@/static/img/yyzz.png" mode=""></image>
<u-input v-model="form.email" placeholder="请输入邮箱地址" placeholderStyle="color: #D3D3D3;" /> 上传微信二维码
</u-form-item> </view>
<u-form-item label="宣传封面" prop="publicize_pic"> <image
<u-upload class="uploadbox" @afterRead="afterRead" :maxCount="1" :imageMode="'heightFix'" v-else
:width="auto" :height="144"> style="width: 100%; height: 288rpx; margin-top: 12rpx"
<view class="yyzz" v-if="form.publicize_pic === ''"> :src="baseurl + '/' + form.code_pic"
<image style="width: 40rpx;height: 40rpx;" src="@/static/img/yyzz.png" mode=""></image> mode="scaleToFill"
上传宣传封面 ></image>
</view> </u-upload>
<image v-else style="width: 100%;height: 288rpx;margin-top: 12rpx;" </u-form-item>
:src="baseurl+ '/' + form.publicize_pic" mode="scaleToFill"></image> <u-form-item label="邮箱" prop="email">
</u-upload> <u-input v-model="form.email" placeholder="请输入邮箱地址" placeholder-style="color: #D3D3D3;" />
</u-form-item> </u-form-item>
<u-form-item label="助企案例" prop="content"> <u-form-item label="宣传封面" prop="publicize_pic">
<u-input v-model="form.content" placeholder="请输入真实案例" placeholderStyle="color: #D3D3D3;" /> <u-upload class="uploadbox" @afterRead="afterRead" :max-count="1" :image-mode="'heightFix'" :width="auto" :height="144">
</u-form-item> <view class="yyzz" v-if="form.publicize_pic === ''">
</u-form> <image style="width: 40rpx; height: 40rpx" src="@/static/img/yyzz.png" mode=""></image>
</view> 上传宣传封面
<view class="sumitbotton"> </view>
<view class="button" @click="submit"> <image
确认提交 v-else
</view> style="width: 100%; height: 288rpx; margin-top: 12rpx"
</view> :src="baseurl + '/' + form.publicize_pic"
</view> mode="scaleToFill"
></image>
</u-upload>
</u-form-item>
<u-form-item label="助企案例" prop="content">
<u-input v-model="form.content" placeholder="请输入真实案例" placeholder-style="color: #D3D3D3;" />
</u-form-item>
</u-form>
</view>
<view class="sumitbotton">
<view class="button" @click="submit">确认提交</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { mediumAdd } from '@/api/shop'
} from 'vue';
import {
mediumAdd
} from '@/api/shop'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL) const baseurl = ref(import.meta.env.VITE_APP_BASE_URL)
// //
const form = ref({ const form = ref({
name: '', name: '',
type: '', type: '',
tag: '', tag: '',
tel: '', tel: '',
email: '', email: '',
publicize_pic: '', publicize_pic: '',
content: '', content: '',
code_pic: '', code_pic: '',
head_pic: '', head_pic: ''
}); })
const show = ref(false)
const columns = reactive([
[
{
id: 1,
name: '自媒体'
},
{
id: 2,
name: '达人'
},
{
id: 3,
name: '网红'
},
{
id: 4,
name: '孵化机构'
},
{
id: 5,
name: '陪跑机构'
}
]
])
const show = ref(false); //
const columns = reactive([[{ const rules = {
'id': 1, name: [
'name': '自媒体' {
}, required: true,
{ message: '请输入姓名',
'id': 2, trigger: ['blur', 'change']
'name': '达人' }
}, ],
{ type: [
'id': 3, {
'name': '网红' required: true,
}, message: '请选择标签',
{ trigger: ['blur', 'change']
'id': 4, }
'name': '孵化机构' ],
}, tel: [
{ {
'id': 5, required: true,
'name': '陪跑机构' message: '请输入联系方式',
}] trigger: ['blur', 'change']
]); }
],
email: [
{
required: true,
message: '请输入邮箱地址',
trigger: ['blur', 'change']
}
],
publicize_pic: [
{
required: true,
message: '请上传宣传封面',
trigger: ['blur', 'change']
}
],
code_pic: [
{
required: true,
message: '请上传微信二维码',
trigger: ['blur', 'change']
}
],
head_pic: [
{
required: true,
message: '请上传头像',
trigger: ['blur', 'change']
}
],
content: [
{
required: true,
message: '请输入真实案例',
trigger: ['blur', 'change']
}
]
}
// const afterRead = async (e) => {
const rules = { console.log(e)
name: [{ uni.uploadFile({
required: true, url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
message: '请输入姓名', filePath: e.file.url,
trigger: ['blur', 'change'], name: 'file',
}, ], header: {
type: [{ token: uni.getStorageSync('access_token')
required: true, },
message: '请输入标签', success: async (val) => {
trigger: ['blur', 'change'], if (JSON.parse(val.data).data.url) {
}, ], console.log(JSON.parse(val.data).data.url)
tel: [{ form.value.publicize_pic = JSON.parse(val.data).data.url
required: true, }
message: '请输入联系方式', },
trigger: ['blur', 'change'], fail: (res) => {
}, ], console.log('失败', res)
email: [{ }
required: true, })
message: '请输入邮箱地址', }
trigger: ['blur', 'change'],
}, ],
publicize_pic: [{
required: true,
message: '请上传宣传封面',
trigger: ['blur', 'change'],
}, ],
code_pic: [{
required: true,
message: '请上传微信二维码',
trigger: ['blur', 'change'],
}, ],
head_pic: [{
required: true,
message: '请上传头像',
trigger: ['blur', 'change'],
}, ],
content: [{
required: true,
message: '请输入真实案例',
trigger: ['blur', 'change'],
}, ],
};
const afterRead = async (e) => { const txafterRead = async (e) => {
console.log(e); uni.uploadFile({
uni.uploadFile({ url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image', filePath: e.file.url,
filePath: e.file.url, name: 'file',
name: 'file', header: {
header: { token: uni.getStorageSync('access_token')
'token': uni.getStorageSync('access_token') },
}, success: async (val) => {
success: async (val) => { if (JSON.parse(val.data).data.url) {
if (JSON.parse(val.data).data.url) { console.log(JSON.parse(val.data).data.url)
console.log(JSON.parse(val.data).data.url); form.value.head_pic = JSON.parse(val.data).data.url
form.value.publicize_pic = JSON.parse(val.data).data.url }
} },
}, fail: (res) => {
fail: (res) => { console.log('失败', res)
console.log('失败', res); }
} })
}) }
}
const txafterRead = async (e) => {
uni.uploadFile({
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
filePath: e.file.url,
name: 'file',
header: {
'token': uni.getStorageSync('access_token')
},
success: async (val) => {
if (JSON.parse(val.data).data.url) {
console.log(JSON.parse(val.data).data.url);
form.value.head_pic = JSON.parse(val.data).data.url
}
},
fail: (res) => {
console.log('失败', res);
}
})
}
const codeafterRead = async (e) => {
uni.uploadFile({
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
filePath: e.file.url,
name: 'file',
header: {
'token': uni.getStorageSync('access_token')
},
success: async (val) => {
if (JSON.parse(val.data).data.url) {
console.log(JSON.parse(val.data).data.url);
form.value.code_pic = JSON.parse(val.data).data.url
}
},
fail: (res) => {
console.log('失败', res);
}
})
}
// const codeafterRead = async (e) => {
const uFormRef = ref(null); uni.uploadFile({
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
filePath: e.file.url,
name: 'file',
header: {
token: uni.getStorageSync('access_token')
},
success: async (val) => {
if (JSON.parse(val.data).data.url) {
console.log(JSON.parse(val.data).data.url)
form.value.code_pic = JSON.parse(val.data).data.url
}
},
fail: (res) => {
console.log('失败', res)
}
})
}
const confirm = (val) => { //
console.log(val.value[0]); const uFormRef = ref(null)
form.value.type = val.value[0].name
form.value.tag = val.value[0].id
show.value = false
}
// const confirm = (val) => {
function submit() { console.log(val.value[0])
uFormRef.value.validate().then(valid => { form.value.type = val.value[0].name
if (valid) { form.value.tag = val.value[0].id
uni.$u.toast('校验通过') show.value = false
delete form.value.type }
mediumAdd(form.value).then((res)=> {
if(res.code === 1) { //
uni.navigateBack() function submit() {
} uFormRef.value
}) .validate()
} else { .then((valid) => {
uni.$u.toast('请填写完整') if (valid) {
} uni.$u.toast('校验通过')
}).catch(() => { delete form.value.type
// mediumAdd(form.value).then((res) => {
uni.$u.toast('请填写完整') if (res.code === 1) {
}); uni.navigateBack()
} }
})
} else {
uni.$u.toast('请填写完整')
}
})
.catch(() => {
//
uni.$u.toast('请填写完整')
})
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
width: 100%; width: 100%;
overflow-y: hidden; overflow-y: hidden;
.formlist { .formlist {
width: 100%; width: 100%;
height: calc(100vh - 346rpx); height: calc(100vh - 346rpx);
background: #e9ecf3; background: #e9ecf3;
padding: 40rpx; padding: 40rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
} }
.sumitbotton { .sumitbotton {
width: 100%; width: 100%;
height: 168rpx; height: 168rpx;
background: #FFFFFF; background: #ffffff;
/* 标签栏投影 */ /* 标签栏投影 */
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3); box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
.button { .button {
width: 574rpx; width: 574rpx;
height: 96rpx; height: 96rpx;
border-radius: 248rpx; border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(90deg, #007fff 0%, #99ccff 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
} }
} }
} }
.yyzz { .yyzz {
margin-top: 12rpx; margin-top: 12rpx;
width: 100%; width: 100%;
height: 288rpx; height: 288rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: #FFFFFF; background: #ffffff;
display: grid; display: grid;
align-content: center; align-content: center;
justify-items: center; justify-items: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 70rpx; line-height: 70rpx;
letter-spacing: normal; letter-spacing: normal;
color: #CCCCCC; color: #cccccc;
} }
:deep(.u-upload) { :deep(.u-upload) {
.u-upload__wrap { .u-upload__wrap {
view { view {
width: 100%; width: 100%;
} }
} }
} }
</style> </style>
<style> <style>
.u-input { .u-input {
background-color: #FFFFFF; background-color: #ffffff;
height: 100rpx !important; height: 100rpx !important;
} }
.u-form-item__body__left__content__label { .u-form-item__body__left__content__label {
white-space: nowrap; white-space: nowrap;
} }
</style> </style>

118
src/pages/index/shoppage/shopHelp.vue

@ -1,73 +1,77 @@
<template> <template>
<u-navbar title="小店帮" placeholder="true" bgColor="#F1F3F9" :autoBack="true"> <u-navbar title="开店帮" placeholder="true" bg-color="#F1F3F9" :auto-back="true"></u-navbar>
</u-navbar> <view class="container">
<view class="container"> <u-search
<u-search @search="search" @clickIcon="clickIcon" shape="square" placeholder="请输入搜索内容" @search="search"
placeholderColor="#a4c7ff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" @clickIcon="clickIcon"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx"></u-search> shape="square"
<zh-scroll ref="zhscrollRel" :scrollList="goods" :searchVal="keyword"></zh-scroll> placeholder="请输入搜索内容"
</view> placeholder-color="#a4c7ff"
<liuDragButton :widthPx="'145rpx'"> v-model="keyword"
<image class="hdzq" src="@/static/img/hdzq.png" mode="" @click="gohdzq"></image> search-icon="/static/img/search.png"
</liuDragButton> search-icon-size="14"
:show-action="false"
height="40"
margin="40rpx 24rpx 24rpx 24rpx"
></u-search>
<zh-scroll ref="zhscrollRel" :scroll-list="goods" :search-val="keyword"></zh-scroll>
</view>
<liuDragButton :width-px="'145rpx'">
<image class="hdzq" src="@/static/img/hdzq.png" mode="aspectFill" @click="gohdzq"></image>
</liuDragButton>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref
} from 'vue';
import zhScroll from '@/components/zh-scroll/zh-scroll.vue'; import zhScroll from '@/components/zh-scroll/zh-scroll.vue'
import { storeList } from '@/api/shop' import { storeList } from '@/api/shop'
import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue' import liuDragButton from '@/uni_modules/liu-drag-button/components/liu-drag-button/liu-drag-button.vue'
const zhscrollRel = ref(null) const zhscrollRel = ref(null)
// //
const keyword = ref(''); const keyword = ref('')
const goods = ref([]); const goods = ref([])
const search = (val) => { const search = (val) => {
zhscrollRel.value.searchleMenuTap(keyword.value) zhscrollRel.value.searchleMenuTap(keyword.value)
} }
const clickIcon = () => { const clickIcon = () => {
zhscrollRel.value.searchleMenuTap(keyword.value) zhscrollRel.value.searchleMenuTap(keyword.value)
} }
const gohdzq = () => {
uni.navigateTo({
url: '/pages/index/shoppage/interactiveZone'
})
}
onShow(async() => {
await storeList({}).then((res)=> {
goods.value = res.data
})
})
const gohdzq = () => {
uni.navigateTo({
url: '/pages/index/shoppage/interactiveZone'
})
}
onShow(async () => {
await storeList({}).then((res) => {
goods.value = res.data
})
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 254rpx); height: calc(100vh - 254rpx);
width: 100%; width: 100%;
.cate-tab { .cate-tab {
height: calc(100vh - 254rpx); height: calc(100vh - 254rpx);
} }
} }
.hdzq { .hdzq {
width: 182rpx; width: 212rpx;
height: 80rpx; height: 86rpx;
position: fixed; position: fixed;
right: 0; right: 0;
top: 70%; top: 70%;
margin-right: -14rpx; margin-right: -14rpx;
} }
</style> </style>

262
src/pages/index/shoppage/shophelpDetail.vue

@ -1,153 +1,147 @@
<template> <template>
<u-navbar :title="'店帮'" placeholder="true" bgColor="#F1F3F9" :autoBack="true" /> <u-navbar :title="'店帮'" placeholder="true" bg-color="#F1F3F9" :auto-back="true" />
<view class="container"> <view class="container">
<text class="title">{{xdbData.title}}</text> <text class="title">{{ xdbData.title }}</text>
<text class="fbr">发布人{{xdbData.publisher}}</text> <text class="fbr">发布人{{ xdbData.publisher }}</text>
<view class="readtime"> <view class="readtime">
<text class="time">{{xdbData.create_time}}</text> <text class="time">{{ xdbData.create_time }}</text>
<view class="readnum"> <view class="readnum">
阅读量<text class="num">{{xdbData.count}}</text> 阅读量
</view> <text class="num">{{ xdbData.count }}</text>
</view> </view>
<view class="nrxq"> </view>
<view class="icon"> <view class="nrxq">
</view> <view class="icon"></view>
<text class="nrtitle">内容详情</text> <text class="nrtitle">内容详情</text>
</view> </view>
<u-parse :content="xdbData.content"></u-parse> <u-parse :content="xdbData.content"></u-parse>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { storeInfo } from '@/api/shop'
import {
ref
} from 'vue';
import {
storeInfo
} from '@/api/shop'
const xdbData = ref({}) const xdbData = ref({})
onLoad(async (param) => { onLoad(async (param) => {
await storeInfo(param.id).then((res) => { await storeInfo(param.id).then((res) => {
if (res.code === 1) { if (res.code === 1) {
xdbData.value = res.data xdbData.value = res.data
} }
}) })
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
padding: 60rpx 40rpx 0 40rpx; padding: 60rpx 40rpx 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: normal; font-weight: normal;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.fbr { .fbr {
margin-top: 28rpx; margin-top: 28rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.readtime { .readtime {
margin-top: 28rpx; margin-top: 28rpx;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.time { .time {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.readnum { .readnum {
display: flex; display: flex;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
/* 阅读量: */ /* 阅读量: */
color: #858494; color: #858494;
.num { .num {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 48rpx; line-height: 48rpx;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
/* 2 */ /* 2 */
color: #007FFF; color: #007fff;
} }
} }
} }
.nrxq { .nrxq {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 60rpx; margin-top: 60rpx;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.icon { .icon {
width: 12rpx; width: 12rpx;
height: 32rpx; height: 32rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
} }
.nrtitle { .nrtitle {
margin-left: 20rpx; margin-left: 20rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.message { .message {
margin-top: 40rpx; margin-top: 40rpx;
} }
} }
</style> </style>

1091
src/pages/index/specialSubject.vue

File diff suppressed because one or more lines are too long

225
src/pages/index/tabsComm.vue

@ -1,40 +1,30 @@
<template> <template>
<view class="tabs-wrapper"> <view class="tabs-wrapper">
<!-- 固定显示的'全部'标签 --> <!-- 固定显示的'全部'标签 -->
<view <view class="tab-item" :class="{ active: activeTab === 'all' }" @click="handleTabSelect('all')">全部</view>
class="tab-item"
:class="{ 'active': activeTab === 'all' }"
@click="handleTabSelect('all')"
>
全部
</view>
<!-- 主显示区域 --> <!-- 主显示区域 -->
<!-- <scroll-view <!-- <scroll-view
scroll-x="true" scroll-x="true"
class="scroll-container" class="scroll-container"
:scroll-left="scrollLeft" :scroll-left="scrollLeft"
> --> > -->
<view <view
v-for="(tab, index) in visibleTabs" v-for="(tab, index) in visibleTabs"
:key="tab.id" :key="tab.id"
class="tab-item" class="tab-item"
:class="{ 'active': activeTab === tab.id }" :class="{ active: activeTab === tab.id }"
@click="handleTabSelect(tab.id)" @click="handleTabSelect(tab.id)"
> >
{{ tab.title.slice(0,2) }} {{ tab.title.slice(0, 2) }}
</view> </view>
<!-- </scroll-view> --> <!-- </scroll-view> -->
<!-- 更多按钮及下拉菜单 --> <!-- 更多按钮及下拉菜单 -->
<view <view v-if="showMoreButton" class="tab-item" @click.stop="show = true">
v-if="showMoreButton" <text>更多 {{ dropdownVisible ? '▲' : '▼' }}</text>
class="tab-item" <u-picker :show="show" :columns="hiddenTabs" key-name="title" @cancel="show = false" @confirm="confirm"></u-picker>
@click.stop="show=true" <!-- <view
>
<text>更多 {{ dropdownVisible ? '▲' : '▼' }}</text>
<u-picker :show="show" :columns="hiddenTabs" keyName="title" @cancel="show=false" @confirm="confirm"></u-picker>
<!-- <view
v-show="dropdownVisible" v-show="dropdownVisible"
class="dropdown-menu" class="dropdown-menu"
:style="{ right: dropdownRight + 'px' }" :style="{ right: dropdownRight + 'px' }"
@ -49,8 +39,8 @@
{{ tab.title }} {{ tab.title }}
</view> </view>
</view> --> </view> -->
</view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>
@ -58,10 +48,10 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import { onShow, onHide } from '@dcloudio/uni-app' import { onShow, onHide } from '@dcloudio/uni-app'
const props = defineProps({ const props = defineProps({
tabsData: { tabsData: {
type: Array, type: Array,
default: () => [] default: () => []
} }
}) })
const emit = defineEmits(['tabChange']) const emit = defineEmits(['tabChange'])
@ -71,131 +61,130 @@ const activeTab = ref('all')
const dropdownVisible = ref(false) const dropdownVisible = ref(false)
const dropdownRight = ref(0) const dropdownRight = ref(0)
const containerWidth = ref(375) // const containerWidth = ref(375) //
const show = ref(false); const show = ref(false)
// //
const visibleTabs = computed(() => { const visibleTabs = computed(() => {
const filtered = props.tabsData.filter(t => t.id !== 'all') const filtered = props.tabsData.filter((t) => t.id !== 'all')
return filtered.length <= 3 ? filtered : filtered.slice(0, 2) return filtered.length <= 3 ? filtered : filtered.slice(0, 2)
}) })
const hiddenTabs = computed(() => { const hiddenTabs = computed(() => {
const filtered = props.tabsData.filter(t => t.id !== 'all') const filtered = props.tabsData.filter((t) => t.id !== 'all')
return [filtered.length > 3 ? filtered.slice(2) : []] return [filtered.length > 3 ? filtered.slice(2) : []]
}) })
const showMoreButton = computed(() => props.tabsData.length > 3) const showMoreButton = computed(() => props.tabsData.length > 3)
// //
const handleTabSelect = (tabId) => { const handleTabSelect = (tabId) => {
activeTab.value = tabId activeTab.value = tabId
dropdownVisible.value = false dropdownVisible.value = false
emit('tabChange', tabId) emit('tabChange', tabId)
} }
const confirm = (tab) => { const confirm = (tab) => {
emit('tabChange', tab.value[0].id) emit('tabChange', tab.value[0].id)
show.value = false show.value = false
} }
const toggleDropdown = () => { const toggleDropdown = () => {
if (!dropdownVisible.value) { if (!dropdownVisible.value) {
uni.getSystemInfo({ uni.getSystemInfo({
success: (res) => { success: (res) => {
containerWidth.value = res.windowWidth containerWidth.value = res.windowWidth
dropdownRight.value = (res.windowWidth - 80) // dropdownRight.value = res.windowWidth - 80 //
} }
}) })
} }
dropdownVisible.value = !dropdownVisible.value dropdownVisible.value = !dropdownVisible.value
} }
// //
const handleClickOutside = (e) => { const handleClickOutside = (e) => {
if (!e.target.closest('.more-wrapper')) { if (!e.target.closest('.more-wrapper')) {
dropdownVisible.value = false dropdownVisible.value = false
} }
} }
// //
onMounted(() => { onMounted(() => {
uni.getSystemInfoSync().windowWidth uni.getSystemInfoSync().windowWidth
// document.addEventListener('click', handleClickOutside) // document.addEventListener('click', handleClickOutside)
}) })
onUnmounted(() => { onUnmounted(() => {
document.removeEventListener('click', handleClickOutside) document.removeEventListener('click', handleClickOutside)
}) })
</script> </script>
<style lang="scss"> <style lang="scss">
.tabs-wrapper { .tabs-wrapper {
position: relative; position: relative;
display: flex;
align-items: center;
padding: 16rpx 0;
border-bottom: 1rpx solid #eee;
:last-child {
margin-right: 0 !important;
}
.scroll-container {
flex: 1;
white-space: nowrap;
height: 80rpx;
}
.tab-item {
display: inline-flex;
align-items: center;
white-space: nowrap;
width: 25%;
box-sizing: border-box;
height: 60rpx;
padding: 0 42rpx;
margin-right: 38rpx;
border-radius: 124rpx;
background: #FFFFFF;
font-family: Source Han Sans;
font-size: 28rpx;
font-weight: 350;
line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; padding: 16rpx 0;
color: #007FFF; :last-child {
margin-right: 0 !important;
}
&.active { .scroll-container {
background: #007FFF; flex: 1;
color: #FFFFFF; white-space: nowrap;
height: 80rpx;
} }
}
.more-wrapper { .tab-item {
position: relative; display: inline-flex;
padding: 0 16rpx; align-items: center;
color: #666; white-space: nowrap;
width: 25%;
.dropdown-menu { box-sizing: border-box;
position: absolute; height: 60rpx;
top: 100%; padding: 0 34rpx;
min-width: 160rpx; margin-right: 38rpx;
background: white; border-radius: 124rpx;
border-radius: 8rpx; background: #f1f3f9;
box-shadow: 0 4rpx 24rpx rgba(0,0,0,0.1); font-family: Source Han Sans;
z-index: 999;
.dropdown-item {
padding: 24rpx 32rpx;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350;
line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */
display: flex;
align-items: center;
letter-spacing: normal;
color: #007fff;
&.active { &.active {
color: #007aff; background: #007fff;
background: #f0f7ff; color: #ffffff;
}
}
.more-wrapper {
position: relative;
padding: 0 16rpx;
color: #666;
.dropdown-menu {
position: absolute;
top: 100%;
min-width: 160rpx;
background: white;
border-radius: 8rpx;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.1);
z-index: 999;
.dropdown-item {
padding: 24rpx 32rpx;
font-size: 28rpx;
&.active {
color: #007aff;
background: #f0f7ff;
}
}
} }
}
} }
}
} }
</style> </style>

153
src/pages/index/ztdetail.vue

@ -1,86 +1,83 @@
<template> <template>
<u-navbar :title="titleData.special_id_name?'“'+ titleData.special_id_name +'”'+'专题':''" placeholder="true" bgColor="#F1F3F9" :autoBack="true"> <u-navbar
</u-navbar> :title="titleData.special_id_name ? '“' + titleData.special_id_name + '”' + '专题' : ''"
<view class="container"> placeholder="true"
<view class="titlepart"> bg-color="#F1F3F9"
<image style="width: 8rpx;height: 1em;" src="@/static/img/Fill1.png" mode=""></image> :auto-back="true"
<image style="width: 8rpx;height: 1em;margin-left: 6rpx;" src="@/static/img/Fill2.png" mode=""></image> ></u-navbar>
<text class="title">{{titleData.title}}</text> <view class="container">
</view> <view class="titlepart">
<!-- <image style="width: 100%;height: 436rpx;margin-top: 48rpx;" src="@/static/img/Bitmap.png" mode=""></image> --> <image style="width: 8rpx; height: 1em" src="@/static/img/Fill1.png" mode=""></image>
<rich-text :nodes="titleData.content"></rich-text> <image style="width: 8rpx; height: 1em; margin-left: 6rpx" src="@/static/img/Fill2.png" mode=""></image>
<view class="fbtime">{{titleData.create_time}}</view> <text class="title">{{ titleData.title }}</text>
</view> </view>
<!-- <image style="width: 100%;height: 436rpx;margin-top: 48rpx;" src="@/static/img/Bitmap.png" mode=""></image> -->
<rich-text :nodes="titleData.content"></rich-text>
<view class="fbtime">{{ titleData.create_time }}</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import { specialListInfo, bannerInfo } from '@/api/index'
import {
ref const titleData = ref([])
} from 'vue';
import { onLoad(async (param) => {
specialListInfo, if (param.type === 'zt') {
bannerInfo const res = await specialListInfo(param.id)
} from '@/api/index' if (res.code === 1) {
titleData.value = res.data
const titleData = ref([]) }
} else {
const res = await bannerInfo(param.id)
onLoad(async(param) => { if (res.code === 1) {
if(param.type === 'zt') { console.log(res)
const res = await specialListInfo(param.id) titleData.value = res.data
if(res.code === 1) { }
titleData.value = res.data }
} titleData.value.content = titleData.value.content.replace(/<img/g, '<img style="width: 100%; max-width: 100%; height: auto;"')
} else { })
const res = await bannerInfo(param.id)
if(res.code === 1) {
console.log(res);
titleData.value = res.data
}
}
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
padding: 48rpx; padding: 48rpx;
box-sizing: border-box; box-sizing: border-box;
.titlepart { .titlepart {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
margin-bottom: 40rpx; margin-bottom: 40rpx;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-weight: 550; font-weight: 550;
font-size: 36rpx; font-size: 36rpx;
color: #0C092A; color: #0c092a;
margin-left: 20rpx; margin-left: 20rpx;
} }
} }
.text { .text {
margin-top: 32rpx; margin-top: 32rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
.fbtime { .fbtime {
font-family: Roboto; font-family: Roboto;
font-size: 28rpx; font-size: 28rpx;
font-weight: normal; font-weight: normal;
line-height: 142rpx; line-height: 142rpx;
letter-spacing: normal; letter-spacing: normal;
/* 外部/SCMP Grey/nobel */ /* 外部/SCMP Grey/nobel */
/* 样式描述:06 Small Grey txt */ /* 样式描述:06 Small Grey txt */
color: #A1A1A1; color: #a1a1a1;
} }
} }
</style> </style>

482
src/pages/learningCenter/detail.vue

@ -1,250 +1,246 @@
<template> <template>
<view class="pagebox"> <view class="pagebox">
<view class="vidoepart" v-if="detailData.s_type === 1"> <view class="vidoepart" v-if="detailData.s_type === 1">
<video class="myVideo" :src="baseurl + detailData.video_path" @error="videoErrorCallback" <video class="myVideo" :src="baseurl + detailData.video_path" @error="videoErrorCallback" @timeupdate="onTimeUpdate"></video>
@timeupdate="onTimeUpdate"></video> </view>
</view> <view class="main">
<view class="main"> <text class="title" v-if="detailData.s_type === 2">{{ detailData.title }}</text>
<text class="title" v-if="detailData.s_type === 2">{{detailData.title}}</text> <view class="peopnum">
<view class="peopnum"> <view class="left">
<view class="left"> <image style="width: 26rpx; height: 28rpx" src="@/static/img/gkrs.png" mode=""></image>
<image style="width: 26rpx;height: 28rpx;" src="@/static/img/gkrs.png" mode=""></image> <text class="txt">观看人数</text>
<text class="txt">观看人数</text> <text class="num">{{ detailData.watch_count }}</text>
<text class="num">{{detailData.watch_count}}</text> </view>
</view> <view class="left">
<view class="left"> <image
<image style="width: 28rpx;height: 28rpx;" :src="issc?'/static/img/scrs.png':'/static/img/sc.png'" style="width: 28rpx; height: 28rpx"
mode="" @click="scClick"></image> :src="issc ? '/static/img/scrs.png' : '/static/img/sc.png'"
<text class="txt">收藏人数</text> mode=""
<text class="num">{{detailData.collect_count}}</text> @click="scClick"
</view> ></image>
</view> <text class="txt">收藏人数</text>
<view class="shqy"> <text class="num">{{ detailData.collect_count }}</text>
<view class="head"> </view>
<image style="width: 12rpx;height: 32rpx;" src="@/static/img/shqy.png" mode=""></image> </view>
<text class="text">适合企业</text> <view class="shqy">
</view> <view class="head">
<view class="cards"> <image style="width: 12rpx; height: 32rpx" src="@/static/img/shqy.png" mode=""></image>
<view class="card" v-for="(item,index) in JSON.parse(detailData.suitable)" :key="index"> <text class="text">适合企业</text>
<text class="lcxb">{{item.title}}</text> </view>
<text class="bz">{{item.describe}}</text> <view class="cards">
</view> <view class="card" v-for="(item, index) in JSON.parse(detailData.suitable)" :key="index">
</view> <text class="lcxb">{{ item.title }}</text>
</view> <text class="bz">{{ item.describe }}</text>
<text class="title" v-if="detailData.s_type === 1">{{detailData.title}}</text> </view>
<text class="message">{{detailData.introduction}}</text> </view>
</view> </view>
</view> <text class="title" v-if="detailData.s_type === 1">{{ detailData.title }}</text>
<text class="message">{{ detailData.introduction }}</text>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { studyCenterDetail, watchCount, studyRecord, isCollect, collect, removeCollect } from '@/api/learningCenter'
studyCenterDetail,
watchCount, const baseurl = import.meta.env.VITE_APP_BASE_URL + '/'
studyRecord,
isCollect, const detailData = ref({})
collect,
removeCollect const issc = ref(false)
} from '@/api/learningCenter'
const kcid = ref(0)
const baseurl = import.meta.env.VITE_APP_BASE_URL + '/'
const videoErrorCallback = (e) => {
const detailData = ref({}) uni.showModal({
content: e.target.errMsg,
const issc = ref(false) showCancel: false
})
const kcid = ref(0) }
const videoErrorCallback = (e) => { const scClick = async () => {
uni.showModal({ issc.value = !issc.value
content: e.target.errMsg, if (issc.value) {
showCancel: false detailData.value.collect_count += 1
}) await collect({ item_id: kcid.value })
} } else {
detailData.value.collect_count -= 1
const scClick = async() => { await removeCollect({ item_id: kcid.value })
issc.value = !issc.value }
if(issc.value) { }
await collect({"item_id": kcid.value})
} else { const percent = ref('')
await removeCollect({"item_id": kcid.value}) const onTimeUpdate = (e) => {
} const currentTime = e.detail.currentTime
} const duration = e.detail.duration
percent.value = ((currentTime / duration) * 100).toFixed(2) //
const percent = ref('') }
const onTimeUpdate = (e) => { onLoad(async (param) => {
const currentTime = e.detail.currentTime; detailData.value = []
const duration = e.detail.duration; kcid.value = param.id
percent.value = (currentTime / duration * 100).toFixed(2); // await watchCount({
} id: param.id
onLoad(async (param) => { })
detailData.value = [] await studyCenterDetail(param.id).then(async (res) => {
kcid.value = param.id if (res.code === 1) {
await watchCount({ detailData.value = res.data
'id': param.id if (res.data.s_type === 1) {
}) } else {
await studyCenterDetail(param.id).then(async (res) => { await studyRecord({
if (res.code === 1) { id: param.id,
detailData.value = res.data progress: '100'
if (res.data.s_type === 1) { })
}
} else { await isCollect({ id: param.id }).then((res1) => {
await studyRecord({ issc.value = res1.data
'id': param.id, })
'progress': '100' }
}) })
} })
await isCollect({"id": param.id}).then((res1)=> { onBeforeUnmount(async () => {
issc.value = res1.data if (detailData.value.s_type === 1) {
}) await studyRecord({
} id: kcid.value,
}) progress: percent.value
}) })
onBeforeUnmount(async ()=> { }
if(detailData.value.s_type === 1) { })
await studyRecord({
'id': kcid.value,
'progress': percent.value
})
}
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pagebox { .pagebox {
height: 100vh; height: 100vh;
.vidoepart { .vidoepart {
.myVideo { .myVideo {
width: 100vw; width: 100vw;
} }
} }
.main { .main {
padding: 30rpx 40rpx; padding: 30rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
.peopnum { .peopnum {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 40rpx; margin-top: 40rpx;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.txt { .txt {
margin-left: 8rpx; margin-left: 8rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
/* 观看人数: */ /* 观看人数: */
color: #858494; color: #858494;
} }
.num { .num {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
/* 观看人数: */ /* 观看人数: */
color: #007FFF; color: #007fff;
} }
} }
} }
.shqy { .shqy {
display: grid; display: grid;
.head { .head {
margin-top: 48rpx; margin-top: 48rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.text { .text {
margin-left: 18rpx; margin-left: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.cards { .cards {
margin-top: 32rpx; margin-top: 32rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 20rpx; gap: 20rpx;
.card { .card {
flex: 0 1 calc(50% - 13rpx); flex: 0 1 calc(50% - 13rpx);
height: 144rpx; height: 144rpx;
border-radius: 24rpx; border-radius: 24rpx;
background: #FAFDFF; background: #fafdff;
box-sizing: border-box; box-sizing: border-box;
border: 8rpx solid #DBEDFF; border: 8rpx solid #dbedff;
display: grid; display: grid;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
.lcxb { .lcxb {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: normal; font-weight: normal;
letter-spacing: normal; letter-spacing: normal;
color: #007FFF; color: #007fff;
} }
.bz { .bz {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
} }
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 350; font-weight: 350;
line-height: 80rpx; line-height: 80rpx;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.message { .message {
margin-top: 40rpx; margin-top: 40rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 300; font-weight: 300;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
line-height: 60rpx; line-height: 60rpx;
} }
} }
} }
</style> </style>

788
src/pages/learningCenter/index.vue

@ -1,400 +1,406 @@
<template> <template>
<view class="container"> <view class="container">
<view class="xxqd"> <view class="xxqd">
<view class="head"> <view class="head">你的学习清单</view>
你的学习清单 <view class="main">
</view> <view class="text">
<view class="main"> 距离上次学习已经
<view class="text"> <text class="hongzi">{{ learntime.days }}</text>
距离上次学习已经
<text class="hongzi"> {{learntime.days}}</text> <text class="hongzi">{{ learntime.hours }}</text>
<text class="hongzi"> {{learntime.hours}}</text>
<text class="hongzi"> {{learntime.minutes}}</text> <text class="hongzi">{{ learntime.minutes }}</text>
</view>
<view class="xxls" v-if="xxList.length !== 0"> </view>
<view class="xxone" v-for="(item,index) in xxList.slice(0,3)" :key="index" @click="kcClick('h',item)"> <view class="xxls" v-if="xxList.length !== 0">
<u-image style="width: 100%;height: 238rpx;border-radius: 16rpx;" <view class="xxone" v-for="(item, index) in xxList.slice(0, 3)" :key="index" @click="kcClick('h', item)">
:src="baseurl + '/' +item.study_center_index_pic" mode="" width="100%" height="238rpx" radius="4"> <u-image
<template v-slot:else> style="width: 100%; height: 238rpx; border-radius: 16rpx"
<image v-if="item.s_type === 1" style="width: 55rpx;height: 55rpx;" src="@/static/img/bof.png" mode=""></image> :src="baseurl + '/' + item.study_center_index_pic"
</template> mode=""
</u-image> width="100%"
<view class="xxjd"> height="238rpx"
已学{{item.progress}}% radius="4"
</view> >
</view> <template v-slot:else>
</view> <image v-if="item.s_type === 1" style="width: 55rpx; height: 55rpx" src="@/static/img/bof.png" mode=""></image>
<view class="xxls" v-else> </template>
无学习历史记录 </u-image>
</view> <view class="xxjd">已学{{ item.progress }}%</view>
</view> </view>
</view> </view>
<u-tabs :list="tabList" :lineWidth="34" :lineHeight="4" lineColor="#007FFF" <view class="xxls" v-else>无学习历史记录</view>
:activeStyle="{color: '#0C092A',fontWeight: '600',fontSize: '34rpx'}" </view>
:inactiveStyle="{color: '#858494',fontWeight: '350',fontSize: '30rpx'}" @click="tabClick"></u-tabs> </view>
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" <u-tabs
placeholderColor="#088cff" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" :list="tabList"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx"></u-search> :line-width="34"
:line-height="4"
<view class="KClist"> line-color="#007FFF"
<view class="kcone" v-for="(item,index) in kcList" :key="index" @click="kcClick('l',item)"> key-name="title"
<image class="img" :src="baseurl + item.index_pic" mode=""></image> :active-style="{ color: '#0C092A', fontWeight: '600', fontSize: '34rpx' }"
<view class="right"> :inactive-style="{ color: '#858494', fontWeight: '350', fontSize: '30rpx' }"
<text class="title">{{item.title}}</text> @click="tabClick"
<text class="txt">{{item.introduction}}</text> ></u-tabs>
<view class="bottompart"> <u-search
<text class="gtsy">{{item.publisher}}</text> @search="search"
<text class="data">{{ item.create_time.slice(0,10)}}</text> @clickIcon="clickIcon"
</view> @clear="clear"
</view> shape="square"
</view> placeholder="请输入搜索内容"
</view> placeholder-color="#088cff"
</view> v-model="keyword"
search-icon="/static/img/search.png"
search-icon-size="14"
:show-action="false"
height="40"
margin="40rpx 24rpx 24rpx 24rpx"
></u-search>
<view class="KClist">
<view class="kcone" v-for="(item, index) in kcList" :key="index" @click="kcClick('l', item)">
<image class="img" :src="baseurl + item.index_pic" mode=""></image>
<view class="right">
<text class="title">{{ item.title }}</text>
<text class="txt">{{ item.introduction }}</text>
<view class="bottompart">
<text class="gtsy">{{ item.publisher }}</text>
<text class="data">{{ item.create_time.slice(0, 10) }}</text>
</view>
</view>
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref, watch } from 'vue'
ref, import { myStudy, studyCenter, studyCenterCategory } from '@/api/learningCenter'
watch
} from 'vue' const baseurl = import.meta.env.VITE_APP_BASE_URL + '/'
import {
myStudy, const learntime = ref({
studyCenter days: 0,
} from '@/api/learningCenter' hours: 0,
minutes: 0
const baseurl = import.meta.env.VITE_APP_BASE_URL + '/' })
const learntime = ref({ const xxList = ref([])
days: 0, const keyword = ref('')
hours: 0,
minutes: 0 const tabIndex = ref('')
}) const tabList = ref([
{
const xxList = ref([]) id: '',
const keyword = ref('') title: '推荐'
}
const tabIndex = ref('') ])
const tabList = ref([{
name: '推荐' const kcList = ref([])
},
{ const tabClick = (item) => {
name: '视频课' keyword.value = ''
}, if (item.index === 0) {
{ tabIndex.value = ''
name: '图文课' getcenterList(1, keyword.value, tabIndex.value, 1, 10)
} } else {
]) tabIndex.value = item.id
getcenterList('', keyword.value, tabIndex.value, 1, 10)
const kcList = ref([]) }
}
const tabClick = (item) => { const search = (val) => {
keyword.value = '' if (tabIndex.value !== '') {
if(item.index === 0) { getcenterList('', keyword.value, tabIndex.value, 1, 10)
tabIndex.value = '' } else {
getcenterList(1, keyword.value, tabIndex.value, 1, 10) getcenterList(1, keyword.value, tabIndex.value, 1, 10)
} else { }
tabIndex.value = item.index }
getcenterList('', keyword.value, tabIndex.value, 1, 10)
} const clickIcon = () => {
if (tabIndex.value !== '') {
} getcenterList('', keyword.value, tabIndex.value, 1, 10)
} else {
const search = (val) => { getcenterList(1, keyword.value, tabIndex.value, 1, 10)
if(tabIndex.value !== '') { }
getcenterList('', keyword.value, tabIndex.value, 1, 10) }
} else {
getcenterList(1, keyword.value, tabIndex.value, 1, 10) const clear = () => {
} keyword.value = ''
} if (tabIndex.value !== '') {
getcenterList('', keyword.value, tabIndex.value, 1, 10)
const clickIcon = () => { } else {
if(tabIndex.value !== '') { getcenterList(1, keyword.value, tabIndex.value, 1, 10)
getcenterList('', keyword.value, tabIndex.value, 1, 10) }
} else { }
getcenterList(1, keyword.value, tabIndex.value, 1, 10)
} const kcClick = (type, item) => {
} if (type === 'h') {
uni.navigateTo({
const clear = () => { url: '/pages/learningCenter/detail?id=' + item.study_center_id
keyword.value = '' })
if(tabIndex.value !== '') { } else {
getcenterList('', keyword.value, tabIndex.value, 1, 10) uni.navigateTo({
} else { url: '/pages/learningCenter/detail?id=' + item.id
getcenterList(1, keyword.value, tabIndex.value, 1, 10) })
} }
} }
const kcClick = (type,item) => { const useTimeDiff = (targetDateStr) => {
if(type === 'h') { const days = ref(0)
uni.navigateTo({ const hours = ref(0)
url: '/pages/learningCenter/detail?id=' + item.study_center_id const minutes = ref(0)
})
} else { const targetDate = new Date(targetDateStr.replace(/-/g, '/'))
uni.navigateTo({ const now = new Date()
url: '/pages/learningCenter/detail?id=' + item.id const diffMs = now - targetDate
})
} days.value = Math.max(0, Math.floor(diffMs / 86400000))
} hours.value = Math.max(0, Math.floor((diffMs % 86400000) / 3600000))
minutes.value = Math.max(0, Math.floor((diffMs % 3600000) / 60000))
return {
const useTimeDiff = (targetDateStr) => { days,
const days = ref(0); hours,
const hours = ref(0); minutes
const minutes = ref(0); }
}
const targetDate = new Date(targetDateStr.replace(/-/g, '/'));
const now = new Date(); const getcenterList = async (recommend, title, type, page, limit) => {
const diffMs = now - targetDate; await studyCenter(recommend, title, type, page, limit).then((res) => {
if (res.code === 1) {
days.value = Math.max(0, Math.floor(diffMs / 86400000)); kcList.value = res.data.data
hours.value = Math.max(0, Math.floor((diffMs % 86400000) / 3600000)); }
minutes.value = Math.max(0, Math.floor((diffMs % 3600000) / 60000)); })
}
return {
days, const spliceval = (val, f, l) => {
hours, return val.splice(f, l)
minutes }
}
} onShow(async () => {
const res = await myStudy()
const getcenterList = async (recommend, title, type, page, limit) => { if (res.code === 1) {
await studyCenter(recommend, title, type, page, limit).then((res) => { xxList.value = res.data
if (res.code === 1) { if (res.data.length !== 0) {
kcList.value = res.data.data const { days, hours, minutes } = useTimeDiff(res.data[0]?.update_time)
} learntime.value.days = days.value
}) learntime.value.hours = hours.value
} learntime.value.minutes = minutes.value
}
const spliceval = (val,f,l) => { }
return val.splice(f,l) if (tabIndex.value !== '') {
} getcenterList('', keyword.value, tabIndex.value, 1, 10)
} else {
getcenterList(1, keyword.value, tabIndex.value, 1, 10)
onShow(async () => { }
const res = await myStudy()
if (res.code === 1) { studyCenterCategory().then((rre) => {
xxList.value = res.data tabList.value = [...tabList.value, ...rre.data]
if (res.data.length !== 0) { })
const { })
days,
hours,
minutes
} = useTimeDiff(res.data[0]?.update_time);
learntime.value.days = days.value
learntime.value.hours = hours.value
learntime.value.minutes = minutes.value
}
}
if(tabIndex.value !== '') {
getcenterList('', keyword.value, tabIndex.value, 1, 10)
} else {
getcenterList(1, keyword.value, tabIndex.value, 1, 10)
}
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
padding: 24rpx; padding: 24rpx;
background: linear-gradient(0deg, #F1F3F9 72%, rgba(241, 243, 249, 0.2) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgba(241, 243, 249, 0.2) 88%);
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
} }
.xxqd { .xxqd {
display: grid; display: grid;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.head { .head {
width: 272rpx; width: 272rpx;
height: 60rpx; height: 60rpx;
background-image: url(@/static/img/xxqd.png); background-image: url(@/static/img/xxqd.png);
background-size: 100% 100%; background-size: 100% 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
line-height: 30rpx; line-height: 30rpx;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
z-index: 1; z-index: 1;
} }
.main { .main {
width: 100%; width: 100%;
height: 410rpx; height: 410rpx;
border-radius: 48rpx; border-radius: 48rpx;
background: #FFFAF7; background: #fffaf7;
box-sizing: border-box; box-sizing: border-box;
border: 12rpx solid #DBEDFF; border: 12rpx solid #dbedff;
padding: 60rpx 24rpx 54rpx 24rpx; padding: 60rpx 24rpx 54rpx 24rpx;
margin-top: -40rpx; margin-top: -40rpx;
display: grid; display: grid;
justify-items: center; justify-items: center;
align-items: flex-start; align-items: flex-start;
.text { .text {
display: flex; display: flex;
align-items: center; align-items: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24rpx; font-size: 24rpx;
font-weight: 350; font-weight: 350;
line-height: 28rpx; line-height: 28rpx;
letter-spacing: normal; letter-spacing: normal;
/* 距离上次学习已经 */ /* 距离上次学习已经 */
color: #0C092A; color: #0c092a;
} }
.hongzi { .hongzi {
margin-left: 6rpx; margin-left: 6rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24rpx; font-size: 24rpx;
font-weight: 350; font-weight: 350;
line-height: 28rpx; line-height: 28rpx;
letter-spacing: normal; letter-spacing: normal;
/* 距离上次学习已经 */ /* 距离上次学习已经 */
color: #FE0000; color: #fe0000;
} }
.xxls { .xxls {
display: flex; display: flex;
margin-top: 20rpx; margin-top: 20rpx;
gap: 26rpx; gap: 26rpx;
.xxone { .xxone {
display: grid; display: grid;
align-items: center; align-items: center;
width: 192rpx; width: 192rpx;
.xxjd { .xxjd {
z-index: 1; z-index: 1;
margin-top: -34rpx; margin-top: -34rpx;
width: 100%; width: 100%;
height: 34rpx; height: 34rpx;
border-radius: 0rpx 0rpx 16rpx 16rpx; border-radius: 0rpx 0rpx 16rpx 16rpx;
background: #000000; background: #000000;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
line-height: 24rpx; line-height: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
display: grid; display: grid;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
} }
} }
} }
} }
.KClist { .KClist {
display: grid; display: grid;
.kcone { .kcone {
width: 100%; width: 100%;
height: 284rpx; height: 284rpx;
border-radius: 32rpx; border-radius: 32rpx;
background: #FFFFFF; background: #ffffff;
display: flex; display: flex;
margin-top: 30rpx; margin-top: 30rpx;
box-sizing: border-box; box-sizing: border-box;
.img { .img {
width: 234rpx; width: 234rpx;
height: 284rpx; height: 284rpx;
border-radius: 20rpx 0 0 20rpx; border-radius: 20rpx 0 0 20rpx;
flex: 1; flex: 1;
} }
.right { .right {
flex: 2; flex: 2;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 20rpx 28rpx 20rpx 20rpx; padding: 20rpx 28rpx 20rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
display: grid; display: grid;
align-items: center; align-items: center;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.txt { .txt {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24rpx; font-size: 24rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.bottompart { .bottompart {
margin-top: 42rpx; margin-top: 42rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
.gtsy { .gtsy {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #007FFF; color: #007fff;
} }
.data { .data {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
} }
} }
</style> </style>
<style> <style>
.u-search { .u-search {
margin: 20rpx 0rpx 0 0 !important; margin: 20rpx 0rpx 0 0 !important;
} }
.u-search__content { .u-search__content {
background-color: #FFFFFF !important; background-color: #ffffff !important;
border-radius: 16rpx !important; border-radius: 16rpx !important;
height: 90rpx !important; height: 90rpx !important;
} }
.u-search__content__input { .u-search__content__input {
background-color: #FFFFFF !important; background-color: #ffffff !important;
} }
</style> </style>

46
src/pages/learningCenter/useTimeDiff.js

@ -1,31 +1,27 @@
import { ref, onMounted, onUnmounted } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue';
export default function useTimeDiff(targetDateStr) { export default function useTimeDiff(targetDateStr) {
const days = ref(0); const days = ref(0)
const hours = ref(0); const hours = ref(0)
const minutes = ref(0); const minutes = ref(0)
const calculateDiff = () => {
const calculateDiff = () => { const targetDate = new Date(targetDateStr.replace(/-/g, '/'))
const targetDate = new Date(targetDateStr.replace(/-/g, '/')); const now = new Date()
const now = new Date(); const diffMs = now - targetDate
const diffMs = now - targetDate; days.value = Math.max(0, Math.floor(diffMs / 86400000))
hours.value = Math.max(0, Math.floor((diffMs % 86400000) / 3600000))
days.value = Math.max(0, Math.floor(diffMs / 86400000)); minutes.value = Math.max(0, Math.floor((diffMs % 3600000) / 60000))
hours.value = Math.max(0, Math.floor((diffMs % 86400000) / 3600000)); }
minutes.value = Math.max(0, Math.floor((diffMs % 3600000) / 60000));
};
let timer; let timer
onMounted(() => {
onMounted(() => { calculateDiff()
calculateDiff(); timer = setInterval(calculateDiff, 60000)
timer = setInterval(calculateDiff, 60000); })
});
onUnmounted(() => { onUnmounted(() => {
clearInterval(timer); clearInterval(timer)
}); })
return { days, hours, minutes }; return { days, hours, minutes }
} }

214
src/pages/login/login.vue

@ -1,122 +1,124 @@
<script setup lang="ts"> <script setup lang="ts">
import { debounce } from 'feng-uniapp-exploit/utils/index' import { debounce } from 'feng-uniapp-exploit/utils/index'
import { mobileAuth } from '@/api/login' import { mobileAuth } from '@/api/login'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const userStore = useUserStore() const userStore = useUserStore()
const loginCode = ref('') const loginCode = ref('')
// code // code
const getLoginCode = async () : Promise<string> => { const getLoginCode = async (): Promise<string> => {
try { try {
const res = await uni.login({ provider: 'weixin' }) const res = await uni.login({ provider: 'weixin' })
loginCode.value = res.code loginCode.value = res.code
return res.code return res.code
} catch (error) { } catch (error) {
console.error('获取登录code失败:', error) console.error('获取登录code失败:', error)
throw error throw error
} }
} }
// //
interface phoneEvent { interface phoneEvent {
detail : { errMsg : string; iv : string; encryptedData : string; code : string } detail: { errMsg: string; iv: string; encryptedData: string; code: string }
} }
const onGetPhoneNumber = debounce(async (e : phoneEvent) => { const onGetPhoneNumber = debounce(async (e: phoneEvent) => {
if (e.detail.errMsg.includes('fail')) { if (e.detail.errMsg.includes('fail')) {
uni.showToast({ title: '用户拒绝授权', icon: 'none' }) uni.showToast({ title: '用户拒绝授权', icon: 'none' })
return return
} }
try { try {
if (!loginCode.value) { if (!loginCode.value) {
await getLoginCode() await getLoginCode()
} }
if (!userStore.openId) { if (!userStore.openId) {
await userStore.getopenid({ code: loginCode.value }) await userStore.getopenid({ code: loginCode.value })
} }
mobileAuth({ openid: userStore.openId, code: e.detail.code }) mobileAuth({ openid: userStore.openId, code: e.detail.code })
.then((res : any) => { .then((res: any) => {
const { data: moblie } = res as { data : string } const { data: moblie } = res as { data: string }
userStore.mobile = moblie userStore.mobile = moblie
uni.setStorageSync('access_token', res.data.token) uni.setStorageSync('access_token', res.data.token)
userStore.getUserInfo() userStore.getUserInfo()
onLoginSuccess() onLoginSuccess()
}) })
.catch(() => { .catch(() => {
uni.showToast({ title: '登录失败!', icon: 'none' }) uni.showToast({ title: '登录失败!', icon: 'none' })
}) })
} catch (error) { } catch (error) {
uni.showToast({ title: '登录失败', icon: 'none' }) uni.showToast({ title: '登录失败', icon: 'none' })
} }
}) })
const onLoginSuccess = () => { const onLoginSuccess = () => {
uni.showToast({ uni.showToast({
title: '登录成功', title: '登录成功',
icon: 'none', icon: 'none',
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
userStore.showtoast = false userStore.showtoast = false
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })
}, 1000) }, 1000)
} }
}) })
} }
const goback = ()=> {
uni.switchTab({
url: '/pages/index/index'
})
}
onLoad((options : any) => {
}) const goback = () => {
uni.switchTab({
url: '/pages/index/index'
})
}
onLoad((options: any) => {})
onShow(() => { onShow(() => {
// if (userStore.mobile) { // if (userStore.mobile) {
// onLoginSuccess() // onLoginSuccess()
// } // }
}) })
</script> </script>
<template> <template>
<view class="login"> <view class="login">
<!-- <image class="logo-img" src="@/static/logo.png" mode="widthFix" /> --> <!-- <image class="logo-img" src="@/static/logo.png" mode="widthFix" /> -->
<text>惠企帮欢迎您</text> <text>惠企帮欢迎您</text>
<view class="btn_box"> <view class="btn_box">
<u-button @getphonenumber="onGetPhoneNumber" text="手机号登录" icon-color="#fff" open-type="getPhoneNumber" <u-button
color="linear-gradient(270deg, rgba(232, 123, 7, 1) 0%, rgba(247, 205, 77, 1) 100%)" shape="circle" /> @getphonenumber="onGetPhoneNumber"
<view class="backindex" @click="goback"> text="手机号登录"
返回主页 icon-color="#fff"
</view> open-type="getPhoneNumber"
</view> color="linear-gradient(270deg, rgba(232, 123, 7, 1) 0%, rgba(247, 205, 77, 1) 100%)"
</view> shape="circle"
/>
<view class="backindex" @click="goback">返回主页</view>
</view>
</view>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.login { .login {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
padding: 500rpx 30rpx 0; padding: 500rpx 30rpx 0;
background-color: #fff; background-color: #fff;
.logo-img { .logo-img {
width: 220rpx; width: 220rpx;
margin-bottom: 60rpx; margin-bottom: 60rpx;
} }
} }
.btn_box { .btn_box {
margin-top: 60rpx; margin-top: 60rpx;
} }
.backindex { .backindex {
margin-top: 20px; margin-top: 20px;
} }
</style> </style>

503
src/pages/memberCenter/index.vue

@ -1,250 +1,267 @@
<template> <template>
<view class="container"> <view class="container">
<u-navbar title="会员中心" placeholder="true" bgColor="#F1F3F9" leftIcon="man-add-fill" leftIconSize="24" <u-navbar
leftText="申请入会" @leftClick="leftClick"> title="会员中心"
</u-navbar> placeholder="true"
<u-search @search="search" @clickIcon="clickIcon" @clear="clear" shape="square" placeholder="请输入搜索内容" bg-color="#F1F3F9"
placeholderColor="#A9D4FF" v-model="keyword" searchIcon="/static/img/search.png" searchIconSize="14" left-icon="man-add-fill"
:showAction="false" height="40" margin="40rpx 24rpx 24rpx 24rpx" bgColor="#FFFFFF"></u-search> left-icon-size="24"
left-text="申请入会"
<u-tabs :list="filterTabs" :activeStyle="{color: '#0C092A',fontsize: '30rpx'}" keyName="title" @leftClick="leftClick"
@click="handleTabSelect"></u-tabs> ></u-navbar>
<view class="main"> <u-search
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore"> @search="search"
<view class="hyCard" v-for="(item,index) in hyList" :key="index" @click="godetail(item.id)"> @clickIcon="clickIcon"
<view class="left"> @clear="clear"
<u-avatar :src="baseurl+item.head_pic" size="64"></u-avatar> shape="square"
<view class="textpart"> placeholder="请输入搜索内容"
<view class="namepart"> placeholder-color="#A9D4FF"
<text class="name">{{item.name}}</text> v-model="keyword"
<view class="biaoq" search-icon="/static/img/search.png"
:style="{background: `linear-gradient(0deg, ${item.member_tag_color} 0%, #dcdcdc70 100%)`}"> search-icon-size="14"
{{item.member_tag_title}} :show-action="false"
</view> height="40"
</view> margin="40rpx 24rpx 24rpx 24rpx"
<text class="company">{{item.enterprise?item.enterprise[0].title:'无'}}</text> bg-color="#FFFFFF"
</view> ></u-search>
</view>
<image style="width: 48rpx;height: 48rpx;" src="@/static/img/Icon.png" mode=""></image> <u-tabs
</view> :list="filterTabs"
</scroll-view> :current="current"
:active-style="{ color: '#0C092A', fontsize: '30rpx' }"
</view> key-name="title"
</view> @click="handleTabSelect"
></u-tabs>
<view class="main">
<scroll-view scroll-y="auto" class="hyonne" @scrolltolower="onloadmore">
<view class="hyCard" v-for="(item, index) in hyList" :key="index" @click="godetail(item.id)">
<view class="left">
<u-avatar :src="baseurl + item.head_pic" size="64"></u-avatar>
<view class="textpart">
<view class="namepart">
<text class="name">{{ item.name }}</text>
<view class="biaoq" :style="{ background: `linear-gradient(0deg, ${item.member_tag_color} 0%, #dcdcdc70 100%)` }">
{{ item.member_tag_title }}
</view>
</view>
<text class="company">{{ item.enterprise ? item.enterprise[0].title : '无' }}</text>
</view>
</view>
<image style="width: 48rpx; height: 48rpx" src="@/static/img/Icon.png" mode=""></image>
</view>
</scroll-view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import tabsComm from '../index/tabsComm.vue'
} from 'vue'; import { memberTagList, memberCenter } from '@/api/memberCenter'
import tabsComm from '../index/tabsComm.vue'
import { const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/')
memberTagList,
memberCenter //
} from '@/api/memberCenter' const keyword = ref('')
const page = ref(1)
const pagesize = ref(6)
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL + '/') const current = ref(0)
const search = async (val) => {
// page.value = 1
const keyword = ref(''); pagesize.value = 6
const page = ref(1) await getMemberCenter(currentTab.value, keyword.value, page.value, pagesize.value)
const pagesize = ref(6) }
const clickIcon = async () => {
const search = async (val) => { page.value = 1
page.value = 1 pagesize.value = 6
pagesize.value = 6 await getMemberCenter(currentTab.value, keyword.value, page.value, pagesize.value)
await getMemberCenter(currentTab.value.id, keyword.value, page.value, pagesize.value) }
}
const clear = async () => {
const clickIcon = async () => { page.value = 1
page.value = 1 pagesize.value = 6
pagesize.value = 6 await getMemberCenter(currentTab.value, keyword.value, page.value, pagesize.value)
await getMemberCenter(currentTab.value.id, keyword.value, page.value, pagesize.value) }
}
const hyList = ref([])
const clear = async () => {
page.value = 1 const currentTab = ref('0')
pagesize.value = 6
await getMemberCenter(currentTab.value.id, keyword.value, page.value, pagesize.value) // ""
} const filterTabs = ref([
{
const hyList = ref([]) id: 0,
title: '全部'
const currentTab = ref('全部'); }
])
// ""
const filterTabs = ref([{ const leftClick = () => {
id: 0, if (uni.getStorageSync('access_token') === '') {
title: '全部' uni.showToast({
}]); title: '请登录',
icon: 'fail'
const leftClick = () => { })
if (uni.getStorageSync('access_token') === '') { } else {
uni.showToast({ uni.navigateTo({
title: '请登录', url: '/pages/memberCenter/inpart'
icon: 'fail' })
}) }
} else { }
uni.navigateTo({
url: '/pages/memberCenter/inpart' //
}) const handleTabSelect = async (tab) => {
} page.value = 1
} pagesize.value = 6
currentTab.value = tab.id
// //
const handleTabSelect = async (tab) => { await getMemberCenter(tab.id, '', page.value, pagesize.value)
page.value = 1 }
pagesize.value = 6
currentTab.value = tab; const godetail = (id) => {
// uni.navigateTo({
await getMemberCenter(tab.id, '', page.value, pagesize.value) url: '/pages/index/shoppage/mediaDetail?id=' + id
}; })
}
const godetail = (id) => {
uni.navigateTo({ const getbqlist = async () => {
url: '/pages/index/shoppage/mediaDetail?id=' + id filterTabs.value = [
}) {
} id: 0,
title: '全部'
const getbqlist = async () => { }
filterTabs.value = [{ ]
id: 0, await memberTagList().then((res) => {
title: '全部' filterTabs.value = [...filterTabs.value, ...res.data]
}] console.log(res.data)
await memberTagList().then((res) => { })
filterTabs.value = [...filterTabs.value, ...res.data] }
console.log(res.data);
}) const getMemberCenter = async (id, name, page, limit) => {
} let params = {
member_tag_id: id,
const getMemberCenter = async (id, name, page, limit) => { name: name,
let params = { page: page,
'member_tag_id': id, limit: limit
'name': name, }
'page': page, await memberCenter(params).then((res) => {
'limit': limit hyList.value = res.data.data
} })
await memberCenter(params).then((res) => { }
hyList.value = res.data.data
}) const onloadmore = async () => {
} page.value++
let params = {
const onloadmore = async () => { member_tag_id: currentTab.value.id,
page.value++ name: keyword.value,
let params = { page: page.value,
'member_tag_id': currentTab.value.id, limit: pagesize.value
'name': keyword.value, }
'page': page.value, await memberCenter(params).then((res) => {
'limit': pagesize.value hyList.value = [...hyList.value, ...res.data.data]
} })
await memberCenter(params).then((res) => { }
hyList.value = [...hyList.value, ...res.data.data]
}) onLoad(async () => {
} await getbqlist()
await getMemberCenter('', '', page.value, pagesize.value)
onShow(async () => { })
await getbqlist()
await getMemberCenter('', '', page.value, pagesize.value)
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background: linear-gradient(0deg, #F1F3F9 72%, rgba(129, 179, 222, 0.5) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgba(129, 179, 222, 0.5) 88%);
height: 100vh; height: 100vh;
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
.main { .main {
width: 100%; width: 100%;
display: grid; display: grid;
padding: 0 24rpx; padding: 0 24rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: hidden; overflow-y: hidden;
.hyCard { .hyCard {
margin-top: 24rpx; margin-top: 24rpx;
width: 100%; width: 100%;
height: 160rpx; height: 160rpx;
border-radius: 24rpx; border-radius: 24rpx;
background: #FFFFFF; background: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
padding: 0 20rpx; padding: 0 20rpx;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
.textpart { .textpart {
margin-left: 32rpx; margin-left: 32rpx;
display: grid; display: grid;
justify-content: left; justify-content: left;
.namepart { .namepart {
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
.name { .name {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 150%; line-height: 150%;
letter-spacing: normal; letter-spacing: normal;
/* 外部/Neutral/Black */ /* 外部/Neutral/Black */
color: #0C092A; color: #0c092a;
} }
.biaoq { .biaoq {
padding: 10rpx; padding: 10rpx;
height: 40.5rpx; height: 40.5rpx;
border-radius: 0rpx 4rpx 20rpx 0rpx; border-radius: 0rpx 4rpx 20rpx 0rpx;
margin-left: 16rpx; margin-left: 16rpx;
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
font-size: 24rpx; font-size: 24rpx;
font-weight: normal; font-weight: normal;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
text-shadow: 0rpx 4rpx 4rpx rgba(0, 0, 0, 0.2); text-shadow: 0rpx 4rpx 4rpx rgba(0, 0, 0, 0.2);
} }
} }
.company { .company {
margin-top: 12rpx; margin-top: 12rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24rpx; font-size: 24rpx;
font-weight: 300; font-weight: 300;
line-height: 150%; line-height: 150%;
letter-spacing: normal; letter-spacing: normal;
/* 外部/Neutral/Grey 2 */ /* 外部/Neutral/Grey 2 */
color: #858494; color: #858494;
} }
} }
} }
} }
} }
:deep(.u-icon__icon) { :deep(.u-icon__icon) {
color: #007FFF !important; color: #007fff !important;
} }
} }
.hdzq { .hdzq {
width: 182rpx; width: 182rpx;
height: 80rpx; height: 80rpx;
position: fixed; position: fixed;
right: 0; right: 0;
top: 70%; top: 70%;
margin-right: -14rpx; margin-right: -14rpx;
} }
</style> </style>

1005
src/pages/memberCenter/inpart.vue

File diff suppressed because it is too large

165
src/pages/mine/associatedDetail.vue

@ -1,93 +1,88 @@
<template> <template>
<view class="container"> <view class="container">
<text class="texttitle">内蒙古数心科技有限公司</text> <text class="texttitle">内蒙古数心科技有限公司</text>
<view class="titlepart"> <view class="titlepart">
<view class="icon"></view> <view class="icon"></view>
<text class="title">公司简介</text> <text class="title">公司简介</text>
</view> </view>
<image style="width: 100%;height: 400rpx;margin-top: 40rpx;" src="@/static/img/Bitmap.png" mode=""></image> <image style="width: 100%; height: 400rpx; margin-top: 40rpx" src="@/static/img/Bitmap.png" mode=""></image>
<text class="message">说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明</text> <text class="message">
</view> 说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明说明
</text>
</view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app';
import {
ref
} from 'vue';
onLoad(() => {})
onLoad(() => {
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: calc(100vh - 182rpx); height: calc(100vh - 182rpx);
width: 100%; width: 100%;
padding: 40rpx 40rpx 0 40rpx; padding: 40rpx 40rpx 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
.titlepart { .titlepart {
margin-top: 40rpx; margin-top: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
.icon{ .icon {
width: 12rpx; width: 12rpx;
height: 32rpx; height: 32rpx;
border-radius: 0rpx 32rpx 32rpx 0rpx; border-radius: 0rpx 32rpx 32rpx 0rpx;
/* 蓝色渐变 */ /* 蓝色渐变 */
background: linear-gradient(0deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(0deg, #007fff 0%, #99ccff 100%);
} }
.title { .title {
margin-left: 18rpx; margin-left: 18rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0072FF; color: #0072ff;
} }
} }
.texttitle { .texttitle {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: normal; font-weight: normal;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.message { .message {
margin-top: 36rpx; margin-top: 36rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
.people { .people {
margin-top: 28rpx; margin-top: 28rpx;
display: flex; display: flex;
.text { .text {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 32rpx; font-size: 32rpx;
font-weight: 300; font-weight: 300;
line-height: 60rpx; line-height: 60rpx;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #3D3D3D; color: #3d3d3d;
} }
} }
} }
</style> </style>

130
src/pages/mine/associatedEnterprise.vue

@ -1,86 +1,72 @@
<template> <template>
<view class="classbox"> <view class="classbox">
<view class="classone" v-for="(item,index) in classList" :key="index"> <view class="classone" v-for="(item, index) in classList" :key="index">
<text class="title">{{item.title}}</text> <text class="title">{{ item.title }}</text>
<!-- <text class="text">关联时间{{item.time}}</text> --> <!-- <text class="text">关联时间{{item.time}}</text> -->
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { onShow } from '@dcloudio/uni-app'
} from 'vue';
import {
onShow
} from '@dcloudio/uni-app';
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
const userStore = useUserStore() const userStore = useUserStore()
const classList = ref([{ const classList = ref([])
id: 1,
title: '内蒙古数心科技有限公司',
time: '2025-04-17'
},
{
id: 2,
title: '内蒙古数心科技有限公司',
time: '2025-04-17'
},
])
const goDetail = (id) => { const goDetail = (id) => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/associatedDetail?id=' + id url: '/pages/mine/associatedDetail?id=' + id
}) })
} }
onShow(() => { onShow(() => {
classList.value = userStore.userInfo.enterprise classList.value = userStore.userInfo.enterprise
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.classbox { .classbox {
height: 100vh; height: 100vh;
background: linear-gradient(0deg, #F1F3F9 72%, rgb(202 202 204 / 20%) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgb(202 202 204 / 20%) 88%);
padding: 6rpx 24rpx 40rpx 24rpx; padding: 6rpx 24rpx 40rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
.classone { .classone {
width: 100%; width: 100%;
height: 144rpx; height: 144rpx;
border-radius: 20rpx; border-radius: 20rpx;
background: #FFFFFF; background: #ffffff;
display: grid; display: grid;
align-items: center; align-items: center;
padding: 32rpx 28rpx; padding: 32rpx 28rpx;
margin-top: 30rpx; margin-top: 30rpx;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.text { .text {
margin-top: 24rpx; margin-top: 24rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
</style> </style>

531
src/pages/mine/completeInformation.vue

@ -1,284 +1,295 @@
<template> <template>
<view class="container"> <view class="container">
<view class="cardbox"> <view class="cardbox">
<view v-for="(group, index) in inputGroups" :key="index" class="input-group"> <view v-for="(group, index) in inputGroups" :key="index" class="input-group">
<view class="inputs" @click="beforeRead(index)"> <view class="inputs" @click="beforeRead(index)">
公司性质 公司性质
<input class="inputclass" placeholder-class="inputplacla" :value="group.type==1 ? '其他(自由职业者等)' : (group.type===2 ? '个体工商户' : (group.type===3 ? '民营企业' : '') )" <input
placeholder="民营企业、个体工商户、其它(自由职业者等)" disabled disabledColor="#ffffff" @tap="qyshow = true" /> class="inputclass"
<u-action-sheet :actions="qylist" title="请选择关联企业类型" :show="qyshow" @select="qyClick" placeholder-class="inputplacla"
@close="qyshow = false"></u-action-sheet> :value="group.type == 1 ? '其他(自由职业者等)' : group.type === 2 ? '个体工商户' : group.type === 3 ? '民营企业' : ''"
公司名称 placeholder="民营企业、个体工商户、其它(自由职业者等)"
<input class="inputclass" placeholder-class="inputplacla" v-model="group.title" disabled
placeholder="请输入真实公司名称" /> disabledColor="#ffffff"
营业执照 @tap="qyshow = true"
<u-upload class="uploadbox" @afterRead="afterRead" :maxCount="1" />
:imageMode="'heightFix'" :width="auto" :height="144"> <u-action-sheet
<view class="yyzz" v-if="group.license === ''"> :actions="qylist"
<image style="width: 40rpx;height: 40rpx;" src="@/static/img/yyzz.png" mode=""></image> title="请选择关联企业类型"
上传营业执照 :show="qyshow"
</view> @select="qyClick"
<image v-else @click="beforeRead(index)" style="width: 100%;height: 288rpx;margin-top: 12rpx;" :src="baseurl+ '/' + group.license" mode="scaleToFill"></image> @close="qyshow = false"
</u-upload> ></u-action-sheet>
</view> 公司名称
<view v-if="index > 0" class="remove-btn" @click="removeGroup(index)">-</view> <input class="inputclass" placeholder-class="inputplacla" v-model="group.title" placeholder="请输入真实公司名称" />
</view> 营业执照
<button @click="addGroup" class="add-btn">+ 添加一组</button> <u-upload class="uploadbox" @afterRead="afterRead" :max-count="1" :image-mode="'heightFix'" :width="auto" :height="144">
</view> <view class="yyzz" v-if="group.license === ''">
</view> <image style="width: 40rpx; height: 40rpx" src="@/static/img/yyzz.png" mode=""></image>
<view class="buts"> 上传营业执照
<view class="but" @click="submit"> </view>
确认提交 <image
</view> v-else
</view> @click="beforeRead(index)"
style="width: 100%; height: 288rpx; margin-top: 12rpx"
:src="baseurl + '/' + group.license"
mode="scaleToFill"
></image>
</u-upload>
</view>
<view v-if="index > 0" class="remove-btn" @click="removeGroup(index)">-</view>
</view>
<button @click="addGroup" class="add-btn">+ 添加一组</button>
</view>
</view>
<view class="buts">
<view class="but" @click="submit">确认提交</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { modifyField1 } from '@/api/mine'
} from 'vue'
import {
modifyField1,
} from '@/api/mine'
const baseurl = ref(import.meta.env.VITE_APP_BASE_URL)
const inputGroups = ref([{ const baseurl = ref(import.meta.env.VITE_APP_BASE_URL)
type: '',
title: '',
license: ''
}])
const addGroup = () => { const inputGroups = ref([
inputGroups.value.push({ {
type: '', type: '',
title: '', title: '',
license: '' license: ''
}) }
} ])
const qyshow = ref(false)
const qylist = ref([{
id: 1,
name: '其他(自由职业者等)',
},
{
id: 2,
name: '个体工商户',
},
{
id: 3,
name: '民营企业',
}
]);
const qyClick = async (val) => {
inputGroups.value[upclickindex.value].type = val.id
}
const removeGroup = (index) => { const addGroup = () => {
inputGroups.value.splice(index, 1) inputGroups.value.push({
} type: '',
title: '',
const upclickindex = ref(0) license: ''
const beforeRead = (index) =>{ })
upclickindex.value = index }
}
const afterRead = async (e) => { const qyshow = ref(false)
uni.uploadFile({ const qylist = ref([
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image', {
filePath: e.file.url, id: 1,
name: 'file', name: '其他(自由职业者等)'
header: { },
'token': uni.getStorageSync('access_token') {
}, id: 2,
success: async (val) => { name: '个体工商户'
inputGroups.value[upclickindex.value].license = '' },
if (JSON.parse(val.data).data.url) { {
inputGroups.value[upclickindex.value].license = JSON.parse(val.data).data.url id: 3,
} name: '民营企业'
}, }
fail: (res) => { ])
console.log('失败', res); const qyClick = async (val) => {
} inputGroups.value[upclickindex.value].type = val.id
}) }
}
const submit = async () => { const removeGroup = (index) => {
let data = [] inputGroups.value.splice(index, 1)
await inputGroups.value.forEach(async(obj) => { }
if(obj.type == ''||obj.title == ''||obj.license == '') {
uni.showToast({ const upclickindex = ref(0)
title: '请填写完整', const beforeRead = (index) => {
icon: 'fail' upclickindex.value = index
}) }
}else {
data.push(obj) const afterRead = async (e) => {
} uni.uploadFile({
}) url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
console.log(data); filePath: e.file.url,
if(data.length !== 0) { name: 'file',
await modifyField1('enterprise',{"value":`${JSON.stringify(data)}`}).then((res) => { header: {
if (res.code === 1) { token: uni.getStorageSync('access_token')
setTimeout(() => { },
uni.showToast({ success: async (val) => {
title: '提交成功!', inputGroups.value[upclickindex.value].license = ''
icon: 'success' if (JSON.parse(val.data).data.url) {
}) inputGroups.value[upclickindex.value].license = JSON.parse(val.data).data.url
uni.switchTab({ }
url: '/pages/mine/index' },
}) fail: (res) => {
}, 500) console.log('失败', res)
} else { }
uni.showToast({ })
title: '提交失败!', }
icon: 'fail' const submit = async () => {
}) let data = []
} await inputGroups.value.forEach(async (obj) => {
if (obj.type == '' || obj.title == '' || obj.license == '') {
}) uni.showToast({
title: '请填写完整',
} icon: 'fail'
} })
} else {
data.push(obj)
}
})
console.log(data)
if (data.length !== 0) {
await modifyField1('enterprise', { value: `${JSON.stringify(data)}` }).then((res) => {
if (res.code === 1) {
setTimeout(() => {
uni.showToast({
title: '提交成功!',
icon: 'success'
})
uni.switchTab({
url: '/pages/mine/index'
})
}, 500)
} else {
uni.showToast({
title: '提交失败!',
icon: 'fail'
})
}
})
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
height: calc(100vh - 168rpx); height: calc(100vh - 168rpx);
width: 100%; width: 100%;
background: #F1F3F9; background: #f1f3f9;
overflow-y: auto; overflow-y: auto;
.cardbox { .cardbox {
box-sizing: border-box; box-sizing: border-box;
} }
.input-group { .input-group {
padding: 40rpx; padding: 40rpx;
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #e2e2e2; background-color: #e2e2e2;
} }
.inputs { .inputs {
flex: 9; flex: 9;
} }
input { input {
flex: 1; flex: 1;
height: 80rpx; height: 80rpx;
border: 2rpx solid #ddd; border: 2rpx solid #ddd;
padding: 0 20rpx; padding: 0 20rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.remove-btn, .remove-btn,
.add-btn { .add-btn {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #f0f0f0; background: #f0f0f0;
border-radius: 8rpx; border-radius: 8rpx;
} }
.remove-btn { .remove-btn {
margin-left: 20rpx; margin-left: 20rpx;
border-radius: 50%; border-radius: 50%;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
color: #ff0000; color: #ff0000;
border: 2rpx solid #ff0000; border: 2rpx solid #ff0000;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: center; justify-content: center;
} }
.add-btn { .add-btn {
width: auto; width: auto;
padding: 0 30rpx; padding: 0 30rpx;
background: #4CAF50; background: #4caf50;
color: white; color: white;
margin-bottom: 60rpx; margin-bottom: 60rpx;
} }
} }
.buts { .buts {
height: 168rpx; height: 168rpx;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
background: #FFFFFF; background: #ffffff;
/* 标签栏投影 */ /* 标签栏投影 */
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3); box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.3);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.but { .but {
width: 574rpx; width: 574rpx;
height: 96rpx; height: 96rpx;
border-radius: 248rpx; border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(90deg, #007fff 0%, #99ccff 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 350; font-weight: 350;
line-height: 32rpx; line-height: 32rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
} }
} }
.inputclass { .inputclass {
margin-top: 12rpx; margin-top: 12rpx;
margin-bottom: 36rpx; margin-bottom: 36rpx;
margin-right: 0 !important; margin-right: 0 !important;
height: 100rpx !important; height: 100rpx !important;
border-radius: 10rpx; border-radius: 10rpx;
background: #FFFFFF; background: #ffffff;
} }
:deep(.inputplacla) { :deep(.inputplacla) {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 24rpx; font-size: 24rpx;
font-weight: 350; font-weight: 350;
line-height: 32.76rpx; line-height: 32.76rpx;
letter-spacing: normal; letter-spacing: normal;
color: #D3D3D3; color: #d3d3d3;
} }
.yyzz { .yyzz {
margin-top: 12rpx; margin-top: 12rpx;
width: 100%; width: 100%;
height: 288rpx; height: 288rpx;
border-radius: 16rpx; border-radius: 16rpx;
background: #FFFFFF; background: #ffffff;
display: grid; display: grid;
align-content: center; align-content: center;
justify-items: center; justify-items: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 30rpx; font-size: 30rpx;
font-weight: 350; font-weight: 350;
line-height: 70rpx; line-height: 70rpx;
letter-spacing: normal; letter-spacing: normal;
color: #CCCCCC; color: #cccccc;
} }
:deep(.u-upload) { :deep(.u-upload) {
.u-upload__wrap { .u-upload__wrap {
view { view {
width: 100%; width: 100%;
} }
} }
} }
</style> </style>

341
src/pages/mine/index.vue

@ -1,189 +1,188 @@
<template> <template>
<view class="container"> <view class="container">
<image style="width: 100%;" src="@/static/img/ztback.png" mode="widthFix"></image> <image style="width: 100%" src="@/static/img/ztback.png" mode="widthFix"></image>
<view class="main"> <view class="main">
<view class="head"> <view class="head">
<view class="left"> <view class="left">
<u-avatar v-if="userStore.userInfo.moblie" <u-avatar v-if="userStore.userInfo.moblie" :src="url + '/' + userStore.userInfo.head_pic" :size="72"></u-avatar>
:src="url + '/' + userStore.userInfo.head_pic" <img v-else style="width: 72px; height: 72px; border-radius: 50%" src="@/static/img/qdl.png" alt="" />
:size="72"></u-avatar> <text class="name">{{ userStore.userInfo.name }}</text>
<img v-else style="width: 72px;height: 72px;border-radius: 50%;" src="@/static/img/qdl.png" alt="" /> </view>
<text class="name">{{userStore.userInfo.name}}</text> <image
</view> v-if="userStore.userInfo.moblie"
<image v-if="userStore.userInfo.moblie" style="width: 48rpx;height: 48rpx;" src="@/static/img/setting.png" mode="" style="width: 48rpx; height: 48rpx"
@click="goeditinfo('')"></image> src="@/static/img/setting.png"
</view> mode=""
<view class="editlist"> @click="goeditinfo('')"
<view class="editone" @click="goeditinfo('关联企业')"> ></image>
<view class="left"> </view>
<image style="width: 74rpx;height: 74rpx;" src="@/static/img/glqy.png" mode=""></image> <view class="editlist">
<text class="txt">关联企业</text> <view class="editone" @click="goeditinfo('关联企业')">
</view> <view class="left">
<image style="width: 14.14rpx;height: 14.14rpx;" src="@/static/img/Group13.png" mode=""></image> <image style="width: 74rpx; height: 74rpx" src="@/static/img/glqy.png" mode=""></image>
</view> <text class="txt">关联企业</text>
<view class="editone" @click="goeditinfo('我的申请')"> </view>
<view class="left"> <image style="width: 14.14rpx; height: 14.14rpx" src="@/static/img/Group13.png" mode=""></image>
<image style="width: 74rpx;height: 74rpx;" src="@/static/img/wdsq.png" mode=""></image> </view>
<text class="txt">我的申请</text> <view class="editone" @click="goeditinfo('我的申请')">
</view> <view class="left">
<image style="width: 14.14rpx;height: 14.14rpx;" src="@/static/img/Group13.png" mode=""></image> <image style="width: 74rpx; height: 74rpx" src="@/static/img/wdsq.png" mode=""></image>
</view> <text class="txt">我的申请</text>
<view class="editone" @click="goeditinfo('我的课程')"> </view>
<view class="left"> <image style="width: 14.14rpx; height: 14.14rpx" src="@/static/img/Group13.png" mode=""></image>
<image style="width: 74rpx;height: 74rpx;" src="@/static/img/wdkc.png" mode=""></image> </view>
<text class="txt">我的课程</text> <view class="editone" @click="goeditinfo('我的课程')">
</view> <view class="left">
<image style="width: 14.14rpx;height: 14.14rpx;" src="@/static/img/Group13.png" mode=""></image> <image style="width: 74rpx; height: 74rpx" src="@/static/img/wdkc.png" mode=""></image>
</view> <text class="txt">我的课程</text>
</view> </view>
<view class="buts"> <image style="width: 14.14rpx; height: 14.14rpx" src="@/static/img/Group13.png" mode=""></image>
<view class="but" @click="outLogin"> </view>
{{userStore.userInfo.moblie?'退出登录':'登录'}} </view>
</view> <view class="buts">
</view> <view class="but" @click="outLogin">
</view> {{ userStore.userInfo.moblie ? '退出登录' : '登录' }}
</view> </view>
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { onLoad } from '@dcloudio/uni-app'
onLoad import { ref } from 'vue'
} from '@dcloudio/uni-app'; import useUserStore from '@/store/user'
import { const userStore = useUserStore()
ref
} from 'vue';
import useUserStore from '@/store/user'
const userStore = useUserStore()
const url = ref(import.meta.env.VITE_APP_BASE_URL)
const goeditinfo = (val) => { const url = ref(import.meta.env.VITE_APP_BASE_URL)
if (val === '关联企业') {
uni.navigateTo({ const goeditinfo = (val) => {
url: '/pages/mine/associatedEnterprise' if (val === '关联企业') {
}) uni.navigateTo({
} else if (val === '我的申请') { url: '/pages/mine/associatedEnterprise'
uni.navigateTo({ })
url: '/pages/mine/myApplication' } else if (val === '我的申请') {
}) uni.navigateTo({
} else if (val === '我的课程') { url: '/pages/mine/myApplication'
uni.navigateTo({ })
url: '/pages/mine/myCourses' } else if (val === '我的课程') {
}) uni.navigateTo({
} else { url: '/pages/mine/myCourses'
uni.navigateTo({ })
url: '/pages/mine/porsonalinfo' } else {
}) uni.navigateTo({
} url: '/pages/mine/porsonalinfo'
} })
}
const outLogin = () => { }
userStore.logOut()
} const outLogin = () => {
onShow(() => { userStore.logOut()
// if (uni.getStorageSync('access_token') === '') { }
// uni.navigateTo({ onShow(() => {
// url: '/pages/login/login' // if (uni.getStorageSync('access_token') === '') {
// }) // uni.navigateTo({
// } else { // url: '/pages/login/login'
userStore.getUserInfo() // })
// } // } else {
}) userStore.getUserInfo()
// }
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
background-color: #FFFFFF; background-color: #ffffff;
height: 100vh; height: 100vh;
width: 100%; width: 100%;
display: grid; display: grid;
.main { .main {
border-radius: 60rpx 60rpx 0rpx 0rpx; border-radius: 60rpx 60rpx 0rpx 0rpx;
background: #FFFFFF; background: #ffffff;
margin-top: -350rpx; margin-top: -350rpx;
height: calc(100vh - 350rpx); height: calc(100vh - 350rpx);
padding: 0 40rpx; padding: 0 40rpx;
box-sizing: border-box; box-sizing: border-box;
.head { .head {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: -50rpx; margin-top: -50rpx;
.name { .name {
margin-top: 50rpx; margin-top: 50rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 40rpx; font-size: 40rpx;
font-weight: 350; font-weight: 350;
text-align: center; text-align: center;
letter-spacing: normal; letter-spacing: normal;
/* 文本/正文 */ /* 文本/正文 */
color: #1A1A1A; color: #1a1a1a;
margin-left: 30rpx; margin-left: 30rpx;
} }
} }
} }
.editlist { .editlist {
margin-top: 24rpx; margin-top: 24rpx;
.editone { .editone {
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
background: #FFFFFF; background: #ffffff;
border-bottom: 2rpx solid #f3f3f3; border-bottom: 2rpx solid #f3f3f3;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.txt { .txt {
margin-left: 36rpx; margin-left: 36rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: right; text-align: right;
letter-spacing: normal; letter-spacing: normal;
color: #333333; color: #333333;
} }
} }
} }
} }
.buts { .buts {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
.but { .but {
margin-top: 160rpx; margin-top: 160rpx;
width: 574rpx; width: 574rpx;
height: 96rpx; height: 96rpx;
border-radius: 248rpx; border-radius: 248rpx;
background: linear-gradient(90deg, #007FFF 0%, #99CCFF 100%); background: linear-gradient(90deg, #007fff 0%, #99ccff 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
} }
} }
} }
} }
</style> </style>

363
src/pages/mine/myApplication.vue

@ -1,196 +1,181 @@
<template> <template>
<view class="classbox"> <view class="classbox">
<view class="pass">
<view class="pass"> <view class="head">申请通过</view>
<view class="head"> <view class="main">
申请通过 <view class="classone" v-for="(item, index) in passList" :key="index">
</view> <text class="title">{{ item.name }}</text>
<view class="main"> <view class="jindu">
<view class="classone" v-for="(item,index) in passList" :key="index"> <image style="width: 32rpx; height: 32rpx" src="@/static/img/timeicon.png" mode=""></image>
<text class="title">{{item.name}}</text> <text class="time">{{ item.create_time }}</text>
<view class="jindu"> </view>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/timeicon.png" mode=""></image> </view>
<text class="time">{{item.create_time}}</text> </view>
</view> </view>
</view> <view class="reject">
</view> <view class="head">申请驳回</view>
</view> <view class="main">
<view class="reject"> <view class="classone" v-for="(item, index) in rejectList" :key="index">
<view class="head"> <text class="title">{{ item.name }}</text>
申请驳回 <view class="jindu">
</view> <image style="width: 32rpx; height: 32rpx" src="@/static/img/timeicon.png" mode=""></image>
<view class="main"> <text class="time">{{ item.create_time }}</text>
<view class="classone" v-for="(item,index) in rejectList" :key="index"> </view>
<text class="title">{{item.name}}</text> <text class="result">{{ item.remark || item.reject_reason }}</text>
<view class="jindu"> </view>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/timeicon.png" mode=""></image> </view>
<text class="time">{{item.create_time}}</text> </view>
</view> </view>
<text class="result">{{item.remark||item.reject_reason}}</text>
</view>
</view>
</view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { myMemberApply } from '@/api/memberCenter'
} from 'vue'; import { myMedium } from '@/api/shop'
import {
myMemberApply import { onShow } from '@dcloudio/uni-app'
} from '@/api/memberCenter'
import { const passList = ref([])
myMedium
} from '@/api/shop' const rejectList = ref([])
import { onShow } from '@dcloudio/uni-app'; onShow(async () => {
await myMemberApply().then((res) => {
res.data.forEach((ele) => {
const passList = ref([]) if (ele.status === 2) {
passList.value.push(ele)
const rejectList = ref([]) } else if (ele.status === 3) {
rejectList.value.push(ele)
onShow(async() => { }
await myMemberApply().then((res)=>{ })
res.data.forEach((ele)=> { })
if(ele.status === 2) { await myMedium().then((res) => {
passList.value.push(ele) console.log(res, 55555)
} res.data.data.forEach((ele) => {
else if(ele.status === 3) { if (ele.status === 1) {
rejectList.value.push(ele) passList.value.push(ele)
} } else if (ele.status === 2) {
}) rejectList.value.push(ele)
}) }
await myMedium().then((res)=> { })
console.log(res,55555); })
res.data.data.forEach((ele)=> { })
if(ele.status === 1) {
passList.value.push(ele)
}
else if(ele.status === 2) {
rejectList.value.push(ele)
}
})
})
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.classbox { .classbox {
height: 100vh; height: 100vh;
background: #FFFFFF; background: #ffffff;
padding: 40rpx 34rpx; padding: 40rpx 34rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
.pass { .pass {
width: 100%; width: 100%;
.head { .head {
width: 100%; width: 100%;
height: 72rpx; height: 72rpx;
display: flex; display: flex;
align-items: center; align-items: center;
background: #007FFF; background: #007fff;
font-family: Lato; font-family: Lato;
font-size: 32rpx; font-size: 32rpx;
font-weight: normal; font-weight: normal;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: 0.76rpx; letter-spacing: 0.76rpx;
/* System Background Primary Light */ /* System Background Primary Light */
color: #FFFFFF; color: #ffffff;
padding-left: 32rpx; padding-left: 32rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.main { .main {
background: #F1F3F9; background: #f1f3f9;
padding: 5rpx 16rpx 24rpx 16rpx; padding: 5rpx 16rpx 24rpx 16rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 0rpx 0rpx 24rpx 24rpx; border-radius: 0rpx 0rpx 24rpx 24rpx;
} }
} }
.reject { .reject {
margin-top: 40rpx; margin-top: 40rpx;
width: 100%; width: 100%;
.head { .head {
width: 100%; width: 100%;
height: 72rpx; height: 72rpx;
display: flex; display: flex;
align-items: center; align-items: center;
background: #FFC36F; background: #ffc36f;
font-family: Lato; font-family: Lato;
font-size: 32rpx; font-size: 32rpx;
font-weight: normal; font-weight: normal;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: 0.76rpx; letter-spacing: 0.76rpx;
/* System Background Primary Light */ /* System Background Primary Light */
color: #FFFFFF; color: #ffffff;
padding-left: 32rpx; padding-left: 32rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.main { .main {
background: #F1F3F9; background: #f1f3f9;
padding: 5rpx 16rpx 24rpx 16rpx; padding: 5rpx 16rpx 24rpx 16rpx;
box-sizing: border-box; box-sizing: border-box;
border-radius: 0rpx 0rpx 24rpx 24rpx; border-radius: 0rpx 0rpx 24rpx 24rpx;
} }
} }
}
}
.classone {
.classone { width: 100%;
width: 100%; border-radius: 16rpx;
border-radius: 16rpx; background: #ffffff;
background: #FFFFFF; display: grid;
display: grid; align-items: center;
align-items: center; padding: 16rpx 32rpx;
padding: 16rpx 32rpx; margin-top: 20rpx;
margin-top: 20rpx; box-sizing: border-box;
box-sizing: border-box;
.title {
.title { font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 300;
font-weight: 300; display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: 0.76rpx;
letter-spacing: 0.76rpx; color: #0c092a;
color: #0C092A; }
}
.jindu {
.jindu { margin-top: 16rpx;
margin-top: 16rpx; width: 100%;
width: 100%; display: flex;
display: flex; align-items: center;
align-items: center;
.time {
.time { font-family: Lato;
font-family: Lato; font-size: 20rpx;
font-size: 20rpx; font-weight: normal;
font-weight: normal; display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: normal;
letter-spacing: normal; color: #858494;
color: #858494; margin-left: 16rpx;
margin-left: 16rpx; }
} }
} .result {
.result { margin-top: 12rpx;
margin-top: 12rpx; font-family: Source Han Sans;
font-family: Source Han Sans; font-size: 28rpx;
font-size: 28rpx; font-weight: 300;
font-weight: 300; display: flex;
display: flex; align-items: center;
align-items: center; letter-spacing: 0.76rpx;
letter-spacing: 0.76rpx; color: #fe0000;
color: #FE0000; }
} }
} </style>
</style>

187
src/pages/mine/myCourses.vue

@ -1,104 +1,101 @@
<template> <template>
<view class="classbox"> <view class="classbox">
<view class="classone" v-for="(item,index) in classList" :key="index" @click="godetail(item)"> <view class="classone" v-for="(item, index) in classList" :key="index" @click="godetail(item)">
<text class="title">{{item.study_center_title}}</text> <text class="title">{{ item.study_center_title }}</text>
<text class="text">{{item.introduction}}</text> <text class="text">{{ item.introduction }}</text>
<view class="jindu"> <view class="jindu">
<text class="learn">已学 {{item.progress}}%</text> <text class="learn">已学 {{ item.progress }}%</text>
<text class="time">{{item.update_time.slice(0,10)}}</text> <text class="time">{{ item.update_time.slice(0, 10) }}</text>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue'
import { import { myStudy } from '@/api/learningCenter'
myStudy
} from '@/api/learningCenter'
const classList = ref([])
const classList = ref([])
const godetail = (item) => {
const godetail = (item) => { uni.navigateTo({
uni.navigateTo({ url: '/pages/learningCenter/detail?id=' + item.study_center_id
url: '/pages/learningCenter/detail?id=' + item.study_center_id })
}) }
}
onShow(async () => {
onShow(async () => { const res = await myStudy()
const res = await myStudy() if (res.code === 1) {
if (res.code === 1) { classList.value = res.data
classList.value = res.data }
} })
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.classbox { .classbox {
height: 100vh; height: 100vh;
background: linear-gradient(0deg, #F1F3F9 72%, rgb(202 202 204 / 20%) 88%); background: linear-gradient(0deg, #f1f3f9 72%, rgb(202 202 204 / 20%) 88%);
padding: 6rpx 24rpx 40rpx 24rpx; padding: 6rpx 24rpx 40rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto; overflow-y: auto;
.classone { .classone {
width: 100%; width: 100%;
border-radius: 20rpx; border-radius: 20rpx;
background: #FFFFFF; background: #ffffff;
display: grid; display: grid;
align-items: center; align-items: center;
padding: 30rpx 28rpx; padding: 30rpx 28rpx;
margin-top: 30rpx; margin-top: 30rpx;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 350; font-weight: 350;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #0C092A; color: #0c092a;
} }
.text { .text {
margin-top: 16rpx; margin-top: 16rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
.jindu { .jindu {
margin-top: 32rpx; margin-top: 32rpx;
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.learn { .learn {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 500; font-weight: 500;
text-align: justify; /* 浏览器可能不支持 */ text-align: justify; /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #007FFF; color: #007fff;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.time { .time {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 20rpx; font-size: 20rpx;
font-weight: 350; font-weight: 350;
text-align: right; text-align: right;
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #858494; color: #858494;
} }
} }
} }
} }
</style> </style>

698
src/pages/mine/porsonalinfo.vue

@ -1,381 +1,373 @@
<template> <template>
<view class="container"> <view class="container">
<view class="editbox"> <view class="editbox">
<view class="editone"> <view class="editone">
<view class="left"> <view class="left">
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/tx.png" mode=""></image> <image style="width: 32rpx; height: 32rpx" src="@/static/img/tx.png" mode=""></image>
<text class="txt">头像</text> <text class="txt">头像</text>
</view> </view>
<view class="right"> <view class="right">
<u-upload :fileList="form.fileList" @afterRead="afterRead" :maxCount="1" :accept="'file'"> <u-upload :file-list="form.fileList" @afterRead="afterRead" :max-count="1">
<image :src='url + `/` + userStore.userInfo.head_pic' mode="" <image :src="url + `/` + userStore.userInfo.head_pic" mode="" style="width: 80rpx; height: 80rpx; border-radius: 50%"></image>
style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image> </u-upload>
</u-upload> <!-- <image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png"
<!-- <image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png"
mode=""></image> --> mode=""></image> -->
</view> </view>
</view> </view>
<view class="editone"> <view class="editone">
<view class="left"> <view class="left">
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/yhm.png" mode=""></image> <image style="width: 32rpx; height: 32rpx" src="@/static/img/yhm.png" mode=""></image>
<text class="txt">用户名</text> <text class="txt">用户名</text>
</view> </view>
<view class="right" @click="openpopup('用户名')"> <view class="right" @click="openpopup('用户名')">
<u-popup :show="usershow" @close="usershow = false"> <u-popup :show="usershow" @close="usershow = false">
<view class="popupbox"> <view class="popupbox">
<text class="title">{{popupTitle}}</text> <text class="title">{{ popupTitle }}</text>
<u-input type="text" v-model="userValue" /> <u-input type="text" v-model="userValue" />
<view class="buts"> <view class="buts">
<view class="jujue" @click="usershow = false"> <view class="jujue" @click="usershow = false">取消</view>
取消 <view class="yunxu" @click="sureClick(typeValue)">确认</view>
</view> </view>
<view class="yunxu" @click="sureClick(typeValue)"> </view>
确认 </u-popup>
</view> <text class="value">{{ userStore.userInfo.nickname }}</text>
</view> <image style="width: 18rpx; height: 18rpx; margin-left: 16rpx" src="@/static/img/Group13.png" mode=""></image>
</view> </view>
</u-popup> </view>
<text class="value">{{userStore.userInfo.nickname}}</text> <view class="editone">
<image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png" mode="" <view class="left">
></image> <image style="width: 32rpx; height: 32rpx" src="@/static/img/xb.png" mode=""></image>
</view> <text class="txt">性别</text>
</view> </view>
<view class="editone"> <view class="right" @click="sexshow = true">
<view class="left"> <text class="value">{{ userStore.userInfo.sex_name }}</text>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/xb.png" mode=""></image> <u-action-sheet
<text class="txt">性别</text> :actions="sexlist"
</view> title="请选择性别"
<view class="right" @click="sexshow = true"> :show="sexshow"
<text class="value">{{userStore.userInfo.sex_name}}</text> @select="selectClick"
<u-action-sheet :actions="sexlist" title="请选择性别" :show="sexshow" @select="selectClick" @close="sexshow = false"
@close="sexshow = false"></u-action-sheet> ></u-action-sheet>
<image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png" mode="" <image style="width: 18rpx; height: 18rpx; margin-left: 16rpx" src="@/static/img/Group13.png" mode=""></image>
></image> </view>
</view> </view>
</view> <view class="editone">
<view class="editone"> <view class="left">
<view class="left"> <image style="width: 32rpx; height: 32rpx" src="@/static/img/sjh.png" mode=""></image>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/sjh.png" mode=""></image> <text class="txt">绑定手机号</text>
<text class="txt">绑定手机号</text> </view>
</view> <view class="right" @click="openpopup('手机号')">
<view class="right" @click="openpopup('手机号')"> <text class="value">{{ userStore.userInfo.moblie }}</text>
<text class="value">{{userStore.userInfo.moblie}}</text> <image style="width: 18rpx; height: 18rpx; margin-left: 16rpx" src="@/static/img/Group13.png" mode=""></image>
<image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png" mode="" </view>
></image> </view>
</view> <view class="editone">
</view> <view class="left">
<view class="editone"> <image style="width: 32rpx; height: 32rpx" src="@/static/img/zsxm.png" mode=""></image>
<view class="left"> <text class="txt">真实姓名</text>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/zsxm.png" mode=""></image> </view>
<text class="txt">真实姓名</text> <view class="right" @click="openpopup('姓名')">
</view> <text class="value">{{ userStore.userInfo.name }}</text>
<view class="right" @click="openpopup('姓名')"> <image style="width: 18rpx; height: 18rpx; margin-left: 16rpx" src="@/static/img/Group13.png" mode=""></image>
<text class="value">{{userStore.userInfo.name}}</text> </view>
<image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png" mode="" </view>
></image> <view class="editone">
</view> <view class="left">
</view> <image style="width: 32rpx; height: 32rpx" src="@/static/img/szqy.png" mode=""></image>
<view class="editone"> <text class="txt">关联企业</text>
<view class="left"> </view>
<image style="width: 32rpx;height: 32rpx;" src="@/static/img/szqy.png" mode=""></image> <view class="right" @click="qyshow = true">
<text class="txt">关联企业</text> <text class="value">{{ userStore.userInfo.identity_name }}</text>
</view> <u-action-sheet
<view class="right" @click="qyshow = true"> :actions="qylist"
<text class="value">{{userStore.userInfo.identity_name}}</text> title="请选择关联企业类型"
<u-action-sheet :actions="qylist" title="请选择关联企业类型" :show="qyshow" @select="qyClick" :show="qyshow"
@close="qyshow = false"></u-action-sheet> @select="qyClick"
<image style="width: 18rpx;height: 18rpx;margin-left: 16rpx;" src="@/static/img/Group13.png" mode="" @close="qyshow = false"
></image> ></u-action-sheet>
</view> <image style="width: 18rpx; height: 18rpx; margin-left: 16rpx" src="@/static/img/Group13.png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script setup> <script setup>
import { import { ref } from 'vue'
ref import { modifyField } from '@/api/mine'
} from 'vue'; import useUserStore from '@/store/user'
import { const userStore = useUserStore()
modifyField
} from '@/api/mine'
import useUserStore from '@/store/user'
const userStore = useUserStore()
const url = ref(import.meta.env.VITE_APP_BASE_URL) const url = ref(import.meta.env.VITE_APP_BASE_URL)
const sexshow = ref(false) const sexshow = ref(false)
const sexlist = ref([{ const sexlist = ref([
name: '男', {
}, name: '男'
{ },
name: '女', {
}, name: '女'
]); }
const selectClick = async (val) => { ])
await modifyField('sex', val.name === '男' ? 1 : 2).then((res) => { const selectClick = async (val) => {
if (res.code === 1) { await modifyField('sex', val.name === '男' ? 1 : 2).then((res) => {
usershow.value = false if (res.code === 1) {
setTimeout(() => { usershow.value = false
userStore.getUserInfo() setTimeout(() => {
uni.showToast({ userStore.getUserInfo()
title: '修改成功!', uni.showToast({
icon: 'success' title: '修改成功!',
}) icon: 'success'
}, 500) })
} else { }, 500)
uni.showToast({ } else {
title: '修改失败!', uni.showToast({
icon: 'fail' title: '修改失败!',
}) icon: 'fail'
} })
}
})
}
}) const qyshow = ref(false)
} const qylist = ref([
{
id: 1,
name: '其他(自由职业者等)'
},
{
id: 2,
name: '个体工商户'
},
{
id: 3,
name: '民营企业'
}
])
const qyClick = async (val) => {
await modifyField('identity', val.id).then((res) => {
if (res.code === 1) {
qyshow.value = false
setTimeout(() => {
userStore.getUserInfo()
uni.showToast({
title: '修改成功!',
icon: 'success'
})
if (val.id === 2 || val.id === 3) {
uni.navigateTo({
url: '/pages/mine/completeInformation'
})
}
}, 500)
} else {
uni.showToast({
title: '修改失败!',
icon: 'fail'
})
}
})
}
const qyshow = ref(false) const usershow = ref(false)
const qylist = ref([{ const popupTitle = ref('')
id: 1,
name: '其他(自由职业者等)',
},
{
id: 2,
name: '个体工商户',
},
{
id: 3,
name: '民营企业',
}
]);
const qyClick = async (val) => {
await modifyField('identity', val.id).then((res) => {
if (res.code === 1) {
qyshow.value = false
setTimeout(() => {
userStore.getUserInfo()
uni.showToast({
title: '修改成功!',
icon: 'success'
})
if(val.id === 2||val.id === 3) {
uni.navigateTo({
url: '/pages/mine/completeInformation'
})
}
}, 500)
} else {
uni.showToast({
title: '修改失败!',
icon: 'fail'
})
}
}) const userValue = ref('')
} const typeValue = ref('')
const form = ref({
fileList: [],
username: '',
sex: '',
num: '',
name: '',
company: ''
})
const usershow = ref(false) const openpopup = (type) => {
const popupTitle = ref('') userValue.value = ''
usershow.value = true
typeValue.value = type
if (type === '用户名') {
popupTitle.value = '请输入用户名'
} else if (type === '手机号') {
popupTitle.value = '请输入手机号'
} else if (type === '姓名') {
popupTitle.value = '请输入真实姓名'
}
}
const sureClick = async (type) => {
let res = {}
if (type === '用户名') {
res = await modifyField('nickname', userValue.value)
} else if (type === '手机号') {
res = await modifyField('moblie', userValue.value)
} else if (type === '姓名') {
res = await modifyField('name', userValue.value)
}
if (res.code === 1) {
usershow.value = false
setTimeout(() => {
userStore.getUserInfo()
uni.showToast({
title: '修改成功!',
icon: 'success'
})
}, 500)
} else {
uni.showToast({
title: '修改失败!',
icon: 'fail'
})
}
}
const userValue = ref('') const afterRead = async (e) => {
const typeValue = ref('') uni.uploadFile({
url: import.meta.env.VITE_APP_BASE_URL + '/api/file/image',
const form = ref({ filePath: e.file.url,
fileList: [], name: 'file',
username: '', header: {
sex: '', token: uni.getStorageSync('access_token')
num: '', },
name: '', success: async (val) => {
company: '' await modifyField('head_pic', JSON.parse(val.data).data.url).then((res) => {
}) if (res.code === 1) {
qyshow.value = false
const openpopup = (type) => { setTimeout(() => {
userValue.value = '' userStore.getUserInfo()
usershow.value = true uni.showToast({
typeValue.value = type title: '修改成功!',
if (type === '用户名') { icon: 'success'
popupTitle.value = '请输入用户名' })
} else if (type === '手机号') { }, 500)
popupTitle.value = '请输入手机号' } else {
} else if (type === '姓名') { uni.showToast({
popupTitle.value = '请输入真实姓名' title: '修改失败!',
} icon: 'fail'
} })
}
const sureClick = async (type) => { })
let res = {} },
if (type === '用户名') { fail: (res) => {
res = await modifyField('nickname', userValue.value) console.log('失败', res)
} else if (type === '手机号') { }
res = await modifyField('moblie', userValue.value) })
} else if (type === '姓名') { }
res = await modifyField('name', userValue.value)
}
if (res.code === 1) {
usershow.value = false
setTimeout(() => {
userStore.getUserInfo()
uni.showToast({
title: '修改成功!',
icon: 'success'
})
}, 500)
} else {
uni.showToast({
title: '修改失败!',
icon: 'fail'
})
}
}
const afterRead = async (e) => {
uni.uploadFile({
url: import.meta.env.VITE_APP_BASE_URL+'/api/file/image',
filePath: e.file.url,
name: 'file',
header: {
'token': uni.getStorageSync('access_token')
},
success: async(val) => {
await modifyField('head_pic',JSON.parse(val.data).data.url).then((res) => {
if (res.code === 1) {
qyshow.value = false
setTimeout(() => {
userStore.getUserInfo()
uni.showToast({
title: '修改成功!',
icon: 'success'
})
}, 500)
} else {
uni.showToast({
title: '修改失败!',
icon: 'fail'
})
}
})
},
fail: (res) => {
console.log('失败',res);
}
})
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
height: 100vh; height: 100vh;
width: 100%; width: 100%;
background: #F1F3F9; background: #f1f3f9;
.editbox { .editbox {
background: #FFFFFF; background: #ffffff;
padding: 0 72rpx 0 62rpx; padding: 0 72rpx 0 62rpx;
.editone { .editone {
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
background: #FFFFFF; background: #ffffff;
border-bottom: 2rpx solid #EBEBEB; border-bottom: 2rpx solid #ebebeb;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.txt { .txt {
margin-left: 16rpx; margin-left: 16rpx;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 300; font-weight: 300;
text-align: right; text-align: right;
letter-spacing: normal; letter-spacing: normal;
color: #273847; color: #273847;
} }
} }
.right { .right {
display: flex; display: flex;
align-items: center; align-items: center;
.value { .value {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 300; font-weight: 300;
text-align: right; text-align: right;
letter-spacing: normal; letter-spacing: normal;
color: #273847; color: #273847;
} }
} }
} }
} }
} }
.popupbox { .popupbox {
display: grid; display: grid;
align-items: center; align-items: center;
justify-items: center; justify-items: center;
padding-bottom: 60rpx; padding-bottom: 60rpx;
.title { .title {
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
font-weight: 300; font-weight: 300;
line-height: 34rpx; line-height: 34rpx;
text-align: right; text-align: right;
letter-spacing: normal; letter-spacing: normal;
color: #273847; color: #273847;
padding: 30rpx 0; padding: 30rpx 0;
} }
.buts { .buts {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 30rpx; margin-top: 30rpx;
.yunxu { .yunxu {
margin-left: 40rpx; margin-left: 40rpx;
width: 180rpx; width: 180rpx;
height: 70rpx; height: 70rpx;
border-radius: 10rpx; border-radius: 10rpx;
background: #07C160; background: #07c160;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #FFFFFF; color: #ffffff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.jujue { .jujue {
width: 180rpx; width: 180rpx;
height: 70rpx; height: 70rpx;
border-radius: 10rpx; border-radius: 10rpx;
background: #dadada; background: #dadada;
font-family: Source Han Sans; font-family: Source Han Sans;
font-size: 28rpx; font-size: 28rpx;
text-align: justify; text-align: justify;
/* 浏览器可能不支持 */ /* 浏览器可能不支持 */
display: flex; display: flex;
align-items: center; align-items: center;
letter-spacing: normal; letter-spacing: normal;
color: #393939; color: #393939;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
} }
} }
</style> </style>

BIN
src/static/img/aiback.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

BIN
src/static/img/aiimg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
src/static/img/hdzq.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/static/img/xzs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
src/static/tabbar/index_select.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 680 B

184
src/store/user.ts

@ -5,104 +5,102 @@ import { getOpenid } from '@/api/login'
import { infoForOpenid, logout } from '@/api/user' import { infoForOpenid, logout } from '@/api/user'
interface userInfoStoreInt { interface userInfoStoreInt {
[n : string] : any [n: string]: any
} }
export default defineStore( export default defineStore(
getPrefixName('user'), getPrefixName('user'),
() => { () => {
const openId = ref('') const openId = ref('')
const mobile = ref('') const mobile = ref('')
const showtoast = ref(false) const showtoast = ref(false)
const userInfo = ref<userInfoStoreInt>({}) const userInfo = ref<userInfoStoreInt>({})
const cometype = ref(0) const cometype = ref(0)
function getopenid(params : { code : string }) { function getopenid(params: { code: string }) {
return new Promise<any>((resolve, reject) => { return new Promise<any>((resolve, reject) => {
getOpenid(params) getOpenid(params)
.then((res : any) => { .then((res: any) => {
openId.value = res.data.openid openId.value = res.data.openid
resolve({ code: 1, message: '登录成功~' }) resolve({ code: 1, message: '登录成功~' })
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err)
}) })
}) })
} }
function getUserInfo() { function getUserInfo() {
return new Promise<any>((resolve, reject) => { return new Promise<any>((resolve, reject) => {
infoForOpenid() infoForOpenid()
.then((res : any) => { .then((res: any) => {
const { data } = res as { data : userInfoStoreInt } const { data } = res as { data: userInfoStoreInt }
userInfo.value = data || {} userInfo.value = data || {}
resolve({ code: 1, data, message: 'SUCCESS' }) resolve({ code: 1, data, message: 'SUCCESS' })
}) })
.catch((err) => { .catch((err) => {
reject(err) reject(err)
}) })
})
}
}) function logOut() {
} if (uni.getStorageSync('access_token') === '') {
uni.navigateTo({
url: '/pages/login/login'
})
} else {
userInfo.value = {}
uni.clearStorageSync()
const res = logout()
console.log(res, uni.getStorageSync('access_token'))
uni.showToast({
icon: 'none',
title: '退出成功',
mask: true,
success() {
setTimeout(() => uni.navigateTo({ url: 'pages/login/login' }), 1000)
}
})
}
}
function logOut() { return {
if(uni.getStorageSync('access_token') === '') { openId,
uni.navigateTo({ mobile,
url: '/pages/login/login' showtoast,
}) userInfo,
} else { getopenid,
userInfo.value = {} getUserInfo,
uni.clearStorageSync() logOut,
const res = logout() cometype
console.log(res,uni.getStorageSync('access_token')); }
},
{
unistorage: {
serializer: {
// 序列化,默认为 JSON.stringify
serialize(v) {
return JSON.stringify(v)
},
// 反序列化,默认为 JSON.parse
deserialize(v) {
return JSON.parse(v)
}
}
} // 开启后对 state 的数据读写都将持久化
// unistorage: {
// key: 'userInfo', // 缓存的键,默认为该 store 的 id,这里是 main,
// paths: ['userInfo.token'], // 需要缓存的路径,这里设置 foo 和 nested 下的 data 会被缓存
// // 初始化恢复前触发
// beforeRestore(ctx: any) {
// console.log(ctx)
// },
// // 初始化恢复后触发
// afterRestore(ctx: any) {
// console.log('ctx', ctx)
// },
uni.showToast({ // },
icon: 'none', }
title: '退出成功', )
mask: true,
success() {
setTimeout(() => uni.navigateTo({ url: 'pages/login/login' }), 1000)
}
})
}
}
return {
openId,
mobile,
showtoast,
userInfo,
getopenid,
getUserInfo,
logOut,
cometype
}
},
{
unistorage: {
serializer: {
// 序列化,默认为 JSON.stringify
serialize(v) {
return JSON.stringify(v)
},
// 反序列化,默认为 JSON.parse
deserialize(v) {
return JSON.parse(v)
}
}
} // 开启后对 state 的数据读写都将持久化
// unistorage: {
// key: 'userInfo', // 缓存的键,默认为该 store 的 id,这里是 main,
// paths: ['userInfo.token'], // 需要缓存的路径,这里设置 foo 和 nested 下的 data 会被缓存
// // 初始化恢复前触发
// beforeRestore(ctx: any) {
// console.log(ctx)
// },
// // 初始化恢复后触发
// afterRestore(ctx: any) {
// console.log('ctx', ctx)
// },
// },
}
)

16
src/utils/http.ts

@ -28,10 +28,10 @@ export const request = {
url = import.meta.env.VITE_APP_BASE_URL + url url = import.meta.env.VITE_APP_BASE_URL + url
// #endif // #endif
const header = Object.assign({ 'content-type': 'application/json', const header = Object.assign(
Authorization: '', { 'content-type': 'application/json', Authorization: '', token: uni.getStorageSync('access_token') || '' },
'token': uni.getStorageSync('access_token') || '', headers
}, headers) )
uni.request({ uni.request({
url, url,
@ -45,10 +45,10 @@ export const request = {
case 1: case 1:
resolve(res.data) resolve(res.data)
break break
case 401: case 401:
uni.showToast({ title: data.msg, icon: 'none', mask: true }) uni.showToast({ title: data.msg, icon: 'none', mask: true })
uni.removeStorageSync('access_token') uni.removeStorageSync('access_token')
break break
default: default:
uni.showToast({ title: data.msg, icon: 'none', mask: true }) uni.showToast({ title: data.msg, icon: 'none', mask: true })
reject(res.data) reject(res.data)

Loading…
Cancel
Save