冲突解决
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
|
<view class="xw_content" v-for="(item,index) in cjsList" :key="index" @click="clickCj(item)">
|
||||||
<u--image :src="item.cover" width="112rpx" height="112rpx" :lazy-load="true">
|
<u--image :src="imgUrl+item.cover" width="112rpx" height="112rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<view class="xw_right">
|
<view class="xw_right">
|
||||||
<view class="xw_title">
|
<view class="xw_title">
|
||||||
@@ -22,42 +22,13 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cjsList: [
|
cjsList: [],
|
||||||
|
imgUrl: '',
|
||||||
// {
|
|
||||||
// src: '/static/report/zhanwei_xf(1).png',
|
|
||||||
// title: '西安兴沃丰餐饮管理有限责任公司',
|
|
||||||
// tags: [{
|
|
||||||
// tag: '咖啡'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// tag: '饮品'
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/report/zhanwei_xf(1).png',
|
|
||||||
// title: '福建省海纳川食品有限公司',
|
|
||||||
// tags: [{
|
|
||||||
// tag: '活冻鲍鱼'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// tag: '鲍鱼罐头'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// tag: '佛跳墙'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// tag: '海螺片'
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getCertifiedCj()
|
this.getCertifiedCj()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取认证厂家列表
|
// 获取认证厂家列表
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="my_avatar">
|
<view class="my_avatar">
|
||||||
<view style="border: 1px solid #EEEEEE;border-radius: 50rpx;">
|
<view style="border-radius: 50rpx;">
|
||||||
<u-avatar :src="avatar" size="100rpx" shape="circle"></u-avatar>
|
<u-avatar :src="avatar" size="100rpx" shape="circle"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 10rpx;margin-bottom: 4rpx;">
|
<view style="margin-top: 10rpx;margin-bottom: 4rpx;">
|
||||||
<u--image v-if="show==false" :src="normal" width="84rpx" height="30rpx">
|
<u--image v-if="member=='2'" :src="normal" width="84rpx" height="30rpx">
|
||||||
</u--image>
|
</u--image>
|
||||||
<u--image v-else :src="VIP" width="84rpx" height="30rpx">
|
<u--image v-if="member=='3'" :src="VIP" width="84rpx" height="30rpx">
|
||||||
</u--image>
|
</u--image>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;align-items: center;">
|
<view style="display: flex;align-items: center;">
|
||||||
<text style="margin-right: 8rpx;">顾发航</text>
|
<text style="margin-right: 8rpx;">{{nickname}}</text>
|
||||||
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
|
<u--image v-if="showEdit==true" src="/static/my/wd_icon_bj.png" width="22rpx" height="22rpx"
|
||||||
@click="changeAvatar()">
|
@click="changeAvatar()">
|
||||||
</u--image>
|
</u--image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -30,9 +29,10 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
show: false,
|
member: false,
|
||||||
showEdit: true,
|
showEdit: true,
|
||||||
avatar: 'https://cdn.uviewui.com/uview/album/2.jpg',
|
avatar: '',
|
||||||
|
nickname: '',
|
||||||
normal: '/static/my/wo_icon_pthy.png',
|
normal: '/static/my/wo_icon_pthy.png',
|
||||||
VIP: '/static/my/wo_icon_vip.png',
|
VIP: '/static/my/wo_icon_vip.png',
|
||||||
};
|
};
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
if (this.center != false) {
|
if (this.center != false) {
|
||||||
this.showEdit = false
|
this.showEdit = false
|
||||||
}
|
}
|
||||||
|
this.getUser()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//修改头像
|
//修改头像
|
||||||
@@ -48,11 +49,17 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../../packageMy/changeAvatar/changeAvatar'
|
url: '../../packageMy/changeAvatar/changeAvatar'
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
//获取普通会员和VIP会员
|
||||||
|
getUser() {
|
||||||
|
this.$apiServe.getUser().then(res => {
|
||||||
|
// console.log('个人信息==', res.data.data);
|
||||||
|
var data = res.data.data
|
||||||
|
this.avatar = data.avatar
|
||||||
|
this.nickname = data.nickname
|
||||||
|
this.member = data.member
|
||||||
|
}).finally(_ => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
return {
|
return {
|
||||||
model: {
|
model: {
|
||||||
userInfo: {
|
userInfo: {
|
||||||
name: '',
|
name: '姓名',
|
||||||
phone: '',
|
phone: '2342233',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
|
<view class="xw_content" v-for="(item,index) in newsList" :key="index" @click="clickNews(item)">
|
||||||
<u--image :src="item.cover" width="192rpx" height="122rpx" :lazy-load="true">
|
<u--image :src="imgUrl+item.cover" width="192rpx" height="122rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<view class="xw_right">
|
<view class="xw_right">
|
||||||
<view class="xw_title">
|
<view class="xw_title">
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<text class="xw_time">
|
<text class="xw_time">
|
||||||
{{item.pub_time}}
|
{{item.pub_time_str}}
|
||||||
</text>
|
</text>
|
||||||
<text class="xw_time xw_place">
|
<text class="xw_time xw_place">
|
||||||
{{item.pub_name}}
|
{{item.pub_name}}
|
||||||
@@ -21,38 +21,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormat
|
||||||
|
} from '../../utills/date.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
newsList: [
|
imgUrl: '',
|
||||||
// {
|
newsList: [],
|
||||||
// src: '/static/report/zhanwei_xf.png',
|
|
||||||
// title: '2022近50款食品饮料新品,创新的方向都在这里',
|
|
||||||
// time: '2022-12-03 09:59',
|
|
||||||
// place: '第一食品资讯官方账号'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/report/zhanwei_xf.png',
|
|
||||||
// title: '食品企业如何开发新产品?创新思维又发挥着怎样的效应呢?',
|
|
||||||
// time: '2022-10-18 14:43',
|
|
||||||
// place: '腾讯新闻 '
|
|
||||||
// },
|
|
||||||
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getNews()
|
this.getNews()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取行业新闻
|
|
||||||
// {
|
|
||||||
// pageSize: 2,
|
|
||||||
// pageNum: 1
|
|
||||||
// }
|
|
||||||
getNews() {
|
getNews() {
|
||||||
this.$apiServe.getNews().then(res => {
|
this.$apiServe.getNews().then(res => {
|
||||||
// console.log('行业新闻', res.data.data)
|
// console.log('行业新闻', res.data.data)
|
||||||
|
for (const item of res.data.data) {
|
||||||
|
item.pub_time_str = dateFormat(item.pub_time_str)
|
||||||
|
}
|
||||||
this.newsList = res.data.data
|
this.newsList = res.data.data
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
</u-image>
|
</u-image>
|
||||||
<view class="bgContent">
|
<view class="bgContent">
|
||||||
<view>
|
<view>
|
||||||
<u-image :src="item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="img_tag">{{item.cate_name}}</view>
|
<view class="img_tag">{{item.cate_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding: 14rpx 22rpx;">
|
<view style="padding: 14rpx 22rpx;">
|
||||||
<view class="title_box">
|
<view class="title_box">
|
||||||
<text class="title">{{item.name}}</text>
|
<text class="title">{{item.name}}</text>
|
||||||
<u-tag :text="item.tag" type="warning" shape="circle"></u-tag>
|
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||||
</view>
|
</view>
|
||||||
<view class="product_desc">
|
<view class="product_desc">
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
:lazy-load="true">
|
:lazy-load="true">
|
||||||
</u-image>
|
</u-image>
|
||||||
<text class="release">发布日期:</text>
|
<text class="release">发布日期:</text>
|
||||||
<text>{{item.pub_time}}</text>
|
<text>{{item.pub_time_str}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -38,56 +38,47 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
productList: [
|
imgUrl: '',
|
||||||
// {
|
tagsArray: [],
|
||||||
// src: '/static/products/zhanwei_dg.png',
|
productList: [],
|
||||||
// title: '锅巴',
|
pageNum: 1, // 当前页
|
||||||
// tag: '无添加剂',
|
pageSize: 4, // 每页条数
|
||||||
// img_tag: '零食铺子',
|
sortType: ''
|
||||||
// desc: '糯米蟹黄锅巴散装,非油炸绿色健康食品',
|
|
||||||
// time: '2022-12-04'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/products/zhanwei_dg.png',
|
|
||||||
// title: '干吃汤圆',
|
|
||||||
// tag: '天然原料',
|
|
||||||
// img_tag: '糕点卷酥',
|
|
||||||
// desc: '休闲食品厂家甜品糯米食品零食闽南特产宵夜好吃糍粑',
|
|
||||||
// time: '2022-12-04'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/products/zhanwei_dg.png',
|
|
||||||
// title: '紫薯魔芋人参魔芋人参魔芋人参…',
|
|
||||||
// tag: '天然原料',
|
|
||||||
// img_tag: '健康创新',
|
|
||||||
// desc: '紫薯魔芋人参代餐粉 冲调饮品贴牌加工 五谷杂粮粉代餐',
|
|
||||||
// time: '2022-12-04'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/products/zhanwei_dg.png',
|
|
||||||
// title: '焦糖饼干',
|
|
||||||
// tag: '无防腐剂',
|
|
||||||
// img_tag: '饼干曲奇',
|
|
||||||
// desc: '比利时风味焦糖饼干代餐小吃零食品',
|
|
||||||
// time: '2022-12-04'
|
|
||||||
// }
|
|
||||||
],
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
uni.$on("getCurrent", data => {
|
||||||
|
if (data == 0) {
|
||||||
|
this.sortType = 1
|
||||||
|
} else if (data == 1) {
|
||||||
|
this.sortType = 2
|
||||||
|
}
|
||||||
|
})
|
||||||
this.getProducts()
|
this.getProducts()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//获取产品列表
|
//获取产品列表
|
||||||
getProducts() {
|
getProducts() {
|
||||||
// console.log("子组件的获取产品列表方法====");
|
this.$apiServe.getProducts({
|
||||||
this.$apiServe.getProducts().then(res => {
|
sortType: this.sortType,
|
||||||
// console.log(res.data.data)
|
pageSize: this.pageSize,
|
||||||
|
pageNum: this.pageNum
|
||||||
|
}).then(res => {
|
||||||
|
let tags = res.data.data
|
||||||
|
for (const item of tags) {
|
||||||
|
let tag = item.tags
|
||||||
|
this.tagsArray = tag.split(',')
|
||||||
|
item.tags = this.tagsArray[0]
|
||||||
|
}
|
||||||
|
// this.$emit("getChild", tags.length);
|
||||||
|
// 用于触底刷新 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
|
||||||
|
// this.productList = [...this.productList, ...res.data.data]
|
||||||
|
//这用于上架时间和点赞量的数据切换
|
||||||
this.productList = res.data.data
|
this.productList = res.data.data
|
||||||
|
}).finally(_ => {
|
||||||
|
|
||||||
}).finally(_ => {})
|
})
|
||||||
},
|
},
|
||||||
//点击图片跳转到详情页
|
//点击图片跳转到详情页
|
||||||
toDetailPage(item) {
|
toDetailPage(item) {
|
||||||
|
|||||||
137
components/productsBtn/productsBtn.vue
Normal file
137
components/productsBtn/productsBtn.vue
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="products_box">
|
||||||
|
<u-grid :border="false" col="2">
|
||||||
|
<u-grid-item v-for="(item,index) in productList" :key="index">
|
||||||
|
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
|
||||||
|
</u-image>
|
||||||
|
<view class="bgContent">
|
||||||
|
<view>
|
||||||
|
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true"
|
||||||
|
@click="toDetailPage()">
|
||||||
|
</u-image>
|
||||||
|
<view class="img_tag">{{item.cate_name}}</view>
|
||||||
|
</view>
|
||||||
|
<view style="padding: 14rpx 22rpx;">
|
||||||
|
<view class="title_box">
|
||||||
|
<text class="title">{{item.name}}</text>
|
||||||
|
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
|
||||||
|
</view>
|
||||||
|
<view class="product_desc">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
<view class="releaseDate">
|
||||||
|
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
|
||||||
|
:lazy-load="true">
|
||||||
|
</u-image>
|
||||||
|
<text class="release">发布日期:</text>
|
||||||
|
<text>{{item.create_time}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-button v-if="type==1" type="success" text="移除" color="#0EBB5B" @click="showModal()"></u-button>
|
||||||
|
<u-button v-if="type==2" type="success" text="取消收藏" color="#0EBB5B"></u-button>
|
||||||
|
</u-grid-item>
|
||||||
|
</u-grid>
|
||||||
|
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay @confirm="confirm"
|
||||||
|
@cancel="cancel" @close="close">
|
||||||
|
</u-modal>
|
||||||
|
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||||
|
v-if="type==1&&productList.length==0">
|
||||||
|
暂无更多浏览记录</view>
|
||||||
|
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||||
|
v-if="type==2&&productList.length==0">
|
||||||
|
暂无更多收藏记录</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormatHistory
|
||||||
|
} from '../../utills/date.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
productId: '',
|
||||||
|
imgUrl: '',
|
||||||
|
tagsArray: [],
|
||||||
|
productList: [],
|
||||||
|
showM: false,
|
||||||
|
content: '您确定移除吗?',
|
||||||
|
productList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
type: String
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
styleIsolation: 'shared', // 解除样式隔离
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getHistoryOrCollection()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取历史记录
|
||||||
|
getHistoryOrCollection() {
|
||||||
|
this.$apiServe.getHistoryOrCollection(this.type).then(res => {
|
||||||
|
let data = res.data.data
|
||||||
|
for (const item of data) {
|
||||||
|
let tag = item.tags
|
||||||
|
this.tagsArray = tag.split(',')
|
||||||
|
item.tags = this.tagsArray[0]
|
||||||
|
item.create_time = dateFormatHistory(item.create_time)
|
||||||
|
}
|
||||||
|
// console.log('获取历史记录', res.data);
|
||||||
|
this.productId = data.id
|
||||||
|
this.productList = data
|
||||||
|
}).finally(_ => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//移除按钮
|
||||||
|
showModal() {
|
||||||
|
this.showM = true
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
this.showM = false
|
||||||
|
console.log('删除成功');
|
||||||
|
// this.$apiServe.deleteHistoryOrCollection(this.productId).then(res => {
|
||||||
|
// console.log('删除历史记录或收藏', res);
|
||||||
|
// this.getHistoryOrCollection()
|
||||||
|
// }).finally(_ => {})
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.showM = false
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.showM = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.u-modal__content {
|
||||||
|
padding: 43rpx 104rpx !important;
|
||||||
|
text-indent: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-button {
|
||||||
|
width: 150rpx !important;
|
||||||
|
height: 50rpx !important;
|
||||||
|
background: #0EBB5B;
|
||||||
|
border-radius: 10rpx !important;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-button__text {
|
||||||
|
font-size: 24rpx !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #FFFFFF;
|
||||||
|
line-height: 33px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
43
packageMy/bindCompany/bindCompany.vue
Normal file
43
packageMy/bindCompany/bindCompany.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<myForm ref="nameAndphone"></myForm>
|
||||||
|
<u-button type="success" text="确定" color="#0EBB5B" @click="handleSureClick()"></u-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
name: '',
|
||||||
|
phone: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.name = this.$refs.nameAndphone.model.userInfo.name
|
||||||
|
this.phone = this.$refs.nameAndphone.model.userInfo.phone
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSureClick() {
|
||||||
|
this.$apiServe.bindComponyAndUpdate({
|
||||||
|
uid: 1,
|
||||||
|
type: 1,
|
||||||
|
companyPhone: this.phone,
|
||||||
|
companyName: this.name
|
||||||
|
}).then(res => {
|
||||||
|
// console.log('绑定公司', res);
|
||||||
|
}).finally(_ => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.u-button {
|
||||||
|
width: 644rpx !important;
|
||||||
|
height: 86rpx !important;
|
||||||
|
background: #0EBB5B;
|
||||||
|
border-radius: 20rpx !important;
|
||||||
|
margin-top: 168rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<myForm></myForm>
|
|
||||||
<u-button type="success" text="确定" color="#0EBB5B"></u-button>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.u-button {
|
|
||||||
width: 644rpx !important;
|
|
||||||
height: 86rpx !important;
|
|
||||||
background: #0EBB5B;
|
|
||||||
border-radius: 20rpx !important;
|
|
||||||
margin-top: 168rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,43 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="products_box">
|
<productsBtn :type="1"></productsBtn>
|
||||||
<u-grid :border="false" col="2">
|
|
||||||
<u-grid-item v-for="(item,index) in productList" :key="index">
|
|
||||||
<u-image src="/static/products/sy_bb.png" width="354rpx" height="539rpx" :lazy-load="true">
|
|
||||||
</u-image>
|
|
||||||
<view class="bgContent">
|
|
||||||
<view>
|
|
||||||
<u-image :src="item.src" width="346rpx" height="320rpx" :lazy-load="true"
|
|
||||||
@click="toDetailPage()">
|
|
||||||
</u-image>
|
|
||||||
<view class="img_tag">{{item.img_tag}}</view>
|
|
||||||
</view>
|
|
||||||
<view style="padding: 14rpx 22rpx;">
|
|
||||||
<view class="title_box">
|
|
||||||
<text class="title">{{item.title}}</text>
|
|
||||||
<u-tag :text="item.tag" type="warning" shape="circle"></u-tag>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="product_desc">
|
|
||||||
{{item.desc}}
|
|
||||||
</view>
|
|
||||||
<view class="releaseDate">
|
|
||||||
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"
|
|
||||||
:lazy-load="true">
|
|
||||||
</u-image>
|
|
||||||
<text class="release">发布日期:</text>
|
|
||||||
<text>{{item.time}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<u-button v-if="type==1" type="success" text="移除" color="#0EBB5B" @click="showModal()"></u-button>
|
|
||||||
<u-button v-if="type==2" type="success" text="取消收藏" color="#0EBB5B"></u-button>
|
|
||||||
</u-grid-item>
|
|
||||||
</u-grid>
|
|
||||||
<u-modal :show="showM" :content="content" showCancelButton closeOnClickOverlay @confirm="confirm"
|
|
||||||
@cancel="cancel" @close="close">
|
|
||||||
</u-modal>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -45,202 +8,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showM: false,
|
type: ''
|
||||||
content: '您确定移除吗?',
|
|
||||||
type: '',
|
|
||||||
productList: [{
|
|
||||||
src: '/static/products/zhanwei_dg.png',
|
|
||||||
title: '锅巴',
|
|
||||||
tag: '无添加剂',
|
|
||||||
img_tag: '零食铺子',
|
|
||||||
desc: '糯米蟹黄锅巴散装,非油炸绿色健康食品',
|
|
||||||
time: '2022-12-04'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '/static/products/zhanwei_dg.png',
|
|
||||||
title: '干吃汤圆',
|
|
||||||
tag: '天然原料',
|
|
||||||
img_tag: '糕点卷酥',
|
|
||||||
desc: '休闲食品厂家甜品糯米食品零食闽南特产宵夜好吃糍粑',
|
|
||||||
time: '2022-12-04'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '/static/products/zhanwei_dg.png',
|
|
||||||
title: '紫薯魔芋人参魔芋人参魔芋人参…',
|
|
||||||
tag: '天然原料',
|
|
||||||
img_tag: '健康创新',
|
|
||||||
desc: '紫薯魔芋人参代餐粉 冲调饮品贴牌加工 五谷杂粮粉代餐',
|
|
||||||
time: '2022-12-04'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '/static/products/zhanwei_dg.png',
|
|
||||||
title: '焦糖饼干',
|
|
||||||
tag: '无防腐剂',
|
|
||||||
img_tag: '饼干曲奇',
|
|
||||||
desc: '比利时风味焦糖饼干代餐小吃零食品',
|
|
||||||
time: '2022-12-04'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
this.type = options.id
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//移除按钮
|
|
||||||
showModal() {
|
|
||||||
this.showM = true
|
|
||||||
},
|
|
||||||
confirm() {
|
|
||||||
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
this.showM = false
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.showM = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.u-modal {
|
|
||||||
width: 472rpx !important;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--cancel {
|
|
||||||
|
|
||||||
background: #D8D8D8;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__content {
|
|
||||||
padding: 43rpx 104rpx !important;
|
|
||||||
text-indent: 25rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__content__text {
|
|
||||||
font-size: 32rpx !important;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #252421 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--confirm {
|
|
||||||
background: #0EBB5B;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-button {
|
|
||||||
width: 150rpx !important;
|
|
||||||
height: 50rpx !important;
|
|
||||||
background: #0EBB5B;
|
|
||||||
border-radius: 10rpx !important;
|
|
||||||
margin-top: 22rpx;
|
|
||||||
margin-bottom: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.products_box {
|
|
||||||
padding: 10rpx;
|
|
||||||
|
|
||||||
.u-grid-item {
|
|
||||||
|
|
||||||
.bgContent {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
|
|
||||||
.u-image__image {
|
|
||||||
margin-left: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img_tag {
|
|
||||||
position: absolute;
|
|
||||||
padding: 2rpx 8rpx;
|
|
||||||
right: 5px;
|
|
||||||
top: 30rpx;
|
|
||||||
border-radius: 54rpx 0px 0px 54rpx;
|
|
||||||
box-shadow: 0px 2rpx 4rpx 0px #078C42;
|
|
||||||
background: linear-gradient(135deg, #0DB658 0%, #16DD6D 100%);
|
|
||||||
font-size: 20rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
line-height: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.title_box {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 186rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-family: PingFangSC-Medium, PingFang SC;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #0EBB5B;
|
|
||||||
line-height: 37rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-tag {
|
|
||||||
height: 26rpx;
|
|
||||||
line-height: 26rpx;
|
|
||||||
background: linear-gradient(124deg, #FEAA19 0%, #FDCF3A 100%);
|
|
||||||
|
|
||||||
.u-tag__text {
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.product_desc {
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #3E3E3E;
|
|
||||||
line-height: 26rpx;
|
|
||||||
margin-top: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.releaseDate {
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-family: PingFangSC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #A3A3A3;
|
|
||||||
line-height: 26rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 25rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.release {
|
|
||||||
padding: 0 10rpx 0 5rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true">
|
<u--image src="/static/my/wo_icon_hyzxbj.png" width="750rpx" height="349rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<myAvatar :center="show"></myAvatar>
|
<myAvatar :center="show"></myAvatar>
|
||||||
<myForm></myForm>
|
<view style="height: 56rpx;"></view>
|
||||||
|
<myForm ref="nameAndphone"></myForm>
|
||||||
<view class="commitment">
|
<view class="commitment">
|
||||||
{{commitment}}
|
{{commitment}}
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="showModal()"></u-button>
|
<u-button type="success" text="升级VIP" color="#0EBB5B" @click="showModal()"></u-button>
|
||||||
<u-modal :show="showM" closeOnClickOverlay confirmText="确定" @confirm="confirm" @close="close">
|
<u-modal :show="showM" closeOnClickOverlay confirmText="确定" @confirm="confirm" @close="close">
|
||||||
<rich-text :nodes="content"></rich-text>
|
<rich-text :nodes="content"></rich-text>
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
name: '',
|
||||||
|
phone: '',
|
||||||
showM: false,
|
showM: false,
|
||||||
//会员中心的用户名旁边不显示edit图标
|
//会员中心的用户名旁边不显示edit图标
|
||||||
show: false,
|
show: false,
|
||||||
@@ -28,6 +30,10 @@
|
|||||||
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
|
commitment: '承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置承诺声明预留文字位置'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.name = this.$refs.nameAndphone.model.userInfo.name
|
||||||
|
this.phone = this.$refs.nameAndphone.model.userInfo.phone
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 联系客服模态框
|
// 联系客服模态框
|
||||||
showModal() {
|
showModal() {
|
||||||
@@ -35,6 +41,14 @@
|
|||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
this.showM = false
|
this.showM = false
|
||||||
|
this.$apiServe.bindComponyAndUpdate({
|
||||||
|
uid: 1,
|
||||||
|
type: 2,
|
||||||
|
companyPhone: this.phone,
|
||||||
|
companyName: this.name
|
||||||
|
}).then(res => {
|
||||||
|
console.log('升级VIP', res);
|
||||||
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.showM = false
|
this.showM = false
|
||||||
@@ -63,30 +77,8 @@
|
|||||||
border-radius: 20rpx !important;
|
border-radius: 20rpx !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-modal {
|
|
||||||
width: 472rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__content {
|
.u-modal__content {
|
||||||
padding: 43rpx 104rpx !important;
|
padding: 43rpx 104rpx !important;
|
||||||
text-indent: 14rpx;
|
text-indent: 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-modal__content__text {
|
|
||||||
font-size: 32rpx !important;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #252421 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--hover {
|
|
||||||
background: #0EBB5B !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--confirm {
|
|
||||||
background: #0EBB5B;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
15
packageMy/myCollection/myCollection.vue
Normal file
15
packageMy/myCollection/myCollection.vue
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<productsBtn :type="2"></productsBtn>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
type: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -59,6 +59,7 @@
|
|||||||
showM: false,
|
showM: false,
|
||||||
content: '您确定删除吗?',
|
content: '您确定删除吗?',
|
||||||
tabCurrent: 0,
|
tabCurrent: 0,
|
||||||
|
type: '',
|
||||||
tabsList: [{
|
tabsList: [{
|
||||||
name: '需求发布'
|
name: '需求发布'
|
||||||
}, {
|
}, {
|
||||||
@@ -84,10 +85,27 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
if (this.tabCurrent == 0) {
|
||||||
|
this.type = 2
|
||||||
|
} else if (this.tabCurrent == 1) {
|
||||||
|
this.type = 1
|
||||||
|
}
|
||||||
|
this.getIdeasAndNeeds()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//获取创意发布
|
||||||
|
getIdeasAndNeeds() {
|
||||||
|
this.$apiServe.getIdeasAndNeeds(this.type).then(res => {
|
||||||
|
console.log('获取创意发布&需求发布', res.data);
|
||||||
|
// this.productList = data
|
||||||
|
}).finally(_ => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
tabChange(data) {
|
tabChange(data) {
|
||||||
this.tabCurrent = data.index
|
this.tabCurrent = data.index
|
||||||
this.needsPublishForm = {}
|
this.getIdeasAndNeeds()
|
||||||
},
|
},
|
||||||
//删除按钮
|
//删除按钮
|
||||||
showModal() {
|
showModal() {
|
||||||
@@ -113,7 +131,6 @@
|
|||||||
editIdeas() {
|
editIdeas() {
|
||||||
console.log('修改创意');
|
console.log('修改创意');
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
// id=' + ideaId + '&
|
|
||||||
url: '/pages/ideasAndNeeds/ideasAndNeeds?index=' + 1
|
url: '/pages/ideasAndNeeds/ideasAndNeeds?index=' + 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -122,39 +139,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.u-modal {
|
|
||||||
width: 472rpx !important;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--cancel {
|
|
||||||
|
|
||||||
background: #D8D8D8;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__content {
|
.u-modal__content {
|
||||||
padding: 43rpx 104rpx !important;
|
padding: 43rpx 104rpx !important;
|
||||||
text-indent: 25rpx;
|
text-indent: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-modal__content__text {
|
|
||||||
font-size: 32rpx !important;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #252421 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--confirm {
|
|
||||||
background: #0EBB5B;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.u-tabs {
|
.u-tabs {
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<u-swiper :list="swiperList" indicatorMode="line " width="750rpx" height="290rpx" radius="0" circular>
|
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="290rpx">
|
||||||
</u-swiper>
|
</u-image>
|
||||||
<view class="feature">
|
<view class="feature">
|
||||||
<text class="one_title">经营范围及特色</text>
|
<text class="one_title">经营范围及特色</text>
|
||||||
<view class="green_block">
|
<view class="green_block">
|
||||||
<text class="green_features">{{features}}</text>
|
<text class="green_features">{{detailList.desc}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="introduce">
|
<view class="introduce">
|
||||||
<view class="introduce_title">企业介绍</view>
|
<view class="introduce_title">企业介绍</view>
|
||||||
<text class="business_introduce">{{business_introduce}}</text>
|
<text class="business_introduce">{{detailList.content}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="show">
|
<view class="show">
|
||||||
<view class="introduce_title">企业展示</view>
|
<view class="introduce_title">企业展示</view>
|
||||||
<u-grid :border="false" col="4">
|
<u-grid :border="false" col="4">
|
||||||
<u-grid-item v-for="(listItem,listIndex) in showList" :key="listIndex">
|
<u-grid-item v-for="(listItem,listIndex) in detailList.images" :key="listIndex">
|
||||||
<u--image :src="listItem.src" width="170rpx" height="170rpx" :lazy-load="true">
|
<u--image :src="imgUrl+listItem" width="170rpx" height="170rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
</u-grid-item>
|
</u-grid-item>
|
||||||
</u-grid>
|
</u-grid>
|
||||||
@@ -34,39 +34,22 @@
|
|||||||
return {
|
return {
|
||||||
id: '',
|
id: '',
|
||||||
detailList: [],
|
detailList: [],
|
||||||
// src: '/static/detail/cj_bg.png',
|
imgUrl: ''
|
||||||
features: '活冻鲍鱼,冻煮鲍鱼,鲍鱼罐头 佛跳墙,海螺片',
|
|
||||||
business_introduce: '福建省海纳川食品有限公司是一家从事水产养殖,加工与销售为一体的现代化企业,公司主要加工:活冻鲍鱼,溏心皇金鲍,兰花蟹,黄金鲍片,佛跳墙,大盆菜,火锅小章鱼,鲨鱼礼盒等系列产品。公司位于福建省自由贸易试验区马尾片区,离全国大的水产交易市场--马尾名成水产市场不到一公里,这里交通方便,商贾云集,冷链物流通达全国。',
|
|
||||||
showList: [{
|
|
||||||
src: '/static/report/zhanwei_xf(1).png'
|
|
||||||
}, {
|
|
||||||
src: '/static/report/zhanwei_xf(1).png'
|
|
||||||
}, {
|
|
||||||
src: '/static/report/zhanwei_xf(1).png'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: '/static/report/zhanwei_xf(1).png'
|
|
||||||
},
|
|
||||||
],
|
|
||||||
swiperList: [
|
|
||||||
'/static/detail/cj_bg.png',
|
|
||||||
'/static/detail/cj_bg.png'
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
console.log('认证厂家id', option.id);
|
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.getCertifiedCjDetail()
|
this.getCertifiedCjDetail()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取认证厂家详情
|
//获取认证厂家详情
|
||||||
getCertifiedCjDetail() {
|
getCertifiedCjDetail() {
|
||||||
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
|
this.$apiServe.getCertifiedCjDetail(this.id).then(res => {
|
||||||
console.log('认证厂家详情页', res)
|
// console.log('认证厂家详情页', res.data.data)
|
||||||
|
let data = res.data.data
|
||||||
// this.detailList = res.data.data
|
data.images = data.images.split(';')
|
||||||
|
this.detailList = data
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,19 +18,17 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormatXwDetail
|
||||||
|
} from '../../utills/date.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: '',
|
id: '',
|
||||||
detailList: []
|
detailList: [],
|
||||||
// title: '2022近50款食品饮料新品,创新的方向都在这里',
|
|
||||||
// time: '2022-12-03 09:59',
|
|
||||||
// place: '第一食品资讯官方账号',
|
|
||||||
// news: '<h1>一级标题</h1><br/><h2>二级标题</h2>'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
console.log('新闻详情id', option.id);
|
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.getNewsDetail()
|
this.getNewsDetail()
|
||||||
},
|
},
|
||||||
@@ -38,9 +36,11 @@
|
|||||||
//获取行业新闻详情
|
//获取行业新闻详情
|
||||||
getNewsDetail() {
|
getNewsDetail() {
|
||||||
this.$apiServe.getNewsDetail(this.id).then(res => {
|
this.$apiServe.getNewsDetail(this.id).then(res => {
|
||||||
console.log('新闻详情页', res.data.data)
|
// console.log('新闻详情页', res.data.data)
|
||||||
|
let detail = res.data.data
|
||||||
|
detail.pub_time = dateFormatXwDetail(detail.pub_time)
|
||||||
this.detailList = res.data.data
|
this.detailList = res.data.data
|
||||||
|
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
11
pages.json
11
pages.json
@@ -68,7 +68,7 @@
|
|||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "packageMy",
|
"root": "packageMy",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "bindCompony/bindCompony",
|
"path": "bindCompany/bindCompany",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "绑定公司",
|
"navigationBarTitleText": "绑定公司",
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
@@ -108,6 +108,15 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "myCollection/myCollection",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "我的收藏",
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarBackgroundColor": "#12CA64",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view :key="index">
|
<view :key="index">
|
||||||
<u-swiper :list="detailList.images" indicatorMode="line " width="750rpx" height="530rpx" radius="0"
|
<u-image :src="imgUrl+detailList.cover" width="750rpx" height="530rpx">
|
||||||
circular>
|
</u-image>
|
||||||
</u-swiper>
|
<view class="collect" @click="starTap">
|
||||||
<view class="collect">
|
|
||||||
<view class="star">
|
<view class="star">
|
||||||
<u-image v-if="showStar==false" src="/static/detail/xp_icon_wstar.png" width="28rpx" height="28rpx"
|
<u-image v-if="detailList.type==0" src="/static/detail/xp_icon_wstar.png" width="28rpx"
|
||||||
@click="starTap">
|
height="28rpx">
|
||||||
</u-image>
|
</u-image>
|
||||||
<u-image v-if="showStar==true" src="/static/detail/xp_icon_star.png" width="28rpx" height="28rpx"
|
<u-image v-if="detailList.type==1" src="/static/detail/xp_icon_star.png" width="28rpx"
|
||||||
@click="starTap">
|
height="28rpx">
|
||||||
</u-image>
|
</u-image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
|
<u-image src="/static/detail/xiangqing_icon_shoucang.png" width="119rpx" height="48rpx">
|
||||||
</u-image>
|
</u-image>
|
||||||
</view>
|
</view>
|
||||||
@@ -31,23 +29,22 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="tag_view">
|
<view class="tag_view">
|
||||||
<view>
|
<view>
|
||||||
<text class="tagOne">{{detailList.tags}}</text>
|
<text class="tagOne" v-for="item in detailList.tags" :key="item.id">{{item}}</text>
|
||||||
<!-- <text class="tagTwo">{{item.tagTwo}}</text> v-for="item in detailList.tags" :key="item.id" -->
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isThumb==false" class="heart">
|
<view v-if="detailList.thumb" class="heart">
|
||||||
<u-image v-if="showHeart==false" src="/static/detail/xp_icon_heart.png" width="34rpx"
|
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx">
|
||||||
height="32rpx" @click="heartTap">
|
|
||||||
</u-image>
|
|
||||||
<u-image v-if="showHeart==true" src="/static/detail/xp_icon_ysc.png" width="34rpx"
|
|
||||||
height="32rpx" @click="heartTap">
|
|
||||||
</u-image>
|
|
||||||
<text class="thumb">点赞</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="isThumb==true" class="heart">
|
|
||||||
<u-image src="/static/detail/xp_icon_ysc.png" width="34rpx" height="32rpx" @click="heartTap">
|
|
||||||
</u-image>
|
</u-image>
|
||||||
<text class="thumb">{{detailList.thumb}}赞</text>
|
<text class="thumb">{{detailList.thumb}}赞</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="heart" @click="heartTap">
|
||||||
|
<u-image v-if="showHeart==false" src="/static/detail/xp_icon_heart.png" width="34rpx"
|
||||||
|
height="32rpx">
|
||||||
|
</u-image>
|
||||||
|
<u-image v-if="showHeart==true" src="/static/detail/xp_icon_ysc.png" width="34rpx"
|
||||||
|
height="32rpx">
|
||||||
|
</u-image>
|
||||||
|
<text class="thumb">点赞</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -64,50 +61,48 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
dateFormatDetail
|
||||||
|
} from '../../../utills/date.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: '',
|
id: '',
|
||||||
showStar: false,
|
imgUrl: '',
|
||||||
|
tagsArray: [],
|
||||||
showHeart: false,
|
showHeart: false,
|
||||||
isThumb: false,
|
detailList: []
|
||||||
detailList: [
|
|
||||||
// {
|
|
||||||
// title: '锅巴',
|
|
||||||
// tag: '零食铺子',
|
|
||||||
// desc: '糯米蟹黄锅巴散装,非油炸绿色健康食品',
|
|
||||||
// classify: '薯片膨化',
|
|
||||||
// tagOne: '无添加剂1',
|
|
||||||
// tagTwo: '无添加剂',
|
|
||||||
// time: '2022年12月04日',
|
|
||||||
// content: '<h1>一级标题</h1><br/><h2>二级标题</h2>'
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
swiperList: [
|
|
||||||
'/static/detail/zhanwei_xppx.png',
|
|
||||||
'/static/detail/zhanwei_xppx.png'
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
console.log('产品id', option.id);
|
|
||||||
this.id = option.id
|
this.id = option.id
|
||||||
this.getProductDetail()
|
this.getProductDetail()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//获取详情信息
|
//获取详情信息
|
||||||
getProductDetail() {
|
getProductDetail() {
|
||||||
this.$apiServe.getProductDetail(this.id).then(res => {
|
this.$apiServe.getProductDetail(this.id).then(res => {
|
||||||
// console.log('详情页', res.data.data.thumb)
|
console.log('详情页', res.data.data)
|
||||||
if (res.data.data.thumb) {
|
if (res.data.data.thumb) {
|
||||||
this.isThumb = true
|
this.isThumb = true
|
||||||
}
|
}
|
||||||
|
let detail = res.data.data
|
||||||
|
detail.pub_time = dateFormatDetail(detail.pub_time)
|
||||||
|
let tag = detail.tags
|
||||||
|
this.tagsArray = tag.split(',')
|
||||||
|
detail.tags = this.tagsArray
|
||||||
this.detailList = res.data.data
|
this.detailList = res.data.data
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
//收藏按钮
|
//收藏按钮
|
||||||
starTap() {
|
starTap() {
|
||||||
this.showStar = !this.showStar
|
this.detailList.type = !this.detailList.type
|
||||||
|
// this.$apiServe.collect(this.id).then(res => {
|
||||||
|
// console.log('收藏成功', res.data)
|
||||||
|
|
||||||
|
// this.detailList.type = 1
|
||||||
|
// }).finally(_ => {})
|
||||||
},
|
},
|
||||||
//点赞按钮
|
//点赞按钮
|
||||||
heartTap() {
|
heartTap() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<view class="classify">
|
<view class="classify">
|
||||||
<u-grid :border="false" col="5">
|
<u-grid :border="false" col="5">
|
||||||
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="toClassify(listItem.id)">
|
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="toClassify(listItem.id)">
|
||||||
<u--image :src="listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
|
<u--image :src="imgUrl+listItem.icon" width="86rpx" height="86rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
|
<!-- <u-icon size="86rpx" :name="listItem.icon"></u-icon> -->
|
||||||
<text class="grid-text">{{listItem.name}}</text>
|
<text class="grid-text">{{listItem.name}}</text>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 分类模块下的轮播图 -->
|
<!-- 分类模块下的轮播图 -->
|
||||||
<view>
|
<view>
|
||||||
<u-swiper :list="swiperList" indicatorMode="line" radius="0" circular></u-swiper>
|
<u-swiper :list="swiperList" keyName="img" indicatorMode="line" radius="0" circular></u-swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -33,12 +33,15 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<!-- 选项卡: 上架时间和点赞量 -->
|
<!-- 选项卡: 上架时间和点赞量 -->
|
||||||
<view>
|
<view>
|
||||||
<u-tabs :list="tabList" lineColor="#15CA65" :is-scroll="false"
|
<u-tabs :list="tabList" lineColor="#15CA65" scrollable="false"
|
||||||
activeStyle="color:#15CA65;font-weight: bold;">
|
activeStyle="color:#15CA65;font-weight: bold;" :current="tabCurrent" @change="tabChange">
|
||||||
</u-tabs>
|
</u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<!-- 产品 -->
|
<!-- 产品 -->
|
||||||
<products ref="getProducts"></products>
|
<products ref="getProductsByTime"></products>
|
||||||
|
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||||
|
v-show="reachBottomLength===0">
|
||||||
|
没有更多数据了</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,51 +49,12 @@
|
|||||||
import {
|
import {
|
||||||
serverHost
|
serverHost
|
||||||
} from '@/service/request.js'
|
} from '@/service/request.js'
|
||||||
|
import loginVue from '../my/login/login.vue'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
classifyList: [
|
classifyList: [],
|
||||||
// {
|
tabCurrent: 0,
|
||||||
// src: '/static/classify/sy_icon_hp.png',
|
|
||||||
// title: '烘培宝典'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_ls.png',
|
|
||||||
// title: '零食铺子'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_yp.png',
|
|
||||||
// title: '饮品大全'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_tw.png',
|
|
||||||
// title: '调味菜单'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_rs.png',
|
|
||||||
// title: '肉食荟萃'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_np.png',
|
|
||||||
// title: '乳品手册'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_gs.png',
|
|
||||||
// title: '果蔬地图'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_sj.png',
|
|
||||||
// title: '食界新贵'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_hz.png',
|
|
||||||
// title: '欢喜盒子'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// src: '/static/classify/sy_icon_cy.png',
|
|
||||||
// title: '创意工具'
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
tabList: [{
|
tabList: [{
|
||||||
name: '上架时间'
|
name: '上架时间'
|
||||||
},
|
},
|
||||||
@@ -98,63 +62,61 @@
|
|||||||
name: '点赞量'
|
name: '点赞量'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
imgUrl: '',
|
||||||
// swiperList: [
|
swiperList: [],
|
||||||
// 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
|
reachBottomLength: '',
|
||||||
// 'https://cdn.uviewui.com/uview/swiper/swiper3.png'
|
productList: [],
|
||||||
// ],
|
pageNum: 1,
|
||||||
|
sortType: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onReachBottom() {
|
||||||
// this.$refs.getProducts.query.pageNum = 1
|
this.pageNum += 1
|
||||||
// this.$refs.getProducts.productList = []
|
if (this.reachBottomLength !== 0) {
|
||||||
|
this.getNewProducts()
|
||||||
this.$refs.getProducts.getProducts()
|
}
|
||||||
//关闭下拉刷新
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.getCategories()
|
this.getCategories()
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
this.getImgUrl()
|
this.getImgUrl()
|
||||||
// this.$refs.getProducts.getProducts()
|
this.getToken()
|
||||||
|
this.imgUrl = uni.getStorageSync('img_url')
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//获取一级分类
|
//点击上架时间和点赞量切换页面
|
||||||
getCategories() {
|
tabChange(data) {
|
||||||
this.$apiServe.getCategories().then(res => {
|
this.tabCurrent = data.index
|
||||||
// console.log(res.data.data)
|
uni.$emit("getCurrent", data.index);
|
||||||
this.classifyList = res.data.data
|
if (data.index == 0) {
|
||||||
}).finally(_ => {})
|
this.sortType = 1
|
||||||
|
} else if (data.index == 1) {
|
||||||
|
this.$refs.getProductsByTime.getProducts()
|
||||||
|
this.sortType = 2
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//获取首页轮播图
|
//下拉刷新获取新数据
|
||||||
getBanner() {
|
getNewProducts() {
|
||||||
this.$apiServe.getBanner().then(res => {
|
this.$apiServe.getProducts({
|
||||||
// console.log(res.data.data);
|
sortType: this.sortType,
|
||||||
let banner = res.data.data
|
pageSize: 4,
|
||||||
for (const item of banner) {
|
pageNum: this.pageNum
|
||||||
this.swiperList = item.img
|
}).then(res => {
|
||||||
// console.log(item);
|
let tags = res.data.data
|
||||||
|
for (const item of tags) {
|
||||||
|
let tag = item.tags
|
||||||
|
this.tagsArray = tag.split(',')
|
||||||
|
item.tags = this.tagsArray[0]
|
||||||
}
|
}
|
||||||
// this.swiperList = res.data.data
|
if (tags.length === 0) {
|
||||||
}).finally(_ => {})
|
this.reachBottomLength = tags.length
|
||||||
},
|
}
|
||||||
//点击一级分类
|
this.$refs.getProductsByTime.productList.push(...res.data.data)
|
||||||
// click(listIndex) {
|
|
||||||
// this.$refs.uToast.success(`点击了第${listIndex}个`)
|
|
||||||
// },
|
|
||||||
//点击搜索框跳转到搜索页面
|
|
||||||
toSearch() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '../../packageSearch/search/search'
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getphonenumber(e) {
|
//获取token
|
||||||
const {
|
getToken() {
|
||||||
code
|
var that = this
|
||||||
} = e.detail;
|
|
||||||
console.log("手机code : ", code);
|
|
||||||
uni.login({
|
uni.login({
|
||||||
"provider": "weixin",
|
"provider": "weixin",
|
||||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||||
@@ -162,13 +124,13 @@
|
|||||||
const {
|
const {
|
||||||
code
|
code
|
||||||
} = event
|
} = event
|
||||||
|
that.$apiServe.login({
|
||||||
console.log("登录code", code);
|
code: code
|
||||||
//客户端成功获取授权临时票据(code),向业务服务器发起登录请求。
|
}).then(res => {
|
||||||
|
var data = res.data.data
|
||||||
|
// console.log('登录code换取的信息', data);
|
||||||
// 调用登录接口 拿到token 传手机code,更新手机号码
|
uni.setStorageSync('token', data.token);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
// 登录授权失败
|
// 登录授权失败
|
||||||
@@ -176,6 +138,40 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//获取手机code
|
||||||
|
getphonenumber(e) {
|
||||||
|
let that = this
|
||||||
|
// const {
|
||||||
|
// code
|
||||||
|
// } = e.detail;
|
||||||
|
// console.log("手机code : ", code);
|
||||||
|
},
|
||||||
|
//获取子组件的getProducts方法返回数据的length,用于当length为0时取消发送请求
|
||||||
|
// getChild(e) {
|
||||||
|
// this.reachBottomLength = e
|
||||||
|
// },
|
||||||
|
//获取一级分类
|
||||||
|
getCategories() {
|
||||||
|
this.$apiServe.getCategories().then(res => {
|
||||||
|
this.classifyList = res.data.data
|
||||||
|
}).finally(_ => {})
|
||||||
|
},
|
||||||
|
//获取首页轮播图
|
||||||
|
getBanner() {
|
||||||
|
this.$apiServe.getBanner().then(res => {
|
||||||
|
let banner = res.data.data
|
||||||
|
for (const item of banner) {
|
||||||
|
item.img = this.imgUrl + item.img
|
||||||
|
}
|
||||||
|
this.swiperList = res.data.data
|
||||||
|
}).finally(_ => {})
|
||||||
|
},
|
||||||
|
//点击搜索框跳转到搜索页面
|
||||||
|
toSearch() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../../packageSearch/search/search'
|
||||||
|
})
|
||||||
|
},
|
||||||
//点击一级分类跳转到分类页
|
//点击一级分类跳转到分类页
|
||||||
toClassify(id) {
|
toClassify(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -184,7 +180,6 @@
|
|||||||
},
|
},
|
||||||
getImgUrl() {
|
getImgUrl() {
|
||||||
this.$apiServe.getImgUrl().then(res => {
|
this.$apiServe.getImgUrl().then(res => {
|
||||||
console.log(res)
|
|
||||||
try {
|
try {
|
||||||
uni.setStorageSync('img_url', res.data.data.img_url);
|
uni.setStorageSync('img_url', res.data.data.img_url);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
<u-button type="primary" open-type="getPhoneNumber" size="medium" @getphonenumber="getphonenumber">
|
||||||
获取电话号码</u-button>
|
获取电话号码</u-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {loginSys} from '@/service/request.js'
|
import {
|
||||||
export default {
|
loginSys
|
||||||
data() {
|
} from '@/service/request.js'
|
||||||
return {
|
export default {
|
||||||
|
data() {
|
||||||
}
|
return {
|
||||||
},
|
|
||||||
methods: {
|
}
|
||||||
getphonenumber(e) {
|
},
|
||||||
const {
|
methods: {
|
||||||
phoneCode
|
getphonenumber(e) {
|
||||||
} = e.detail;
|
const {
|
||||||
console.log("手机code : ", phoneCode);
|
phoneCode
|
||||||
uni.login({
|
} = e.detail;
|
||||||
"provider": "weixin",
|
console.log("手机code : ", phoneCode);
|
||||||
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
uni.login({
|
||||||
success: function(event) {
|
"provider": "weixin",
|
||||||
const {
|
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
||||||
code
|
success: function(event) {
|
||||||
} = event
|
const {
|
||||||
|
code
|
||||||
console.log("登录code", code);
|
} = event
|
||||||
//客户端成功获取授权临时票据(code),向业务服务器发起登录请求。
|
|
||||||
|
console.log("登录code", code);
|
||||||
|
//客户端成功获取授权临时票据(code),向业务服务器发起登录请求。
|
||||||
// 调用登录接口 拿到token 传手机code,更新手机号码
|
|
||||||
loginSys(code).then(res=>{
|
|
||||||
console.log(res);
|
// 调用登录接口 拿到token 传手机code,更新手机号码
|
||||||
|
loginSys(code).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
|
//登录完成后使用手机code换取手机号,调用/user/getMobileByMnp接口
|
||||||
//接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
|
//接口详细链接 https://docs.apipost.cn/preview/468be606f65cae75/3f2f988ddf82dd8e
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: function(err) {
|
fail: function(err) {
|
||||||
// 登录授权失败
|
// 登录授权失败
|
||||||
// err.code是错误码
|
// err.code是错误码
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -24,27 +24,29 @@
|
|||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<u-modal :show="showM" showCancelButton closeOnClickOverlay confirmText="是" cancelText="否"
|
<u-modal :show="showM" showCancelButton closeOnClickOverlay confirmText="是" cancelText="否"
|
||||||
@confirm="confirm" @cancel="cancel" @close="close">
|
@confirm="confirm" @cancel="cancel" @close="close">
|
||||||
<rich-text :nodes="content"></rich-text>
|
<view>
|
||||||
|
<text>{{phone}}</text>
|
||||||
|
<text>是否拨打客服电话</text>
|
||||||
|
</view>
|
||||||
</u-modal>
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import loginVue from './login/login.vue'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showM: false,
|
showM: false,
|
||||||
content: `138 1222 222<br>
|
phone: '138 1222 222',
|
||||||
是否拨打客服电话`,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//跳转到绑定公司页面
|
//跳转到绑定公司页面
|
||||||
bindCompany() {
|
bindCompany() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../../packageMy/bindCompony/bindCompony'
|
url: '../../packageMy/bindCompany/bindCompany'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//跳转到会员中心页面
|
//跳转到会员中心页面
|
||||||
@@ -56,14 +58,13 @@
|
|||||||
//跳转到浏览记录页面
|
//跳转到浏览记录页面
|
||||||
toBrowseHistory() {
|
toBrowseHistory() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../../packageMy/browseHistory/browseHistory?id=' + 1
|
url: '../../packageMy/browseHistory/browseHistory'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//跳转到我的收藏页面
|
//跳转到我的收藏页面
|
||||||
toMyCollect() {
|
toMyCollect() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../../packageMy/browseHistory/browseHistory?id=' + 2
|
url: '../../packageMy/myCollection/myCollection'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//跳转到我的发布页面
|
//跳转到我的发布页面
|
||||||
@@ -72,7 +73,6 @@
|
|||||||
url: '../../packageMy/myRelease/myRelease'
|
url: '../../packageMy/myRelease/myRelease'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 联系客服模态框
|
// 联系客服模态框
|
||||||
showModal() {
|
showModal() {
|
||||||
this.showM = true
|
this.showM = true
|
||||||
@@ -139,36 +139,10 @@
|
|||||||
color: #CCCCCC !important;
|
color: #CCCCCC !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-modal {
|
|
||||||
width: 472rpx !important;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--cancel {
|
|
||||||
|
|
||||||
background: #D8D8D8;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__content {
|
.u-modal__content {
|
||||||
padding: 43rpx 104rpx !important;
|
padding: 43rpx 104rpx !important;
|
||||||
text-indent: 25rpx;
|
text-indent: 25rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-modal__content__text {
|
|
||||||
font-size: 32rpx !important;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #252421 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper--confirm {
|
|
||||||
background: #0EBB5B;
|
|
||||||
|
|
||||||
.u-modal__button-group__wrapper__text {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<view class="classify">
|
<view class="classify">
|
||||||
<u-grid :border="false" col="3">
|
<u-grid :border="false" col="3">
|
||||||
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="click(listIndex)">
|
<u-grid-item v-for="(listItem,listIndex) in classifyList" :key="listIndex" @click="click(listIndex)">
|
||||||
<!-- 懒加载 :lazy-load="true" -->
|
|
||||||
<u--image :src="listItem.src" width="86rpx" height="86rpx" :lazy-load="true">
|
<u--image :src="listItem.src" width="86rpx" height="86rpx" :lazy-load="true">
|
||||||
</u--image>
|
</u--image>
|
||||||
<text class="grid-text">{{listItem.title}}</text>
|
<text class="grid-text">{{listItem.title}}</text>
|
||||||
@@ -121,7 +120,9 @@
|
|||||||
color: #5ACCF0;
|
color: #5ACCF0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.u-image__error {
|
||||||
|
position: static !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.xpfb_text {
|
.xpfb_text {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const serverHost = 'https://pupil.hchyun.com/api' // https://api-ugo-web.itheima.net'
|
const serverHost = 'https://pupil.hchyun.com/api' // https://api-ugo-web.itheima.net'
|
||||||
function isOutTime(res) {
|
function isOutTime(res) {
|
||||||
if (res.data.message === '请先登录') {
|
if (res.data.message === '请先登录') {
|
||||||
@@ -18,7 +17,8 @@ function isOutTime(res) {
|
|||||||
const service = {
|
const service = {
|
||||||
get(url, data) {
|
get(url, data) {
|
||||||
const header = {}
|
const header = {}
|
||||||
header['Authorization'] = 'Bearer ' + uni.getStorageSync('token')
|
// header['Authorization'] = 'Bearer ' + uni.getStorageSync('token')
|
||||||
|
header['token'] = uni.getStorageSync('token')
|
||||||
header['content-type'] = 'application/json'
|
header['content-type'] = 'application/json'
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
@@ -43,15 +43,8 @@ const service = {
|
|||||||
},
|
},
|
||||||
post(url, data, isLogin) {
|
post(url, data, isLogin) {
|
||||||
const header = {}
|
const header = {}
|
||||||
if (isLogin) {
|
header['token'] = uni.getStorageSync('token')
|
||||||
// header['content-type'] = 'application/x-www-form-urlencoded';
|
header['content-type'] = 'application/json'
|
||||||
console.log(isLogin)
|
|
||||||
header['Authorization'] = ''
|
|
||||||
} else {
|
|
||||||
header['Authorization'] = 'Bearer ' + uni.getStorageSync('token')
|
|
||||||
header['content-type'] = 'application/json'
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -60,7 +53,6 @@ const service = {
|
|||||||
header: header,
|
header: header,
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(1111, res)
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
// if (res.data.exception === 'UnAuthorizedException') {
|
// if (res.data.exception === 'UnAuthorizedException') {
|
||||||
// let pages = getCurrentPages()
|
// let pages = getCurrentPages()
|
||||||
@@ -100,14 +92,8 @@ const service = {
|
|||||||
},
|
},
|
||||||
put(url, data, isLogin) {
|
put(url, data, isLogin) {
|
||||||
const header = {}
|
const header = {}
|
||||||
|
header['token'] = uni.getStorageSync('token')
|
||||||
if (isLogin) {
|
header['content-type'] = 'application/json'
|
||||||
header['content-type'] = 'application/x-www-form-urlencoded'
|
|
||||||
} else {
|
|
||||||
header['Authorization'] = 'Bearer ' + uni.getStorageSync('token')
|
|
||||||
header['content-type'] = 'application/json'
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
@@ -118,7 +104,6 @@ const service = {
|
|||||||
isOutTime(res)
|
isOutTime(res)
|
||||||
reject(res)
|
reject(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(res)
|
resolve(res)
|
||||||
},
|
},
|
||||||
data: data,
|
data: data,
|
||||||
@@ -131,7 +116,6 @@ const service = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const toastDuration = 1500
|
const toastDuration = 1500
|
||||||
const toast = {
|
const toast = {
|
||||||
@@ -175,11 +159,18 @@ const toast = {
|
|||||||
const apiService = {
|
const apiService = {
|
||||||
uploadImgUrl: serverHost,
|
uploadImgUrl: serverHost,
|
||||||
imgUrl: serverHost,
|
imgUrl: serverHost,
|
||||||
login: data => {
|
// login: data => {
|
||||||
data = Object.assign(data || {}, {})
|
// data = Object.assign(data || {}, {})
|
||||||
const url = `/api`
|
// const url = `/api`
|
||||||
|
// return new Promise((resolve, reject) => {
|
||||||
|
// resolve(service.post(url, data, true))
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
//登录接口
|
||||||
|
login(data) {
|
||||||
|
const url = `/login/mnpLogin`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data, true))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取首页轮播图
|
// 获取首页轮播图
|
||||||
@@ -190,10 +181,10 @@ const apiService = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取产品列表
|
// 获取产品列表
|
||||||
getProducts() {
|
getProducts(data) {
|
||||||
const url = `/home/product?sortType=1&pageSize=4&pageNum=1`
|
const url = `/home/product`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取产品详情
|
// 获取产品详情
|
||||||
@@ -231,76 +222,120 @@ const apiService = {
|
|||||||
resolve(service.get(url, id))
|
resolve(service.get(url, id))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
login: data => {
|
//绑定公司和升级VIP
|
||||||
data = Object.assign(data || {}, {})
|
bindComponyAndUpdate(data) {
|
||||||
const url = `/api`
|
const url = `/center/update`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data, true))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//获取历史记录或收藏
|
||||||
|
getHistoryOrCollection(type) {
|
||||||
|
const url = `/center/favlist/?type=${type}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.get(url, type))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//删除历史记录或收藏
|
||||||
|
deleteHistoryOrCollection(id) {
|
||||||
|
const url = `/center/delfav/?id=${id}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.post(url, id))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取创意发布&需求发布
|
||||||
|
getIdeasAndNeeds(type) {
|
||||||
|
const url = `/center/rlist?type=${type}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.get(url, type))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//收藏按钮
|
||||||
|
collect(pid) {
|
||||||
|
const url = `/center/addfav/?pid=${pid}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.post(url, pid))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//点赞按钮
|
||||||
|
thumb(pid) {
|
||||||
|
const url = `/center/thumb/?pid=${pid}`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.post(url, pid))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//获取个人信息
|
||||||
|
getUser() {
|
||||||
|
const url = `/center/userinfo`
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(service.get(url))
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取首页分类Tag
|
// 获取首页分类Tag
|
||||||
getTags(data) {
|
getTags(data) {
|
||||||
const url = `/home/tags`
|
const url = `/home/tags`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url, data))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取首页分类
|
// 获取首页分类
|
||||||
getCategories(data) {
|
getCategories(data) {
|
||||||
const url = `/home/classlist`
|
const url = `/home/classlist`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url, data))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 搜索发现 热搜
|
// 搜索发现 热搜
|
||||||
getDiscover() {
|
getDiscover() {
|
||||||
const url = `/home/discover`
|
const url = `/home/discover`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 搜索产品
|
// 搜索产品
|
||||||
getProductList(data) {
|
getProductList(data) {
|
||||||
const url = `/home/product`
|
const url = `/home/product`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url, data))
|
resolve(service.get(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 图片基本地址
|
// 图片基本地址
|
||||||
getImgUrl() {
|
getImgUrl() {
|
||||||
const url = `/center/cfg?key=img_url`
|
const url = `/center/cfg?key=img_url`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.get(url))
|
resolve(service.get(url))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
addOutboundOrder(data) {
|
addOutboundOrder(data) {
|
||||||
const url = `/api`
|
const url = `/api`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
deliveryOrderConfirm(data) {
|
deliveryOrderConfirm(data) {
|
||||||
const url = `/api`
|
const url = `/api`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, data))
|
resolve(service.post(url, data))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 解密
|
// 解密
|
||||||
decrypt(data) {
|
decrypt(data) {
|
||||||
const url = `/api`
|
const url = `/api`
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(service.post(url, { data }))
|
resolve(service.post(url, {
|
||||||
})
|
data
|
||||||
},
|
}))
|
||||||
// 国密sm4加密
|
})
|
||||||
sm4Encrypt(data) {
|
},
|
||||||
const url = `/api`
|
// 国密sm4加密
|
||||||
return new Promise((resolve, reject) => {
|
sm4Encrypt(data) {
|
||||||
resolve(service.sm(url, data))
|
const url = `/api`
|
||||||
})
|
return new Promise((resolve, reject) => {
|
||||||
}
|
resolve(service.sm(url, data))
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export {
|
export {
|
||||||
apiService,
|
apiService,
|
||||||
|
|||||||
@@ -16,20 +16,46 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.my_avatar {
|
.my_avatar {
|
||||||
position: absolute;
|
margin-top: -200rpx;
|
||||||
right: 325rpx;
|
|
||||||
top: 152rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-family: PingFangSC-Medium, PingFang SC;
|
font-family: PingFangSC-Medium, PingFang SC;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
line-height: 37rpx;
|
line-height: 37rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 头像后面的背景定位
|
||||||
|
.u-image {
|
||||||
|
position: static !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
//模态框公共样式
|
||||||
|
.u-modal {
|
||||||
|
width: 472rpx !important;
|
||||||
|
}
|
||||||
|
.u-modal__content__text {
|
||||||
|
font-size: 32rpx !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #252421 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-modal__button-group__wrapper--confirm {
|
||||||
|
background: #0EBB5B;
|
||||||
|
|
||||||
|
.u-modal__button-group__wrapper__text {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.u-modal__button-group__wrapper--cancel {
|
||||||
|
background: #D8D8D8;
|
||||||
|
.u-modal__button-group__wrapper__text {
|
||||||
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,4 +46,7 @@
|
|||||||
margin-top: 35rpx;
|
margin-top: 35rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.u-image__error {
|
||||||
|
position: static !important;
|
||||||
}
|
}
|
||||||
63
utills/date.js
Normal file
63
utills/date.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
function dateFormat(time) {
|
||||||
|
let date = new Date(time);
|
||||||
|
let year = date.getFullYear();
|
||||||
|
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
||||||
|
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||||
|
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||||
|
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||||
|
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||||
|
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||||
|
// 拼接
|
||||||
|
return year + "-" + month + "-" + day + " " + hours + ":" + minutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
//时间戳转换为2022年2月2日格式
|
||||||
|
function dateFormatDetail(time) {
|
||||||
|
time = time * 1000
|
||||||
|
let date = new Date(time);
|
||||||
|
let year = date.getFullYear();
|
||||||
|
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
||||||
|
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||||
|
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||||
|
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||||
|
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||||
|
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||||
|
// 拼接
|
||||||
|
return year + "年" + month + "月" + day + "日";
|
||||||
|
}
|
||||||
|
|
||||||
|
//时间戳转换为2022-12-03 09:59
|
||||||
|
function dateFormatXwDetail(time) {
|
||||||
|
time = time * 1000
|
||||||
|
let date = new Date(time);
|
||||||
|
let year = date.getFullYear();
|
||||||
|
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
||||||
|
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||||
|
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||||
|
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||||
|
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||||
|
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||||
|
// 拼接
|
||||||
|
return year + "-" + month + "-" + day + " " + hours + ":" + minutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
//时间戳转换为2022-12-03
|
||||||
|
function dateFormatHistory(time) {
|
||||||
|
time = time * 1000
|
||||||
|
let date = new Date(time);
|
||||||
|
let year = date.getFullYear();
|
||||||
|
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
|
||||||
|
let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
||||||
|
let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||||
|
let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
|
||||||
|
let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||||
|
let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
||||||
|
// 拼接
|
||||||
|
return year + "-" + month + "-" + day;
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
dateFormat,
|
||||||
|
dateFormatDetail,
|
||||||
|
dateFormatXwDetail,
|
||||||
|
dateFormatHistory
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user