广场动态样式问题优化

main
wangdong 6 months ago
parent ae6da1d87e
commit 68af2d1f64
  1. 2
      App.vue
  2. 4
      main.js
  3. 56
      pages/squareDynamic/index.vue

@ -84,6 +84,8 @@
<style lang="scss">
/* uView库样式 */
@import "./uni_modules/vk-uview-ui/index.scss";
/* uni-icons样式*/
@import "./uni_modules/uni-icons/components/uni-icons/uniicons.css";
/* 项目基础样式 */
@import "./app.scss";
/* iconfont图标库 */

@ -4,8 +4,10 @@ import store from './store'
import bootstrap from './core/bootstrap'
import mixin from './core/mixins/app'
import uView from './uni_modules/vk-uview-ui'
import UniIcons from './uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
import { navTo, showToast, showSuccess, showError, getShareUrlParams, checkModuleKey, checkModules } from './core/app'
import Config from '@/core/config'
const picUrl = Config.get('picUrl')
// 不能修改createApp方法名,不能修改从Vue中导入的createSSRApp
export function createApp() {
@ -25,6 +27,8 @@ console.log(wx.getExtConfigSync())
// 使用 uView UI
app.use(uView)
app.use(UniIcons);
// 全局mixin
app.mixin(mixin)

@ -8,7 +8,7 @@
<view v-for="(item, index) in tabList" :key="index" class="tab-item" :class="{ 'active': activeTab === item }" @click="activeTab = item">{{ item }}</view>
</view>
<view class="list">
<view v-for="(item, index) in dynamicList" :key="index" class="dynamic-item">
<view v-for="(item, index) in dynamicList" :key="index" class="dynamic-item" :style="{ 'visibility': !item.contH ? 'hidden' : 'visible'}">
<view class="user">
<image v-if="item.avatar_url && item.avatar_url[0]" :src="item.avatar_url[0].external_url" mode="aspectFill"></image>
<image v-else src="/static/touxiang.png" mode="aspectFill"></image>
@ -41,6 +41,10 @@
<image src="/static/copy.png" mode="aspectFill"></image>
<view>复制文案</view>
</view>
<view class="btn" v-if="userInfo.user_type == 40" @click="handleDelete(item)">
<uni-icons type="trash" size="40" color="#ccc" class="delete" @click="back"></uni-icons>
<view>删除文案</view>
</view>
<view class="btn" v-if="item.imgs && item.imgs.length > 0" @click="downloadMultipleImages(item.imgs)">
<image src="/static/download.png" mode="aspectFill"></image>
<view>下载图片</view>
@ -146,15 +150,15 @@
this.page = 1;
this.dynamicList = [];
this.getDynamicList();
} else {
this.isPreview = false;
}
if (uni.getStorageSync("userInfo").user_id) {
this.isLogin = true
this.onRefreshPage()
} else {
this.userInfo = {}
}
} else {
this.isPreview = false;
}
},
methods: {
//
@ -188,7 +192,7 @@
})
})
},
async getDynamicList() {
getDynamicList() {
if (this.loading || this.finished) {
return;
}
@ -381,7 +385,39 @@
this.$navTo('pages/goods/detail', {
goodsId: item.goods_id
})
},
//
handleDelete(item) {
const app = this;
uni.showModal({
title: '提示',
content: '您确定要删除该动态吗?',
showCancel: true,
success({
confirm
}) {
//
confirm && app.deleteDynamic(item)
}
})
},
deleteDynamic(item) {
// Api.deleteDynamic({
// id: item.id
// })
// .then(result => {
// console.log(result);
// uni.showToast({
// icon: 'success',
// title: '',
// });
// this.finished = false;
// this.page = 1;
// this.dynamicList = [];
// this.getDynamicList();
// })
// .finally(() => {})
},
},
};
</script>
@ -563,6 +599,16 @@
height: 40rpx;
margin-bottom: 10rpx;
}
::v-deep {
.delete {
margin-bottom: 10rpx;
.uni-icons {
font-size: 40rpx!important;
font-weight: bold;
line-height: 40rpx;
}
}
}
}
}
}

Loading…
Cancel
Save