Browse Source

fix conflict for tid1867

tid1867
刘嘉炜 4 months ago
parent
commit
b238633cf8
  1. 39
      package.json
  2. 7
      src/pages.json
  3. 67
      src/subpackage/community/components/list_item.vue
  4. 4
      src/subpackage/community/components/tab_bar.vue
  5. 42
      src/subpackage/community/pages/index.vue
  6. 97
      src/subpackage/community/pages/modules/tab_pages/one.vue
  7. 187
      src/subpackage/community/pages/modules/tab_pages/three.vue
  8. 3
      vue.config.js
  9. 18
      yarn.lock

39
package.json

@ -42,26 +42,27 @@
"test:mp-weixin": "cross-env UNI_PLATFORM=mp-weixin jest -i"
},
"dependencies": {
"@dcloudio/uni-app": "2.0.2-4040520250103001",
"@dcloudio/uni-app-plus": "2.0.2-4040520250103001",
"@dcloudio/uni-h5": "2.0.2-4040520250103001",
"@climblee/uv-ui": "^1.1.20",
"@dcloudio/uni-app-plus": "2.0.1-36520221121002",
"@dcloudio/uni-h5": "2.0.1-36520221121002",
"@dcloudio/uni-helper-json": "*",
"@dcloudio/uni-i18n": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-360": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-alipay": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-baidu": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-jd": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-kuaishou": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-lark": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-qq": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-toutiao": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-vue": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-weixin": "2.0.2-4040520250103001",
"@dcloudio/uni-mp-xhs": "2.0.2-4040520250103001",
"@dcloudio/uni-quickapp-native": "2.0.2-4040520250103001",
"@dcloudio/uni-quickapp-webview": "2.0.2-4040520250103001",
"@dcloudio/uni-stacktracey": "2.0.2-4040520250103001",
"@dcloudio/uni-stat": "2.0.2-4040520250103001",
"@dcloudio/uni-i18n": "2.0.1-36520221121002",
"@dcloudio/uni-mp-360": "2.0.1-36520221121002",
"@dcloudio/uni-mp-alipay": "2.0.1-36520221121002",
"@dcloudio/uni-mp-baidu": "2.0.1-36520221121002",
"@dcloudio/uni-mp-jd": "2.0.1-36520221121002",
"@dcloudio/uni-mp-kuaishou": "2.0.1-36520221121002",
"@dcloudio/uni-mp-lark": "2.0.1-36520221121002",
"@dcloudio/uni-mp-qq": "2.0.1-36520221121002",
"@dcloudio/uni-mp-toutiao": "2.0.1-36520221121002",
"@dcloudio/uni-mp-vue": "2.0.1-36520221121002",
"@dcloudio/uni-mp-weixin": "2.0.1-36520221121002",
"@dcloudio/uni-mp-xhs": "2.0.1-36520221121002",
"@dcloudio/uni-quickapp-native": "2.0.1-36520221121002",
"@dcloudio/uni-quickapp-webview": "2.0.1-36520221121002",
"@dcloudio/uni-stacktracey": "2.0.1-36520221121002",
"@dcloudio/uni-stat": "2.0.1-36520221121002",
"@dcloudio/uni-ui": "^1.5.7",
"@vue/shared": "^3.0.0",
"core-js": "^3.6.5",
"flyio": "^0.6.2",

7
src/pages.json

@ -1,4 +1,11 @@
{
"easycom": {
"autoscan": true,
"custom": { // yarn add @dcloudio/uni-ui @climblee/uv-ui
"^uv-(.*)": "@climblee/uv-ui/components/uv-$1/uv-$1.vue",
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",

67
src/subpackage/community/components/list_item.vue

@ -0,0 +1,67 @@
<template>
<view class="list-item">
<image src="https://imgcdn.ouxuanzhineng.cn/upload/63/362/banner/95187047953124ba158c7146e09805a2.jpg" class="wi-img" mode="widthFix"></image>
<view class="wi-content">
<view class="wi-des">天神之眼👀是什么</view>
<view class="wi-user">
<view class="wu-info">
<image class="wi-img" mode="aspectFill" src="https://imgcdn.ouxuanzhineng.cn/upload/63/362/banner/95187047953124ba158c7146e09805a2.jpg"></image>
<view class="wi-name">湖人总冠军</view>
</view>
<view class="wu-like">
<!-- <uv-icon name="heart"></uv-icon> -->
<uv-icon name="heart-fill" color="#ff0036"></uv-icon>
<text>1</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.list-item {
overflow: hidden;
border-radius: 12upx;
background: #fff;
.wi-img{
width: 100%;
}
.wi-content{
padding: 12upx;
}
.wi-des{
@include flcw(28upx, 40upx, #333);
}
.wi-user{
margin-top: 12upx;
@include ctf(space-between);
.wu-info{
@include ctf;
.wi-img{
margin-right: 12upx;
flex-shrink: 0;
width: 56upx;
height: 56upx;
border-radius: 50%;
overflow: hidden;
}
.wi-name{
flex-grow: 1;
@include flcw(24upx, 60upx, #5A5A5A);
@include tHide;
}
}
.wu-like{
margin-left: 16upx;
@include flcw(28upx, 42upx, #ACACAC);
@include ctf(flex-end);
}
}
}
</style>

4
src/subpackage/community/components/tab_bar.vue

@ -1,6 +1,10 @@
<template>
<view class="tab-bar" id="tabBar">
<<<<<<< HEAD
<view class="tab-bar-item" v-for="i in 5" :key="i">
=======
<view class="tab-bar-item" v-for="i in 5" :key="i" @click="$emit('click:item', i)">
>>>>>>> c9734741656ce605d3ddc0148c404952cfe236c6
<view class="tbi-img"></view>
<view class="tbi-view">tab{{i}}</view>
</view>

42
src/subpackage/community/pages/index.vue

@ -1,49 +1,45 @@
<template>
<view class="index-container">
<scroll-view class="ic-scroll" :style="scrollStyle">
</scroll-view>
<tab-bar ref="tabBar"></tab-bar>
<pages-one v-show="tabIdx === 0" :safe-height="safeHeight"></pages-one>
<pages-three v-show="tabIdx === 2" :tab-bar-height="tabBarHeight" :safe-height="safeHeight"></pages-three>
<tab-bar ref="tabBar" @click:item="tabChange"></tab-bar>
</view>
</template>
<script>
import pagesOne from "./modules/tab_pages/one.vue";
import pagesThree from "./modules/tab_pages/three.vue";
import tabBar from "../components/tab_bar.vue";
import { getNodeMes } from "../../../utils/util.js";
export default {
components:{ tabBar },
computed: {
scrollStyle(){
let { remainHeight } = this;
return `height: ${remainHeight}px;`;
}
},
components:{ tabBar, pagesOne, pagesThree },
data() {
return {
remainHeight: 650,
tabBarHeight: 0,
safeHeight: 0,
tabIdx: 0,
}
},
onLoad(){
async onLoad(){
this.initSafeHeight();
},
methods: {
async initSafeHeight(){
let _tabBarInfo = await this.$refs?.tabBar?.getDomInfo?.();
let _winInfo = uni.getWindowInfo();
console.log('wInfo --->', _winInfo);
let _remainHeight = _winInfo?.windowHeight - _tabBarInfo?.height;
this.remainHeight = _remainHeight;
console.warn('_remainHeight -->', _remainHeight)
let _tHeight = _tabBarInfo?.height ?? 0;
let _remainHeight = (_winInfo?.windowHeight ?? 0) - _tHeight;
this.tabBarHeight = _tHeight;
this.safeHeight = _remainHeight;
},
tabChange(idx){
this.tabIdx = idx;
}
}
}
</script>
<style lang="scss">
.index-container{
.ic-scroll{
background: #000;
}
page{
background: #f2f2f7;
}
</style>

97
src/subpackage/community/pages/modules/tab_pages/one.vue

@ -0,0 +1,97 @@
<template>
<view class="page-one">
<view class="po-tab">
<uv-tabs id="uvTabs" ref="tabs" :list="tabList" :current="0" :scroll-count="0" bar-animate-mode="worm"
:active-style="{color: '#000',fontWeight: 700}" bg-color="#fff" @click="clickTab">
</uv-tabs>
</view>
<scroll-view scroll-y :style="scrollStyle">
<uv-waterfall ref="waterfall"
v-model="list"
:add-time="10"
:left-gap="leftGap"
:right-gap="rightGap"
:column-gap="columnGap"
@changeList="changeList"
>
<!-- 第一列数据 -->
<template v-slot:list1>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view>
<view style="height: 24rpx;"></view>
<list-item></list-item>
<view style="height: 24rpx;"></view>
<list-item></list-item>
<view style="height: 24rpx;"></view>
<list-item></list-item>
<view style="height: 24rpx;"></view>
</view>
</template>
<!-- 第二列数据 -->
<template v-slot:list2>
<!-- 为了磨平部分平台的BUG必须套一层view -->
<view>
<list-item></list-item>
<view style="height: 24rpx;"></view>
<list-item></list-item>
</view>
</template>
</uv-waterfall>
</scroll-view>
</view>
</template>
<script>
import { getNodeMes } from "@/utils/util.js";
import listItem from "../../../components/list_item.vue";
export default {
components: { listItem },
props: {
safeHeight: {
type: Number,
default: 0
}
},
computed: {
scrollStyle(){
let { scrollHeight } = this;
return `height: ${scrollHeight}px;`;
},
},
watch: {
safeHeight: {
async handler(val) {
console.log('one watch safeHeight', val);
if(!val)return this.scrollHeight = 0;
let _tabsInfo = await getNodeMes('.po-tab',this);
this.scrollHeight = val - (_tabsInfo?.height ?? 0);
},
immediate: true
}
},
data(){
return {
tabList: [{ name: '门店' }, { name: '品牌' }, { name: '附近' }],
scrollHeight: 0,
list: [],//
list1: [],//
list2: [],//
leftGap: 10,
rightGap: 10,
columnGap: 10,
}
},
async mounted(){
},
methods: {
clickTab(){
}
}
}
</script>
<style lang="scss">
</style>

187
src/subpackage/community/pages/modules/tab_pages/three.vue

@ -0,0 +1,187 @@
<template>
<scroll-view class="pages-tree" scroll-y :style="scrollStyle">
<view class="pt-release">
<view class="pr-tit">上传图片</view>
<uv-upload
:fileList="fileList1"
name="1"
multiple
:maxCount="10"
@afterRead="afterRead"
@delete="deletePic"
></uv-upload>
<view class="line"></view>
<input class="title-input" type="text" placeholder="输入标题(可选)" :maxlength="20">
<view class="line"></view>
<textarea class="content-textarea" auto-height :show-confirm-bar="false"
:cursor-spacing="50" placeholder="添加正文" :maxlength="9999"></textarea>
</view>
<picker>
<uv-cell icon="bag" title="商品卡" isLink></uv-cell>
</picker>
<uv-cell icon="map" title="XXX店"></uv-cell>
<view class="fixed-box" :style="fixedStyle">
<view class="fixed-line-container">
<view class="item-box">
<uni-icons type="compose" size="30"></uni-icons>
<view class="text"> 存草稿 </view>
</view>
<view class="send-box">
发布帖子
</view>
</view>
</view>
</scroll-view>
</template>
<script>
export default {
props: {
safeHeight: {
type: Number,
default: 0
},
tabBarHeight: {
type: Number,
default: 0
}
},
computed: {
scrollStyle(){
let { safeHeight } = this;
return `height: ${safeHeight}px;`;
},
fixedStyle(){
let { tabBarHeight } = this;
return `bottom: ${tabBarHeight}px;`;
}
},
data() {
return {
fileList1: []
}
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(url)
}, 1000)
// let a = uni.uploadFile({
// url: 'http://192.168.2.21:7001/upload', //
// filePath: url,
// name: 'file',
// formData: {
// user: 'test'
// },
// success: (res) => {
// setTimeout(() => {
// resolve(res.data.data)
// }, 1000)
// }
// });
})
}
}
}
</script>
<style lang="scss">
.pages-tree{
padding-bottom: 130upx;
position: relative;
background: #fff;
.fixed-box {
position: fixed;
z-index: 90;
bottom: 0;
width: 100%;
display: flex;
background-color: #f7f7f7;
.fixed-line-container {
width: 100%;
display: inline-flex;
align-items: center;
box-sizing: border-box;
padding: 20rpx 30rpx;
.item-box {
margin-right: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
.icon {
flex-shrink: 0;
height: 40rpx;
width: 40rpx;
margin-bottom: 10rpx;
}
.text {
font-size: 24rpx;
}
}
.send-box {
flex: 1;
border-radius: 100rpx;
background-color: $mColor;
color: #fff;
text-align: center;
@include flcw(32upx, 88upx, #fff);
}
}
}
}
.pt-release{
padding: 10rpx 30rpx 20rpx;
.pr-tit{
margin-bottom: 24upx;
@include flcw(32upx, 42upx, #333, 500);
}
.title-input {
margin-top: 10rpx;
height: 80rpx;
font-size: 32rpx;
// border: 2rpx #eee solid;
}
.line {
border: 2rpx #eee solid;
margin: 20rpx 0;
}
.content-textarea {
min-height: 400rpx;
width: 100%;
// border: 2rpx #eee solid;
}
}
</style>

3
vue.config.js

@ -0,0 +1,3 @@
module.exports = {
transpileDependencies: ['@climblee/uv-ui', '@dcloudio/uni-ui']
}

18
yarn.lock

@ -935,6 +935,11 @@
resolved "https://registry.npmmirror.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@climblee/uv-ui@^1.1.20":
version "1.1.20"
resolved "https://registry.npmmirror.com/@climblee/uv-ui/-/uv-ui-1.1.20.tgz#52edd6948c8b62284c89b611401a21f523cf5f54"
integrity sha512-jkyesHJsPJkF4Nap9ZmG1/ibKlxXA5M8+ntqKXwwloIsYSYL5SOKb0gyPj17aBOU1PkJpmeiZ8PwnTolhK2/HA==
"@cnakazawa/watch@^1.0.3":
version "1.0.4"
resolved "https://registry.npmmirror.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a"
@ -1118,10 +1123,15 @@
"@babel/types" "^7.3.3"
vue-template-compiler "^2.6.10"
"@dcloudio/vue-cli-plugin-hbuilderx@2.0.2-4040520250103001":
version "2.0.2-4040520250103001"
resolved "https://registry.npmmirror.com/@dcloudio/vue-cli-plugin-hbuilderx/-/vue-cli-plugin-hbuilderx-2.0.2-4040520250103001.tgz#7d13fe22e0a67721deb6e55847d700d45718fb75"
integrity sha512-aWp+IEN5i9KLHW9QadWH+24IluCHazyybh9uHKyYH6yhdgBnFpEIZSARrfzvQv2FULHF/h9G6Nf+k92mF847dg==
"@dcloudio/uni-ui@^1.5.7":
version "1.5.7"
resolved "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.7.tgz#74daef1f537ae2b9320e51f44163fe56bdd19c87"
integrity sha512-DugxSIrQrze1FLdUOj9a+JEQ0bHGjnJTcGUK1mN/MivKg7nuKJBRWk5Ipa9sUdoBznX6ndz5h2e7Uao6x1CdCw==
"@dcloudio/vue-cli-plugin-hbuilderx@2.0.1-36520221121002":
version "2.0.1-36520221121002"
resolved "https://registry.npmmirror.com/@dcloudio/vue-cli-plugin-hbuilderx/-/vue-cli-plugin-hbuilderx-2.0.1-36520221121002.tgz"
integrity sha512-IponmFxU0Tz35MK/6KJ0gV5v5YLPHybOoI6kOH0ZhtgNjUAyHiQcprcI15fNFFfU5q4RpM5ri/c1pLVcVufPRQ==
dependencies:
acorn "^5.2.1"
css "~2.2.1"

Loading…
Cancel
Save